Re: [gdm-list] Fixes for ConsoleKit and GDM 2.21 for Solaris
- From: Brian Cameron <Brian Cameron Sun COM>
- To: Ray Strode <halfline gmail com>
- Cc: gdm-list gnome org
- Subject: Re: [gdm-list] Fixes for ConsoleKit and GDM 2.21 for Solaris
- Date: Thu, 31 Jan 2008 22:41:03 -0600
Ray:
Thanks for the comment. I was about to code this up, but I noticed the
change was already made upstream. Also thanks to whoever fixed this up.
Brian
+#ifdef ENABLE_RBAC_SHUTDOWN
+static char *
+get_user_name (uid_t uid)
+{
+ struct passwd *pwent;
+ char *name;
+
+ name = NULL;
+
+ pwent = getpwuid (uid);
+
+ if (pwent != NULL) {
+ name = g_strdup (pwent->pw_name);
+ }
+
+ return name;
+}
+#endif
+
You could drop this function and just use g_get_user_name().
(since you only ever call it with getuid() as the argument)
Note the semantics of g_get_user_name() are a little different, in
that you don't g_free() the result.
--Ray
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]