diff options
author | Volker Lendecke <vl@samba.org> | 2007-12-15 21:53:26 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2007-12-15 22:09:36 +0100 |
commit | 7b01537679d4d4f1408634fe63c64c144f9d9519 (patch) | |
tree | 0a2191050b3ca77f10c837ec318b8db31f131850 /source3 | |
parent | 54ae9dfcbce727ae3107f21eee68762502acda60 (diff) | |
download | samba-7b01537679d4d4f1408634fe63c64c144f9d9519.tar.gz samba-7b01537679d4d4f1408634fe63c64c144f9d9519.tar.bz2 samba-7b01537679d4d4f1408634fe63c64c144f9d9519.zip |
Replace sid_string_static with sid_string_tos
In utils/ I was a bit lazy...
(This used to be commit 60e830b0f4571bd5d9039f2edd199534f2a4c341)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpcclient/cmd_lsarpc.c | 11 | ||||
-rw-r--r-- | source3/utils/net_groupmap.c | 14 | ||||
-rw-r--r-- | source3/utils/net_idmap.c | 3 | ||||
-rw-r--r-- | source3/utils/net_lookup.c | 4 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 2 | ||||
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 6 | ||||
-rw-r--r-- | source3/utils/net_rpc_shell.c | 2 | ||||
-rw-r--r-- | source3/utils/net_sam.c | 9 | ||||
-rw-r--r-- | source3/utils/net_usershare.c | 3 | ||||
-rw-r--r-- | source3/utils/pdbedit.c | 4 | ||||
-rw-r--r-- | source3/utils/profiles.c | 16 | ||||
-rw-r--r-- | source3/utils/sharesec.c | 11 |
12 files changed, 44 insertions, 41 deletions
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c index fd7b8762ab..61495075c1 100644 --- a/source3/rpcclient/cmd_lsarpc.c +++ b/source3/rpcclient/cmd_lsarpc.c @@ -89,7 +89,7 @@ static void display_query_info_3(DOM_QUERY_3 d) unistr2_to_ascii(name, &d.uni_domain_name, sizeof(name)); d_printf("Domain Name: %s\n", name); - d_printf("Domain Sid: %s\n", sid_string_static(&d.dom_sid.sid)); + d_printf("Domain Sid: %s\n", sid_string_tos(&d.dom_sid.sid)); } static void display_query_info_5(DOM_QUERY_5 d) @@ -99,7 +99,7 @@ static void display_query_info_5(DOM_QUERY_5 d) unistr2_to_ascii(name, &d.uni_domain_name, sizeof(name)); d_printf("Domain Name: %s\n", name); - d_printf("Domain Sid: %s\n", sid_string_static(&d.dom_sid.sid)); + d_printf("Domain Sid: %s\n", sid_string_tos(&d.dom_sid.sid)); } static void display_query_info_10(DOM_QUERY_10 d) @@ -125,7 +125,7 @@ static void display_query_info_12(DOM_QUERY_12 d) d_printf("Domain NetBios Name: %s\n", dom_name); d_printf("Domain DNS Name: %s\n", dns_dom_name); d_printf("Domain Forest Name: %s\n", forest_name); - d_printf("Domain Sid: %s\n", sid_string_static(&d.dom_sid.sid)); + d_printf("Domain Sid: %s\n", sid_string_tos(&d.dom_sid.sid)); d_printf("Domain GUID: %s\n", smb_uuid_string(talloc_tos(), d.dom_guid)); @@ -725,7 +725,8 @@ static NTSTATUS cmd_lsa_enum_acct_rights(struct rpc_pipe_client *cli, if (!NT_STATUS_IS_OK(result)) goto done; - printf("found %d privileges for SID %s\n", count, sid_string_static(&sid)); + printf("found %d privileges for SID %s\n", count, + sid_string_tos(&sid)); for (i = 0; i < count; i++) { printf("\t%s\n", rights[i]); @@ -929,7 +930,7 @@ static void display_trust_dom_info_6(TRUSTED_DOMAIN_INFO_EX *i) { printf("Domain Name:\t\t%s\n", unistr2_static(&i->domain_name.unistring)); printf("NetBIOS Name:\t\t%s\n", unistr2_static(&i->netbios_name.unistring)); - printf("SID:\t\t\t%s\n", sid_string_static(&i->sid.sid)); + printf("SID:\t\t\t%s\n", sid_string_tos(&i->sid.sid)); printf("Trust Direction:\t0x%08x\n", i->trust_direction); printf("Trust Type:\t\t0x%08x\n", i->trust_type); printf("Trust Attributes:\t0x%08x\n", i->trust_attributes); diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index 8aead50b9f..c59548b2f1 100644 --- a/source3/utils/net_groupmap.c +++ b/source3/utils/net_groupmap.c @@ -57,10 +57,10 @@ static void print_map_entry ( GROUP_MAP map, bool long_list ) { if (!long_list) d_printf("%s (%s) -> %s\n", map.nt_name, - sid_string_static(&map.sid), gidtoname(map.gid)); + sid_string_tos(&map.sid), gidtoname(map.gid)); else { d_printf("%s\n", map.nt_name); - d_printf("\tSID : %s\n", sid_string_static(&map.sid)); + d_printf("\tSID : %s\n", sid_string_tos(&map.sid)); d_printf("\tUnix gid : %d\n", map.gid); d_printf("\tUnix group: %s\n", gidtoname(map.gid)); d_printf("\tGroup type: %s\n", @@ -249,7 +249,7 @@ static int net_groupmap_add(int argc, const char **argv) { if (pdb_getgrgid(&map, gid)) { d_printf("Unix group %s already mapped to SID %s\n", - unixgrp, sid_string_static(&map.sid)); + unixgrp, sid_string_tos(&map.sid)); return -1; } } @@ -619,7 +619,7 @@ static int net_groupmap_cleanup(int argc, const char **argv) if (!sid_check_is_in_our_domain(&map[i].sid)) { printf("Deleting mapping for NT Group %s, sid %s\n", map[i].nt_name, - sid_string_static(&map[i].sid)); + sid_string_tos(&map[i].sid)); pdb_delete_group_mapping_entry(map[i].sid); } } @@ -690,7 +690,7 @@ static int net_groupmap_listmem(int argc, const char **argv) } for (i = 0; i < num; i++) { - printf("%s\n", sid_string_static(&(members[i]))); + printf("%s\n", sid_string_tos(&(members[i]))); } TALLOC_FREE(members); @@ -712,7 +712,7 @@ static bool print_alias_memberships(TALLOC_CTX *mem_ctx, mem_ctx, domain_sid, member, 1, &alias_rids, &num_alias_rids))) { d_fprintf(stderr, "Could not list memberships for sid %s\n", - sid_string_static(member)); + sid_string_tos(member)); return False; } @@ -720,7 +720,7 @@ static bool print_alias_memberships(TALLOC_CTX *mem_ctx, DOM_SID alias; sid_copy(&alias, domain_sid); sid_append_rid(&alias, alias_rids[i]); - printf("%s\n", sid_string_static(&alias)); + printf("%s\n", sid_string_tos(&alias)); } return True; diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 052566fa73..2a060d2f49 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -145,7 +145,8 @@ static int net_idmap_restore(int argc, const char **argv) if (!winbind_set_mapping(&map)) { d_fprintf(stderr, "Could not set mapping of %s %lu to sid %s\n", (map.xid.type == ID_TYPE_GID) ? "GID" : "UID", - (unsigned long)map.xid.id, sid_string_static(map.sid)); + (unsigned long)map.xid.id, + sid_string_tos(map.sid)); continue; } diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c index 9060f8366a..20298faa29 100644 --- a/source3/utils/net_lookup.c +++ b/source3/utils/net_lookup.c @@ -328,7 +328,7 @@ static int net_lookup_name(int argc, const char **argv) return -1; } - d_printf("%s %d (%s) %s\\%s\n", sid_string_static(&sid), + d_printf("%s %d (%s) %s\\%s\n", sid_string_tos(&sid), type, sid_type_lookup(type), dom, name); return 0; } @@ -355,7 +355,7 @@ static int net_lookup_sid(int argc, const char **argv) return -1; } - d_printf("%s %d (%s) %s\\%s\n", sid_string_static(&sid), + d_printf("%s %d (%s) %s\\%s\n", sid_string_tos(&sid), type, sid_type_lookup(type), dom, name); return 0; } diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index 1dd37888cd..2e085d6c0a 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -4224,7 +4224,7 @@ static void dump_user_token(struct user_token *token) d_printf("%s\n", token->name); for (i=0; i<token->token.num_sids; i++) { - d_printf(" %s\n", sid_string_static(&token->token.user_sids[i])); + d_printf(" %s\n", sid_string_tos(&token->token.user_sids[i])); } } diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 31d989ad37..d546c83357 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -52,7 +52,7 @@ static void display_alias_mem(uint32 rid, SAM_ALIAS_MEM_INFO *a) int i; d_printf("Alias rid %u: ", rid); for (i=0;i<a->num_members;i++) { - d_printf("%s ", sid_string_static(&a->sids[i].sid)); + d_printf("%s ", sid_string_tos(&a->sids[i].sid)); } d_printf("\n"); } @@ -570,7 +570,7 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta) if (map.gid != passwd->pw_gid) { if (!(grp = getgrgid(map.gid))) { DEBUG(0, ("Could not find unix group %lu for user %s (group SID=%s)\n", - (unsigned long)map.gid, pdb_get_username(sam_account), sid_string_static(&group_sid))); + (unsigned long)map.gid, pdb_get_username(sam_account), sid_string_tos(&group_sid))); } else { smb_set_primary_group(grp->gr_name, pdb_get_username(sam_account)); } @@ -705,7 +705,7 @@ static NTSTATUS fetch_group_mem_info(uint32 rid, SAM_GROUP_MEM_INFO *delta) if (!pdb_getsampwsid(member, &member_sid)) { DEBUG(1, ("Found bogus group member: %d (member_sid=%s group=%s)\n", - delta->rids[i], sid_string_static(&member_sid), grp->gr_name)); + delta->rids[i], sid_string_tos(&member_sid), grp->gr_name)); TALLOC_FREE(member); continue; } diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c index fb0b5cfe4e..e6302b652e 100644 --- a/source3/utils/net_rpc_shell.c +++ b/source3/utils/net_rpc_shell.c @@ -236,7 +236,7 @@ int net_rpc_shell(int argc, const char **argv) } d_printf("Talking to domain %s (%s)\n", ctx->domain_name, - sid_string_static(ctx->domain_sid)); + sid_string_tos(ctx->domain_sid)); this_ctx = ctx; diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 123aa54715..c82c89bf42 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -721,7 +721,7 @@ static int net_sam_mapunixgroup(int argc, const char **argv) } d_printf("Mapped unix group %s to SID %s\n", argv[0], - sid_string_static(&map.sid)); + sid_string_tos(&map.sid)); return 0; } @@ -1038,7 +1038,7 @@ static int net_sam_delmem(int argc, const char **argv) memberdomain, membername, groupdomain, groupname); } else { d_printf("Deleted %s from %s\\%s\n", - sid_string_static(&member), groupdomain, groupname); + sid_string_tos(&member), groupdomain, groupname); } return 0; @@ -1087,8 +1087,7 @@ static int net_sam_listmem(int argc, const char **argv) &dom, &name, NULL)) { d_printf(" %s\\%s\n", dom, name); } else { - d_printf(" %s\n", - sid_string_static(&members[i])); + d_printf(" %s\n", sid_string_tos(&members[i])); } } @@ -1217,7 +1216,7 @@ static int net_sam_show(int argc, const char **argv) } d_printf("%s\\%s is a %s with SID %s\n", dom, name, - sid_type_lookup(type), sid_string_static(&sid)); + sid_type_lookup(type), sid_string_tos(&sid)); return 0; } diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c index f95b1bdc6e..3af5fd44b8 100644 --- a/source3/utils/net_usershare.c +++ b/source3/utils/net_usershare.c @@ -824,7 +824,8 @@ static int net_usershare_add(int argc, const char **argv) return -1; } } - us_acl = talloc_asprintf_append(us_acl, "%s:%c,", sid_string_static(&sid), pcolon[1]); + us_acl = talloc_asprintf_append( + us_acl, "%s:%c,", sid_string_tos(&sid), pcolon[1]); /* Move to the next ACL entry. */ if (pcolon[2] == ',') { diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index 7d23c67f0c..6884783396 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -230,9 +230,9 @@ static int print_sam_info (struct samu *sam_pwent, bool verbosity, bool smbpwdst printf ("NT username: %s\n", pdb_get_nt_username(sam_pwent)); printf ("Account Flags: %s\n", pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sam_pwent), NEW_PW_FORMAT_SPACE_PADDED_LEN)); printf ("User SID: %s\n", - sid_string_static(pdb_get_user_sid(sam_pwent))); + sid_string_tos(pdb_get_user_sid(sam_pwent))); printf ("Primary Group SID: %s\n", - sid_string_static(pdb_get_group_sid(sam_pwent))); + sid_string_tos(pdb_get_group_sid(sam_pwent))); printf ("Full Name: %s\n", pdb_get_fullname(sam_pwent)); printf ("Home Directory: %s\n", pdb_get_homedir(sam_pwent)); printf ("HomeDir Drive: %s\n", pdb_get_dir_drive(sam_pwent)); diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index c641429beb..0b8a0d4278 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -61,33 +61,33 @@ static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID *s2 ) int i; bool update = False; - verbose_output(" Owner SID: %s\n", sid_string_static(sd->owner_sid)); + verbose_output(" Owner SID: %s\n", sid_string_tos(sd->owner_sid)); if ( sid_equal( sd->owner_sid, s1 ) ) { sid_copy( sd->owner_sid, s2 ); update = True; verbose_output(" New Owner SID: %s\n", - sid_string_static(sd->owner_sid)); + sid_string_tos(sd->owner_sid)); } - verbose_output(" Group SID: %s\n", sid_string_static(sd->group_sid)); + verbose_output(" Group SID: %s\n", sid_string_tos(sd->group_sid)); if ( sid_equal( sd->group_sid, s1 ) ) { sid_copy( sd->group_sid, s2 ); update = True; verbose_output(" New Group SID: %s\n", - sid_string_static(sd->group_sid)); + sid_string_tos(sd->group_sid)); } acl = sd->dacl; verbose_output(" DACL: %d entries:\n", acl->num_aces); for ( i=0; i<acl->num_aces; i++ ) { verbose_output(" Trustee SID: %s\n", - sid_string_static(&acl->aces[i].trustee)); + sid_string_tos(&acl->aces[i].trustee)); if ( sid_equal( &acl->aces[i].trustee, s1 ) ) { sid_copy( &acl->aces[i].trustee, s2 ); update = True; verbose_output(" New Trustee SID: %s\n", - sid_string_static(&acl->aces[i].trustee)); + sid_string_tos(&acl->aces[i].trustee)); } } @@ -96,12 +96,12 @@ static bool swap_sid_in_acl( SEC_DESC *sd, DOM_SID *s1, DOM_SID *s2 ) verbose_output(" SACL: %d entries: \n", acl->num_aces); for ( i=0; i<acl->num_aces; i++ ) { verbose_output(" Trustee SID: %s\n", - sid_string_static(&acl->aces[i].trustee)); + sid_string_tos(&acl->aces[i].trustee)); if ( sid_equal( &acl->aces[i].trustee, s1 ) ) { sid_copy( &acl->aces[i].trustee, s2 ); update = True; verbose_output(" New Trustee SID: %s\n", - sid_string_static(&acl->aces[i].trustee)); + sid_string_tos(&acl->aces[i].trustee)); } } #endif diff --git a/source3/utils/sharesec.c b/source3/utils/sharesec.c index 3da406dd34..9409690c8b 100644 --- a/source3/utils/sharesec.c +++ b/source3/utils/sharesec.c @@ -64,7 +64,7 @@ static void print_ace(FILE *f, SEC_ACE *ace) int do_print = 0; uint32 got_mask; - fprintf(f, "%s:", sid_string_static(&ace->trustee)); + fprintf(f, "%s:", sid_string_tos(&ace->trustee)); /* Ace type */ @@ -126,9 +126,9 @@ static void sec_desc_print(FILE *f, SEC_DESC *sd) /* Print owner and group sid */ - fprintf(f, "OWNER:%s\n", sid_string_static(sd->owner_sid)); + fprintf(f, "OWNER:%s\n", sid_string_tos(sd->owner_sid)); - fprintf(f, "GROUP:%s\n", sid_string_static(sd->group_sid)); + fprintf(f, "GROUP:%s\n", sid_string_tos(sd->group_sid)); /* Print aces */ for (i = 0; sd->dacl && i < sd->dacl->num_aces; i++) { @@ -459,7 +459,8 @@ static int change_share_sec(TALLOC_CTX *mem_ctx, const char *sharename, char *th } if (!found) { - printf("ACL for SID %s not found\n", sid_string_static(&sd->dacl->aces[i].trustee)); + printf("ACL for SID %s not found\n", + sid_string_tos(&sd->dacl->aces[i].trustee)); } } @@ -585,7 +586,7 @@ int main(int argc, const char *argv[]) return 3; } - printf ("%s\n", sid_string_static( sid ) ); + printf ("%s\n", sid_string_tos( sid ) ); return 0; } |