X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fqueue.py;h=813782e23ef38e0dfc7c35818eba74d3f00a37c2;hb=f8996e240d9d0278bce098e23be63db0bcc6fbee;hp=2c3602a2b4741ba4690af16b3315e181df762ae7;hpb=a6dbdaaf2281e70a1ccf28af8b673ab9db2a7574;p=dak.git diff --git a/daklib/queue.py b/daklib/queue.py index 2c3602a2..813782e2 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -219,7 +219,21 @@ class Upload: try: os.chmod(dump_filename, 0664) except OSError, e: - raise + # chmod may fail when the dumpfile is not owned by the user + # invoking dak (like e.g. when NEW is processed by a member + # of ftpteam) + if errno.errorcode[e.errno] == 'EPERM': + perms = stat.S_IMODE(os.stat(dump_filename)[stat.ST_MODE]) + # security precaution, should never happen unless a weird + # umask is set anywhere + if perms & stat.S_IWOTH: + utils.fubar("%s is world writable and chmod failed." % \ + (dump_filename,)) + # ignore the failed chmod otherwise as the file should + # already have the right privileges and is just, at worst, + # unreadable for world + else: + raise p = cPickle.Pickler(dump_file, 1) d_changes = {}