diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-05-12 06:30:45 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-05-12 06:30:45 +0000 |
commit | 6cbb826b154e61085fd651116caf472d4d438c1d (patch) | |
tree | 238c67987f1364d130d81ac59dc1fb5b319c2f00 | |
parent | 5e2a0b3cb9be19596e9885371b3dc96fc8fda1b2 (diff) | |
download | samba-6cbb826b154e61085fd651116caf472d4d438c1d.tar.gz samba-6cbb826b154e61085fd651116caf472d4d438c1d.tar.xz samba-6cbb826b154e61085fd651116caf472d4d438c1d.zip |
use "winbind separator" option for domain/user separator character
-rw-r--r-- | source/include/proto.h | 2 | ||||
-rw-r--r-- | source/lib/username.c | 14 | ||||
-rw-r--r-- | source/param/loadparm.c | 7 | ||||
-rw-r--r-- | source/smbd/password.c | 2 | ||||
-rw-r--r-- | source/smbd/reply.c | 2 |
5 files changed, 9 insertions, 18 deletions
diff --git a/source/include/proto.h b/source/include/proto.h index de27782fdee..7a64a046d74 100644 --- a/source/include/proto.h +++ b/source/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/source/lib/username.c b/source/lib/username.c index 2620d74eba3..d253f9ba64f 100644 --- a/source/lib/username.c +++ b/source/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/source/param/loadparm.c b/source/param/loadparm.c index 97901cae8e8..9acfd5c170b 100644 --- a/source/param/loadparm.c +++ b/source/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/source/smbd/password.c b/source/smbd/password.c index f9aa10ecedf..95f03ab2041 100644 --- a/source/smbd/password.c +++ b/source/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/source/smbd/reply.c b/source/smbd/reply.c index 5c80a615113..b08606452f3 100644 --- a/source/smbd/reply.c +++ b/source/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); |