Re: [gdm-list] Fixes for ConsoleKit and GDM 2.21 for Solaris
- From: "Ray Strode" <halfline gmail com>
- To: "Brian Cameron" <Brian Cameron sun com>
- Cc: gdm-list gnome org
- Subject: Re: [gdm-list] Fixes for ConsoleKit and GDM 2.21 for Solaris
- Date: Tue, 29 Jan 2008 11:38:35 -0500
Hi,
+#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]