diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-11-17 07:13:40 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2012-11-30 17:17:19 +0100 |
commit | 6bffad67d24df2c90b174bbcc9c578899783a834 (patch) | |
tree | 7b36fa56f315022f44dced276f5b70b86a5adffe /source4/scripting | |
parent | f843c04b0f2314ccedb4759c85721773845eb207 (diff) | |
download | samba-6bffad67d24df2c90b174bbcc9c578899783a834.tar.gz samba-6bffad67d24df2c90b174bbcc9c578899783a834.tar.bz2 samba-6bffad67d24df2c90b174bbcc9c578899783a834.zip |
s4:netcmd/gpo.py: the nTSecurityDescriptor may not be visible for the current user
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/netcmd/gpo.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/netcmd/gpo.py b/source4/scripting/python/samba/netcmd/gpo.py index 656b2bd369..1c6f25dc39 100644 --- a/source4/scripting/python/samba/netcmd/gpo.py +++ b/source4/scripting/python/samba/netcmd/gpo.py @@ -465,8 +465,12 @@ class cmd_show(Command): except Exception: raise CommandError("GPO '%s' does not exist" % gpo) - secdesc_ndr = msg['nTSecurityDescriptor'][0] - secdesc = ndr_unpack(security.descriptor, secdesc_ndr) + try: + secdesc_ndr = msg['nTSecurityDescriptor'][0] + secdesc = ndr_unpack(security.descriptor, secdesc_ndr) + secdesc_sddl = secdesc.as_sddl() + except Exception: + secdesc_sddl = "<hidden>" self.outf.write("GPO : %s\n" % msg['name'][0]) self.outf.write("display name : %s\n" % msg['displayName'][0]) @@ -474,7 +478,7 @@ class cmd_show(Command): self.outf.write("dn : %s\n" % msg.dn) self.outf.write("version : %s\n" % attr_default(msg, 'versionNumber', '0')) self.outf.write("flags : %s\n" % gpo_flags_string(int(attr_default(msg, 'flags', 0)))) - self.outf.write("ACL : %s\n" % secdesc.as_sddl()) + self.outf.write("ACL : %s\n" % secdesc_sddl) self.outf.write("\n") |