summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
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;