diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2004-10-18 20:51:13 -0700 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 22:02:46 -0700 |
commit | 9cd1b46a138dbdd6c3fad2e23f88e34740b3a054 (patch) | |
tree | f833f5c2529e8cc86465168bf896f3d8d52701aa /udev_add.c | |
parent | 1da6b0d0a71960f49e1ecf8bd9f1bc9e14c2b90e (diff) |
[PATCH] $local user
We once implemented the devfsd feature to set the owner of a device node
to the "local" user. This was before we had the dev.d/ scripts. We discussed
a similar issue with D-BUS recently and this should be better handled depending
on the distributions way to do such a thing.
I'm for removing this here as this can be easily covered by a dev.d/
script.
Here is the patch if nobody objects :)
Diffstat (limited to 'udev_add.c')
-rw-r--r-- | udev_add.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/udev_add.c b/udev_add.c index 809a33cedb..0e7d575d58 100644 --- a/udev_add.c +++ b/udev_add.c @@ -48,8 +48,6 @@ #include "udevdb.h" #include "klibc_fixups.h" -#define LOCAL_USER "$local" - #include "selinux.h" /* @@ -155,37 +153,6 @@ exit: return retval; } -/* get the local logged in user */ -static void set_to_local_user(char *user) -{ - struct utmp *u; - time_t recent = 0; - - strfieldcpymax(user, default_owner_str, OWNER_SIZE); - setutent(); - while (1) { - u = getutent(); - if (u == NULL) - break; - - /* is this a user login ? */ - if (u->ut_type != USER_PROCESS) - continue; - - /* is this a local login ? */ - if (strcmp(u->ut_host, "")) - continue; - - if (u->ut_time > recent) { - recent = u->ut_time; - strfieldcpymax(user, u->ut_user, OWNER_SIZE); - dbg("local user is '%s'", user); - break; - } - } - endutent(); -} - static int create_node(struct udevice *udev) { char filename[NAME_SIZE]; @@ -229,8 +196,6 @@ static int create_node(struct udevice *udev) uid = (uid_t) id; else { struct passwd *pw; - if (strncmp(udev->owner, LOCAL_USER, sizeof(LOCAL_USER)) == 0) - set_to_local_user(udev->owner); pw = getpwnam(udev->owner); if (pw == NULL) |