← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~bratsche/xsplash/setgid into lp:xsplash

 

Cody Russell has proposed merging lp:~bratsche/xsplash/setgid into lp:xsplash.

    Requested reviews:
    Canonical Desktop Experience Team (canonical-dx-team)
Related bugs:
  #439268 Logging is quite broken
  https://bugs.launchpad.net/bugs/439268

-- 
https://code.launchpad.net/~bratsche/xsplash/setgid/+merge/12788
Your team ayatana-commits is subscribed to branch lp:xsplash.
=== modified file 'src/xsplash.c'
--- src/xsplash.c	2009-10-01 20:56:55 +0000
+++ src/xsplash.c	2009-10-02 14:40:24 +0000
@@ -920,7 +920,6 @@
   DBusGProxy      *bus_proxy;
   guint            nameret = 0;
   struct passwd *pwd;
-  uid_t uid;
 
   pwd = getpwnam (XSPLASH_USER);
   if (pwd == NULL)
@@ -929,9 +928,17 @@
       return 1;
     }
 
-  uid = pwd->pw_uid;
+  if (setgid (pwd->pw_gid))
+    {
+      g_error ("Failed to setgid");
+      return 1;
+    }
 
-  setuid (uid);
+  if (setuid (pwd->pw_uid))
+    {
+      g_error ("Failed to setuid");
+      return 1;
+    }
 
   context = g_option_context_new ("xsplash");
   g_option_context_add_main_entries (context,


Follow ups