summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-11-10 20:51:25 +0000
committerJeremy Allison <jra@samba.org>1998-11-10 20:51:25 +0000
commit375e53826c59c33d52009307f757b71a1fe3d589 (patch)
treece9a53fa7e12ef495eb9d3f455e46416a8f22b27 /source3/smbd/reply.c
parent84934fbfac7644191e09124dd4961c6c08de3b9f (diff)
downloadsamba-375e53826c59c33d52009307f757b71a1fe3d589.tar.gz
samba-375e53826c59c33d52009307f757b71a1fe3d589.tar.bz2
samba-375e53826c59c33d52009307f757b71a1fe3d589.zip
include/local.h:
include/smb.h: param/loadparm.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-). printing/printing.c: Added J.F.'s latest fix. rpc_parse/parse_misc.c: parse_reg.c: rpcclient/cmd_reg.c: rpcclient/display.c: SGI compiler signed/unsigned issues. smbd/reply.c: Made GUEST_SESSSETUP run time selectable. Horror of horrors :-). utils/testparm.c: Added extra test. Jeremy. (This used to be commit 9668a5ef50be2e6b575f9989e87ee2ff8da5ac1d)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 67c2abb9b5..d3131b5fea 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -701,14 +701,21 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
{
if (lp_security() >= SEC_USER)
{
-#if (GUEST_SESSSETUP == 0)
- return(ERROR(ERRSRV,ERRbadpw));
-#endif
-#if (GUEST_SESSSETUP == 1)
- if (Get_Pwnam(user,True))
+ if (lp_map_to_guest() == NEVER_MAP_TO_GUEST)
return(ERROR(ERRSRV,ERRbadpw));
-#endif
+
+ if (lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_USER)
+ {
+ if (Get_Pwnam(user,True))
+ return(ERROR(ERRSRV,ERRbadpw));
+ }
+
+ /*
+ * ..else if lp_map_to_guest() == MAP_TO_GUEST_ON_BAD_PASSWORD
+ * Then always map to guest account - as done below.
+ */
}
+
if (*smb_apasswd || !Get_Pwnam(user,True))
pstrcpy(user,lp_guestaccount(-1));
DEBUG(3,("Registered username %s for guest access\n",user));