git.samba.org
/
amitay
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87fe862
)
gpo: Sudoers ext should not crash if policy missing
author
David Mulder
<dmulder@suse.com>
Fri, 7 Aug 2020 19:44:55 +0000
(13:44 -0600)
committer
David Mulder
<dmulder@samba.org>
Thu, 27 Aug 2020 15:59:33 +0000
(15:59 +0000)
If a user has manually removed a policy, the
extension should not crash in an unapply removing
it.
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/gp_sudoers_ext.py
patch
|
blob
|
history
diff --git
a/python/samba/gp_sudoers_ext.py
b/python/samba/gp_sudoers_ext.py
index 673b0e131c604331948b2742871268135e5fcb49..a693fc960a2f8177d9af051574158505f9956b41 100644
(file)
--- a/
python/samba/gp_sudoers_ext.py
+++ b/
python/samba/gp_sudoers_ext.py
@@
-51,7
+51,8
@@
class gp_sudoers_ext(gp_pol_ext):
self.gp_db.set_guid(guid)
if str(self) in settings:
for attribute, sudoers in settings[str(self)].items():
- os.unlink(sudoers)
+ if os.path.exists(sudoers):
+ os.unlink(sudoers)
self.gp_db.delete(str(self), attribute)
self.gp_db.commit()