Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 162542 | Differences between
and this patch

Collapse All | Expand All

(-)pym/portage.py (-4 / +26 lines)
Lines 4234-4245 Link Here
4234
					if droppriv:
4234
					if droppriv:
4235
						st = os.stat(mydir)
4235
						st = os.stat(mydir)
4236
						if st.st_gid != portage_gid or \
4236
						if st.st_gid != portage_gid or \
4237
							not stat.S_IMODE(st.st_mode) & dirmode:
4237
							not dirmode == (stat.S_IMODE(st.st_mode) & dirmode):
4238
							droppriv_fix = True
4238
							droppriv_fix = True
4239
						if not droppriv_fix:
4240
							# Check permissions of files in the directory.
4241
							for filename in os.listdir(mydir):
4242
								try:
4243
									subdir_st = os.lstat(
4244
										os.path.join(mydir, filename))
4245
								except OSError:
4246
									continue
4247
								if subdir_st.st_gid != portage_gid or \
4248
									((stat.S_ISDIR(subdir_st.st_mode) and \
4249
									not dirmode == (stat.S_IMODE(subdir_st.st_mode) & dirmode)) or \
4250
									(not stat.S_ISDIR(subdir_st.st_mode) and \
4251
									not filemode == (stat.S_IMODE(subdir_st.st_mode) & filemode))):
4252
									droppriv_fix = True
4253
									break
4254
					if droppriv_fix:
4255
						writemsg(colorize("WARN", " * ") + \
4256
							 "Adjusting permissions " + \
4257
							 "for FEATURES=userpriv: '%s'\n" % mydir,
4258
							noiselevel=-1)
4259
					elif modified:
4260
						writemsg(colorize("WARN", " * ") + \
4261
							 "Adjusting permissions " + \
4262
							 "for FEATURES=%s: '%s'\n" % (myfeature, mydir),
4263
							noiselevel=-1)
4239
					if modified or kwargs["always_recurse"] or droppriv_fix:
4264
					if modified or kwargs["always_recurse"] or droppriv_fix:
4240
						if modified:
4241
							writemsg("Adjusting permissions recursively: '%s'\n" % mydir,
4242
								noiselevel=-1)
4243
						def onerror(e):
4265
						def onerror(e):
4244
							raise	# The feature is disabled if a single error
4266
							raise	# The feature is disabled if a single error
4245
									# occurs during permissions adjustment.
4267
									# occurs during permissions adjustment.

Return to bug 162542