summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-02-08 11:02:11 +0000
committerAndrew Bartlett <abartlet@samba.org>2004-02-08 11:02:11 +0000
commitb401888b6be6f3cd9cdd8187dc74521eb3207f9c (patch)
treeac079aa894cf5e5b670dd2e0a210262ceacf607a /source3/passdb
parent8a547323d26a0350eb0a2bfc4d9ebeaade7baacc (diff)
downloadsamba-b401888b6be6f3cd9cdd8187dc74521eb3207f9c.tar.gz
samba-b401888b6be6f3cd9cdd8187dc74521eb3207f9c.tar.bz2
samba-b401888b6be6f3cd9cdd8187dc74521eb3207f9c.zip
Add static, and assert that we will never overflow the static fstring
in pdb_encode_acct_ctrl() (All current callers are fine) Andrew Bartlett (This used to be commit 01be89eb438567cfe0a002a247fe2d314b01f9da)
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/passdb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index d781e68fbf..3df6b5ada9 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -412,7 +412,7 @@ NTSTATUS pdb_free_sam(SAM_ACCOUNT **user)
* SSS
***************************************************************************/
-NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
+static NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
{
const char *guest_account = lp_guestaccount();
GROUP_MAP map;
@@ -475,6 +475,9 @@ NTSTATUS pdb_set_sam_sids(SAM_ACCOUNT *account_data, const struct passwd *pwd)
char *pdb_encode_acct_ctrl(uint16 acct_ctrl, size_t length)
{
static fstring acct_str;
+
+ SMB_ASSERT(length <= sizeof(acct_str));
+
size_t i = 0;
acct_str[i++] = '[';