diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-06-22 19:11:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-06-22 19:11:20 +0000 |
commit | 8bb10bfd68b8efcbd76e64b4fa4a42ee0428ec4a (patch) | |
tree | b99a733d294507066cb8cc7442888d71d75fb78e | |
parent | 8da8a1a38fe0674d1fcf02ab1034111d9e60b0d8 (diff) | |
download | portage-8bb10bfd68b8efcbd76e64b4fa4a42ee0428ec4a.tar.gz portage-8bb10bfd68b8efcbd76e64b4fa4a42ee0428ec4a.tar.bz2 portage-8bb10bfd68b8efcbd76e64b4fa4a42ee0428ec4a.zip |
Simplify permission logic for emerge.log.
svn path=/main/trunk/; revision=3609
-rwxr-xr-x | bin/emerge | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/bin/emerge b/bin/emerge index 0b4f5b10d..579ecf1d4 100755 --- a/bin/emerge +++ b/bin/emerge @@ -465,13 +465,11 @@ def emergelog(mystr,short_msg=None): else: xtermTitle(mystr) try: - #seems odd opening a file each write... - if not os.path.exists("/var/log/emerge.log"): - mylogfile=open("/var/log/emerge.log", "w") - os.chmod("/var/log/emerge.log", S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) - os.chown("/var/log/emerge.log", portage.portage_uid, portage.portage_gid) - else: - mylogfile=open("/var/log/emerge.log", "a") + file_path = "/var/log/emerge.log" + mylogfile = open(file_path, "a") + portage_util.apply_secpass_permissions(file_path, + uid=portage.portage_uid, gid=portage.portage_gid, + mode=0660) l=portage_locks.lockfile(mylogfile) # seek because we may have gotten held up by the lock. |