diff options
author | Andrew Bartlett <abartlet@samba.org> | 2002-06-16 09:38:11 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2002-06-16 09:38:11 +0000 |
commit | 70c16188c7a267f9f3f8de0b6830f66c9e68a2c7 (patch) | |
tree | b3a2ace7e514c613f623273cdd2766b078f6cb57 | |
parent | a8805a34e5d96eeb5ffe15681b241d5a449a6144 (diff) | |
download | samba-70c16188c7a267f9f3f8de0b6830f66c9e68a2c7.tar.gz samba-70c16188c7a267f9f3f8de0b6830f66c9e68a2c7.tar.xz samba-70c16188c7a267f9f3f8de0b6830f66c9e68a2c7.zip |
Further updates to the service.c code. authorise_login() is now a bit simpiler
and we seem to have eliminated the segfault.
Unfortunetly I'm still at a bit of a loss as to why it did segfault, but
the patch is correct in any case.
Andrew Bartlett
-rw-r--r-- | source/smbd/password.c | 4 | ||||
-rw-r--r-- | source/smbd/service.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/smbd/password.c b/source/smbd/password.c index 6eaa7b7fbbc..f9bcad4154c 100644 --- a/source/smbd/password.c +++ b/source/smbd/password.c @@ -474,7 +474,7 @@ static char *validate_group(char *group, DATA_BLOB password,int snum) ****************************************************************************/ BOOL authorise_login(int snum,char *user, DATA_BLOB password, - BOOL *guest, BOOL *force) + BOOL *guest) { BOOL ok = False; @@ -485,8 +485,6 @@ BOOL authorise_login(int snum,char *user, DATA_BLOB password, *guest = False; - if (GUEST_ONLY(snum)) - *force = True; /* there are several possibilities: 1) login as the given user with given password 2) login as a previously registered username with the given password diff --git a/source/smbd/service.c b/source/smbd/service.c index 1bb55fbcf83..caf1cef17a5 100644 --- a/source/smbd/service.c +++ b/source/smbd/service.c @@ -360,6 +360,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, fstrcpy(user,pass->pw_name); conn->force_user = True; string_set(&conn->user,pass->pw_name); + passwd_free(&pass); DEBUG(3,("Guest only user %s\n",user)); } else if (vuser) { if (vuser->guest) { @@ -388,9 +389,10 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, are in share mode security */ add_session_user(lp_servicename(snum)); /* shall we let them in? */ - if (!authorise_login(snum,user,password,&guest,&force)) { - DEBUG( 2, ( "Invalid username/password for %s [%s]\n", - lp_servicename(snum), user ) ); + if (!authorise_login(snum,user,password,&guest)) { + DEBUG( 2, ( "Invalid username/password for [%s]\n", + lp_servicename(snum)) ); + conn_free(conn); *status = NT_STATUS_WRONG_PASSWORD; return NULL; } |