summaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorkwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059>2012-10-12 19:20:57 +0800
committerkwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059>2012-10-12 19:20:57 +0800
commitda884fe92f1d494f17bf4c1303c48666c787a31a (patch)
tree392b26367b9450fd268db4760362a949ecfeb37e /sysutils
parent0398ebdb6d952870fffe2f69b33e47d108808bf6 (diff)
downloadmarcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.tar
marcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.tar.gz
marcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.tar.bz2
marcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.tar.lz
marcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.tar.xz
marcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.tar.zst
marcuscom-ports-da884fe92f1d494f17bf4c1303c48666c787a31a.zip
Teach accountsservice to use the right commands for user management.
control center isn't working yet due to what looks like a polkit issue. Submitted by: Berislav Purgar <bpurgar@gmail.com> git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@17112 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/accountsservice/Makefile5
-rw-r--r--sysutils/accountsservice/files/patch-src_daemon.c54
-rw-r--r--sysutils/accountsservice/files/patch-src_user.c148
3 files changed, 204 insertions, 3 deletions
diff --git a/sysutils/accountsservice/Makefile b/sysutils/accountsservice/Makefile
index 625767510..5f274e7d9 100644
--- a/sysutils/accountsservice/Makefile
+++ b/sysutils/accountsservice/Makefile
@@ -1,10 +1,10 @@
# Created by: Koop Mast <kwm@FreeBSD.org>
# $FreeBSD$
-# $MCom: ports/sysutils/accountsservice/Makefile,v 1.10 2012/09/19 21:50:44 kwm Exp $
+# $MCom: ports/sysutils/accountsservice/Makefile,v 1.11 2012/10/08 09:31:19 kwm Exp $
PORTNAME= accountsservice
PORTVERSION= 0.6.24
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils devel
MASTER_SITES= http://www.freedesktop.org/software/${PORTNAME}/
@@ -22,6 +22,7 @@ USE_GETTEXT= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
+CONFIGURE_ARGS= --disable-systemd
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
diff --git a/sysutils/accountsservice/files/patch-src_daemon.c b/sysutils/accountsservice/files/patch-src_daemon.c
index 995df3de9..f102cde17 100644
--- a/sysutils/accountsservice/files/patch-src_daemon.c
+++ b/sysutils/accountsservice/files/patch-src_daemon.c
@@ -1,5 +1,5 @@
--- src/daemon.c.orig 2012-08-16 19:03:51.000000000 +0000
-+++ src/daemon.c 2012-10-08 09:18:14.000000000 +0000
++++ src/daemon.c 2012-10-08 19:05:09.000000000 +0000
@@ -68,6 +68,7 @@
"nobody4",
"noaccess",
@@ -28,3 +28,55 @@
if (pwent != NULL) {
return pwent;
}
+@@ -1030,20 +1036,18 @@
+
+ sys_log (context, "create user '%s'", cd->user_name);
+
+- argv[0] = "/usr/sbin/useradd";
+- argv[1] = "-m";
+- argv[2] = "-c";
+- argv[3] = cd->real_name;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = "useradd";
++ argv[2] = cd->user_name;
++ argv[3] = "-m";
++ argv[4] = "-c";
++ argv[5] = cd->real_name;
+ if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) {
+- argv[4] = "-G";
+- argv[5] = "wheel";
+- argv[6] = "--";
+- argv[7] = cd->user_name;
++ argv[6] = "-G";
++ argv[7] = "wheel";
+ argv[8] = NULL;
+ }
+ else if (cd->account_type == ACCOUNT_TYPE_STANDARD) {
+- argv[4] = "--";
+- argv[5] = cd->user_name;
+ argv[6] = NULL;
+ }
+ else {
+@@ -1250,16 +1254,15 @@
+ g_remove (filename);
+ g_free (filename);
+
+- argv[0] = "/usr/sbin/userdel";
++ argv[0] = "/usr/sbin/pw";
+ if (ud->remove_files) {
+- argv[1] = "-f";
+- argv[2] = "-r";
+- argv[3] = "--";
+- argv[4] = pwent->pw_name;
+- argv[5] = NULL;
++ argv[1] = "userdel";
++ argv[2] = pwent->pw_name;
++ argv[3] = "-r";
++ argv[4] = NULL;
+ }
+ else {
+- argv[1] = "--";
++ argv[1] = "userdel";
+ argv[2] = pwent->pw_name;
+ argv[3] = NULL;
+ }
diff --git a/sysutils/accountsservice/files/patch-src_user.c b/sysutils/accountsservice/files/patch-src_user.c
new file mode 100644
index 000000000..1cb68ea3e
--- /dev/null
+++ b/sysutils/accountsservice/files/patch-src_user.c
@@ -0,0 +1,148 @@
+--- src/user.c.orig 2012-08-16 19:03:51.000000000 +0000
++++ src/user.c 2012-10-08 19:13:02.000000000 +0000
+@@ -546,11 +546,11 @@
+ "change real name of user '%s' (%d) to '%s'",
+ user->user_name, user->uid, name);
+
+- argv[0] = "/usr/sbin/usermod";
+- argv[1] = "-c";
+- argv[2] = name;
+- argv[3] = "--";
+- argv[4] = user->user_name;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = "usermod";
++ argv[2] = user->user_name;
++ argv[3] = "-c";
++ argv[4] = name;
+ argv[5] = NULL;
+
+ error = NULL;
+@@ -620,11 +620,11 @@
+ "change name of user '%s' (%d) to '%s'",
+ old_name, user->uid, name);
+
+- argv[0] = "/usr/sbin/usermod";
+- argv[1] = "-l";
+- argv[2] = name;
+- argv[3] = "--";
+- argv[4] = user->user_name;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = "usermod";
++ argv[2] = user->user_name;
++ argv[3] = "-n";
++ argv[4] = name;
+ argv[5] = NULL;
+
+ error = NULL;
+@@ -964,11 +964,11 @@
+ "change shell of user '%s' (%d) to '%s'",
+ user->user_name, user->uid, shell);
+
+- argv[0] = "/usr/sbin/usermod";
+- argv[1] = "-s";
+- argv[2] = shell;
+- argv[3] = "--";
+- argv[4] = user->user_name;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = "usermod";
++ argv[2] = user->user_name;
++ argv[3] = "-s";
++ argv[4] = shell;
+ argv[5] = NULL;
+
+ error = NULL;
+@@ -1224,11 +1224,10 @@
+ sys_log (context,
+ "%s account of user '%s' (%d)",
+ locked ? "locking" : "unlocking", user->user_name, user->uid);
+- argv[0] = "/usr/sbin/usermod";
+- argv[1] = locked ? "-L" : "-U";
+- argv[2] = "--";
+- argv[3] = user->user_name;
+- argv[4] = NULL;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = locked ? "lock" : "unlock";
++ argv[2] = user->user_name;
++ argv[3] = NULL;
+
+ error = NULL;
+ if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1315,11 +1314,11 @@
+
+ g_free (groups);
+
+- argv[0] = "/usr/sbin/usermod";
+- argv[1] = "-G";
+- argv[2] = str->str;
+- argv[3] = "--";
+- argv[4] = user->user_name;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = "usermod";
++ argv[2] = user->user_name;
++ argv[3] = "-G";
++ argv[4] = str->str;
+ argv[5] = NULL;
+
+ g_string_free (str, FALSE);
+@@ -1386,10 +1385,8 @@
+ mode == PASSWORD_MODE_NONE) {
+
+ argv[0] = "/usr/bin/passwd";
+- argv[1] = "-d";
+- argv[2] = "--";
+- argv[3] = user->user_name;
+- argv[4] = NULL;
++ argv[1] = user->user_name;
++ argv[2] = NULL;
+
+ error = NULL;
+ if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1399,12 +1396,11 @@
+ }
+
+ if (mode == PASSWORD_MODE_SET_AT_LOGIN) {
+- argv[0] = "/usr/bin/chage";
+- argv[1] = "-d";
++ argv[0] = "/usr/bin/chpass";
++ argv[1] = "-e";
+ argv[2] = "0";
+- argv[3] = "--";
+- argv[4] = user->user_name;
+- argv[5] = NULL;
++ argv[3] = user->user_name;
++ argv[4] = NULL;
+
+ error = NULL;
+ if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1428,11 +1424,10 @@
+ }
+ }
+ else if (user->locked) {
+- argv[0] = "/usr/sbin/usermod";
+- argv[1] = "-U";
+- argv[2] = "--";
+- argv[3] = user->user_name;
+- argv[4] = NULL;
++ argv[0] = "/usr/sbin/pw";
++ argv[1] = "unlock";
++ argv[2] = user->user_name;
++ argv[3] = NULL;
+
+ error = NULL;
+ if (!spawn_with_login_uid (context, argv, &error)) {
+@@ -1503,12 +1498,11 @@
+
+ g_object_freeze_notify (G_OBJECT (user));
+
+- argv[0] = "/usr/sbin/usermod";
++ argv[0] = "/usr/bin/chpass";
+ argv[1] = "-p";
+ argv[2] = strings[0];
+- argv[3] = "--";
+- argv[4] = user->user_name;
+- argv[5] = NULL;
++ argv[3] = user->user_name;
++ argv[4] = NULL;
+
+ error = NULL;
+ if (!spawn_with_login_uid (context, argv, &error)) {