chiark / gitweb /
[PATCH] wait() for specific pid to return from fork().
[elogind.git] / udev_add.c
index 809a33cedb664f7f4dafab1dde562982e85ccdef..689c2dceecf8e3132f0151d55ca3d5d735ac0d42 100644 (file)
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <linux/sockios.h>
-#ifndef __KLIBC__
 #include <pwd.h>
-#include <utmp.h>
-#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)