summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2007-09-21 14:37:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:30:58 -0500
commitc97fe37ea3d92a631e8da17c21dafae1db15e97b (patch)
tree8a198088c25da1fdd720da7e9d056186eb468380 /source3/utils
parent6873d5446e4cee76b022bfc0d33e9e8380e796c0 (diff)
downloadsamba-c97fe37ea3d92a631e8da17c21dafae1db15e97b.tar.gz
samba-c97fe37ea3d92a631e8da17c21dafae1db15e97b.tar.bz2
samba-c97fe37ea3d92a631e8da17c21dafae1db15e97b.zip
r25294: Tidy up callers of unistr2_to_ascii() to pass sizeof(target_area) to
the maxeln parameter instead of sizeof(target_area) - 1 (or even sizeof(fstring) - 1 in some places. I hope these were really all there were. Michael (This used to be commit 9a28be220df622322857dfe102fa35e108f932dc)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c10
-rw-r--r--source3/utils/net_rpc_samsync.c34
2 files changed, 22 insertions, 22 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index e44d33d874..b2e37ac559 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -1257,9 +1257,9 @@ static NTSTATUS rpc_user_list_internals(const DOM_SID *domain_sid,
loop_count++;
for (i = 0; i < num_entries; i++) {
- unistr2_to_ascii(user, &(&ctr.sam.info1->str[i])->uni_acct_name, sizeof(user)-1);
+ unistr2_to_ascii(user, &(&ctr.sam.info1->str[i])->uni_acct_name, sizeof(user));
if (opt_long_list_entries)
- unistr2_to_ascii(desc, &(&ctr.sam.info1->str[i])->uni_acct_desc, sizeof(desc)-1);
+ unistr2_to_ascii(desc, &(&ctr.sam.info1->str[i])->uni_acct_desc, sizeof(desc));
if (opt_long_list_entries)
printf("%-21.21s %s\n", user, desc);
@@ -1808,7 +1808,7 @@ static NTSTATUS rpc_group_delete_internals(const DOM_SID *domain_sid,
if (user_ctr->info.id21->group_rid == group_rid) {
unistr2_to_ascii(temp, &(user_ctr->info.id21)->uni_user_name,
- sizeof(temp)-1);
+ sizeof(temp));
if (opt_verbose)
d_printf("Group is primary group of %s\n",temp);
group_is_primary = True;
@@ -2515,8 +2515,8 @@ static NTSTATUS rpc_group_list_internals(const DOM_SID *domain_sid,
fstring group, desc;
- unistr2_to_ascii(group, &(&ctr.sam.info3->str[i])->uni_grp_name, sizeof(group)-1);
- unistr2_to_ascii(desc, &(&ctr.sam.info3->str[i])->uni_grp_desc, sizeof(desc)-1);
+ unistr2_to_ascii(group, &(&ctr.sam.info3->str[i])->uni_grp_name, sizeof(group));
+ unistr2_to_ascii(desc, &(&ctr.sam.info3->str[i])->uni_grp_desc, sizeof(desc));
if (opt_long_list_entries)
printf("%-21.21s %-50.50s\n",
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index 0be9381c3a..72b7f63cc4 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -585,8 +585,8 @@ static NTSTATUS fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta)
GROUP_MAP map;
BOOL insert = True;
- unistr2_to_ascii(name, &delta->uni_grp_name, sizeof(name)-1);
- unistr2_to_ascii(comment, &delta->uni_grp_desc, sizeof(comment)-1);
+ unistr2_to_ascii(name, &delta->uni_grp_name, sizeof(name));
+ unistr2_to_ascii(comment, &delta->uni_grp_desc, sizeof(comment));
/* add the group to the mapping table */
sid_copy(&group_sid, get_global_sam_sid());
@@ -776,8 +776,8 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta,
GROUP_MAP map;
BOOL insert = True;
- unistr2_to_ascii(name, &delta->uni_als_name, sizeof(name)-1);
- unistr2_to_ascii(comment, &delta->uni_als_desc, sizeof(comment)-1);
+ unistr2_to_ascii(name, &delta->uni_als_name, sizeof(name));
+ unistr2_to_ascii(comment, &delta->uni_als_desc, sizeof(comment));
/* Find out whether the group is already mapped */
sid_copy(&alias_sid, &dom_sid);
@@ -839,7 +839,7 @@ static NTSTATUS fetch_domain_info(uint32 rid, SAM_DOMAIN_INFO *delta)
u_lockoutreset = uint64s_nt_time_to_unix_abs(&delta->account_lockout.reset_count);
u_lockouttime = uint64s_nt_time_to_unix_abs(&delta->account_lockout.lockout_duration);
- unistr2_to_ascii(domname, &delta->uni_dom_name, sizeof(domname) - 1);
+ unistr2_to_ascii(domname, &delta->uni_dom_name, sizeof(domname));
/* we don't handle BUILTIN account policies */
if (!strequal(domname, get_global_sam_name())) {
@@ -1399,7 +1399,7 @@ static NTSTATUS fetch_group_info_to_ldif(SAM_DELTA_CTR *delta, GROUPMAP *groupma
/* Get the group name */
unistr2_to_ascii(groupname,
&(delta->group_info.uni_grp_name),
- sizeof(groupname)-1);
+ sizeof(groupname));
/* Set up the group type (always 2 for group info) */
grouptype = 2;
@@ -1470,7 +1470,7 @@ static NTSTATUS fetch_account_info_to_ldif(SAM_DELTA_CTR *delta,
/* Get the username */
unistr2_to_ascii(username,
&(delta->account_info.uni_acct_name),
- sizeof(username)-1);
+ sizeof(username));
/* Get the rid */
rid = delta->account_info.user_rid;
@@ -1482,7 +1482,7 @@ static NTSTATUS fetch_account_info_to_ldif(SAM_DELTA_CTR *delta,
/* Get the home directory */
if (delta->account_info.acb_info & ACB_NORMAL) {
unistr2_to_ascii(homedir, &(delta->account_info.uni_home_dir),
- sizeof(homedir)-1);
+ sizeof(homedir));
if (!*homedir) {
pstr_sprintf(homedir, "/home/%s", username);
} else {
@@ -1496,27 +1496,27 @@ static NTSTATUS fetch_account_info_to_ldif(SAM_DELTA_CTR *delta,
/* Get the logon script */
unistr2_to_ascii(logonscript, &(delta->account_info.uni_logon_script),
- sizeof(logonscript)-1);
+ sizeof(logonscript));
/* Get the home drive */
unistr2_to_ascii(homedrive, &(delta->account_info.uni_dir_drive),
- sizeof(homedrive)-1);
+ sizeof(homedrive));
/* Get the home path */
unistr2_to_ascii(homepath, &(delta->account_info.uni_home_dir),
- sizeof(homepath)-1);
+ sizeof(homepath));
/* Get the description */
unistr2_to_ascii(description, &(delta->account_info.uni_acct_desc),
- sizeof(description)-1);
+ sizeof(description));
/* Get the display name */
unistr2_to_ascii(fullname, &(delta->account_info.uni_full_name),
- sizeof(fullname)-1);
+ sizeof(fullname));
/* Get the profile path */
unistr2_to_ascii(profilepath, &(delta->account_info.uni_profile),
- sizeof(profilepath)-1);
+ sizeof(profilepath));
/* Get lm and nt password data */
if (memcmp(delta->account_info.pass.buf_lm_pwd, zero_buf, 16) != 0) {
@@ -1620,11 +1620,11 @@ static NTSTATUS fetch_alias_info_to_ldif(SAM_DELTA_CTR *delta,
/* Get the alias name */
unistr2_to_ascii(aliasname, &(delta->alias_info.uni_als_name),
- sizeof(aliasname)-1);
+ sizeof(aliasname));
/* Get the alias description */
unistr2_to_ascii(description, &(delta->alias_info.uni_als_desc),
- sizeof(description)-1);
+ sizeof(description));
/* Set up the group type */
switch (db_type) {
@@ -1895,7 +1895,7 @@ static NTSTATUS fetch_database_to_ldif(struct rpc_pipe_client *pipe_hnd,
unistr2_to_ascii(
domainname,
&deltas[k].domain_info.uni_dom_name,
- sizeof(domainname)-1);
+ sizeof(domainname));
break;
case SAM_DELTA_GROUP_INFO: