summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-05-04 11:38:26 -0700
committerJeremy Allison <jra@samba.org>2011-05-04 12:12:15 -0700
commit8380835fc6de38706d9af29dc7f0fa4cec4f9c90 (patch)
tree5fdf238d5573c022a135e3f2e5590b656b0d64bf /source3/utils
parentdf023b8657cab232df88d3656aa5d87676bb7254 (diff)
downloadsamba-8380835fc6de38706d9af29dc7f0fa4cec4f9c90.tar.gz
samba-8380835fc6de38706d9af29dc7f0fa4cec4f9c90.tar.bz2
samba-8380835fc6de38706d9af29dc7f0fa4cec4f9c90.zip
Fix warning messages caused by addition of null check in fstrcpy macro.
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_groupmap.c10
-rw-r--r--source3/utils/net_rpc.c6
-rw-r--r--source3/utils/smbpasswd.c4
3 files changed, 10 insertions, 10 deletions
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index 818905e122..9145093f52 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/utils/net_groupmap.c
@@ -130,7 +130,7 @@ static int net_groupmap_list(struct net_context *c, int argc, const char **argv)
GROUP_MAP map;
if ( sid_string[0] )
- fstrcpy( ntgroup, sid_string);
+ strlcpy(ntgroup, sid_string, sizeof(ntgroup));
if (!get_sid_from_input(&sid, ntgroup)) {
return -1;
@@ -324,7 +324,7 @@ static int net_groupmap_add(struct net_context *c, int argc, const char **argv)
}
if (!ntgroup[0] )
- fstrcpy( ntgroup, unixgrp );
+ strlcpy(ntgroup, unixgrp, sizeof(ntgroup));
if (!NT_STATUS_IS_OK(add_initial_entry(gid, string_sid, sid_type, ntgroup, ntcomment))) {
d_fprintf(stderr, _("adding entry for group %s failed!\n"), ntgroup);
@@ -457,10 +457,10 @@ static int net_groupmap_modify(struct net_context *c, int argc, const char **arg
/* Change comment if new one */
if ( ntcomment[0] )
- fstrcpy( map.comment, ntcomment );
+ strlcpy(map.comment, ntcomment, sizeof(map.comment));
if ( ntgroup[0] )
- fstrcpy( map.nt_name, ntgroup );
+ strlcpy(map.nt_name, ntgroup, sizeof(map.nt_name));
if ( unixgrp[0] ) {
gid = nametogid( unixgrp );
@@ -528,7 +528,7 @@ static int net_groupmap_delete(struct net_context *c, int argc, const char **arg
/* give preference to the SID if we have that */
if ( sid_string[0] )
- fstrcpy( ntgroup, sid_string );
+ strlcpy(ntgroup, sid_string, sizeof(ntgroup));
if ( !get_sid_from_input(&sid, ntgroup) ) {
d_fprintf(stderr, _("Unable to resolve group %s to a SID\n"),
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index a3657262c4..43398524ec 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3763,8 +3763,8 @@ static NTSTATUS copy_fn(const char *mnt, struct file_info *f,
}
/* search below that directory */
- fstrcpy(new_mask, dir);
- fstrcat(new_mask, "\\*");
+ strlcpy(new_mask, dir, sizeof(new_mask));
+ strlcat(new_mask, "\\*", sizeof(new_mask));
old_dir = local_state->cwd;
local_state->cwd = dir;
@@ -4802,7 +4802,7 @@ static bool get_user_tokens_from_file(FILE *f,
token = &((*tokens)[*num_tokens-1]);
- fstrcpy(token->name, line);
+ strlcpy(token->name, line, sizeof(token->name));
token->token.num_sids = 0;
token->token.sids = NULL;
continue;
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index ada057c247..8c780498b5 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -378,7 +378,7 @@ static int process_root(int local_flags)
*/
slprintf(buf, sizeof(buf)-1, "%s$", user_name);
- fstrcpy(user_name, buf);
+ strlcpy(user_name, buf, sizeof(user_name));
} else if (local_flags & LOCAL_INTERDOM_ACCOUNT) {
static fstring buf;
@@ -395,7 +395,7 @@ static int process_root(int local_flags)
/* prepare uppercased and '$' terminated username */
slprintf(buf, sizeof(buf) - 1, "%s$", user_name);
- fstrcpy(user_name, buf);
+ strlcpy(user_name, buf, sizeof(user_name));
} else {