libcli/security Return number of entries in the old source3 list
authorAndrew Bartlett <abartlet@samba.org>
Fri, 27 Aug 2010 01:52:51 +0000 (11:52 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 Sep 2010 04:45:59 +0000 (14:45 +1000)
This ensures there isn't a behaviour change when the source3 list is combined
with the longer source4 list.

Andrew Bartlett

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

index 4815d1837c0c965cf77605a702ba264a418d3c47..bf623e0ad638ac1e2b6f8411131510cffed8c56d 100644 (file)
@@ -53,6 +53,8 @@ const uint64_t se_remote_shutdown = SE_REMOTE_SHUTDOWN;
 const uint64_t se_restore         = SE_RESTORE;
 const uint64_t se_take_ownership  = SE_TAKE_OWNERSHIP;
 
+#define NUM_SHORT_LIST_PRIVS 8
+
 PRIVS privs[] = {
 #if 0  /* usrmgr will display these twice if you include them.  We don't
           use them but we'll keep the bitmasks reserved in privileges.h anyways */
@@ -304,12 +306,11 @@ bool user_has_any_privilege(struct security_token *token, const uint64_t *privil
  return the number of elements in the privlege array
 *******************************************************************/
 
-int count_all_privileges( void )
+int num_privileges_in_short_list( void )
 {
-       return ARRAY_SIZE(privs);
+       return NUM_SHORT_LIST_PRIVS;
 }
 
-
 /*********************************************************************
  Generate the struct lsa_LUIDAttribute structure based on a bitmask
  The assumption here is that the privilege has already been validated
index 449b5c894fa31320128f7831849267b3a4412676..663f6fec9f5ab9a3393bfbc83958530cbc9345cd 100644 (file)
@@ -1452,7 +1452,7 @@ NTSTATUS _lsa_EnumPrivs(struct pipes_struct *p,
        struct lsa_info *handle;
        uint32 i;
        uint32 enum_context = *r->in.resume_handle;
-       int num_privs = count_all_privileges();
+       int num_privs = num_privileges_in_short_list();
        struct lsa_PrivEntry *entries = NULL;
        struct lsa_LUIDAttribute luid;