Changeset 111331


Ignore:
Timestamp:
Sep 19, 2013, 1:05:01 AM (7 years ago)
Author:
cal@…
Message:

cregistry/registry.c: remove unneeded write check, fixes testing with root privs, avoid race condition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/cregistry/registry.c

    r100218 r111331  
    190190    }
    191191    /* can_write is still true if one of the stat calls succeeded */
    192     if (can_write) {
    193         if (sb.st_uid == getuid()) {
    194             if (!(sb.st_mode & S_IWUSR)) {
    195                 can_write = 0;
    196             }
    197         } else if (sb.st_gid == getgid()) {
    198             if (!(sb.st_mode & S_IWGRP)) {
    199                 can_write = 0;
    200             }
    201         } else if (!(sb.st_mode & S_IWOTH) && getuid() != 0) {
    202             can_write = 0;
    203         }
    204     }
    205192    if (initialized || can_write) {
    206193        sqlite3_stmt* stmt = NULL;
Note: See TracChangeset for help on using the changeset viewer.