summaryrefslogtreecommitdiffstats
path: root/source3/nsswitch/wb_client.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-07-11 01:04:09 +0000
committerJeremy Allison <jra@samba.org>2000-07-11 01:04:09 +0000
commit9f126139046700b235e4fe13b5b7c853e862f546 (patch)
treefe77340a4e088306b246cdde9899f75ba215052d /source3/nsswitch/wb_client.c
parent445e92eb01949335feed9fa5716209976d8021f1 (diff)
downloadsamba-9f126139046700b235e4fe13b5b7c853e862f546.tar.gz
samba-9f126139046700b235e4fe13b5b7c853e862f546.tar.xz
samba-9f126139046700b235e4fe13b5b7c853e862f546.zip
Add local fallback for name lookup if no winbindd running...
Jeremy. (This used to be commit d85deb9e4e9c9784006292d3cb5a6b7b408ff972)
Diffstat (limited to 'source3/nsswitch/wb_client.c')
-rw-r--r--source3/nsswitch/wb_client.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c
index 0fe8b977f28..78de466636d 100644
--- a/source3/nsswitch/wb_client.c
+++ b/source3/nsswitch/wb_client.c
@@ -29,25 +29,35 @@
BOOL winbind_lookup_name(char *name, DOM_SID *sid, uint8 *name_type)
{
+ extern pstring global_myname;
struct winbindd_request request;
- struct winbindd_response response;
+ struct winbindd_response response;
enum nss_status result;
- if (!sid || !name_type) return False;
+ if (!sid || !name_type)
+ return False;
- /* Send off request */
+ /* Send off request */
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
+ ZERO_STRUCT(request);
+ ZERO_STRUCT(response);
- fstrcpy(request.data.name, name);
- if ((result = winbindd_request(WINBINDD_LOOKUPNAME, &request,
+ fstrcpy(request.data.name, name);
+ if ((result = winbindd_request(WINBINDD_LOOKUPNAME, &request,
&response)) == NSS_STATUS_SUCCESS) {
string_to_sid(sid, response.data.sid.sid);
*name_type = response.data.sid.type;
+ } else {
+
+ /*
+ * Try a local lookup - winbindd may not
+ * be running.
+ */
+
+ return lookup_local_name(global_myname, name, sid, name_type);
}
- return result == NSS_STATUS_SUCCESS;
+ return result == NSS_STATUS_SUCCESS;
}
/* Call winbindd to convert sid to name */
@@ -62,7 +72,8 @@ BOOL winbind_lookup_sid(DOM_SID *sid, fstring dom_name, fstring name,
uint32 rid;
fstring sid_str;
- if (!name_type) return False;
+ if (!name_type)
+ return False;
/* Check if this is our own sid. This should perhaps be done by
winbind? For the moment handle it here. */