summaryrefslogtreecommitdiff
path: root/source3/nsswitch/idmap_nss.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-01-14 17:58:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:08 -0500
commitc50c8d0dc31b95a98e09b1cfdd2e54e4bac336f2 (patch)
tree566e23e3e4956d2c01d48b779007fbbb4c7be21e /source3/nsswitch/idmap_nss.c
parentfb9a229643015fc6fea67bac9317f5d6a6283fc4 (diff)
downloadsamba-c50c8d0dc31b95a98e09b1cfdd2e54e4bac336f2.tar.gz
samba-c50c8d0dc31b95a98e09b1cfdd2e54e4bac336f2.tar.bz2
samba-c50c8d0dc31b95a98e09b1cfdd2e54e4bac336f2.zip
r20774: I thought I committed this before Xmas holidays ...
This change is needed to make it possible to not expire caches in disconnected mode. Jerry, please can you look at this and confirm it is ok? Simo. (This used to be commit 9e8715e4e15d9cede8f4aa9652642995392617e6)
Diffstat (limited to 'source3/nsswitch/idmap_nss.c')
-rw-r--r--source3/nsswitch/idmap_nss.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/source3/nsswitch/idmap_nss.c b/source3/nsswitch/idmap_nss.c
index 014a193c6a..3cd8a8e8ea 100644
--- a/source3/nsswitch/idmap_nss.c
+++ b/source3/nsswitch/idmap_nss.c
@@ -62,7 +62,7 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
pw = getpwuid((uid_t)ids[i]->xid.id);
if (!pw) {
- ids[i]->mapped = False;
+ ids[i]->status = ID_UNMAPPED;
continue;
}
name = pw->pw_name;
@@ -71,13 +71,13 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
gr = getgrgid((gid_t)ids[i]->xid.id);
if (!gr) {
- ids[i]->mapped = False;
+ ids[i]->status = ID_UNMAPPED;
continue;
}
name = gr->gr_name;
break;
default: /* ?? */
- ids[i]->mapped = False;
+ ids[i]->status = ID_UNKNOWN;
continue;
}
@@ -89,17 +89,16 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
winbind_off();
if (!ret) {
- ids[i]->mapped = False;
+ /* TODO: how do we know if the name is really not mapped,
+ * or something just failed ? */
+ ids[i]->status = ID_UNMAPPED;
continue;
}
- /* make sure it is marked as unmapped if types do not match */
- ids[i]->mapped = False;
-
switch (type) {
case SID_NAME_USER:
if (ids[i]->xid.type == ID_TYPE_UID) {
- ids[i]->mapped = True;
+ ids[i]->status = ID_MAPPED;
}
break;
@@ -107,11 +106,12 @@ static NTSTATUS idmap_nss_unixids_to_sids(struct idmap_domain *dom, struct id_ma
case SID_NAME_ALIAS:
case SID_NAME_WKN_GRP:
if (ids[i]->xid.type == ID_TYPE_GID) {
- ids[i]->mapped = True;
+ ids[i]->status = ID_MAPPED;
}
break;
default:
+ ids[i]->status = ID_UNKNOWN;
break;
}
}
@@ -151,13 +151,12 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
winbind_off();
if (!ret) {
- ids[i]->mapped = False;
+ /* TODO: how do we know if the name is really not mapped,
+ * or something just failed ? */
+ ids[i]->status = ID_UNMAPPED;
continue;
}
- /* make sure it is marked as unmapped if types do not match */
- ids[i]->mapped = False;
-
switch (type) {
case SID_NAME_USER:
@@ -167,7 +166,7 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
if (pw) {
ids[i]->xid.id = pw->pw_uid;
ids[i]->xid.type = ID_TYPE_UID;
- ids[i]->mapped = True;
+ ids[i]->status = ID_MAPPED;
}
break;
@@ -179,12 +178,12 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
if (gr) {
ids[i]->xid.id = gr->gr_gid;
ids[i]->xid.type = ID_TYPE_GID;
- ids[i]->mapped = True;
+ ids[i]->status = ID_MAPPED;
}
break;
default:
- ids[i]->mapped = False;
+ ids[i]->status = ID_UNKNOWN;
break;
}
}