s3:idmap_cache: also store negative entries for unknown sids
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Jun 2012 12:07:51 +0000 (14:07 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 21 Jun 2012 16:04:05 +0000 (18:04 +0200)
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun 21 18:04:05 CEST 2012 on sn-devel-104

source3/lib/idmap_cache.c

index 011a017c483959addd2688f2da6064174ec42c81..edf37a84962c5d4476e561a1ac73035e41329388 100644 (file)
@@ -89,6 +89,10 @@ bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id,
                        tmp_id.type = ID_TYPE_BOTH;
                        break;
 
+               case 'N':
+                       tmp_id.type = ID_TYPE_NOT_SPECIFIED;
+                       break;
+
                case '\0':
                        DEBUG(0, ("FAILED to parse value for key [%s] "
                                  "(id=[%llu], endptr=[%s]): "
@@ -289,6 +293,9 @@ void idmap_cache_set_sid2unixid(const struct dom_sid *sid, struct unixid *unix_i
                case ID_TYPE_BOTH:
                        fstr_sprintf(value, "%d:B", (int)unix_id->id);
                        break;
+               case ID_TYPE_NOT_SPECIFIED:
+                       fstr_sprintf(value, "%d:N", (int)unix_id->id);
+                       break;
                default:
                        return;
                }