Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 76232 Details for
Bug 117781
portage does not control GID of /usr/portage/distfiles/.locks directory
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
add_group_perms.patch
add_group_perms.patch (text/plain), 3.80 KB, created by
Zac Medico
on 2006-01-05 05:22:51 UTC
(
hide
)
Description:
add_group_perms.patch
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2006-01-05 05:22:51 UTC
Size:
3.80 KB
patch
obsolete
>Index: portage-2.1_pre3/pym/portage.py >=================================================================== >--- portage-2.1_pre3.orig/pym/portage.py >+++ portage-2.1_pre3/pym/portage.py >@@ -1844,43 +1844,23 @@ def fetch(myuris, mysettings, listonly=0 > print "!!! No write access to %s" % mysettings["DISTDIR"]+"/" > can_fetch=False > else: >- mystat=os.stat(mysettings["DISTDIR"]+"/") >- if mystat.st_gid != portage_gid: >- try: >- os.chown(mysettings["DISTDIR"],-1,portage_gid) >- except OSError, oe: >- if oe.errno == 1: >- print red("!!!")+" Unable to chgrp of %s to portage, continuing\n" % mysettings["DISTDIR"] >- else: >- raise oe >- >- # writable by portage_gid? This is specific to root, adjust perms if needed automatically. >- if not stat.S_IMODE(mystat.st_mode) & 020: >+ portage_util.add_group_perms(mysettings["DISTDIR"],portage_gid,"portage") >+ if use_locks and locks_in_subdir: >+ distlocks_subdir=os.path.join(mysettings["DISTDIR"],locks_in_subdir) > try: >- os.chmod(mysettings["DISTDIR"],stat.S_IMODE(mystat.st_mode) | 020) >+ os.mkdir(distlocks_subdir) >+ os.chown(distlocks_subdir,-1,portage_gid) >+ os.chmod(distlocks_subdir,0775) > except OSError, oe: >- if oe.errno == 1: >- print red("!!!")+" Unable to chmod %s to perms 0755. Non-root users will experience issues.\n" % mysettings["DISTDIR"] >+ import errno >+ if oe.errno == errno.EEXIST: >+ portage_util.add_group_perms(distlocks_subdir,portage_gid,"portage") > else: > raise oe >- >- if use_locks and locks_in_subdir: >- if os.path.exists(mysettings["DISTDIR"]+"/"+locks_in_subdir): >- if not os.access(mysettings["DISTDIR"]+"/"+locks_in_subdir,os.W_OK): >- writemsg("!!! No write access to write to %s. Aborting.\n" % mysettings["DISTDIR"]+"/"+locks_in_subdir) >- return 0 >- else: >- old_umask=os.umask(0002) >- os.mkdir(mysettings["DISTDIR"]+"/"+locks_in_subdir,0775) >- if os.stat(mysettings["DISTDIR"]+"/"+locks_in_subdir).st_gid != portage_gid: >- try: >- os.chown(mysettings["DISTDIR"]+"/"+locks_in_subdir,-1,portage_gid) >- except SystemExit, e: >- raise >- except: >- pass >- os.umask(old_umask) >- >+ if not os.access(distlocks_subdir,os.W_OK): >+ writemsg("!!! No write access to write to %s. Aborting.\n" % distlocks_subdir) >+ return 0 >+ del distlocks_subdir > > for myfile in filedict.keys(): > fetched=0 >@@ -2775,6 +2755,8 @@ def doebuild(myebuild,mydo,myroot,mysett > try: > if not os.path.exists(mysettings["DISTDIR"]): > os.makedirs(mysettings["DISTDIR"]) >+ os.chown(mysettings["DISTDIR"],-1,portage_gid) >+ os.chmod(mysettings["DISTDIR"],0775) > if not os.path.exists(mysettings["DISTDIR"]+"/cvs-src"): > os.makedirs(mysettings["DISTDIR"]+"/cvs-src") > except OSError, e: >Index: portage-2.1_pre3/pym/portage_util.py >=================================================================== >--- portage-2.1_pre3.orig/pym/portage_util.py >+++ portage-2.1_pre3/pym/portage_util.py >@@ -444,3 +444,33 @@ def unique_array(s): > if x not in u: > u.append(x) > return u >+ >+def add_group_perms(location, gid, grname, mystat=None): >+ import errno, stat >+ success = True >+ if not mystat: >+ mystat = os.stat(location) >+ if mystat.st_gid != gid: >+ try: >+ os.chown(location, -1, gid) >+ except OSError, oe: >+ success=False >+ if oe.errno == errno.EPERM: >+ writemsg("!!! Unable to chgrp %s to %s, continuing\n" % (location, grname)) >+ else: >+ raise oe >+ >+ mybits = 060 >+ if stat.S_ISDIR(mystat.st_mode): >+ mybits = 070 >+ if not stat.S_IMODE(mystat.st_mode) & mybits: >+ mymode = stat.S_IMODE(mystat.st_mode) | mybits >+ try: >+ os.chmod(location, mymode) >+ except OSError, oe: >+ success = False >+ if oe.errno == errno.EPERM: >+ writemsg("!!! Unable to chmod %s to perms %s. Non-root users will experience issues.\n" % (location, oct(mymode))) >+ else: >+ raise oe >+ return success
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 117781
:
76183
|
76184
| 76232