Set a default 0022 umask value always (#83006)
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 7 Jan 2008 14:09:20 +0000 (16:09 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 7 Jan 2008 14:09:20 +0000 (16:09 +0200)
Patch derived from rpm5.org work of Jeff Johnson

lib/rpmrc.c

index 37d21e7..11ca6e4 100644 (file)
@@ -1679,6 +1679,10 @@ static rpmRC rpmReadRC(const char * rcfiles)
 
 int rpmReadConfigFiles(const char * file, const char * target)
 {
+    mode_t mode = 0022;
+    /* Reset umask to its default umask(2) value. */
+    mode = umask(mode);
+
     /* Initialize crypto engine as early as possible */
     if (rpmInitCrypto() < 0) {
        return -1;