editrights: New package

This commit is contained in:
David Macek
2015-04-26 10:43:34 +02:00
parent e0d5f3cb01
commit ead31bfba0
2 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# Maintainer: David Macek <david.macek.0@gmail.com>
_realname=editrights
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.03
pkgrel=1
pkgdesc="Edit special privileges of Windows accounts (mingw-w64)"
arch=('any')
url="http://cygwin.org/"
license=('custom')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc")
source=("http://cygwin.cybermirror.org/release/$_realname/$_realname-$pkgver-1-src.tar.xz"
'uncygwinize.patch')
md5sums=('f24c3c33c30516f13fc84b765020e1e7'
'ad733a23daeb1d46e98c80d334929846')
prepare(){
tar -xjf $_realname-$pkgver-1.src/$_realname-$pkgver.tar.bz2
patch -p1 -i "${srcdir}/uncygwinize.patch"
}
build() {
cd $_realname
make clean
make CC=${MINGW_CHOST}-gcc
}
package() {
cd $_realname
make DESTDIR="$pkgdir" PREFIX=${MINGW_PREFIX} install
install -Dm0644 LICENCE ${pkgdir}${MINGW_PREFIX}/share/licenses/editrights/LICENCE
mv ${pkgdir}${MINGW_PREFIX}/share/doc/{Cygwin,Msys}
}

View File

@@ -0,0 +1,31 @@
--- src/editrights/main.c.orig 2014-10-31 19:49:43.000000000 +0100
+++ src/editrights/main.c 2015-04-26 10:37:44.997236000 +0200
@@ -38,8 +38,12 @@
#include <strings.h>
#include <wchar.h>
#include <locale.h>
+
+#ifdef __CYGWIN__
#include <pwd.h>
#include <grp.h>
+#endif
+
#include <windows.h>
#include <sddl.h>
#include <ntsecapi.h>
@@ -177,6 +181,7 @@
exit (RETURN_ERROR);
}
+#ifdef __CYGWIN__
/* Convert Cygwin username to windows username. */
if ((pw = getpwnam (optUser)) != NULL)
{
@@ -190,6 +195,7 @@
else if ((gr = getgrnam (optUser)) != NULL)
sid_str = gr->gr_passwd;
else
+#endif
{
WCHAR wuser[strlen (optUser) * 2 + 1];
DWORD sid_size = 128, dom_size = 256;