[111331] trunk/base/src/cregistry/registry.c

cal at macports.org cal at macports.org
Wed Sep 18 18:05:01 PDT 2013


Revision: 111331
          https://trac.macports.org/changeset/111331
Author:   cal at macports.org
Date:     2013-09-18 18:05:01 -0700 (Wed, 18 Sep 2013)
Log Message:
-----------
cregistry/registry.c: remove unneeded write check, fixes testing with root privs, avoid race condition

Modified Paths:
--------------
    trunk/base/src/cregistry/registry.c

Modified: trunk/base/src/cregistry/registry.c
===================================================================
--- trunk/base/src/cregistry/registry.c	2013-09-19 00:59:48 UTC (rev 111330)
+++ trunk/base/src/cregistry/registry.c	2013-09-19 01:05:01 UTC (rev 111331)
@@ -189,19 +189,6 @@
         }
     }
     /* can_write is still true if one of the stat calls succeeded */
-    if (can_write) {
-        if (sb.st_uid == getuid()) {
-            if (!(sb.st_mode & S_IWUSR)) {
-                can_write = 0;
-            }
-        } else if (sb.st_gid == getgid()) {
-            if (!(sb.st_mode & S_IWGRP)) {
-                can_write = 0;
-            }
-        } else if (!(sb.st_mode & S_IWOTH) && getuid() != 0) {
-            can_write = 0;
-        }
-    }
     if (initialized || can_write) {
         sqlite3_stmt* stmt = NULL;
         char* query = sqlite3_mprintf("ATTACH DATABASE '%q' AS registry", path);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130918/2aff3ddb/attachment.html>


More information about the macports-changes mailing list