[PATCH koji] Set proper permissions (0666) when creating files

Enrico Scholz enrico.scholz at informatik.tu-chemnitz.de
Fri May 11 16:48:22 UTC 2007


Currently, os.open() is used without specifying the third argument.
Hence, all files will be created with 0777 perms (minus umask).

Because only datafiles will be uploaded, the exec-bit should be removed.

Signed-off-by: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
---

 builder/kojid  |    2 +-
 hub/kojihub.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builder/kojid b/builder/kojid
index 6243edd..9a82c60 100755
--- a/builder/kojid
+++ b/builder/kojid
@@ -109,7 +109,7 @@ def log_output(path, args, outfile, uploadpath, cwd=None, logerror=0, append=0,
             flags = os.O_CREAT | os.O_WRONLY
             if append:
                 flags |= os.O_APPEND
-            fd = os.open(outfile, flags)
+            fd = os.open(outfile, flags, 0666)
             os.dup2(fd, 1)
             if logerror:
                 os.dup2(fd, 2)
diff --git a/hub/kojihub.py b/hub/kojihub.py
index a3bbe5f..03cb76f 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -3958,7 +3958,7 @@ class RootExports(object):
             # elif offset == 0:
             #     #first chunk, so file should not exist yet
             #     raise koji.GenericError, "file already exists: %s" % fn
-        fd = os.open(fn, os.O_RDWR | os.O_CREAT)
+        fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0666)
         # log_error("fd=%r" %fd)
         try:
             if offset == 0 or (offset == -1 and size == len(contents)):




More information about the buildsys mailing list