From: Torsten Werner Date: Mon, 19 Mar 2012 20:11:38 +0000 (+0100) Subject: Ignore 'Operation not permitted' error. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=7de6bf94ac8324bfb62a6d7a5efc340dca894907;p=dak.git Ignore 'Operation not permitted' error. Signed-off-by: Torsten Werner --- diff --git a/daklib/queue.py b/daklib/queue.py index 8acfb4e7..e2ab8467 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -2432,7 +2432,12 @@ distribution.""" self.force_reject(reject_files) # Change permissions of the .changes file to be world readable - os.chmod(changesfile, os.stat(changesfile).st_mode | stat.S_IROTH) + try: + os.chmod(changesfile, os.stat(changesfile).st_mode | stat.S_IROTH) + except OSError as (errno, strerror): + # Ignore 'Operation not permitted' error. + if errno != 1: + raise # If we fail here someone is probably trying to exploit the race # so let's just raise an exception ...