summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-02-08 12:03:14 +0000
committerAndrew Bartlett <abartlet@samba.org>2004-02-08 12:03:14 +0000
commit880f3b2952592133fb8da640aab73449e13f2ff6 (patch)
tree65b487af632baf005cf93ed264ec31c28bd6580d /source3
parentbbfd3a90ca9f34bf777fde0e9aeb434c058d205a (diff)
downloadsamba-880f3b2952592133fb8da640aab73449e13f2ff6.tar.gz
samba-880f3b2952592133fb8da640aab73449e13f2ff6.tar.bz2
samba-880f3b2952592133fb8da640aab73449e13f2ff6.zip
(merge from 3.0)
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 badf7f64fb38dfd40bdf65b19e9dd8932d5e6c3b)
Diffstat (limited to 'source3')
-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 52dee801ad..d45450a4fd 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++] = '[';