]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Change permission mask for FIFOs and shared memory to 0600 instead of 0666
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 15 Apr 2012 21:20:52 +0000 (21:20 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 15 Apr 2012 21:20:52 +0000 (21:20 +0000)
Following a discussion about which user can debug which VAlgrind gdbserver:
The default umask will remove the "other" and "group" write bits.
Without the w bits, nothing works in any case.
Moreover, if the vgdb process does not belong to the user running the
V gdbserver, connections are also not possible.
=> remove useless/confusing bits.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12505

coregrind/m_gdbserver/remote-utils.c

index 76bf4981c0a6f7801c274e95f1fb3c173871548a..88b903f01e955e092f2beb713bf9d0fd2774f242 100644 (file)
@@ -196,7 +196,7 @@ static
 void safe_mknod (char *nod)
 {
    SysRes m;
-   m = VG_(mknod) (nod, VKI_S_IFIFO|0666, 0);
+   m = VG_(mknod) (nod, VKI_S_IFIFO|0600, 0);
    if (sr_isError (m)) {
       if (sr_Err (m) == VKI_EEXIST) {
          if (VG_(clo_verbosity) > 1) {
@@ -307,7 +307,7 @@ void remote_open (char *name)
 
       pid_from_to_creator = pid;
       
-      o = VG_(open) (shared_mem, VKI_O_CREAT|VKI_O_RDWR, 0666);
+      o = VG_(open) (shared_mem, VKI_O_CREAT|VKI_O_RDWR, 0600);
       if (sr_isError (o)) {
          sr_perror(o, "cannot create shared_mem file %s\n", shared_mem);
          fatal("");