Exclude ports/system users that have a login shell since we only want to

deal with human users
This commit is contained in:
ajacoutot 2012-07-08 16:35:19 +00:00
parent 0068b2757f
commit f5e3aee4f3
2 changed files with 31 additions and 8 deletions

View File

@ -1,10 +1,12 @@
# $OpenBSD: Makefile,v 1.27 2012/07/05 07:18:59 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.28 2012/07/08 16:35:19 ajacoutot Exp $
COMMENT= D-Bus interface for user account query and manipulation
DISTNAME= accountsservice-0.6.22
EXTRACT_SUFX= .tar.xz
REVISION= 0
SHARED_LIBS += accountsservice 0.0 # 0.0
CATEGORIES= sysutils

View File

@ -1,4 +1,7 @@
$OpenBSD: patch-src_daemon_c,v 1.17 2012/07/05 07:18:59 ajacoutot Exp $
$OpenBSD: patch-src_daemon_c,v 1.18 2012/07/08 16:35:19 ajacoutot Exp $
In default_excludes[], add any ports and system users that has a login
shell.
Revert the following commit:
This reverts commit dfa1a6239b01c823ce0fec781c6c9541c988f56e.
@ -7,7 +10,7 @@ http://bugs.freedesktop.org/show_bug.cgi?id=41747
(XXX we need a way to only get local users)
--- src/daemon.c.orig Thu Jun 28 17:24:55 2012
+++ src/daemon.c Thu Jul 5 08:58:57 2012
+++ src/daemon.c Sun Jul 8 18:33:40 2012
@@ -35,6 +35,10 @@
#include <utmpx.h>
#endif
@ -19,7 +22,25 @@ http://bugs.freedesktop.org/show_bug.cgi?id=41747
#include <glib.h>
#include <glib/gi18n.h>
#include <glib-object.h>
@@ -300,22 +304,32 @@ reload_passwd (Daemon *daemon)
@@ -77,6 +81,17 @@ static const char *default_excludes[] = {
"games",
"man",
"at",
+ "_couchdb",
+ "_ejabberd",
+ "_jabberd",
+ "_mediatomb",
+ "_mon",
+ "_openfire",
+ "_postgresql",
+ "_rancid",
+ "_rocrail",
+ "_sogo",
+ "_varnish",
NULL
};
@@ -300,22 +315,32 @@ reload_passwd (Daemon *daemon)
GSList *old_users;
GSList *new_users;
GSList *list;
@ -52,7 +73,7 @@ http://bugs.freedesktop.org/show_bug.cgi?id=41747
/* Skip system users... */
if (daemon_local_user_is_excluded (daemon, pwent->pw_name, pwent->pw_shell)) {
g_debug ("skipping user: %s", pwent->pw_name);
@@ -365,10 +379,12 @@ reload_passwd (Daemon *daemon)
@@ -365,10 +390,12 @@ reload_passwd (Daemon *daemon)
}
}
@ -65,7 +86,7 @@ http://bugs.freedesktop.org/show_bug.cgi?id=41747
g_slist_foreach (new_users, (GFunc) g_object_thaw_notify, NULL);
g_slist_foreach (new_users, (GFunc) g_object_unref, NULL);
@@ -922,7 +938,11 @@ daemon_create_user_authorized_cb (Daemon
@@ -922,7 +949,11 @@ daemon_create_user_authorized_cb (Daemon
CreateUserData *cd = data;
User *user;
GError *error;
@ -77,7 +98,7 @@ http://bugs.freedesktop.org/show_bug.cgi?id=41747
if (getpwnam (cd->user_name) != NULL) {
throw_error (context, ERROR_USER_EXISTS, "A user with name '%s' already exists", cd->user_name);
@@ -939,14 +959,31 @@ daemon_create_user_authorized_cb (Daemon
@@ -939,14 +970,31 @@ daemon_create_user_authorized_cb (Daemon
if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) {
argv[4] = "-G";
argv[5] = "wheel";
@ -109,7 +130,7 @@ http://bugs.freedesktop.org/show_bug.cgi?id=41747
}
else {
throw_error (context, ERROR_FAILED, "Don't know how to add user of type %d", cd->account_type);
@@ -1018,15 +1055,49 @@ daemon_delete_user_authorized_cb (Daemon
@@ -1018,15 +1066,49 @@ daemon_delete_user_authorized_cb (Daemon
return;
}