diff options
author | Jeremy Allison <jra@samba.org> | 2004-07-08 21:01:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:52:10 -0500 |
commit | d4ac326d46faab010eeeb24c893ab13bbbf0337e (patch) | |
tree | 8c9a257d054dbd4a8e79f6bccd6187f0b507468b /source3/lib | |
parent | c1a0b0a9e7ce57bdb0e5341f8d272bc02a4b6e84 (diff) | |
download | samba-d4ac326d46faab010eeeb24c893ab13bbbf0337e.tar.gz samba-d4ac326d46faab010eeeb24c893ab13bbbf0337e.tar.bz2 samba-d4ac326d46faab010eeeb24c893ab13bbbf0337e.zip |
r1412: Fix password history list in tdbsam. Fix some memory leaks. Add
my (C) to a header file that was at least 50% mine :-).
Jeremy.
(This used to be commit 8ee6060977ec8e65082f3ad09e1e1ccf5b4672ed)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/account_pol.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/source3/lib/account_pol.c b/source3/lib/account_pol.c index c2c63493a6..8d5b963da2 100644 --- a/source3/lib/account_pol.c +++ b/source3/lib/account_pol.c @@ -81,6 +81,30 @@ static const struct { {0, NULL} }; +char *account_policy_names_list(void) +{ + char *nl, *p; + int i; + size_t len = 0; + + for (i=0; account_policy_names[i].string; i++) { + len += strlen(account_policy_names[i].string) + 1; + } + len++; + nl = malloc(len); + if (!nl) { + return NULL; + } + p = nl; + for (i=0; account_policy_names[i].string; i++) { + memcpy(p, account_policy_names[i].string, strlen(account_policy_names[i].string) + 1); + p[strlen(account_policy_names[i].string)] = '\n'; + p += strlen(account_policy_names[i].string) + 1; + } + *p = '\0'; + return nl; +} + /**************************************************************************** Get the account policy name as a string from its #define'ed number ****************************************************************************/ @@ -111,9 +135,9 @@ int account_policy_name_to_fieldnum(const char *name) } - /**************************************************************************** ****************************************************************************/ + BOOL account_policy_get(int field, uint32 *value) { fstring name; @@ -159,4 +183,3 @@ BOOL account_policy_set(int field, uint32 value) return True; } - |