diff options
author | Jeremy Allison <jra@samba.org> | 1998-06-12 03:08:23 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-06-12 03:08:23 +0000 |
commit | 9a735eb7e25d8bf6c5be7775d89436034ea6be8a (patch) | |
tree | a490a918617f3085cf8fbd032252d1def7addc01 /source3/smbd | |
parent | e6e4a63113b756ac637e2584e31e2f2d0f92b4d0 (diff) | |
download | samba-9a735eb7e25d8bf6c5be7775d89436034ea6be8a.tar.gz samba-9a735eb7e25d8bf6c5be7775d89436034ea6be8a.tar.bz2 samba-9a735eb7e25d8bf6c5be7775d89436034ea6be8a.zip |
ipc.c: map_username is now a BOOL function.
reply.c: map_username is now a BOOL function.
server.c: Added capability to do map_username on service names
when looking for a home directory. That's what the
original code would do.
lib/rpc/server/srv_util.c: Changed domain_ to builtin_ for
BUILTIN aliases.
username.c: Work in progress on groupname map parameter.
Jeremy
(This used to be commit fa95fae5eed95aff64f0a01825477610a101bbc7)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/ipc.c | 4 | ||||
-rw-r--r-- | source3/smbd/reply.c | 6 | ||||
-rw-r--r-- | source3/smbd/server.c | 70 |
3 files changed, 47 insertions, 33 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index f92e376575..9c48951e35 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -1637,7 +1637,7 @@ static BOOL api_SetUserPassword(int cnum,uint16 vuid, char *param,char *data, * function. */ - map_username(user); + (void)map_username(user); /* * Do any UNIX username case mangling. @@ -1725,7 +1725,7 @@ static BOOL api_SamOEMChangePassword(int cnum,uint16 vuid, char *param,char *dat * function. */ - map_username(user); + (void)map_username(user); /* * Do any UNIX username case mangling. diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index c9b0c6852d..a9db0b3840 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -237,7 +237,7 @@ int reply_tcon(char *inbuf,char *outbuf, int dum_size, int dum_buffsize) * function. */ - map_username(user); + (void)map_username(user); /* * Do any UNIX username case mangling. @@ -317,7 +317,7 @@ int reply_tcon_and_X(char *inbuf,char *outbuf,int length,int bufsize) * function. */ - map_username(user); + (void)map_username(user); /* * Do any UNIX username case mangling. @@ -628,7 +628,7 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize) * function. */ - map_username(user); + (void)map_username(user); /* * Do any UNIX username case mangling. diff --git a/source3/smbd/server.c b/source3/smbd/server.c index ba7a0a18f1..25ec11abaa 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -2340,16 +2340,28 @@ int find_service(char *service) if (iService < 0) { char *phome_dir = get_home_dir(service); + + if(!phome_dir) + { + /* + * Try mapping the servicename, it may + * be a Windows to unix mapped user name. + */ + if(map_username(service)) + phome_dir = get_home_dir(service); + } + DEBUG(3,("checking for home directory %s gave %s\n",service, - phome_dir?phome_dir:"(NULL)")); + phome_dir?phome_dir:"(NULL)")); + if (phome_dir) { - int iHomeService; - if ((iHomeService = lp_servicenumber(HOMES_NAME)) >= 0) - { - lp_add_home(service,iHomeService,phome_dir); - iService = lp_servicenumber(service); - } + int iHomeService; + if ((iHomeService = lp_servicenumber(HOMES_NAME)) >= 0) + { + lp_add_home(service,iHomeService,phome_dir); + iService = lp_servicenumber(service); + } } } @@ -2380,34 +2392,36 @@ int find_service(char *service) /* just possibly it's a default service? */ if (iService < 0) + { + char *pdefservice = lp_defaultservice(); + if (pdefservice && *pdefservice && !strequal(pdefservice,service)) { - char *pdefservice = lp_defaultservice(); - if (pdefservice && *pdefservice && !strequal(pdefservice,service)) { - /* - * We need to do a local copy here as lp_defaultservice() - * returns one of the rotating lp_string buffers that - * could get overwritten by the recursive find_service() call - * below. Fix from Josef Hinteregger <joehtg@joehtg.co.at>. - */ - pstring defservice; - pstrcpy(defservice, pdefservice); - iService = find_service(defservice); - if (iService >= 0) { - string_sub(service,"_","/"); - iService = lp_add_service(service,iService); - } + /* + * We need to do a local copy here as lp_defaultservice() + * returns one of the rotating lp_string buffers that + * could get overwritten by the recursive find_service() call + * below. Fix from Josef Hinteregger <joehtg@joehtg.co.at>. + */ + pstring defservice; + pstrcpy(defservice, pdefservice); + iService = find_service(defservice); + if (iService >= 0) + { + string_sub(service,"_","/"); + iService = lp_add_service(service,iService); } } + } if (iService >= 0) - if (!VALID_SNUM(iService)) - { - DEBUG(0,("Invalid snum %d for %s\n",iService,service)); - iService = -1; - } + if (!VALID_SNUM(iService)) + { + DEBUG(0,("Invalid snum %d for %s\n",iService,service)); + iService = -1; + } if (iService < 0) - DEBUG(3,("find_service() failed to find service %s\n", service)); + DEBUG(3,("find_service() failed to find service %s\n", service)); return (iService); } |