summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c32
-rw-r--r--source3/utils/profiles.c5
2 files changed, 21 insertions, 16 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 76b53d6113..ff754c33dc 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -1005,26 +1005,32 @@ rpc_user_info_internals(const DOM_SID *domain_sid, const char *domain_name,
result = cli_samr_query_usergroups(cli, mem_ctx, &user_pol,
&num_rids, &user_gids);
- /* Look up rids */
+ if (!NT_STATUS_IS_OK(result)) goto done;
- rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids);
+ /* Look up rids */
- for (i = 0; i < num_rids; i++)
- rids[i] = user_gids[i].g_rid;
+ if (rids) {
+ rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids);
- result = cli_samr_lookup_rids(cli, mem_ctx, &domain_pol,
- flags, num_rids, rids,
- &num_names, &names, &name_types);
+ for (i = 0; i < num_rids; i++)
+ rids[i] = user_gids[i].g_rid;
- if (!NT_STATUS_IS_OK(result)) {
- goto done;
- }
+ result = cli_samr_lookup_rids(cli, mem_ctx, &domain_pol,
+ flags, num_rids, rids,
+ &num_names, &names, &name_types);
- /* Display results */
+ if (!NT_STATUS_IS_OK(result)) {
+ goto done;
+ }
- for (i = 0; i < num_names; i++)
- printf("%s\n", names[i]);
+ /* Display results */
+ for (i = 0; i < num_names; i++)
+ printf("%s\n", names[i]);
+ }
+ else {
+ printf("no groups\n");
+ }
done:
return result;
}
diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c
index 6911341708..5b5cb7f07b 100644
--- a/source3/utils/profiles.c
+++ b/source3/utils/profiles.c
@@ -521,7 +521,7 @@ static void process_acl(ACL *acl, const char *prefix)
int main(int argc, char *argv[])
{
int opt;
- int fd, start = 0;
+ int fd;
char *base;
struct stat sbuf;
REGF_HDR *regf_hdr;
@@ -608,10 +608,9 @@ int main(int argc, char *argv[])
* Now, mmap the file into memory, check the header and start
* dealing with the records. We are interested in the sk record
*/
- start = 0;
#ifdef HAVE_MMAP
- base = mmap(&start, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ base = mmap(NULL, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
#else
base = (char *)-1;
errno = ENOSYS;