summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMarc VanHeyningen <marc.vanheyningen@isilon.com>2008-03-14 14:26:28 -0800
committerVolker Lendecke <vl@samba.org>2008-03-17 20:52:25 +0100
commite06aa46b9fab1e107fea8f6453fb13deffa91e96 (patch)
treedb972999f1b17db3e6b100fec70b5f4643632172 /source3/utils
parent6274929b1e1ddf89f4c5e93414121eaf06b6ab14 (diff)
downloadsamba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.gz
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.bz2
samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.zip
Coverity fixes
(This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c7
-rw-r--r--source3/utils/rpccheck.c3
-rw-r--r--source3/utils/smbget.c7
3 files changed, 13 insertions, 4 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 31cc63845e..50465da9b9 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3048,7 +3048,7 @@ static NTSTATUS rpc_group_members_internals(const DOM_SID *domain_sid,
rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_pol);
- string_to_sid(&sid_Builtin, "S-1-5-32");
+ (void) string_to_sid(&sid_Builtin, "S-1-5-32");
result = rpccli_samr_OpenDomain(pipe_hnd, mem_ctx,
&connect_pol,
@@ -4501,7 +4501,10 @@ static bool get_user_sids(const char *domain, const char *user, NT_USER_TOKEN *t
return False;
}
- string_to_sid(&user_sid, response.data.sid.sid);
+ if (!string_to_sid(&user_sid, response.data.sid.sid)) {
+ DEBUG(1, ("Could not convert string '%s' to SID\n", response.data.sid.sid));
+ return False;
+ }
init_user_token(token, &user_sid);
diff --git a/source3/utils/rpccheck.c b/source3/utils/rpccheck.c
index 63c2f14601..87632db16d 100644
--- a/source3/utils/rpccheck.c
+++ b/source3/utils/rpccheck.c
@@ -40,7 +40,8 @@ main()
ctx=talloc_init("main");
if (!ctx) exit(1);
- prs_init(&ps, 1600, 4, ctx, MARSHALL);
+ if (!prs_init(&ps, 1600, 4, ctx, MARSHALL))
+ exit(1);
while (scanf("%s", s)!=-1) {
if (strlen(s)==2 && strchr_m(filter, *s)!=NULL && strchr_m(filter, *(s+1))!=NULL) {
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 1b284c1725..3d4a71b71d 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -330,7 +330,12 @@ static int smb_download_file(const char *base, const char *name, int recursive,
return 0;
}
- fstat(localhandle, &localstat);
+ if (fstat(localhandle, &localstat) != 0) {
+ fprintf(stderr, "Can't fstat %s: %s\n", newpath, strerror(errno));
+ smbc_close(remotehandle);
+ close(localhandle);
+ return 0;
+ }
start_offset = localstat.st_size;