~dbarth/xsplash/artwork-licensing

« back to all changes in this revision

Viewing changes to src/xsplash.c

  • Committer: Cody Russell
  • Date: 2009-08-26 15:28:39 UTC
  • mfrom: (53.1.1 setuid)
  • Revision ID: crussell@canonical.com-20090826152839-30fxrqy2dp344zvs
mergeĀ setuidĀ branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <stdlib.h>
21
21
#include <math.h>
22
22
#include <string.h>
 
23
#include <unistd.h>
 
24
#include <pwd.h>
23
25
 
24
26
#include <gtk/gtk.h>
25
27
#include <gdk/gdkkeysyms.h>
639
641
  DBusGConnection *system_bus;
640
642
  DBusGProxy      *bus_proxy;
641
643
  guint            nameret = 0;
 
644
  struct passwd *pwd;
 
645
  uid_t uid;
 
646
 
 
647
  pwd = getpwnam (XSPLASH_USER);
 
648
  if (pwd == (struct passwd*)0)
 
649
    {
 
650
      g_error ("Unknown user: %s", XSPLASH_USER);
 
651
      return 1;
 
652
    }
 
653
 
 
654
  uid = pwd->pw_uid;
 
655
 
 
656
  setuid (uid);
642
657
 
643
658
  context = g_option_context_new ("xsplash");
644
659
  g_option_context_add_main_entries (context,