[pulseaudio-commits] r2201 - /trunk/src/pulse/util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Mar 31 15:06:16 PDT 2008


Author: lennart
Date: Tue Apr  1 00:06:15 2008
New Revision: 2201

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2201&root=pulseaudio&view=rev
Log:
merge r2185 from prepare-0.9.10

Modified:
    trunk/src/pulse/util.c

Modified: trunk/src/pulse/util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/util.c?rev=2201&root=pulseaudio&r1=2200&r2=2201&view=diff
==============================================================================
--- trunk/src/pulse/util.c (original)
+++ trunk/src/pulse/util.c Tue Apr  1 00:06:15 2008
@@ -65,7 +65,7 @@
 #include "util.h"
 
 char *pa_get_user_name(char *s, size_t l) {
-    char *p;
+    const char *p;
     char buf[1024];
 
 #ifdef HAVE_PWD_H
@@ -75,7 +75,10 @@
     pa_assert(s);
     pa_assert(l > 0);
 
-    if (!(p = getenv("USER")) && !(p = getenv("LOGNAME")) && !(p = getenv("USERNAME"))) {
+    if (!(p = (getuid() == 0 ? "root" : NULL)) &&
+        !(p = getenv("USER")) &&
+        !(p = getenv("LOGNAME")) &&
+        !(p = getenv("USERNAME"))) {
 #ifdef HAVE_PWD_H
 
 #ifdef HAVE_GETPWUID_R




More information about the pulseaudio-commits mailing list