From 7de6bf94ac8324bfb62a6d7a5efc340dca894907 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Mon, 19 Mar 2012 21:11:38 +0100 Subject: [PATCH] Ignore 'Operation not permitted' error. Signed-off-by: Torsten Werner --- daklib/queue.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ... -- 2.39.2