summaryrefslogtreecommitdiff
path: root/libcli/security
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-12-01 17:39:30 -0800
committerJeremy Allison <jra@samba.org>2010-12-02 03:26:03 +0100
commit75508cea4a95ea63a1a4c192c82e827a712aa709 (patch)
tree630f05b8cbcbf8496feb162e70697a3d9eb8479c /libcli/security
parentc8395ac6cfe3ee66c8fa8ad47f48353ae14ba8c4 (diff)
downloadsamba-75508cea4a95ea63a1a4c192c82e827a712aa709.tar.gz
samba-75508cea4a95ea63a1a4c192c82e827a712aa709.tar.bz2
samba-75508cea4a95ea63a1a4c192c82e827a712aa709.zip
Turns out there are lots of places in S3 where token passed in
here can be NULL (become_root() sets the current security token to NULL for example). Ensure we don't crash. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Dec 2 03:26:03 CET 2010 on sn-devel-104
Diffstat (limited to 'libcli/security')
-rw-r--r--libcli/security/privileges.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c
index 57c485dbe6..e215b5f43a 100644
--- a/libcli/security/privileges.c
+++ b/libcli/security/privileges.c
@@ -412,6 +412,10 @@ bool security_token_has_privilege(const struct security_token *token, enum sec_p
{
uint64_t mask;
+ if (!token) {
+ return false;
+ }
+
mask = sec_privilege_mask(privilege);
if (mask == 0) {
return false;