chiark / gitweb /
selinux: check PID 1 label instead of /selinux mount point to figure out if selinux...
[elogind.git] / src / sd-login.c
index 6dfc2d086e4ff9d0895929d62859389d5cf3da39..2c5b153fba7eb5fc012c754d3bb0dbfc120606bf 100644 (file)
@@ -327,7 +327,6 @@ _public_ int sd_session_is_active(const char *session) {
 _public_ int sd_session_get_uid(const char *session, uid_t *uid) {
         int r;
         char *p, *s = NULL;
-        unsigned long ul;
 
         if (!session)
                 return -EINVAL;
@@ -349,14 +348,10 @@ _public_ int sd_session_get_uid(const char *session, uid_t *uid) {
         if (!s)
                 return -EIO;
 
-        r = safe_atolu(s, &ul);
+        r = parse_uid(s, uid);
         free(s);
 
-        if (r < 0)
-                return r;
-
-        *uid = (uid_t) ul;
-        return 0;
+        return r;
 }
 
 _public_ int sd_session_get_seat(const char *session, char **seat) {
@@ -614,7 +609,6 @@ static inline sd_login_monitor* FD_TO_MONITOR(int fd) {
 }
 
 _public_ int sd_login_monitor_new(const char *category, sd_login_monitor **m) {
-        const char *path;
         int fd, k;
         bool good = false;