summaryrefslogtreecommitdiff
path: root/source3/nsswitch/wb_client.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-05-07 04:32:40 +0000
committerTim Potter <tpot@samba.org>2001-05-07 04:32:40 +0000
commita36f9250e7c9446f3eece6d8db29fcbde99256fb (patch)
tree5b981dc1171e92f4a28232c3cc7b6d619054ea75 /source3/nsswitch/wb_client.c
parentc2887d57b5ff6da52aefac4657c23c142977ee2e (diff)
downloadsamba-a36f9250e7c9446f3eece6d8db29fcbde99256fb.tar.gz
samba-a36f9250e7c9446f3eece6d8db29fcbde99256fb.tar.bz2
samba-a36f9250e7c9446f3eece6d8db29fcbde99256fb.zip
Preliminary merge of winbind into HEAD. Note that this compiles and links
but I haven't actually run it yet so it probably doesn't work. (-: (This used to be commit 59f95416b66db6df05289bde224de29c721978e5)
Diffstat (limited to 'source3/nsswitch/wb_client.c')
-rw-r--r--source3/nsswitch/wb_client.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c
index 746e5406bc..366edbbe41 100644
--- a/source3/nsswitch/wb_client.c
+++ b/source3/nsswitch/wb_client.c
@@ -25,6 +25,28 @@
#include "includes.h"
+/* Copy of parse_domain_user from winbindd_util.c. Parse a string of the
+ form DOMAIN/user into a domain and a user */
+
+static void parse_domain_user(char *domuser, fstring domain, fstring user)
+{
+ char *p;
+ char *sep = lp_winbind_separator();
+ if (!sep) sep = "\\";
+ p = strchr(domuser,*sep);
+ if (!p) p = strchr(domuser,'\\');
+ if (!p) {
+ fstrcpy(domain,"");
+ fstrcpy(user, domuser);
+ return;
+ }
+
+ fstrcpy(user, p+1);
+ fstrcpy(domain, domuser);
+ domain[PTR_DIFF(p, domuser)] = 0;
+ strupper(domain);
+}
+
/* Call winbindd to convert a name to a sid */
BOOL winbind_lookup_name(const char *name, DOM_SID *sid, enum SID_NAME_USE *name_type)