Ignore:
Timestamp:
Jun 26, 2020, 7:16:26 PM (5 years ago)
Author:
bird
Message:

kmk: Avoid setting umask just to get it, store the current value in a global variable (g_fUMask). The umask(0777) call in cp.c raced other code (kmk_append) that created files and directories, leaving us with read-only files sometimes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/kmkbuiltin/install.c

    r3241 r3389  
    396396
    397397#ifdef KMK_BUILTIN_STANDALONE
     398mode_t g_fUMask;
    398399int main(int argc, char **argv, char **envp)
    399400{
    400401        KMKBUILTINCTX Ctx = { "kmk_install", NULL };
     402        umask(g_fUMask = umask(0077));
    401403        return kmk_builtin_install(argc, argv, envp, &Ctx);
    402404}
Note: See TracChangeset for help on using the changeset viewer.