Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 342302 Details for
Bug 461868
sys-apps/portage: xattr support not allowed for security.* labels on SELinux
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch applied on portage for more verbose logs
debug-portage.patch (text/plain), 4.06 KB, created by
Vincent Brillault
on 2013-03-16 21:11:29 UTC
(
hide
)
Description:
Patch applied on portage for more verbose logs
Filename:
MIME Type:
Creator:
Vincent Brillault
Created:
2013-03-16 21:11:29 UTC
Size:
4.06 KB
patch
obsolete
>--- /usr/lib/portage/pym/portage/util/movefile.py.back 2013-03-16 20:30:24.881280226 +0100 >+++ /usr/lib/portage/pym/portage/util/movefile.py 2013-03-16 21:12:20.987584777 +0100 >@@ -28,6 +28,7 @@ > _os.chmod(dest, stat.S_IMODE(src_stat.st_mode)) > > if hasattr(_os, "getxattr"): >+ print 'Fea, has attr' > # Python >=3.3 and GNU/Linux > def _copyxattr(src, dest): > for attr in _os.listxattr(src): >@@ -39,17 +40,20 @@ > if raise_exception: > raise OperationNotSupported("Filesystem containing file '%s' does not support extended attributes" % dest) > else: >+ print 'Fea, has not attr' > try: > import xattr > except ImportError: > xattr = None > if xattr is not None: > def _copyxattr(src, dest): >+ print 'Fea, case 1' > for attr in xattr.list(src): > try: > xattr.set(dest, attr, xattr.get(src, attr)) > raise_exception = False >- except IOError: >+ except IOError as e: >+ print 'IOERROR copyxattr: {0}'.format(e) > raise_exception = True > if raise_exception: > raise OperationNotSupported("Filesystem containing file '%s' does not support extended attributes" % dest) >@@ -64,6 +68,7 @@ > _devnull.close() > if _has_getfattr_and_setfattr: > def _copyxattr(src, dest): >+ print 'Fea, case 2' > getfattr_process = subprocess.Popen(["getfattr", "-d", "--absolute-names", src], stdout=subprocess.PIPE) > getfattr_process.wait() > extended_attributes = getfattr_process.stdout.readlines() >@@ -76,6 +81,7 @@ > raise OperationNotSupported("Filesystem containing file '%s' does not support extended attributes" % dest) > else: > def _copyxattr(src, dest): >+ print 'Fea, case 3 O_o' > pass > > def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, >@@ -191,6 +197,7 @@ > # For atomic replacement, first create the link as a temp file > # and them use os.rename() to replace the destination. > if hardlink_candidates: >+ print 'Fea, hard' > head, tail = os.path.split(dest) > hardlink_tmp = os.path.join(head, ".%s._portage_merge_.%s" % \ > (tail, os.getpid())) >@@ -218,10 +225,13 @@ > return None > hardlinked = True > break >+ else: >+ print 'Fea, not hard' > > renamefailed=1 > if hardlinked: > renamefailed = False >+ print '{0} {1} {2}=={3}'.format(hardlinked, selinux_enabled, sstat.st_dev, dstat.st_dev) > if not hardlinked and (selinux_enabled or sstat.st_dev == dstat.st_dev): > try: > if selinux_enabled: >@@ -230,6 +240,7 @@ > os.rename(src,dest) > renamefailed=0 > except OSError as e: >+ print 'renamefailed, err {0}'.format(e) > if e.errno != errno.EXDEV: > # Some random error. > writemsg("!!! %s\n" % _("Failed to move %(src)s to %(dest)s") % >@@ -238,25 +249,31 @@ > return None > # Invalid cross-device-link 'bind' mounted or actually Cross-Device > if renamefailed: >+ print 'Fea, renamefailed' >+ >+ print '{0}, then {1}, then {2}'.format(stat.ST_MODE, sstat[stat.ST_MODE], stat.S_ISREG(sstat[stat.ST_MODE])) > if stat.S_ISREG(sstat[stat.ST_MODE]): >+ print 'Fea, stat.S_ISREG(sstat[stat.ST_MODE])' > dest_tmp = dest + "#new" > dest_tmp_bytes = _unicode_encode(dest_tmp, encoding=encoding, > errors='strict') > try: # For safety copy then move it over. >+ print '{0} -> {1}'.format(src_bytes, dest_tmp_bytes) > _copyfile(src_bytes, dest_tmp_bytes) > if xattr_enabled: > try: > _copyxattr(src_bytes, dest_tmp_bytes) > except SystemExit: > raise >- except: >+ except Exception as e: >+ print 'Fea, l263: {0}'.format(e) > msg = _("Failed to copy extended attributes. " > "In order to avoid this error, set " > "FEATURES=\"-xattr\" in make.conf.") > msg = textwrap.wrap(msg, 65) > for line in msg: > writemsg("!!! %s\n" % (line,), noiselevel=-1) >- raise >+ raise e > _apply_stat(sstat, dest_tmp_bytes) > _rename(dest_tmp_bytes, dest_bytes) > _os.unlink(src_bytes) >@@ -268,6 +285,8 @@ > writemsg("!!! %s\n" % (e,), noiselevel=-1) > return None > else: >+ print 'Fea, falback mv' >+ > #we don't yet handle special, so we need to fall back to /bin/mv > a = spawn([MOVE_BINARY, '-f', src, dest], env=os.environ) > if a != os.EX_OK:
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 461868
:
342284
| 342302 |
343338