X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udev_add.c;h=689c2dceecf8e3132f0151d55ca3d5d735ac0d42;hp=809a33cedb664f7f4dafab1dde562982e85ccdef;hb=e920fed3499aa1445657b62499a11348faa3b24e;hpb=5d24c6ca364c6232efa626049b03d02c15ab5e85 diff --git a/udev_add.c b/udev_add.c index 809a33ced..689c2dcee 100644 --- a/udev_add.c +++ b/udev_add.c @@ -34,10 +34,7 @@ #include #include #include -#ifndef __KLIBC__ #include -#include -#endif #include "libsysfs/sysfs/libsysfs.h" #include "udev.h" @@ -46,9 +43,6 @@ #include "logging.h" #include "namedev.h" #include "udevdb.h" -#include "klibc_fixups.h" - -#define LOCAL_USER "$local" #include "selinux.h" @@ -155,37 +149,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 +192,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)