From: Zac Medico Date: Thu, 22 Jun 2006 19:11:20 +0000 (-0000) Subject: Simplify permission logic for emerge.log. X-Git-Tag: v2.1.1~428 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8bb10bfd68b8efcbd76e64b4fa4a42ee0428ec4a;p=portage.git Simplify permission logic for emerge.log. svn path=/main/trunk/; revision=3609 --- 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.