Change uint_t to unsigned int in source4
[metze/samba/wip.git] / source4 / libcli / security / privilege.c
index f81ff6dccc2ebdca3b53f4ce3d7f0c686aabcda3..82638306543762ee6d9728e9aca8bec87e17d3e7 100644 (file)
@@ -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,
    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 {
@@ -123,7 +123,11 @@ static const struct {
 
        {SEC_PRIV_REMOTE_INTERACTIVE_LOGON,   
         "SeRemoteInteractiveLogonRight",
-       "Remote Interactive logon"}
+       "Remote Interactive logon"},
+
+       {SEC_PRIV_MACHINE_ACCOUNT,
+        "SeMachineAccountPrivilege",
+       "Add workstations to domain"}
 };
 
 
@@ -192,27 +196,27 @@ 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 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;
@@ -220,14 +224,14 @@ 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));
 
        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);