bugrdiff-backup - Bugs: bug #31624, 64bit + euid of 4294967294 == ouch

 
 

bug #31624: 64bit + euid of 4294967294 == ouch

Submitted by:  None
Submitted on:  Fri 12 Nov 2010 01:47:18 AM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 24 Feb 2020 04:20:37 PM UTC, comment #1: 
Eric L. <ericzolf>
Project Administrator
Fri 12 Nov 2010 01:47:18 AM UTC, original submission:  

When euid and (but probably or also) egid = 4294967294

rdiff-backup --exclude **/*.nobackup --include /private/tmp/tmpXPzaEj/client --exclude-regexp /.* ::/ /private/tmp/tmpXPzaEj/server

Fails with "OverflowError: signed integer is greater than maximum."

I believe it is because set_ownership (from fs_abilities.py) sets uid+1 and gid+1.  This may be related to this bug: http://bugs.python.org/issue1747858

def set_ownership(self, testdir):
"""Set self.ownership to true iff testdir's ownership can be changed"""
tmp_rp = testdir.append("foo")
tmp_rp.touch()
uid, gid = tmp_rp.getuidgid()
try:
tmp_rp.chown(uid+1, gid+1) # just choose random uid/gid
tmp_rp.chown(0, 0)
except (IOError, OSError, AttributeError): self.ownership = 0
else: self.ownership = 1
tmp_rp.delete()

One may ask how would this ever happen.  It happened to me because macports uses that euid and egid when for "Privilege de-escalation".

Here is the stack trace (from rdiff-backup 1.2.8)

INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
INFO:     try: Main(arglist)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 324, in Main
INFO:     take_action(rps)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 280, in take_action
INFO:     elif action == "backup": Backup(rps[0], rps[1])
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 334, in Backup
INFO:     rpout.conn.fs_abilities.backup_set_globals(rpin, force)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/fs_abilities.py", line 922, in backup_set_globals
INFO:     dest_fsa = FSAbilities('destination').init_readwrite(Globals.rbdir)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/fs_abilities.py", line 157, in init_readwrite
INFO:     self.set_ownership(subdir)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/fs_abilities.py", line 180, in set_ownership
INFO:     tmp_rp.chown(uid+1, gid+1) # just choose random uid/gid
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/rpath.py", line 977, in chown
INFO:     else: os.chown(self.path, uid, gid)
INFO:
INFO: Traceback (most recent call last):
INFO:   File "/opt/local/bin/rdiff-backup", line 30, in <module>
INFO:     rdiff_backup.Main.error_check_Main(sys.argv[1:])
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 304, in error_check_Main
INFO:     try: Main(arglist)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 324, in Main
INFO:     take_action(rps)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 280, in take_action
INFO:     elif action == "backup": Backup(rps[0], rps[1])
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/Main.py", line 334, in Backup
INFO:     rpout.conn.fs_abilities.backup_set_globals(rpin, force)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/fs_abilities.py", line 922, in backup_set_globals
INFO:     dest_fsa = FSAbilities('destination').init_readwrite(Globals.rbdir)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/fs_abilities.py", line 157, in init_readwrite
INFO:     self.set_ownership(subdir)
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/fs_abilities.py", line 180, in set_ownership
INFO:     tmp_rp.chown(uid+1, gid+1) # just choose random uid/gid
INFO:   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/rdiff_backup/rpath.py", line 977, in chown
INFO:     else: os.chown(self.path, uid, gid)
INFO: OverflowError: signed integer is greater than maximum

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ericzolf (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-02-24 ericzolf StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.5