s3-privs Inline dump_se_priv into callers now that it's just a uint64_t
authorAndrew Bartlett <abartlet@samba.org>
Fri, 27 Aug 2010 00:04:05 +0000 (10:04 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 Sep 2010 04:45:58 +0000 (14:45 +1000)
The previous 128 bit structure needed this helper function.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
libcli/security/privileges.c
source3/auth/token_util.c
source3/lib/privileges.c
source3/rpc_server/srv_lsa_nt.c

index d72401af3fd7da9f9d8f62d33c8a758cd4c4ef49..f4f3321198672fde501674ff63b80278bafab9d2 100644 (file)
@@ -176,15 +176,6 @@ bool se_priv_from_name( const char *name, uint64_t *privilege_mask )
        return false;
 }
 
-/***************************************************************************
- dump an uint64_t structure to the log files
-****************************************************************************/
-
-void dump_se_priv( int dbg_cl, int dbg_lvl, const uint64_t *privilege_mask )
-{
-       DEBUGADDC( dbg_cl, dbg_lvl,("uint64_t 0x%llx\n", (unsigned long long)*privilege_mask));
-}
-
 /****************************************************************************
  check if the privilege is in the privilege list
 ****************************************************************************/
index 46637b348bc070310ee4314e4fcd18fa17206c5f..e8334c63068a25dab4e9556afad2d80a3140a595 100644 (file)
@@ -671,7 +671,7 @@ void debug_nt_user_token(int dbg_class, int dbg_lev, struct security_token *toke
                          ("SID[%3lu]: %s\n", (unsigned long)i,
                           sid_string_dbg(&token->sids[i])));
 
-       dump_se_priv( dbg_class, dbg_lev, &token->privilege_mask );
+       DEBUGADDC(dbg_class, dbg_lev,("Privilege mask: 0x%llx\n", (unsigned long long)token->privilege_mask));
 }
 
 /****************************************************************************
index 4713bc07004c9293f0276f25955fedf3d2f6a600..61425e827284cc35af368a19ddd3f44d52ab517d 100644 (file)
@@ -139,8 +139,8 @@ bool get_privileges_for_sids(uint64_t *privileges, struct dom_sid *slist, int sc
                        continue;
 
                DEBUG(5,("get_privileges_for_sids: sid = %s\nPrivilege "
-                        "set:\n", sid_string_dbg(&slist[i])));
-               dump_se_priv( DBGC_ALL, 5, &mask );
+                        "set: 0x%llx\n", sid_string_dbg(&slist[i]),
+                        (unsigned long long)mask));
 
                se_priv_add( privileges, &mask );
                found = True;
@@ -285,11 +285,9 @@ bool grant_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
 
        DEBUG(10,("grant_privilege: %s\n", sid_string_dbg(sid)));
 
-       DEBUGADD( 10, ("original privilege mask:\n"));
-       dump_se_priv( DBGC_ALL, 10, &old_mask );
+       DEBUGADD( 10, ("original privilege mask: 0x%llx\n", (unsigned long long)new_mask));
 
-       DEBUGADD( 10, ("new privilege mask:\n"));
-       dump_se_priv( DBGC_ALL, 10, &new_mask );
+       DEBUGADD( 10, ("new privilege mask:      0x%llx\n", (unsigned long long)new_mask));
 
        return set_privileges( sid, &new_mask );
 }
@@ -326,13 +324,11 @@ bool revoke_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
 
        DEBUG(10,("revoke_privilege: %s\n", sid_string_dbg(sid)));
 
-       DEBUGADD( 10, ("original privilege mask:\n"));
-       dump_se_priv( DBGC_ALL, 10, &mask );
+       DEBUGADD( 10, ("original privilege mask: 0x%llx\n", (unsigned long long)mask));
 
        se_priv_remove( &mask, priv_mask );
 
-       DEBUGADD( 10, ("new privilege mask:\n"));
-       dump_se_priv( DBGC_ALL, 10, &mask );
+       DEBUGADD( 10, ("new privilege mask:      0x%llx\n", (unsigned long long)mask));
 
        return set_privileges( sid, &mask );
 }
index 48d5609e0f704f42589161424f73941724200b80..2f7e975b821ce133008b02a24776062b92953663 100644 (file)
@@ -2017,8 +2017,7 @@ NTSTATUS _lsa_AddPrivilegesToAccount(struct pipes_struct *p,
        if ( !grant_privilege( &info->sid, &mask ) ) {
                DEBUG(3,("_lsa_AddPrivilegesToAccount: grant_privilege(%s) failed!\n",
                         sid_string_dbg(&info->sid) ));
-               DEBUG(3,("Privilege mask:\n"));
-               dump_se_priv( DBGC_ALL, 3, &mask );
+               DEBUG(3,("Privilege mask: 0x%llx\n", (unsigned long long)mask));
                return NT_STATUS_NO_SUCH_PRIVILEGE;
        }
 
@@ -2057,8 +2056,7 @@ NTSTATUS _lsa_RemovePrivilegesFromAccount(struct pipes_struct *p,
        if ( !revoke_privilege( &info->sid, &mask ) ) {
                DEBUG(3,("_lsa_RemovePrivilegesFromAccount: revoke_privilege(%s) failed!\n",
                         sid_string_dbg(&info->sid) ));
-               DEBUG(3,("Privilege mask:\n"));
-               dump_se_priv( DBGC_ALL, 3, &mask );
+               DEBUG(3,("Privilege mask: 0x%llx\n", (unsigned long long)mask));
                return NT_STATUS_NO_SUCH_PRIVILEGE;
        }