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,
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 <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "librpc/gen_ndr/security.h"
+#include "libcli/security/security.h"
static const struct {
{SEC_PRIV_REMOTE_INTERACTIVE_LOGON,
"SeRemoteInteractiveLogonRight",
- "Remote Interactive logon"}
+ "Remote Interactive logon"},
+
+ {SEC_PRIV_MACHINE_ACCOUNT,
+ "SeMachineAccountPrivilege",
+ "Add workstations to domain"}
};
/*
- 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 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;
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;
}
/*
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;
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));
if (token->privilege_mask) {
int i = 0;
- uint_t privilege;
+ unsigned int privilege;
for (privilege = 1; privilege <= 64; privilege++) {
uint64_t mask = sec_privilege_mask(privilege);