From 6ca874f71ad77c82d6e161a3e4772100de2ad6c5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Dec 2004 05:41:19 +0000 Subject: r4147: converted from NT_USER_TOKEN to struct security_token this is mostly just a tidyup, but also adds the privilege_mask, which I will be using shortly in ACL checking. note that I had to move the definition of struct security_token out of security.idl as pidl doesn't yet handle arrays of pointers, and the usual workaround (to use a intermediate structure) would make things too cumbersome for this structure, especially given we never encode it to NDR. (This used to be commit 7b446af09b8050746bfc2c50e9d56aa94397cc1a) --- source4/libcli/security/privilege.c | 84 +++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 source4/libcli/security/privilege.c (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c new file mode 100644 index 0000000000..1962aaa374 --- /dev/null +++ b/source4/libcli/security/privilege.c @@ -0,0 +1,84 @@ +/* + Unix SMB/CIFS implementation. + + manipulate privileges + + Copyright (C) Andrew Tridgell 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "librpc/gen_ndr/ndr_security.h" + + +static const struct { + enum sec_privilege privilege; + const char *name; +} privilege_names[] = { + {SEC_PRIV_SECURITY, "SeSecurityPrivilege"}, + {SEC_PRIV_BACKUP, "SeBackupPrivilege"}, + {SEC_PRIV_RESTORE, "SeRestorePrivilege"}, + {SEC_PRIV_SYSTEMTIME, "SeSystemtimePrivilege"}, + {SEC_PRIV_SHUTDOWN, "SeShutdownPrivilege"}, + {SEC_PRIV_REMOTE_SHUTDOWN, "SeRemoteShutdownPrivilege"}, + {SEC_PRIV_TAKE_OWNERSHIP, "SeTakeOwnershipPrivilege"}, + {SEC_PRIV_DEBUG, "SeDebugPrivilege"}, + {SEC_PRIV_SYSTEM_ENVIRONMENT, "SeSystemEnvironmentPrivilege"}, + {SEC_PRIV_SYSTEM_PROFILE, "SeSystemProfilePrivilege"}, + {SEC_PRIV_PROFILE_SINGLE_PROCESS, "SeProfileSingleProcessPrivilege"}, + {SEC_PRIV_INCREASE_BASE_PRIORITY, "SeIncreaseBasePriorityPrivilege"}, + {SEC_PRIV_LOAD_DRIVER, "SeLoadDriverPrivilege"}, + {SEC_PRIV_CREATE_PAGEFILE, "SeCreatePagefilePrivilege"}, + {SEC_PRIV_INCREASE_QUOTA, "SeIncreaseQuotaPrivilege"}, + {SEC_PRIV_CHANGE_NOTIFY, "SeChangeNotifyPrivilege"}, + {SEC_PRIV_UNDOCK, "SeUndockPrivilege"}, + {SEC_PRIV_MANAGE_VOLUME, "SeManageVolumePrivilege"}, + {SEC_PRIV_IMPERSONATE, "SeImpersonatePrivilege"}, + {SEC_PRIV_CREATE_GLOBAL, "SeCreateGlobalPrivilege"}, + {SEC_PRIV_ENABLE_DELEGATION, "SeEnableDelegationPrivilege"}, + {SEC_PRIV_INTERACTIVE_LOGON, "SeInteractiveLogonRight"}, + {SEC_PRIV_NETWORK_LOGON, "SeNetworkLogonRight"}, + {SEC_PRIV_REMOTE_INTERACTIVE_LOGON, "SeRemoteInteractiveLogonRight"} +}; + + +/* + map a privilege id to the wire string constant +*/ +const char *sec_privilege_name(unsigned int privilege) +{ + int i; + for (i=0;i Date: Sat, 11 Dec 2004 12:01:20 +0000 Subject: r4150: - add fns for manipulating the privilege_mask in a security_token - add the hooks in access_check that check the privilege bitmasks for SEC_STD_DELETE and SEC_FLAG_SYSTEM_SECURITY (This used to be commit 0fa3764edcabffe8f7d5e40f0097f97d0c4519c4) --- source4/libcli/security/privilege.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index 1962aaa374..10a51c8b42 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -82,3 +82,27 @@ int sec_privilege_id(const char *name) } return -1; } + + +/* + return True if a security_token has a particular privilege bit set +*/ +BOOL sec_privilege_check(const struct security_token *token, unsigned int privilege) +{ + uint64_t mask = 1; + mask <<= (privilege-1); + if (token->privilege_mask & mask) { + return True; + } + return False; +} + +/* + set a bit in the privilege mask +*/ +void sec_privilege_set(struct security_token *token, unsigned int privilege) +{ + uint64_t mask = 1; + mask <<= (privilege-1); + token->privilege_mask |= mask; +} -- cgit From adbdb055ee08b0aede06ecec34157ecf4f22c9de Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Dec 2004 13:19:41 +0000 Subject: r4151: added privilege attribute handling on samdb. pvfs will now honor some privileges on ACLs, and it will be quite easy to add the checks for more privileges in the necessary places, by making calls to sec_privilege_check(). (This used to be commit 3549039d0fbc54f87ae679e7288b82b28713e487) --- source4/libcli/security/privilege.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index 10a51c8b42..93599598db 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -85,12 +85,22 @@ int sec_privilege_id(const char *name) /* - return True if a security_token has a particular privilege bit set + return a privilege mask given a privilege id */ -BOOL sec_privilege_check(const struct security_token *token, unsigned int privilege) +uint64_t sec_privilege_mask(unsigned int privilege) { uint64_t mask = 1; mask <<= (privilege-1); + return mask; +} + + +/* + return True if a security_token has a particular privilege bit set +*/ +BOOL sec_privilege_check(const struct security_token *token, unsigned int privilege) +{ + uint64_t mask = sec_privilege_mask(privilege); if (token->privilege_mask & mask) { return True; } @@ -102,7 +112,5 @@ BOOL sec_privilege_check(const struct security_token *token, unsigned int privil */ void sec_privilege_set(struct security_token *token, unsigned int privilege) { - uint64_t mask = 1; - mask <<= (privilege-1); - token->privilege_mask |= mask; + token->privilege_mask |= sec_privilege_mask(privilege); } -- cgit From c80d77cdb8ab4b519c7c688cf4d0bf793a361424 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 14 Dec 2004 05:51:01 +0000 Subject: r4196: - added server side code for lsa_LookupPrivDisplayName - added english descriptions of privileges. We should add other languages in the future. (This used to be commit 3eee8b7c13de3ffe7c5a87d6f1ebdcc66ff391eb) --- source4/libcli/security/privilege.c | 136 +++++++++++++++++++++++++++++------- 1 file changed, 112 insertions(+), 24 deletions(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index 93599598db..aa01dc2c65 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -27,31 +27,103 @@ static const struct { enum sec_privilege privilege; const char *name; + const char *display_name; } privilege_names[] = { - {SEC_PRIV_SECURITY, "SeSecurityPrivilege"}, - {SEC_PRIV_BACKUP, "SeBackupPrivilege"}, - {SEC_PRIV_RESTORE, "SeRestorePrivilege"}, - {SEC_PRIV_SYSTEMTIME, "SeSystemtimePrivilege"}, - {SEC_PRIV_SHUTDOWN, "SeShutdownPrivilege"}, - {SEC_PRIV_REMOTE_SHUTDOWN, "SeRemoteShutdownPrivilege"}, - {SEC_PRIV_TAKE_OWNERSHIP, "SeTakeOwnershipPrivilege"}, - {SEC_PRIV_DEBUG, "SeDebugPrivilege"}, - {SEC_PRIV_SYSTEM_ENVIRONMENT, "SeSystemEnvironmentPrivilege"}, - {SEC_PRIV_SYSTEM_PROFILE, "SeSystemProfilePrivilege"}, - {SEC_PRIV_PROFILE_SINGLE_PROCESS, "SeProfileSingleProcessPrivilege"}, - {SEC_PRIV_INCREASE_BASE_PRIORITY, "SeIncreaseBasePriorityPrivilege"}, - {SEC_PRIV_LOAD_DRIVER, "SeLoadDriverPrivilege"}, - {SEC_PRIV_CREATE_PAGEFILE, "SeCreatePagefilePrivilege"}, - {SEC_PRIV_INCREASE_QUOTA, "SeIncreaseQuotaPrivilege"}, - {SEC_PRIV_CHANGE_NOTIFY, "SeChangeNotifyPrivilege"}, - {SEC_PRIV_UNDOCK, "SeUndockPrivilege"}, - {SEC_PRIV_MANAGE_VOLUME, "SeManageVolumePrivilege"}, - {SEC_PRIV_IMPERSONATE, "SeImpersonatePrivilege"}, - {SEC_PRIV_CREATE_GLOBAL, "SeCreateGlobalPrivilege"}, - {SEC_PRIV_ENABLE_DELEGATION, "SeEnableDelegationPrivilege"}, - {SEC_PRIV_INTERACTIVE_LOGON, "SeInteractiveLogonRight"}, - {SEC_PRIV_NETWORK_LOGON, "SeNetworkLogonRight"}, - {SEC_PRIV_REMOTE_INTERACTIVE_LOGON, "SeRemoteInteractiveLogonRight"} + {SEC_PRIV_SECURITY, + "SeSecurityPrivilege", + "System security"}, + + {SEC_PRIV_BACKUP, + "SeBackupPrivilege", + "Backup files and directories"}, + + {SEC_PRIV_RESTORE, + "SeRestorePrivilege", + "Restore files and directories"}, + + {SEC_PRIV_SYSTEMTIME, + "SeSystemtimePrivilege", + "Set the system clock"}, + + {SEC_PRIV_SHUTDOWN, + "SeShutdownPrivilege", + "Shutdown the system"}, + + {SEC_PRIV_REMOTE_SHUTDOWN, + "SeRemoteShutdownPrivilege", + "Shutdown the system remotely"}, + + {SEC_PRIV_TAKE_OWNERSHIP, + "SeTakeOwnershipPrivilege", + "Take ownership of files and directories"}, + + {SEC_PRIV_DEBUG, + "SeDebugPrivilege", + "Debug processes"}, + + {SEC_PRIV_SYSTEM_ENVIRONMENT, + "SeSystemEnvironmentPrivilege", + "Modify system environment"}, + + {SEC_PRIV_SYSTEM_PROFILE, + "SeSystemProfilePrivilege", + "Profile the system"}, + + {SEC_PRIV_PROFILE_SINGLE_PROCESS, + "SeProfileSingleProcessPrivilege", + "Profile one process"}, + + {SEC_PRIV_INCREASE_BASE_PRIORITY, + "SeIncreaseBasePriorityPrivilege", + "Increase base priority"}, + + {SEC_PRIV_LOAD_DRIVER, + "SeLoadDriverPrivilege", + "Load drivers"}, + + {SEC_PRIV_CREATE_PAGEFILE, + "SeCreatePagefilePrivilege", + "Create page files"}, + + {SEC_PRIV_INCREASE_QUOTA, + "SeIncreaseQuotaPrivilege", + "Increase quota"}, + + {SEC_PRIV_CHANGE_NOTIFY, + "SeChangeNotifyPrivilege", + "Register for change notify"}, + + {SEC_PRIV_UNDOCK, + "SeUndockPrivilege", + "Undock devices"}, + + {SEC_PRIV_MANAGE_VOLUME, + "SeManageVolumePrivilege", + "Manage system volumes"}, + + {SEC_PRIV_IMPERSONATE, + "SeImpersonatePrivilege", + "Impersonate users"}, + + {SEC_PRIV_CREATE_GLOBAL, + "SeCreateGlobalPrivilege", + "Create global"}, + + {SEC_PRIV_ENABLE_DELEGATION, + "SeEnableDelegationPrivilege", + "Enable Delegation"}, + + {SEC_PRIV_INTERACTIVE_LOGON, + "SeInteractiveLogonRight", + "Interactive logon"}, + + {SEC_PRIV_NETWORK_LOGON, + "SeNetworkLogonRight", + "Network logon"}, + + {SEC_PRIV_REMOTE_INTERACTIVE_LOGON, + "SeRemoteInteractiveLogonRight", + "Remote Interactive logon"} }; @@ -69,6 +141,22 @@ const char *sec_privilege_name(unsigned int privilege) return NULL; } +/* + map a privilege id to a privilege display name. Return NULL if not found + + TODO: this should use language mappings +*/ +const char *sec_privilege_display_name(int privilege, uint16_t *language) +{ + int i; + for (i=0;i Date: Thu, 30 Dec 2004 20:34:20 +0000 Subject: r4419: move security_token stuff to the libcli/security/ and debug privileges metze (This used to be commit c981808ed4cfa63c7ba7c4f9190b6b14f74bab40) --- source4/libcli/security/privilege.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index aa01dc2c65..ed98e9ce32 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -21,7 +21,7 @@ */ #include "includes.h" -#include "librpc/gen_ndr/ndr_security.h" +#include "libcli/security/security.h" static const struct { -- cgit From 3be75a4c6d4b9d86f1b85c75fb2f41c6c0eeec94 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 11 Aug 2005 13:12:45 +0000 Subject: r9240: - move struct security_token to the idl file, with this we can the ndr_pull/push/print functions for it in the ntacl-lsm module - fix compiler warnings in the ldap_encode_ndr_* code metze (This used to be commit 83d65d0d7ed9c240ad44aa2c881c1f07212bfda4) --- source4/libcli/security/privilege.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index ed98e9ce32..aa01dc2c65 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -21,7 +21,7 @@ */ #include "includes.h" -#include "libcli/security/security.h" +#include "librpc/gen_ndr/ndr_security.h" static const struct { -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/libcli/security/privilege.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index aa01dc2c65..fec8c1278c 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -21,7 +21,6 @@ */ #include "includes.h" -#include "librpc/gen_ndr/ndr_security.h" static const struct { -- cgit From 35349a58df5b69446607fbd742a05f57f3515319 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 18 Mar 2006 15:42:57 +0000 Subject: r14542: Remove librpc, libndr and libnbt from includes.h (This used to be commit 51b4270513752d2eafbe77f9de598de16ef84a1f) --- source4/libcli/security/privilege.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index fec8c1278c..202a418f6b 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include "librpc/gen_ndr/security.h" static const struct { -- cgit From 5559f5e3e5b283a4fe85984589d61598b14fcfff Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 3 Apr 2006 14:39:46 +0000 Subject: r14891: fix a bug found by the ibm checker the problem was that we shift with <<= (privilege-1) and we called the function with privilege=0 add some checks to catch invalid privilege values and hide the mask representation in privilege.c metze (This used to be commit a69f000324764bcd4cf420f2ecba1aca788258e4) --- source4/libcli/security/privilege.c | 53 +++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 8 deletions(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index 202a418f6b..f81ff6dccc 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -130,7 +130,7 @@ static const struct { /* map a privilege id to the wire string constant */ -const char *sec_privilege_name(unsigned int privilege) +const char *sec_privilege_name(enum sec_privilege privilege) { int i; for (i=0;i 64) { + return NULL; + } for (i=0;i 64) { + return 0; + } + mask <<= (privilege-1); return mask; } @@ -186,9 +194,15 @@ uint64_t sec_privilege_mask(unsigned int privilege) /* return True if a security_token has a particular privilege bit set */ -BOOL sec_privilege_check(const struct security_token *token, unsigned int privilege) +BOOL sec_privilege_check(const struct security_token *token, enum sec_privilege privilege) { - uint64_t mask = sec_privilege_mask(privilege); + uint64_t mask; + + if (privilege < 1 || privilege > 64) { + return False; + } + + mask = sec_privilege_mask(privilege); if (token->privilege_mask & mask) { return True; } @@ -198,7 +212,30 @@ BOOL sec_privilege_check(const struct security_token *token, unsigned int privil /* set a bit in the privilege mask */ -void sec_privilege_set(struct security_token *token, unsigned int privilege) +void sec_privilege_set(struct security_token *token, enum sec_privilege privilege) { + if (privilege < 1 || privilege > 64) { + return; + } token->privilege_mask |= sec_privilege_mask(privilege); } + +void sec_privilege_debug(int dbg_lev, const struct security_token *token) +{ + DEBUGADD(dbg_lev, (" Privileges (0x%16llX):\n", + (unsigned long long) token->privilege_mask)); + + if (token->privilege_mask) { + int i = 0; + uint_t privilege; + + for (privilege = 1; privilege <= 64; privilege++) { + uint64_t mask = sec_privilege_mask(privilege); + + if (token->privilege_mask & mask) { + DEBUGADD(dbg_lev, (" Privilege[%3lu]: %s\n", (unsigned long)i++, + sec_privilege_name(privilege))); + } + } + } +} -- cgit From 1ac990ddcf8501ce551c87e70cb3722ae9f4f34b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 3 Apr 2006 15:18:12 +0000 Subject: r14894: - add some 'const' - remove sid_active_in_token() was the same as security_token_has_sid() - rename some functions metze (This used to be commit 81390dcda50f53d61e70059fb33014de0d283dc5) --- source4/libcli/security/privilege.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index f81ff6dccc..b4855b59e2 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -194,7 +194,7 @@ static uint64_t sec_privilege_mask(enum sec_privilege privilege) /* return True if a security_token has a particular privilege bit set */ -BOOL sec_privilege_check(const struct security_token *token, enum sec_privilege privilege) +BOOL security_token_has_privilege(const struct security_token *token, enum sec_privilege privilege) { uint64_t mask; @@ -212,7 +212,7 @@ BOOL sec_privilege_check(const struct security_token *token, enum sec_privilege /* set a bit in the privilege mask */ -void sec_privilege_set(struct security_token *token, enum sec_privilege privilege) +void security_token_set_privilege(struct security_token *token, enum sec_privilege privilege) { if (privilege < 1 || privilege > 64) { return; @@ -220,7 +220,7 @@ void sec_privilege_set(struct security_token *token, enum sec_privilege privileg token->privilege_mask |= sec_privilege_mask(privilege); } -void sec_privilege_debug(int dbg_lev, const struct security_token *token) +void security_token_debug_privileges(int dbg_lev, const struct security_token *token) { DEBUGADD(dbg_lev, (" Privileges (0x%16llX):\n", (unsigned long long) token->privilege_mask)); -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/security/privilege.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index b4855b59e2..635f470bf6 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From dccf3f99e45137b6cd18c1de1c79808ad67130d1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 13:27:14 +0000 Subject: r25027: Fix more warnings. (This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729) --- source4/libcli/security/privilege.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index 635f470bf6..103e2e3c14 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -21,6 +21,7 @@ #include "includes.h" #include "librpc/gen_ndr/security.h" +#include "libcli/security/security.h" static const struct { -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/libcli/security/privilege.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/libcli/security/privilege.c') diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c index 103e2e3c14..2cbef13538 100644 --- a/source4/libcli/security/privilege.c +++ b/source4/libcli/security/privilege.c @@ -192,21 +192,21 @@ static uint64_t sec_privilege_mask(enum sec_privilege privilege) /* - return True if a security_token has a particular privilege bit set + return true if a security_token has a particular privilege bit set */ -BOOL security_token_has_privilege(const struct security_token *token, enum sec_privilege privilege) +bool security_token_has_privilege(const struct security_token *token, enum sec_privilege privilege) { uint64_t mask; if (privilege < 1 || privilege > 64) { - return False; + return false; } mask = sec_privilege_mask(privilege); if (token->privilege_mask & mask) { - return True; + return true; } - return False; + return false; } /* -- cgit