s/sid_to_string/sid_to_fstring/
authorVolker Lendecke <vl@samba.org>
Sat, 15 Dec 2007 21:47:30 +0000 (22:47 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 15 Dec 2007 21:47:30 +0000 (22:47 +0100)
least surprise for callers
(This used to be commit eb523ba77697346a365589101aac379febecd546)

38 files changed:
source3/groupdb/mapping_ldb.c
source3/groupdb/mapping_tdb.c
source3/lib/display_sec.c
source3/lib/privileges.c
source3/lib/smbldap_util.c
source3/lib/substitute.c
source3/lib/util_sid.c
source3/libads/ldap.c
source3/libsmb/cliquota.c
source3/libsmb/libsmbclient.c
source3/libsmb/samlogon_cache.c
source3/libsmb/trustdom_cache.c
source3/nsswitch/wb_client.c
source3/passdb/pdb_interface.c
source3/passdb/pdb_ldap.c
source3/rpc_server/srv_lsa_nt.c
source3/rpc_server/srv_samr_nt.c
source3/rpcclient/cmd_lsarpc.c
source3/rpcclient/cmd_netlogon.c
source3/rpcclient/cmd_samr.c
source3/utils/net.c
source3/utils/net_groupmap.c
source3/utils/net_rpc.c
source3/utils/net_rpc_rights.c
source3/utils/net_rpc_samsync.c
source3/utils/net_usershare.c
source3/utils/smbcacls.c
source3/utils/smbcquotas.c
source3/winbindd/idmap_cache.c
source3/winbindd/idmap_tdb.c
source3/winbindd/winbindd_async.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_group.c
source3/winbindd/winbindd_idmap.c
source3/winbindd/winbindd_misc.c
source3/winbindd/winbindd_pam.c
source3/winbindd/winbindd_sid.c
source3/winbindd/winbindd_util.c

index 205111e5ac4b409aa7e8c31923e23c619ef132aa..ea467775983942c943f782b4daa77ed8be55a5a1 100644 (file)
@@ -119,7 +119,7 @@ static struct ldb_dn *mapping_dn(TALLOC_CTX *mem_ctx, const DOM_SID *sid)
        if (!sid_split_rid(&domsid, &rid)) {
                return NULL;
        }
-       if (!sid_to_string(string_sid, &domsid)) {
+       if (!sid_to_fstring(string_sid, &domsid)) {
                return NULL;
        }
        /* we split by domain and rid so we can do a subtree search
@@ -149,7 +149,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag)
 
        if (ldb_msg_add_string(msg, "objectClass", "groupMap") != LDB_SUCCESS ||
            ldb_msg_add_string(msg, "sid", 
-                              sid_to_string(string_sid, &map->sid)) != LDB_SUCCESS ||
+                              sid_to_fstring(string_sid, &map->sid)) != LDB_SUCCESS ||
            ldb_msg_add_fmt(msg, "gidNumber", "%u", (unsigned)map->gid) != LDB_SUCCESS ||
            ldb_msg_add_fmt(msg, "sidNameUse", "%u", (unsigned)map->sid_name_use) != LDB_SUCCESS ||
            ldb_msg_add_string(msg, "comment", map->comment) != LDB_SUCCESS ||
@@ -327,7 +327,7 @@ static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_
 
        /* we do a subtree search on the domain */
        if (domsid != NULL) {
-               sid_to_string(name, domsid);
+               sid_to_fstring(name, domsid);
                basedn = ldb_dn_string_compose(tmp_ctx, NULL, "domain=%s", name);
                if (basedn == NULL) goto failed;
        }
@@ -376,7 +376,7 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
        fstring string_sid;
        NTSTATUS status = NT_STATUS_INTERNAL_DB_CORRUPTION;
 
-       if (!sid_to_string(string_sid, member)) {
+       if (!sid_to_fstring(string_sid, member)) {
                return NT_STATUS_INVALID_PARAMETER;
        }
 
@@ -427,7 +427,7 @@ static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
        GROUP_MAP map;
 
        if (!get_group_map_from_sid(*alias, &map)) {
-               sid_to_string(string_sid, alias);
+               sid_to_fstring(string_sid, alias);
                return NT_STATUS_NO_SUCH_ALIAS;
        }
 
@@ -452,7 +452,7 @@ static NTSTATUS modify_aliasmem(const DOM_SID *alias, const DOM_SID *member,
        el.name = talloc_strdup(tmp_ctx, "member");
        el.num_values = 1;
        el.values = &val;
-       sid_to_string(string_sid, member);
+       sid_to_fstring(string_sid, member);
        val.data = (uint8_t *)string_sid;
        val.length = strlen(string_sid);
 
index ad8ed0d34d3dd0d35149f8cbdca2166fc9f6e916..cf9f9058afc7b6cac5a0d71915d1c64f04798f01 100644 (file)
@@ -97,7 +97,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag)
        int len;
        bool ret;
 
-       sid_to_string(string_sid, &map->sid);
+       sid_to_fstring(string_sid, &map->sid);
 
        len = tdb_pack(NULL, sizeof(buf), "ddff",
                map->gid, map->sid_name_use, map->nt_name, map->comment);
@@ -139,7 +139,7 @@ static bool get_group_map_from_sid(DOM_SID sid, GROUP_MAP *map)
 
        /* the key is the SID, retrieving is direct */
 
-       sid_to_string(string_sid, &sid);
+       sid_to_fstring(string_sid, &sid);
        if (asprintf(&key, "%s%s", GROUP_PREFIX, string_sid) < 0) {
                return false;
        }
@@ -271,7 +271,7 @@ static bool group_map_remove(const DOM_SID *sid)
 
        /* the key is the SID, retrieving is direct */
 
-       sid_to_string(string_sid, sid);
+       sid_to_fstring(string_sid, sid);
        if (asprintf(&key, "%s%s", GROUP_PREFIX, string_sid) < 0) {
                return false;
        }
@@ -397,7 +397,7 @@ static NTSTATUS one_alias_membership(const DOM_SID *member,
        TALLOC_CTX *frame;
 
        slprintf(key, sizeof(key), "%s%s", MEMBEROF_PREFIX,
-                sid_to_string(tmp, member));
+                sid_to_fstring(tmp, member));
 
        dbuf = tdb_fetch_bystring(tdb, key);
 
@@ -480,14 +480,14 @@ static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
        if (is_aliasmem(alias, member))
                return NT_STATUS_MEMBER_IN_ALIAS;
 
-       sid_to_string(string_sid, member);
+       sid_to_fstring(string_sid, member);
        if (asprintf(&key, "%s%s", MEMBEROF_PREFIX, string_sid) < 0) {
                return NT_STATUS_NO_MEMORY;
        }
 
        dbuf = tdb_fetch_bystring(tdb, key);
 
-       sid_to_string(string_sid, alias);
+       sid_to_fstring(string_sid, alias);
 
        if (dbuf.dptr != NULL) {
                asprintf(&new_memberstring, "%s %s", (char *)(dbuf.dptr),
@@ -624,7 +624,7 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
 
        num -= 1;
 
-       sid_to_string(sid_string, member);
+       sid_to_fstring(sid_string, member);
        if (asprintf(&key, "%s%s", MEMBEROF_PREFIX, sid_string) < 0) {
                TALLOC_FREE(sids);
                return NT_STATUS_NO_MEMORY;
@@ -649,7 +649,7 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
        for (i=0; i<num; i++) {
                char *s = member_string;
 
-               sid_to_string(sid_string, &sids[i]);
+               sid_to_fstring(sid_string, &sids[i]);
                asprintf(&member_string, "%s %s", s, sid_string);
 
                SAFE_FREE(s);
index caa13a6a5ee5c5900dbbeaa65607e6b8ff1ba43a..f6a6bb64655b8298a4573359eca9052b2e666845 100644 (file)
@@ -151,7 +151,7 @@ void display_sec_ace(SEC_ACE *ace)
        printf(" (%d) flags: 0x%02x ", ace->type, ace->flags);
        display_sec_ace_flags(ace->flags);
        display_sec_access(&ace->access_mask);
-       sid_to_string(sid_str, &ace->trustee);
+       sid_to_fstring(sid_str, &ace->trustee);
        printf("\t\tSID: %s\n\n", sid_str);
 
        if (sec_ace_object(ace->type)) {
@@ -246,12 +246,12 @@ void display_sec_desc(SEC_DESC *sec)
        }
 
        if (sec->owner_sid) {
-               sid_to_string(sid_str, sec->owner_sid);
+               sid_to_fstring(sid_str, sec->owner_sid);
                printf("\tOwner SID:\t%s\n", sid_str);
        }
 
        if (sec->group_sid) {
-               sid_to_string(sid_str, sec->group_sid);
+               sid_to_fstring(sid_str, sec->group_sid);
                printf("\tGroup SID:\t%s\n", sid_str);
        }
 }
index 9f155acd8b94e0a79efc4ea62103f029ab5d93ce..63fb462e32d72a32265340704fb0798f24b74423 100644 (file)
@@ -54,7 +54,7 @@ static bool get_privileges( const DOM_SID *sid, SE_PRIV *mask )
 
        /* PRIV_<SID> (NULL terminated) as the key */
        
-       fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_string(tmp, sid));
+       fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
 
        data = tdb_fetch_bystring( tdb, keystr );
        
@@ -95,7 +95,7 @@ static bool set_privileges( const DOM_SID *sid, SE_PRIV *mask )
 
        /* PRIV_<SID> (NULL terminated) as the key */
        
-       fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_string(tmp, sid));
+       fstr_sprintf(keystr, "%s%s", PRIVPREFIX, sid_to_fstring(tmp, sid));
        
        /* no packing.  static size structure, just write it out */
        
index 42861ae11112ad55c4f514d92ac5076b4fbbae69..66aef6ba668f0dc3daa91e70b36908ab2f255b2f 100644 (file)
@@ -192,7 +192,7 @@ static NTSTATUS add_new_domain_info(struct smbldap_state *ldap_state,
        /* If we don't have an entry, then ask secrets.tdb for what it thinks.
           It may choose to make it up */
 
-       sid_to_string(sid_string, get_global_sam_sid());
+       sid_to_fstring(sid_string, get_global_sam_sid());
        smbldap_set_mod(&mods, LDAP_MOD_ADD,
                        get_attr_key2string(dominfo_attr_list,
                                            LDAP_ATTR_DOM_SID),
index 3fbdd2859e78a2bd9d0ec1e52190f11210c0f5a0..e06917c8fbe24d3140526236503a04dd18c67e33 100644 (file)
@@ -309,7 +309,7 @@ static char *longvar_domainsid( void )
                return NULL;
        }
        
-       sid_string = SMB_STRDUP( sid_to_string( tmp, &sid ) );
+       sid_string = SMB_STRDUP( sid_to_fstring( tmp, &sid ) );
        
        if ( !sid_string ) {
                DEBUG(0,("longvar_domainsid: failed to dup SID string!\n"));
index 868ac36d11a23d4efa352faa58ed44a2a97de548..52f65aa77dcab81e697d42a537b905cd86c754fb 100644 (file)
@@ -172,7 +172,7 @@ const char *get_global_sam_name(void)
  Convert a SID to an ascii string.
 *****************************************************************/
 
-char *sid_to_string(fstring sidstr_out, const DOM_SID *sid)
+char *sid_to_fstring(fstring sidstr_out, const DOM_SID *sid)
 {
        char *str = sid_string_talloc(talloc_tos(), sid);
        fstrcpy(sidstr_out, str);
index c3dd9154debeb26e16624dea05dd3e7d830f512c..e9124a387cec130924a6e0d4c3a322f91f88480b 100644 (file)
@@ -1849,7 +1849,7 @@ static void dump_sid(ADS_STRUCT *ads, const char *field, struct berval **values)
                DOM_SID sid;
                fstring tmp;
                sid_parse(values[i]->bv_val, values[i]->bv_len, &sid);
-               printf("%s: %s\n", field, sid_to_string(tmp, &sid));
+               printf("%s: %s\n", field, sid_to_fstring(tmp, &sid));
        }
 }
 
index 3c794240bc0f4207f80cb3be24bc6a556f0a3655..206576f040b593c01c18060ba5e0422ec1efebd3 100644 (file)
@@ -608,7 +608,7 @@ void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, bool _verbose, bool _numeric, void (*_
                                if (_sidtostring) {
                                        _sidtostring(username_str,&qt->sid,_numeric);
                                } else {
-                                       sid_to_string(username_str, &qt->sid);
+                                       sid_to_fstring(username_str, &qt->sid);
                                }
 
                                if (_verbose) { 
index 9b8d5edb4af6e6947a53f07dfeaeeb2249187aa2..2ff28302561b5d14c96689a5aaf3a87c06fcf1bf 100644 (file)
@@ -4136,7 +4136,7 @@ convert_sid_to_string(struct cli_state *ipc_cli,
        struct rpc_pipe_client *pipe_hnd = find_lsa_pipe_hnd(ipc_cli);
        TALLOC_CTX *ctx;
 
-       sid_to_string(str, sid);
+       sid_to_fstring(str, sid);
 
        if (numeric) {
                return;     /* no lookup desired */
index a15a3b228d60e6a6688c86fbbc04674f1528a546..4f791f66f6a47e04e9708a4220f6ea3305b88cb5 100644 (file)
@@ -81,7 +81,7 @@ void netsamlogon_clear_cached_user(TDB_CONTEXT *tdb, NET_USER_INFO_3 *user)
 
        /* Clear U/SID cache entry */
 
-       fstr_sprintf(key_str, "U/%s", sid_to_string(sid_string, &sid));
+       fstr_sprintf(key_str, "U/%s", sid_to_fstring(sid_string, &sid));
 
        DEBUG(10, ("netsamlogon_clear_cached_user: clearing %s\n", key_str));
 
@@ -89,7 +89,7 @@ void netsamlogon_clear_cached_user(TDB_CONTEXT *tdb, NET_USER_INFO_3 *user)
 
        /* Clear UG/SID cache entry */
 
-       fstr_sprintf(key_str, "UG/%s", sid_to_string(sid_string, &sid));
+       fstr_sprintf(key_str, "UG/%s", sid_to_fstring(sid_string, &sid));
 
        DEBUG(10, ("netsamlogon_clear_cached_user: clearing %s\n", key_str));
 
@@ -124,7 +124,7 @@ bool netsamlogon_cache_store( const char *username, NET_USER_INFO_3 *user )
        sid_append_rid( &user_sid, user->user_rid );
 
        /* Prepare key as DOMAIN-SID/USER-RID string */
-       slprintf(keystr, sizeof(keystr), "%s", sid_to_string(tmp, &user_sid));
+       slprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, &user_sid));
 
        DEBUG(10,("netsamlogon_cache_store: SID [%s]\n", keystr));
        
@@ -186,7 +186,7 @@ NET_USER_INFO_3* netsamlogon_cache_get( TALLOC_CTX *mem_ctx, const DOM_SID *user
        }
 
        /* Prepare key as DOMAIN-SID/USER-RID string */
-       slprintf(keystr, sizeof(keystr), "%s", sid_to_string(tmp, user_sid));
+       slprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, user_sid));
        DEBUG(10,("netsamlogon_cache_get: SID [%s]\n", keystr));
        data = tdb_fetch_bystring( netsamlogon_tdb, keystr );
        
index 498a0221f2a372523e466a91daca8276c1fcdc80..6755de3814bb05c7174ed2b0f2e0af6704d88b33 100644 (file)
@@ -129,7 +129,7 @@ bool trustdom_cache_store(char* name, char* alt_name, const DOM_SID *sid,
        alt_key = alt_name ? trustdom_cache_key(alt_name) : NULL;
 
        /* Generate string representation domain SID */
-       sid_to_string(sid_string, sid);
+       sid_to_fstring(sid_string, sid);
 
        /*
         * try to put the names in the cache
index ce5e8ef1d03c4dbcfb92a3bc621c969dd82ed663..d24bba2fe14671ccaa35fa5d9b455342bd2f3b2e 100644 (file)
@@ -75,7 +75,7 @@ bool winbind_lookup_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
        ZERO_STRUCT(request);
        ZERO_STRUCT(response);
 
-       sid_to_string(request.data.sid, sid);
+       sid_to_fstring(request.data.sid, sid);
        
        /* Make request */
 
@@ -134,7 +134,7 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
        ZERO_STRUCT(request);
        ZERO_STRUCT(response);
 
-       sid_to_string(request.data.sid, domain_sid);
+       sid_to_fstring(request.data.sid, domain_sid);
        
        len = 0;
        buflen = 0;
@@ -238,7 +238,7 @@ bool winbind_sid_to_uid(uid_t *puid, const DOM_SID *sid)
        ZERO_STRUCT(request);
        ZERO_STRUCT(response);
 
-       sid_to_string(sid_str, sid);
+       sid_to_fstring(sid_str, sid);
        fstrcpy(request.data.sid, sid_str);
        
        /* Make request */
@@ -305,7 +305,7 @@ bool winbind_sid_to_gid(gid_t *pgid, const DOM_SID *sid)
        ZERO_STRUCT(request);
        ZERO_STRUCT(response);
 
-       sid_to_string(sid_str, sid);
+       sid_to_fstring(sid_str, sid);
        fstrcpy(request.data.sid, sid_str);
        
        /* Make request */
@@ -470,7 +470,7 @@ bool winbind_set_mapping(const struct id_map *map)
 
        request.data.dual_idmapset.id = map->xid.id;
        request.data.dual_idmapset.type = map->xid.type;
-       sid_to_string(request.data.dual_idmapset.sid, map->sid);
+       sid_to_fstring(request.data.dual_idmapset.sid, map->sid);
 
        result = winbindd_request_response(WINBINDD_SET_MAPPING, &request, &response);
 
index 6a75732de75bfca67f2fce4e2706b5546cf23fda..ed6a91cb2b53312ae38bb7f0861d0cb61179536c 100644 (file)
@@ -606,7 +606,7 @@ static NTSTATUS pdb_default_create_dom_group(struct pdb_methods *methods,
 
        sid_compose(&group_sid, get_global_sam_sid(), *rid);
                
-       return add_initial_entry(grp->gr_gid, sid_to_string(tmp, &group_sid),
+       return add_initial_entry(grp->gr_gid, sid_to_fstring(tmp, &group_sid),
                                 SID_NAME_DOM_GRP, name, NULL);
 }
 
index 466222da800ea94b0a093b3e426143d188c19e42..bc912ada29d2bcfe7675eb27ac54afbe2ae3d640 100644 (file)
@@ -407,7 +407,7 @@ static int ldapsam_search_suffix_by_sid (struct ldapsam_privates *ldap_state,
        filter = talloc_asprintf(talloc_tos(), "(&(%s=%s)%s)",
                get_userattr_key2string(ldap_state->schema_ver,
                        LDAP_ATTR_USER_SID),
-               sid_to_string(sid_string, sid),
+               sid_to_fstring(sid_string, sid),
                get_objclass_filter(ldap_state->schema_ver));
        if (!filter) {
                return LDAP_NO_MEMORY;
@@ -1152,7 +1152,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
                        case SCHEMAVER_SAMBASAMACCOUNT:
                                smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods,
                                        get_userattr_key2string(ldap_state->schema_ver, LDAP_ATTR_USER_SID), 
-                                       sid_to_string(sid_string, user_sid));
+                                       sid_to_fstring(sid_string, user_sid));
                                break;
 
                        default:
@@ -1190,7 +1190,7 @@ static bool init_ldap_from_sam (struct ldapsam_privates *ldap_state,
                        case SCHEMAVER_SAMBASAMACCOUNT:
                                smbldap_make_mod(ldap_state->smbldap_state->ldap_struct, existing, mods,
                                        get_userattr_key2string(ldap_state->schema_ver, 
-                                       LDAP_ATTR_PRIMARY_GROUP_SID), sid_to_string(sid_string, group_sid));
+                                       LDAP_ATTR_PRIMARY_GROUP_SID), sid_to_fstring(sid_string, group_sid));
                                break;
 
                        default:
@@ -2582,7 +2582,7 @@ static NTSTATUS ldapsam_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
        if (asprintf(&filter, "(&(objectClass=%s)(%s=%s))",
                LDAP_OBJ_GROUPMAP,
                get_attr_key2string(groupmap_attr_list, LDAP_ATTR_GROUP_SID),
-               sid_to_string(tmp, &sid)) < 0) {
+               sid_to_fstring(tmp, &sid)) < 0) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -3566,7 +3566,7 @@ static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods,
 
        if (asprintf(&filter,
                     "(&(objectClass=%s)(sambaSid=%s)(sambaGroupType=%d))",
-                    LDAP_OBJ_GROUPMAP, sid_to_string(tmp, alias),
+                    LDAP_OBJ_GROUPMAP, sid_to_fstring(tmp, alias),
                     type) < 0) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -3614,7 +3614,7 @@ static NTSTATUS ldapsam_modify_aliasmem(struct pdb_methods *methods,
        smbldap_set_mod(&mods, modop,
                        get_attr_key2string(groupmap_attr_list,
                                            LDAP_ATTR_SID_LIST),
-                       sid_to_string(tmp, member));
+                       sid_to_fstring(tmp, member));
 
        rc = smbldap_modify(ldap_state->smbldap_state, dn, mods);
 
@@ -3688,7 +3688,7 @@ static NTSTATUS ldapsam_enum_aliasmem(struct pdb_methods *methods,
 
        if (asprintf(&filter,
                     "(&(objectClass=%s)(sambaSid=%s)(sambaGroupType=%d))",
-                    LDAP_OBJ_GROUPMAP, sid_to_string(tmp, alias),
+                    LDAP_OBJ_GROUPMAP, sid_to_fstring(tmp, alias),
                     type) < 0) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -4743,7 +4743,7 @@ static bool ldapsam_search_grouptype(struct pdb_methods *methods,
        state->filter = talloc_asprintf(search->mem_ctx,
                                        "(&(objectclass=sambaGroupMapping)"
                                        "(sambaGroupType=%d)(sambaSID=%s*))", 
-                                       type, sid_to_string(tmp, sid));
+                                       type, sid_to_fstring(tmp, sid));
        state->attrs = talloc_attrs(search->mem_ctx, "cn", "sambaSid",
                                    "displayName", "description",
                                    "sambaGroupType", NULL);
index 02f7f090a4b1ace1dccbeb723e5c7696f89af366..a1ddc8e6c8954d2baa9b50db341f855ff9b4a575 100644 (file)
@@ -870,8 +870,8 @@ static NTSTATUS _lsa_lookup_sids_internal(pipes_struct *p,
                         * SID. We (Jerry/VL) could not figure out which the
                         * hard cases are, so leave it with the SID.  */
                        name->name = talloc_asprintf(p->mem_ctx, "%s", 
-                                                    sid_to_string(tmp,
-                                                                  sids[i]));
+                                                    sid_to_fstring(tmp,
+                                                                   sids[i]));
                        if (name->name == NULL) {
                                return NT_STATUS_NO_MEMORY;
                        }
index d013ec8f0337c90996b257219b66244db9749b1d..1af41228a779307d0698be915efce3ec338aeca4 100644 (file)
@@ -315,7 +315,7 @@ static struct samr_info *get_samr_info_by_sid(DOM_SID *psid)
        TALLOC_CTX *mem_ctx;
        
        if (psid) {
-               sid_to_string(sid_str, psid);
+               sid_to_fstring(sid_str, psid);
        } else {
                fstrcpy(sid_str,"(NULL)");
        }
@@ -4875,7 +4875,7 @@ NTSTATUS _samr_open_group(pipes_struct *p, SAMR_Q_OPEN_GROUP *q_u, SAMR_R_OPEN_G
 
        sid_copy(&info_sid, get_global_sam_sid());
        sid_append_rid(&info_sid, q_u->rid_group);
-       sid_to_string(sid_string, &info_sid);
+       sid_to_fstring(sid_string, &info_sid);
 
        if ((info = get_samr_info_by_sid(&info_sid)) == NULL)
                return NT_STATUS_NO_MEMORY;
index 61495075c1e5d51f5801091eaa6d82c2277f4e87..d54f67264a95b8fe3485bb658fb01d4de2dce328 100644 (file)
@@ -251,7 +251,7 @@ static NTSTATUS cmd_lsa_lookup_names(struct rpc_pipe_client *cli,
 
        for (i = 0; i < (argc - 1); i++) {
                fstring sid_str;
-               sid_to_string(sid_str, &sids[i]);
+               sid_to_fstring(sid_str, &sids[i]);
                printf("%s %s (%s: %d)\n", argv[i + 1], sid_str,
                       sid_type_lookup(types[i]), types[i]);
        }
@@ -301,7 +301,7 @@ static NTSTATUS cmd_lsa_lookup_names_level(struct rpc_pipe_client *cli,
 
        for (i = 0; i < (argc - 2); i++) {
                fstring sid_str;
-               sid_to_string(sid_str, &sids[i]);
+               sid_to_fstring(sid_str, &sids[i]);
                printf("%s %s (%s: %d)\n", argv[i + 2], sid_str,
                       sid_type_lookup(types[i]), types[i]);
        }
@@ -369,7 +369,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        for (i = 0; i < (argc - 1); i++) {
                fstring sid_str;
 
-               sid_to_string(sid_str, &sids[i]);
+               sid_to_fstring(sid_str, &sids[i]);
                printf("%s %s\\%s (%d)\n", sid_str, 
                       domains[i] ? domains[i] : "*unknown*", 
                       names[i] ? names[i] : "*unknown*", types[i]);
@@ -432,7 +432,7 @@ static NTSTATUS cmd_lsa_enum_trust_dom(struct rpc_pipe_client *cli,
                for (i = 0; i < num_domains; i++) {
                        fstring sid_str;
 
-                       sid_to_string(sid_str, &domain_sids[i]);
+                       sid_to_fstring(sid_str, &domain_sids[i]);
                        printf("%s %s\n", domain_names[i] ? domain_names[i] : 
                               "*unknown*", sid_str);
                }
@@ -581,7 +581,7 @@ static NTSTATUS cmd_lsa_enum_sids(struct rpc_pipe_client *cli,
        for (i = 0; i < count; i++) {
                fstring sid_str;
 
-               sid_to_string(sid_str, &sids[i]);
+               sid_to_fstring(sid_str, &sids[i]);
                printf("%s\n", sid_str);
        }
 
index 6acac8273cfb53cda988fbc698058273680c91f2..e997bb5090536444c31fd908c3cc8a5a47629f48 100644 (file)
@@ -365,7 +365,7 @@ static void display_sam_sync(uint32 num_deltas, SAM_DELTA_HDR *hdr_deltas,
                         for (j = 0; j < alias->num_members; j++) {
                                 fstring sid_str;
 
-                                sid_to_string(sid_str, &alias->sids[j].sid);
+                                sid_to_fstring(sid_str, &alias->sids[j].sid);
 
                                 printf("%s\n", sid_str);
                         }
index 6a3c92a16a358e2b9a5df95758516c54fbfe34fc..dae6c42bf221a5709de040d8068a0be231f4684e 100644 (file)
@@ -1118,7 +1118,7 @@ static NTSTATUS cmd_samr_query_aliasmem(struct rpc_pipe_client *cli,
        for (i = 0; i < num_members; i++) {
                fstring sid_str;
 
-               sid_to_string(sid_str, &alias_sids[i]);
+               sid_to_fstring(sid_str, &alias_sids[i]);
                printf("\tsid:[%s]\n", sid_str);
        }
 
@@ -2114,7 +2114,7 @@ static NTSTATUS cmd_samr_lookup_domain(struct rpc_pipe_client *cli,
        result = rpccli_samr_lookup_domain(
                cli, mem_ctx, &connect_pol, domain_name, &sid);
 
-       sid_to_string(sid_string,&sid);
+       sid_to_fstring(sid_string,&sid);
  
        if (NT_STATUS_IS_OK(result)) 
                printf("SAMR_LOOKUP_DOMAIN: Domain Name: %s Domain SID: %s\n",
index 8118ec45128d5f605e3bd878ff0641b62dc2cb6d..bf70d08d8b42aa567c468089688547bb00b657b1 100644 (file)
@@ -665,7 +665,7 @@ static int net_getlocalsid(int argc, const char **argv)
                DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
                return 1;
        }
-       sid_to_string(sid_str, &sid);
+       sid_to_fstring(sid_str, &sid);
        d_printf("SID for domain %s is: %s\n", name, sid_str);
        return 0;
 }
@@ -743,7 +743,7 @@ static int net_getdomainsid(int argc, const char **argv)
                d_fprintf(stderr, "Could not fetch local SID\n");
                return 1;
        }
-       sid_to_string(sid_str, &domain_sid);
+       sid_to_fstring(sid_str, &domain_sid);
        d_printf("SID for local machine %s is: %s\n", global_myname(), sid_str);
 
        if (!secrets_fetch_domain_sid(opt_workgroup, &domain_sid)) {
@@ -751,7 +751,7 @@ static int net_getdomainsid(int argc, const char **argv)
                return 1;
        }
 
-       sid_to_string(sid_str, &domain_sid);
+       sid_to_fstring(sid_str, &domain_sid);
        d_printf("SID for domain %s is: %s\n", opt_workgroup, sid_str);
 
        return 0;
index c59548b2f150ca066723b771e45e526ab2f60139..b0e3d60a24d48609decb5e297036eb85be1a365f 100644 (file)
@@ -270,7 +270,7 @@ static int net_groupmap_add(int argc, const char **argv)
        if ( !string_sid[0] ) {
                sid_copy(&sid, get_global_sam_sid());
                sid_append_rid(&sid, rid);
-               sid_to_string(string_sid, &sid);
+               sid_to_fstring(string_sid, &sid);
        }
 
        if (!ntcomment[0]) {
index 2e085d6c0a17b3167045756f83594b7b17654d60..ab0cc73e4980ba2de45e5204f93eb0ee7d2f46fe 100644 (file)
@@ -442,7 +442,7 @@ NTSTATUS rpc_info_internals(const DOM_SID *domain_sid,
        SAM_UNK_CTR ctr;
        fstring sid_str;
 
-       sid_to_string(sid_str, domain_sid);
+       sid_to_fstring(sid_str, domain_sid);
 
        /* Get sam policy handle */     
        result = rpccli_samr_connect(pipe_hnd, mem_ctx, MAXIMUM_ALLOWED_ACCESS, 
@@ -519,7 +519,7 @@ static NTSTATUS rpc_getsid_internals(const DOM_SID *domain_sid,
 {
        fstring sid_str;
 
-       sid_to_string(sid_str, domain_sid);
+       sid_to_fstring(sid_str, domain_sid);
        d_printf("Storing SID %s for Domain %s in secrets.tdb\n",
                 sid_str, domain_name);
 
@@ -2661,7 +2661,7 @@ static NTSTATUS rpc_list_group_members(struct rpc_pipe_client *pipe_hnd,
        int i;
 
        fstring sid_str;
-       sid_to_string(sid_str, domain_sid);
+       sid_to_fstring(sid_str, domain_sid);
 
        result = rpccli_samr_open_group(pipe_hnd, mem_ctx, domain_pol,
                                     MAXIMUM_ALLOWED_ACCESS,
@@ -2773,7 +2773,7 @@ static NTSTATUS rpc_list_alias_members(struct rpc_pipe_client *pipe_hnd,
 
        for (i = 0; i < num_members; i++) {
                fstring sid_str;
-               sid_to_string(sid_str, &alias_sids[i]);
+               sid_to_fstring(sid_str, &alias_sids[i]);
 
                if (opt_long_list_entries) {
                        printf("%s %s\\%s %d\n", sid_str, 
@@ -5818,7 +5818,7 @@ static NTSTATUS rpc_query_domain_sid(const DOM_SID *domain_sid,
                                        const char **argv)
 {
        fstring str_sid;
-       sid_to_string(str_sid, domain_sid);
+       sid_to_fstring(str_sid, domain_sid);
        d_printf("%s\n", str_sid);
        return NT_STATUS_OK;
 }
@@ -5829,7 +5829,7 @@ static void print_trusted_domain(DOM_SID *dom_sid, const char *trusted_dom_name)
        int pad_len, col_len = 20;
 
        /* convert sid into ascii string */
-       sid_to_string(ascii_sid, dom_sid);
+       sid_to_fstring(ascii_sid, dom_sid);
 
        /* calculate padding space for d_printf to look nicer */
        pad_len = col_len - strlen(trusted_dom_name);
index 2375bc9fcf0aa66f021ec5f8d49046736713b413..23be8859e031052b5c3b5baf6e5ceefb9084ff32 100644 (file)
@@ -231,7 +231,7 @@ static NTSTATUS enum_accounts_for_privilege(struct rpc_pipe_client *pipe_hnd,
                   printing the raw SID if necessary */
                result = sid_to_name( pipe_hnd, ctx, &sids[i], name );
                if ( !NT_STATUS_IS_OK (result) )
-                       sid_to_string(name, &sids[i]);
+                       sid_to_fstring(name, &sids[i]);
 
                d_printf("  %s\n", name);
        }
@@ -267,7 +267,7 @@ static NTSTATUS enum_privileges_for_accounts(struct rpc_pipe_client *pipe_hnd,
                   
                result = sid_to_name(pipe_hnd, ctx, &sids[i], name );
                if ( !NT_STATUS_IS_OK (result) )
-                       sid_to_string(name, &sids[i]);
+                       sid_to_fstring(name, &sids[i]);
                        
                d_printf("%s\n", name);
                
index d546c83357482d7f8c76dac1e725d465aa5fc6ab..ca3279ee3acc6274aea2976fbb69f980baf23714 100644 (file)
@@ -535,11 +535,13 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
        sid_copy(&user_sid, get_global_sam_sid());
        sid_append_rid(&user_sid, delta->user_rid);
 
-       DEBUG(3, ("Attempting to find SID %s for user %s in the passdb\n", sid_to_string(sid_string, &user_sid), account));
+       DEBUG(3, ("Attempting to find SID %s for user %s in the passdb\n",
+                 sid_to_fstring(sid_string, &user_sid), account));
        if (!pdb_getsampwsid(sam_account, &user_sid)) {
                sam_account_from_delta(sam_account, delta);
                DEBUG(3, ("Attempting to add user SID %s for user %s in the passdb\n", 
-                         sid_to_string(sid_string, &user_sid), pdb_get_username(sam_account)));
+                         sid_to_fstring(sid_string, &user_sid),
+                         pdb_get_username(sam_account)));
                if (!NT_STATUS_IS_OK(pdb_add_sam_account(sam_account))) {
                        DEBUG(1, ("SAM Account for %s failed to be added to the passdb!\n",
                                  account));
@@ -548,7 +550,8 @@ static NTSTATUS fetch_account_info(uint32 rid, SAM_ACCOUNT_INFO *delta)
        } else {
                sam_account_from_delta(sam_account, delta);
                DEBUG(3, ("Attempting to update user SID %s for user %s in the passdb\n", 
-                         sid_to_string(sid_string, &user_sid), pdb_get_username(sam_account)));
+                         sid_to_fstring(sid_string, &user_sid),
+                         pdb_get_username(sam_account)));
                if (!NT_STATUS_IS_OK(pdb_update_sam_account(sam_account))) {
                        DEBUG(1, ("SAM Account for %s failed to be updated in the passdb!\n",
                                  account));
@@ -603,7 +606,7 @@ static NTSTATUS fetch_group_info(uint32 rid, SAM_GROUP_INFO *delta)
        /* add the group to the mapping table */
        sid_copy(&group_sid, get_global_sam_sid());
        sid_append_rid(&group_sid, rid);
-       sid_to_string(sid_string, &group_sid);
+       sid_to_fstring(sid_string, &group_sid);
 
        if (pdb_getgrsid(&map, group_sid)) {
                if ( map.gid != -1 )
@@ -794,7 +797,7 @@ static NTSTATUS fetch_alias_info(uint32 rid, SAM_ALIAS_INFO *delta,
        /* Find out whether the group is already mapped */
        sid_copy(&alias_sid, &dom_sid);
        sid_append_rid(&alias_sid, rid);
-       sid_to_string(sid_string, &alias_sid);
+       sid_to_fstring(sid_string, &alias_sid);
 
        if (pdb_getgrsid(&map, alias_sid)) {
                grp = getgrgid(map.gid);
@@ -1838,7 +1841,7 @@ static NTSTATUS fetch_database_to_ldif(struct rpc_pipe_client *pipe_hnd,
        } 
 
        /* Get the sid */
-       sid_to_string(sid, &dom_sid);
+       sid_to_fstring(sid, &dom_sid);
 
        /* Get the ldap suffix */
        suffix = lp_ldap_suffix();
@@ -2117,10 +2120,10 @@ NTSTATUS rpc_vampire_internals(const DOM_SID *domain_sid,
                         "workgroup=%s\n\n in your smb.conf?\n",
                         domain_name,
                         get_global_sam_name(),
-                        sid_to_string(my_dom_sid_str, 
-                                      get_global_sam_sid()),
-                        domain_name, sid_to_string(rem_dom_sid_str,
-                                                   domain_sid),
+                        sid_to_fstring(my_dom_sid_str, 
+                                       get_global_sam_sid()),
+                        domain_name, sid_to_fstring(rem_dom_sid_str,
+                                                    domain_sid),
                         domain_name);
                return NT_STATUS_UNSUCCESSFUL;
        }
index 3af5fd44b8fcfff4127269da31b6d7b27fbc8b97..550157a1037d5e3274893aff48f23de7cfd26748 100644 (file)
@@ -423,7 +423,8 @@ static int info_fn(struct file_list *fl, void *priv)
 
                } else {
                        fstring sidstr;
-                       sid_to_string(sidstr, &psd->dacl->aces[num_aces].trustee);
+                       sid_to_fstring(sidstr,
+                                      &psd->dacl->aces[num_aces].trustee);
                        acl_str = talloc_asprintf_append(acl_str,
                                                "%s",
                                                sidstr);
index f823ea3bfdc4c019905f4b18c209b78ba74f3567..958f8e255eb1801470ce5ddcf8d830ae4e0448a8 100644 (file)
@@ -168,7 +168,7 @@ static void SidToString(struct cli_state *cli, fstring str, const DOM_SID *sid)
        enum lsa_SidType type;
        NTSTATUS status;
 
-       sid_to_string(str, sid);
+       sid_to_fstring(str, sid);
 
        if (numeric) {
                return;
index 08a3cc18068739bca7b50e5083cd4c8a8da11dfb..e6aa5e86cf21d9c3f2a4c7333add4881dfe937d6 100644 (file)
@@ -80,7 +80,7 @@ static void SidToString(fstring str, DOM_SID *sid, bool _numeric)
        char **names = NULL;
        enum lsa_SidType *types = NULL;
 
-       sid_to_string(str, sid);
+       sid_to_fstring(str, sid);
 
        if (_numeric) return;
 
index 4e286f88c038a0b7f7be10d29dda5b89438ad6ab..cf46196ebe58b76bb5549611bae3a9d5289e8679 100644 (file)
@@ -80,7 +80,7 @@ NTSTATUS idmap_cache_build_sidkey(TALLOC_CTX *ctx, char **sidkey, const struct i
        fstring sidstr;
 
        *sidkey = talloc_asprintf(ctx, "IDMAP/SID/%s",
-                                 sid_to_string(sidstr, id->sid));
+                                 sid_to_fstring(sidstr, id->sid));
        if ( ! *sidkey) {
                DEBUG(1, ("failed to build sidkey, OOM?\n"));
                return NT_STATUS_NO_MEMORY;
index d693c357f727812b51eafd290db0e652d6f93e38..e5f605361b4ebb8028f5ce6f2312dbfffa5cf82e 100644 (file)
@@ -86,7 +86,7 @@ static int convert_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA data, void *state
        sid_copy(&sid, &domain->sid);
        sid_append_rid(&sid, rid);
 
-       sid_to_string(keystr, &sid);
+       sid_to_fstring(keystr, &sid);
        key2 = string_term_tdb_data(keystr);
 
        if (tdb_store(tdb, key2, data, TDB_INSERT) != 0) {
@@ -714,8 +714,8 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map
        unsigned long rec_id = 0;
        fstring tmp;
 
-       if ((keystr = talloc_asprintf(ctx, "%s",
-                                     sid_to_string(tmp, map->sid))) == NULL) {
+       if ((keystr = talloc_asprintf(
+                    ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
                DEBUG(0, ("Out of memory!\n"));
                ret = NT_STATUS_NO_MEMORY;
                goto done;
@@ -909,7 +909,7 @@ static NTSTATUS idmap_tdb_set_mapping(struct idmap_domain *dom, const struct id_
        }
 
        if ((ksidstr = talloc_asprintf(
-                    ctx, "%s", sid_to_string(tmp, map->sid))) == NULL) {
+                    ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
                DEBUG(0, ("Out of memory!\n"));
                ret = NT_STATUS_NO_MEMORY;
                goto done;
@@ -1024,7 +1024,7 @@ static NTSTATUS idmap_tdb_remove_mapping(struct idmap_domain *dom, const struct
        }
 
        if ((ksidstr = talloc_asprintf(
-                    ctx, "%s", sid_to_string(tmp, map->sid))) == NULL) {
+                    ctx, "%s", sid_to_fstring(tmp, map->sid))) == NULL) {
                DEBUG(0, ("Out of memory!\n"));
                ret = NT_STATUS_NO_MEMORY;
                goto done;
index 0971476f440c04db23f2dd6545bf9185cc48d88a..76724582a1817a97e7662919ba3803d02c750d84 100644 (file)
@@ -175,7 +175,7 @@ static void lookupsid_recv(TALLOC_CTX *mem_ctx, bool success,
 
                ZERO_STRUCT(request);
                request.cmd = WINBINDD_LOOKUPSID;
-               sid_to_string(request.data.sid, &s->sid);
+               sid_to_fstring(request.data.sid, &s->sid);
 
                do_async_domain(mem_ctx, root_domain, &request, lookupsid_recv2,
                                (void *)cont, s);
@@ -209,7 +209,7 @@ void winbindd_lookupsid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
 
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_LOOKUPSID;
-       sid_to_string(request.data.sid, sid);
+       sid_to_fstring(request.data.sid, sid);
 
        if ( (s = TALLOC_ZERO_P(mem_ctx, struct lookupsid_state)) == NULL ) {
                DEBUG(0, ("winbindd_lookupsid_async: talloc failed\n"));
@@ -443,7 +443,7 @@ enum winbindd_result winbindd_dual_lookupname(struct winbindd_domain *domain,
                return WINBINDD_ERROR;
        }
 
-       sid_to_string(state->response.data.sid.sid, &sid);
+       sid_to_fstring(state->response.data.sid.sid, &sid);
        state->response.data.sid.type = type;
 
        return WINBINDD_OK;
@@ -460,7 +460,7 @@ bool print_sidlist(TALLOC_CTX *mem_ctx, const DOM_SID *sids,
        for (i=0; i<num_sids; i++) {
                fstring tmp;
                sprintf_append(mem_ctx, result, len, &buflen,
-                              "%s\n", sid_to_string(tmp, &sids[i]));
+                              "%s\n", sid_to_fstring(tmp, &sids[i]));
        }
 
        if ((num_sids != 0) && (*result == NULL)) {
@@ -796,7 +796,7 @@ void winbindd_gettoken_async(TALLOC_CTX *mem_ctx, const DOM_SID *user_sid,
 
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_GETUSERDOMGROUPS;
-       sid_to_string(request.data.sid, user_sid);
+       sid_to_fstring(request.data.sid, user_sid);
 
        do_async_domain(mem_ctx, domain, &request, gettoken_recvdomgroups,
                        NULL, state);
@@ -949,7 +949,7 @@ void query_user_async(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
        struct winbindd_request request;
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_DUAL_USERINFO;
-       sid_to_string(request.data.sid, sid);
+       sid_to_fstring(request.data.sid, sid);
        do_async_domain(mem_ctx, domain, &request, query_user_recv,
                        (void *)cont, private_data);
 }
index 31747dd4c8793817cda959e27dbe8e3b9f75f2d6..f63c7a5b2f7185b9384fa9e3b9bcbdf81fd572a5 100644 (file)
@@ -756,7 +756,7 @@ static void centry_put_hash16(struct cache_entry *centry, const uint8 val[16])
 static void centry_put_sid(struct cache_entry *centry, const DOM_SID *sid) 
 {
        fstring sid_string;
-       centry_put_string(centry, sid_to_string(sid_string, sid));
+       centry_put_string(centry, sid_to_fstring(sid_string, sid));
 }
 
 
@@ -876,7 +876,7 @@ static void wcache_save_sid_to_name(struct winbindd_domain *domain, NTSTATUS sta
                centry_put_string(centry, name);
        }
 
-       centry_end(centry, "SN/%s", sid_to_string(sid_string, sid));
+       centry_end(centry, "SN/%s", sid_to_fstring(sid_string, sid));
        DEBUG(10,("wcache_save_sid_to_name: %s -> %s (%s)\n", sid_string, 
                  name, nt_errstr(status)));
        centry_free(centry);
@@ -902,7 +902,8 @@ static void wcache_save_user(struct winbindd_domain *domain, NTSTATUS status, WI
        centry_put_uint32(centry, info->primary_gid);
        centry_put_sid(centry, &info->user_sid);
        centry_put_sid(centry, &info->group_sid);
-       centry_end(centry, "U/%s", sid_to_string(sid_string, &info->user_sid));
+       centry_end(centry, "U/%s", sid_to_fstring(sid_string,
+                                                 &info->user_sid));
        DEBUG(10,("wcache_save_user: %s (acct_name %s)\n", sid_string, info->acct_name));
        centry_free(centry);
 }
@@ -966,7 +967,7 @@ NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const DOM_SID
                return NT_STATUS_INVALID_SID;
        }
 
-       fstr_sprintf(key_str, "CRED/%s", sid_to_string(tmp, sid));
+       fstr_sprintf(key_str, "CRED/%s", sid_to_fstring(tmp, sid));
 
        data = tdb_fetch(cache->tdb, string_tdb_data(key_str));
        if (!data.dptr) {
@@ -1009,7 +1010,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
           fall back to an unsalted cred. */
 
        centry = wcache_fetch(cache, domain, "CRED/%s",
-                             sid_to_string(tmp, sid));
+                             sid_to_fstring(tmp, sid));
        if (!centry) {
                DEBUG(10,("wcache_get_creds: entry for [CRED/%s] not found\n", 
                          sid_string_dbg(sid)));
@@ -1027,7 +1028,7 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
        if (*cached_nt_pass == NULL) {
                fstring sidstr;
 
-               sid_to_string(sidstr, sid);
+               sid_to_fstring(sidstr, sid);
 
                /* Bad (old) cred cache. Delete and pretend we
                   don't have it. */
@@ -1095,7 +1096,7 @@ NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
 
        centry_put_hash16(centry, salted_hash);
        centry_put_hash16(centry, cred_salt);
-       centry_end(centry, "CRED/%s", sid_to_string(sid_string, sid));
+       centry_end(centry, "CRED/%s", sid_to_fstring(sid_string, sid));
 
        DEBUG(10,("wcache_save_creds: %s\n", sid_string));
 
@@ -1470,7 +1471,8 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain,
        if (!cache->tdb)
                goto do_query;
 
-       centry = wcache_fetch(cache, domain, "SN/%s", sid_to_string(sid_string, sid));
+       centry = wcache_fetch(cache, domain, "SN/%s",
+                             sid_to_fstring(sid_string, sid));
        if (!centry)
                goto do_query;
 
@@ -1565,7 +1567,7 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain,
                }
 
                centry = wcache_fetch(cache, domain, "SN/%s",
-                                     sid_to_string(tmp, &sid));
+                                     sid_to_fstring(tmp, &sid));
                if (!centry) {
                        goto do_query;
                }
@@ -1687,7 +1689,7 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
                goto do_query;
 
        centry = wcache_fetch(cache, domain, "U/%s",
-                             sid_to_string(tmp, user_sid));
+                             sid_to_fstring(tmp, user_sid));
        
        /* If we have an access denied cache entry and a cached info3 in the
            samlogon cache then do a query.  This will force the rpc back end
@@ -1759,7 +1761,8 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
        if (!cache->tdb)
                goto do_query;
 
-       centry = wcache_fetch(cache, domain, "UG/%s", sid_to_string(sid_string, user_sid));
+       centry = wcache_fetch(cache, domain, "UG/%s",
+                             sid_to_fstring(sid_string, user_sid));
        
        /* If we have an access denied cache entry and a cached info3 in the
            samlogon cache then do a query.  This will force the rpc back end
@@ -1826,7 +1829,7 @@ do_query:
                centry_put_sid(centry, &(*user_gids)[i]);
        }       
 
-       centry_end(centry, "UG/%s", sid_to_string(sid_string, user_sid));
+       centry_end(centry, "UG/%s", sid_to_fstring(sid_string, user_sid));
        centry_free(centry);
 
 skip_save:
@@ -1859,7 +1862,7 @@ static NTSTATUS lookup_useraliases(struct winbindd_domain *domain,
        for (i=0; i<num_sids; i++) {
                fstring tmp;
                sidlist = talloc_asprintf(mem_ctx, "%s/%s", sidlist,
-                                         sid_to_string(tmp, &sids[i]));
+                                         sid_to_fstring(tmp, &sids[i]));
                if (sidlist == NULL)
                        return NT_STATUS_NO_MEMORY;
        }
@@ -1939,7 +1942,8 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
        if (!cache->tdb)
                goto do_query;
 
-       centry = wcache_fetch(cache, domain, "GM/%s", sid_to_string(sid_string, group_sid));
+       centry = wcache_fetch(cache, domain, "GM/%s",
+                             sid_to_fstring(sid_string, group_sid));
        if (!centry)
                goto do_query;
 
@@ -1999,7 +2003,7 @@ do_query:
                centry_put_string(centry, (*names)[i]);
                centry_put_uint32(centry, (*name_types)[i]);
        }       
-       centry_end(centry, "GM/%s", sid_to_string(sid_string, group_sid));
+       centry_end(centry, "GM/%s", sid_to_fstring(sid_string, group_sid));
        centry_free(centry);
 
 skip_save:
@@ -2480,7 +2484,8 @@ bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
                return False;
        }
 
-       centry = wcache_fetch(cache, domain, "SN/%s", sid_to_string(tmp, sid));
+       centry = wcache_fetch(cache, domain, "SN/%s",
+                             sid_to_fstring(tmp, sid));
        if (centry == NULL) {
                return False;
        }
@@ -2690,7 +2695,7 @@ NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const
 
                DEBUG(11,("we already have an entry, deleting that\n"));
 
-               fstr_sprintf(key_str, "CRED/%s", sid_to_string(tmp, sid));
+               fstr_sprintf(key_str, "CRED/%s", sid_to_fstring(tmp, sid));
 
                tdb_delete(cache->tdb, string_tdb_data(key_str));
 
@@ -3544,7 +3549,7 @@ static int pack_tdc_domains( struct winbindd_tdc_domain *domains,
                len += tdb_pack( buffer+len, buflen-len, "fffddd",
                                 domains[i].domain_name,
                                 domains[i].dns_name,
-                                sid_to_string(tmp, &domains[i].sid),
+                                sid_to_fstring(tmp, &domains[i].sid),
                                 domains[i].trust_flags,
                                 domains[i].trust_attribs,
                                 domains[i].trust_type );
@@ -3825,7 +3830,7 @@ static void wcache_save_user_pwinfo(struct winbindd_domain *domain,
        centry_put_string( centry, gecos );
        centry_put_uint32( centry, gid );
        
-       centry_end(centry, "NSS/PWINFO/%s", sid_to_string(tmp, user_sid) );
+       centry_end(centry, "NSS/PWINFO/%s", sid_to_fstring(tmp, user_sid) );
 
        DEBUG(10,("wcache_save_user_pwinfo: %s\n", sid_string_dbg(user_sid) ));
 
@@ -3848,7 +3853,7 @@ NTSTATUS nss_get_info_cached( struct winbindd_domain *domain,
                goto do_query;
 
        centry = wcache_fetch(cache, domain, "NSS/PWINFO/%s",
-                             sid_to_string(tmp, user_sid));
+                             sid_to_fstring(tmp, user_sid));
        
        if (!centry)
                goto do_query;
index 49562a112c3d9f42d7d872e83425e39637dd023c..140943cc2c97b3dbec40c7180bbc1d43f59a445f 100644 (file)
@@ -1649,7 +1649,7 @@ static void getusersids_recv(void *private_data, bool success, DOM_SID *sids,
        /* work out the response size */
        for (i = 0; i < num_sids; i++) {
                fstring s;
-               sid_to_string(s, &sids[i]);
+               sid_to_fstring(s, &sids[i]);
                ret_size += strlen(s) + 1;
        }
 
@@ -1663,7 +1663,7 @@ static void getusersids_recv(void *private_data, bool success, DOM_SID *sids,
        ofs = 0;
        for (i = 0; i < num_sids; i++) {
                fstring s;
-               sid_to_string(s, &sids[i]);
+               sid_to_fstring(s, &sids[i]);
                safe_strcpy(ret + ofs, s, ret_size - ofs - 1);
                ofs += strlen(ret+ofs) + 1;
        }
index ebea6a749520bffd4d930f30eda8be79b828c584..3c7aa2d0c22d173df0f912a5ba208e1bce3fce4e 100644 (file)
@@ -84,7 +84,7 @@ void winbindd_set_mapping_async(TALLOC_CTX *mem_ctx, const struct id_map *map,
        request.cmd = WINBINDD_DUAL_SET_MAPPING;
        request.data.dual_idmapset.id = map->xid.id;
        request.data.dual_idmapset.type = map->xid.type;
-       sid_to_string(request.data.dual_idmapset.sid, map->sid);
+       sid_to_fstring(request.data.dual_idmapset.sid, map->sid);
 
        do_async(mem_ctx, idmap_child(), &request, winbindd_set_mapping_recv,
                 (void *)cont, private_data);
@@ -301,7 +301,7 @@ void winbindd_sid2uid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
        struct winbindd_request request;
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_DUAL_SID2UID;
-       sid_to_string(request.data.dual_sid2id.sid, sid);
+       sid_to_fstring(request.data.dual_sid2id.sid, sid);
        do_async(mem_ctx, idmap_child(), &request, winbindd_sid2uid_recv,
                 (void *)cont, private_data);
 }
@@ -357,7 +357,7 @@ void winbindd_sid2gid_async(TALLOC_CTX *mem_ctx, const DOM_SID *sid,
        struct winbindd_request request;
        ZERO_STRUCT(request);
        request.cmd = WINBINDD_DUAL_SID2GID;
-       sid_to_string(request.data.dual_sid2id.sid, sid);
+       sid_to_fstring(request.data.dual_sid2id.sid, sid);
 
        DEBUG(7,("winbindd_sid2gid_async: Resolving %s to a gid\n",
                request.data.dual_sid2id.sid));
@@ -444,7 +444,7 @@ enum winbindd_result winbindd_dual_uid2sid(struct winbindd_domain *domain,
        result = idmap_uid_to_sid(&sid, state->request.data.uid);
 
        if (NT_STATUS_IS_OK(result)) {
-               sid_to_string(state->response.data.sid.sid, &sid);
+               sid_to_fstring(state->response.data.sid.sid, &sid);
                state->response.data.sid.type = SID_NAME_USER;
                return WINBINDD_OK;
        }
@@ -501,7 +501,7 @@ enum winbindd_result winbindd_dual_gid2sid(struct winbindd_domain *domain,
        result = idmap_gid_to_sid(&sid, state->request.data.gid);
 
        if (NT_STATUS_IS_OK(result)) {
-               sid_to_string(state->response.data.sid.sid, &sid);
+               sid_to_fstring(state->response.data.sid.sid, &sid);
                DEBUG(10, ("[%5lu]: retrieved sid: %s\n",
                           (unsigned long)state->pid,
                           state->response.data.sid.sid));
index 2771faf152a8de1dbcccdda1f029a794e6e55fce..8c3ef5bb6f522ae8230c5b3c491f7632117e5b2e 100644 (file)
@@ -466,7 +466,7 @@ void winbindd_domain_info(struct winbindd_cli_state *state)
                domain->name);
        fstrcpy(state->response.data.domain_info.alt_name,
                domain->alt_name);
-       sid_to_string(state->response.data.domain_info.sid, &domain->sid);
+       sid_to_fstring(state->response.data.domain_info.sid, &domain->sid);
        
        state->response.data.domain_info.native_mode =
                domain->native_mode;
@@ -498,7 +498,7 @@ static void domain_info_init_recv(void *private_data, bool success)
                domain->name);
        fstrcpy(state->response.data.domain_info.alt_name,
                domain->alt_name);
-       sid_to_string(state->response.data.domain_info.sid, &domain->sid);
+       sid_to_fstring(state->response.data.domain_info.sid, &domain->sid);
        
        state->response.data.domain_info.native_mode =
                domain->native_mode;
index 8a372a3a8ca45439a65f6c4255c4d9bcc31a3a4e..51332392587fd82500c16ae4f9d8c5df23c10b43 100644 (file)
@@ -51,7 +51,7 @@ static NTSTATUS append_info3_as_txt(TALLOC_CTX *mem_ctx,
 
        state->response.data.auth.info3.user_rid = info3->user_rid;
        state->response.data.auth.info3.group_rid = info3->group_rid;
-       sid_to_string(str_sid, &(info3->dom_sid.sid));
+       sid_to_fstring(str_sid, &(info3->dom_sid.sid));
        fstrcpy(state->response.data.auth.info3.dom_sid, str_sid);
 
        state->response.data.auth.info3.num_groups = info3->num_groups;
@@ -187,7 +187,7 @@ static NTSTATUS append_afs_token(TALLOC_CTX *mem_ctx,
 
                sid_copy(&user_sid, &info3->dom_sid.sid);
                sid_append_rid(&user_sid, info3->user_rid);
-               sid_to_string(sidstr, &user_sid);
+               sid_to_fstring(sidstr, &user_sid);
                afsname = talloc_string_sub(mem_ctx, afsname,
                                            "%s", sidstr);
        }
index 302460c942f778fb715d53f24cf887411a022d7e..0e8e6ca00bf9ffa50df770543fc205928a6f9827 100644 (file)
@@ -118,7 +118,7 @@ static void lookupname_recv(void *private_data, bool success,
                return;
        }
 
-       sid_to_string(state->response.data.sid.sid, sid);
+       sid_to_fstring(state->response.data.sid.sid, sid);
        state->response.data.sid.type = type;
        request_ok(state);
        return;
index 5ac1eb64da63dde17395a21f37ef234766ac467c..70468b6bcd2df85644fe53fffe03bbb0130b35b2 100644 (file)
@@ -668,7 +668,7 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai
 
        fstrcpy(state->response.data.domain_info.name, domain->name);
        fstrcpy(state->response.data.domain_info.alt_name, domain->alt_name);
-       sid_to_string(state->response.data.domain_info.sid, &domain->sid);
+       sid_to_fstring(state->response.data.domain_info.sid, &domain->sid);
        
        state->response.data.domain_info.native_mode
                = domain->native_mode;