From 30139bb4e1b63484677a7a6e7f2a5f0fd783cc9a Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Wed, 5 Feb 2014 15:40:59 +1300 Subject: [PATCH 2/2] provision: capture slightly less generic exceptions during the test for acls Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett Reviewed-by: Jelmer Vernooij (cherry picked from commit f279a297a4a94c5cbc049c9b2cde14b02960a76f) --- python/samba/provision/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py index 3b00cf0..f75202e 100644 --- a/python/samba/provision/__init__.py +++ b/python/samba/provision/__init__.py @@ -1534,7 +1534,7 @@ def setsysvolacl(samdb, netlogon, sysvol, uid, gid, domainsid, dnsdomain, try: try: smbd.set_simple_acl(file.name, 0755, gid) - except Exception: + except OSError: if not smbd.have_posix_acls(): # This clue is only strictly correct for RPM and # Debian-like Linux systems, but hopefully other users @@ -1546,7 +1546,7 @@ def setsysvolacl(samdb, netlogon, sysvol, uid, gid, domainsid, dnsdomain, "Try the mounting the filesystem with the 'acl' option.") try: smbd.chown(file.name, uid, gid) - except Exception: + except OSError: raise ProvisioningError("Unable to chown a file on your filesystem. " "You may not be running provision as root.") finally: -- 1.9.1