idmap: Use dom_sid_str_buf
authorVolker Lendecke <vl@samba.org>
Fri, 2 Nov 2018 19:54:37 +0000 (20:54 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 9 Nov 2018 21:42:29 +0000 (22:42 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/idmap_cache.c

index 4c65841fd9c578a385f3ed4c9c3e1792960df0d6..1d87bbdec45a07bc6e2efe288d52f68fd44955e7 100644 (file)
@@ -36,7 +36,7 @@
 bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id,
                                 bool *expired)
 {
-       fstring sidstr;
+       struct dom_sid_buf sidstr;
        char *key;
        char *value = NULL;
        char *endptr;
@@ -45,7 +45,7 @@ bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id,
        struct unixid tmp_id;
 
        key = talloc_asprintf(talloc_tos(), "IDMAP/SID2XID/%s",
-                             sid_to_fstring(sidstr, sid));
+                             dom_sid_str_buf(sid, &sidstr));
        if (key == NULL) {
                return false;
        }
@@ -289,11 +289,12 @@ void idmap_cache_set_sid2unixid(const struct dom_sid *sid, struct unixid *unix_i
 {
        time_t now = time(NULL);
        time_t timeout;
-       fstring sidstr, key, value;
+       fstring key, value;
 
        if (!is_null_sid(sid)) {
+               struct dom_sid_buf sidstr;
                fstr_sprintf(key, "IDMAP/SID2XID/%s",
-                            sid_to_fstring(sidstr, sid));
+                            dom_sid_str_buf(sid, &sidstr));
                switch (unix_id->type) {
                case ID_TYPE_UID:
                        fstr_sprintf(value, "%d:U", (int)unix_id->id);