[pulseaudio-commits] r1113 - in /trunk/src: daemon/main.c modules/module-protocol-stub.c pulse/context.c pulsecore/core-util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Jul 19 17:21:52 PDT 2006


Author: ossman
Date: Thu Jul 20 02:21:50 2006
New Revision: 1113

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1113&root=pulseaudio&view=rev
Log:
Make -1 mean "current group/user" so that some platform dependent calls
can be centralised.

Modified:
    trunk/src/daemon/main.c
    trunk/src/modules/module-protocol-stub.c
    trunk/src/pulse/context.c
    trunk/src/pulsecore/core-util.c

Modified: trunk/src/daemon/main.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/main.c?rev=1113&root=pulseaudio&r1=1112&r2=1113&view=diff
==============================================================================
--- trunk/src/daemon/main.c (original)
+++ trunk/src/daemon/main.c Thu Jul 20 02:21:50 2006
@@ -249,7 +249,7 @@
      * per-user mode. We create the runtime directory somewhere in
      * /tmp/ with the current UID/GID */
     
-    if (pa_make_secure_dir(fn, 0700, getuid(), getgid()) < 0) {
+    if (pa_make_secure_dir(fn, 0700, (uid_t)-1, (gid_t)-1) < 0) {
         pa_log(__FILE__": Failed to create '%s': %s", fn, pa_cstrerror(errno));
         return -1;
     }

Modified: trunk/src/modules/module-protocol-stub.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-protocol-stub.c?rev=1113&root=pulseaudio&r1=1112&r2=1113&view=diff
==============================================================================
--- trunk/src/modules/module-protocol-stub.c (original)
+++ trunk/src/modules/module-protocol-stub.c Thu Jul 20 02:21:50 2006
@@ -254,7 +254,7 @@
     /* This socket doesn't reside in our own runtime dir but in
      * /tmp/.esd/, hence we have to create the dir first */
     
-    if (pa_make_secure_parent_dir(u->socket_path, c->is_system_instance ? 0755 : 0700, getuid(), getgid()) < 0) {
+    if (pa_make_secure_parent_dir(u->socket_path, c->is_system_instance ? 0755 : 0700, (uid_t)-1, (gid_t)-1) < 0) {
         pa_log(__FILE__": Failed to create socket directory: %s\n", pa_cstrerror(errno));
         goto fail;
     }

Modified: trunk/src/pulse/context.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulse/context.c?rev=1113&root=pulseaudio&r1=1112&r2=1113&view=diff
==============================================================================
--- trunk/src/pulse/context.c (original)
+++ trunk/src/pulse/context.c Thu Jul 20 02:21:50 2006
@@ -707,7 +707,7 @@
             char lf[PATH_MAX];
 
             pa_runtime_path(AUTOSPAWN_LOCK, lf, sizeof(lf));
-            pa_make_secure_parent_dir(lf, 0700, getuid(), getgid());
+            pa_make_secure_parent_dir(lf, 0700, (uid_t)-1, (gid_t)-1);
             assert(c->autospawn_lock_fd <= 0);
             c->autospawn_lock_fd = pa_lock_lockfile(lf);
 

Modified: trunk/src/pulsecore/core-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/core-util.c?rev=1113&root=pulseaudio&r1=1112&r2=1113&view=diff
==============================================================================
--- trunk/src/pulsecore/core-util.c (original)
+++ trunk/src/pulsecore/core-util.c Thu Jul 20 02:21:50 2006
@@ -157,6 +157,10 @@
         return -1;
 
 #ifdef HAVE_CHOWN
+    if (uid == (uid_t)-1)
+        uid = getuid();
+    if (gid == (gid_t)-1)
+        gid = getgid();
     chown(dir, uid, gid);
 #endif
     




More information about the pulseaudio-commits mailing list