summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/username.c14
-rw-r--r--source3/param/loadparm.c7
-rw-r--r--source3/smbd/password.c2
-rw-r--r--source3/smbd/reply.c2
5 files changed, 9 insertions, 18 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index de27782fde..7a64a046d7 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -291,7 +291,6 @@ BOOL map_username(char *user);
struct passwd *Get_Pwnam(char *user,BOOL allow_change);
BOOL user_in_list(char *user,char *list);
struct passwd *smb_getpwnam(char *user, BOOL allow_change);
-int smb_initgroups(char *user, char *domain, gid_t group);
/*The following definitions come from lib/util.c */
@@ -1287,6 +1286,7 @@ char *lp_winbind_uid(void);
char *lp_winbind_gid(void);
char *lp_template_homedir(void);
char *lp_template_shell(void);
+char *lp_winbind_separator(void);
char *lp_ldap_server(void);
char *lp_ldap_suffix(void);
char *lp_ldap_filter(void);
diff --git a/source3/lib/username.c b/source3/lib/username.c
index 2620d74eba..d253f9ba64 100644
--- a/source3/lib/username.c
+++ b/source3/lib/username.c
@@ -443,17 +443,3 @@ struct passwd *smb_getpwnam(char *user, BOOL allow_change)
return NULL;
}
-int smb_initgroups(char *user, char *domain, gid_t group)
-{
- fstring userdom;
- int ret;
-
- ret = initgroups(user, group);
- if (ret==0 || !domain || !*domain) return ret;
-
- slprintf(userdom, sizeof(userdom), "%s/%s", domain, user);
-
- DEBUG(4,("smb_initgroups trying userdom %s\n", userdom));
-
- return initgroups(userdom, group);
-}
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 97901cae8e..9acfd5c170 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -169,6 +169,7 @@ typedef struct
char *szWinbindGID;
char *szTemplateHomedir;
char *szTemplateShell;
+ char *szWinbindSeparator;
int max_log_size;
int mangled_stack;
int max_xmit;
@@ -903,6 +904,7 @@ static struct parm_struct parm_table[] =
{"winbind gid", P_STRING, P_GLOBAL, &Globals.szWinbindGID, handle_winbind_id, NULL, 0},
{"template homedir", P_STRING, P_GLOBAL, &Globals.szTemplateHomedir, NULL, NULL, 0},
{"template shell", P_STRING, P_GLOBAL, &Globals.szTemplateShell, NULL, NULL, 0},
+ {"winbind separator", P_STRING, P_GLOBAL, &Globals.szWinbindSeparator, NULL, NULL, 0},
{"winbind cache time", P_INTEGER, P_GLOBAL, &Globals.winbind_cache_time, NULL, NULL, 0},
{NULL, P_BOOL, P_NONE, NULL, NULL, NULL, 0}
@@ -1090,6 +1092,7 @@ static void init_globals(void)
string_set(&Globals.szTemplateShell, "/bin/false");
string_set(&Globals.szTemplateHomedir, "/home/%D/%U");
+ string_set(&Globals.szWinbindSeparator, "\\");
Globals.winbind_cache_time = 15;
/*
@@ -1280,11 +1283,13 @@ FN_GLOBAL_STRING(lp_domain_guest_users,&Globals.szDomainGuestUsers)
FN_GLOBAL_STRING(lp_nt_forms,&Globals.szNtForms)
FN_GLOBAL_STRING(lp_nt_drivers_file,&Globals.szNtDriverFile)
-#ifdef WITH_LDAP
FN_GLOBAL_STRING(lp_winbind_uid,&Globals.szWinbindUID)
FN_GLOBAL_STRING(lp_winbind_gid,&Globals.szWinbindGID)
FN_GLOBAL_STRING(lp_template_homedir,&Globals.szTemplateHomedir)
FN_GLOBAL_STRING(lp_template_shell,&Globals.szTemplateShell)
+FN_GLOBAL_STRING(lp_winbind_separator,&Globals.szWinbindSeparator)
+
+#ifdef WITH_LDAP
FN_GLOBAL_STRING(lp_ldap_server,&Globals.szLdapServer);
FN_GLOBAL_STRING(lp_ldap_suffix,&Globals.szLdapSuffix);
FN_GLOBAL_STRING(lp_ldap_filter,&Globals.szLdapFilter);
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index f9aa10eced..95f03ab204 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -167,7 +167,7 @@ int setup_groups(char *user, char *domain,
gid_t grp = 0;
gid_t *groups = NULL;
- if (-1 == smb_initgroups(user,domain,gid))
+ if (-1 == initgroups(user,gid))
{
DEBUG(0,("Unable to initgroups. Error was %s\n", strerror(errno) ));
if (getuid() == 0)
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5c80a61511..b08606452f 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -857,7 +857,7 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
that */
if (!getpwnam(user)) {
pstring user2;
- slprintf(user2,sizeof(user2),"%s/%s", domain, user);
+ slprintf(user2,sizeof(user2),"%s%s%s", domain, lp_winbind_separator(), user);
if (getpwnam(user2)) {
DEBUG(3,("Using unix username %s\n", user2));
pstrcpy(user, user2);