summaryrefslogtreecommitdiff
path: root/source3/smbd/service.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-01-23 01:52:30 +0000
committerJeremy Allison <jra@samba.org>2001-01-23 01:52:30 +0000
commit2f7c1db093504a9798cdfd9c5d08a259cb4abc46 (patch)
tree31db36db246f4f9bb42135b7526f64168f4dd6c5 /source3/smbd/service.c
parent3ea544fecba9d6aa662491ea4006b57a6fb6e79f (diff)
downloadsamba-2f7c1db093504a9798cdfd9c5d08a259cb4abc46.tar.gz
samba-2f7c1db093504a9798cdfd9c5d08a259cb4abc46.tar.bz2
samba-2f7c1db093504a9798cdfd9c5d08a259cb4abc46.zip
include/vfs.h:
smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod_acl and chmod_acl. lib/substitute.c: smbd/lanman.c: smbd/open.c: smbd/process.c: smbd/reply.c: smbd/service.c: Removed sessetup_user variable. Added current_user_info struct which conatins domain info etc. Added '%D' for client domain parameter. Jeremy. (This used to be commit 2844ec3d511680609d6794b8718001a1bda9e89f)
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r--source3/smbd/service.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 1db5dc4a5f..a6e66965c3 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -33,7 +33,7 @@ extern BOOL case_mangle;
extern BOOL case_sensitive;
extern BOOL use_mangled_map;
extern fstring remote_machine;
-extern pstring sesssetup_user;
+extern userdom_struct current_user_info;
extern fstring remote_machine;
@@ -113,8 +113,28 @@ int find_service(char *service)
int iHomeService;
if ((iHomeService = lp_servicenumber(HOMES_NAME)) >= 0)
{
- lp_add_home(service,iHomeService,phome_dir);
- iService = lp_servicenumber(service);
+ /*
+ * If this is a winbindd provided username, remove
+ * the domain component before adding the service.
+ * Log a warning if the "path=" parameter does not
+ * include any macros.
+ */
+
+ fstring new_service;
+ char *usr_p = NULL;
+
+ fstrcpy(new_service, service);
+
+ if ((usr_p = strchr(service,*lp_winbind_separator())) != NULL)
+ fstrcpy(new_service, usr_p+1);
+
+ lp_add_home(new_service,iHomeService,phome_dir);
+ iService = lp_servicenumber(new_service);
+
+ if (usr_p && (strchr(lp_pathname(iService),'%') == NULL))
+ DEBUG(0,("find_service: Service %s added for user %s - contains non-local (Domain) user \
+with non parameterised path (%s). This may be cause the wrong directory to be seen.\n",
+ new_service, service, lp_pathname(iService) ));
}
}
}
@@ -234,11 +254,11 @@ connection_struct *make_connection(char *service,char *user,char *password, int
return(make_connection(dos_username,user,password,pwlen,dev,vuid,ecode));
}
} else {
- /* Security = share. Try with sesssetup_user
+ /* Security = share. Try with current_user_info.smb_name
* as the username. */
- if(*sesssetup_user) {
+ if(*current_user_info.smb_name) {
fstring dos_username;
- fstrcpy(user,sesssetup_user);
+ fstrcpy(user,current_user_info.smb_name);
fstrcpy(dos_username, user);
unix_to_dos(dos_username, True);
return(make_connection(dos_username,user,password,pwlen,dev,vuid,ecode));