summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-06-30 09:15:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:43 -0500
commit4ed5f70eeda59d07e5d10d4cf302359d7a518987 (patch)
treed4658941e1deaa9fde695b6ce68ca0782b2e1de5 /source3/lib
parentffe11a657f2cbef87c32774153c51bbf28c49d5d (diff)
downloadsamba-4ed5f70eeda59d07e5d10d4cf302359d7a518987.tar.gz
samba-4ed5f70eeda59d07e5d10d4cf302359d7a518987.tar.bz2
samba-4ed5f70eeda59d07e5d10d4cf302359d7a518987.zip
r23665: Remove two unneeded global variables
(This used to be commit 51a3933b3d367e3693daa6842f5a286328f4fd39)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/privileges_basic.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source3/lib/privileges_basic.c b/source3/lib/privileges_basic.c
index b1ca1765d5..93ecee89dc 100644
--- a/source3/lib/privileges_basic.c
+++ b/source3/lib/privileges_basic.c
@@ -364,15 +364,10 @@ BOOL user_has_any_privilege(NT_USER_TOKEN *token, const SE_PRIV *privilege)
int count_all_privileges( void )
{
- static int count;
-
- if ( count )
- return count;
-
- /* loop over the array and count it */
- for ( count=0; !se_priv_equal(&privs[count].se_priv, &se_priv_end); count++ ) ;
-
- return count;
+ /*
+ * The -1 is due to the weird SE_END record...
+ */
+ return (sizeof(privs) / sizeof(privs[0])) - 1;
}
@@ -404,9 +399,8 @@ LUID_ATTR get_privilege_luid( SE_PRIV *mask )
Convert a LUID to a named string
****************************************************************************/
-char* luid_to_privilege_name(const LUID *set)
+const char *luid_to_privilege_name(const LUID *set)
{
- static fstring name;
int i;
if (set->high != 0)
@@ -414,8 +408,7 @@ char* luid_to_privilege_name(const LUID *set)
for ( i=0; !se_priv_equal(&privs[i].se_priv, &se_priv_end); i++ ) {
if ( set->low == privs[i].luid.low ) {
- fstrcpy( name, privs[i].name );
- return name;
+ return privs[i].name;
}
}