diff options
author | Andrew Bartlett <abartlet@samba.org> | 2013-03-22 22:16:03 +1100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2013-03-25 11:35:03 +0100 |
commit | 874a93bc1c437543474a6c574b0065b7b953ad38 (patch) | |
tree | aa0563ff79f7918234da4125ffc46e3d58ce40d2 | |
parent | 4789a3072a4241841c096115dbdb0c3259968e68 (diff) | |
download | samba-874a93bc1c437543474a6c574b0065b7b953ad38.tar.gz samba-874a93bc1c437543474a6c574b0065b7b953ad38.tar.bz2 samba-874a93bc1c437543474a6c574b0065b7b953ad38.zip |
scripting: Modify samba.descriptor.get_diff_sds() to cope with a missing reference owner
This allows the reference SD not to have an owner specified, and still
have the comparison with a database SD that does have an owner pass.
(And the same for owning group).
Andrew Bartlett
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | python/samba/descriptor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/python/samba/descriptor.py b/python/samba/descriptor.py index 4137bc3a12..164b0bf254 100644 --- a/python/samba/descriptor.py +++ b/python/samba/descriptor.py @@ -528,13 +528,13 @@ def get_diff_sds(refsd, cursd, domainsid, checkSacl = True): if not hash_cur.has_key("owner"): txt = "\tNo owner in current SD" - elif hash_cur["owner"] != hash_ref["owner"]: + elif hash_ref.has_key("owner") and hash_cur["owner"] != hash_ref["owner"]: txt = "\tOwner mismatch: %s (in ref) %s" \ "(in current)\n" % (hash_ref["owner"], hash_cur["owner"]) if not hash_cur.has_key("group"): txt = "%s\tNo group in current SD" % txt - elif hash_cur["group"] != hash_ref["group"]: + elif hash_ref.has_key("group") and hash_cur["group"] != hash_ref["group"]: txt = "%s\tGroup mismatch: %s (in ref) %s" \ "(in current)\n" % (txt, hash_ref["group"], hash_cur["group"]) |