summaryrefslogtreecommitdiff
path: root/source3/smbd/password.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-05-06 14:00:27 +1000
committerAndrew Tridgell <tridge@samba.org>2011-05-06 14:49:47 +1000
commit2fc8ad88871bf8287e22cc13cea5d4dc4ddbeb61 (patch)
treec3a4561a114200ac22d13199c5d5f02a3ed88f9f /source3/smbd/password.c
parent153a091d9c2593938c0686c0a2a86c91dde6f9d7 (diff)
downloadsamba-2fc8ad88871bf8287e22cc13cea5d4dc4ddbeb61.tar.gz
samba-2fc8ad88871bf8287e22cc13cea5d4dc4ddbeb61.tar.bz2
samba-2fc8ad88871bf8287e22cc13cea5d4dc4ddbeb61.zip
s3-auth: fixed bug with usernames longer than sizeof(char *)
using sizeof(user) when user is "fstring user" as a C parameter actually returns sizeof(char *), which means that long usernames aren't allowed. Jeremy, you need a longer username :-) Cheers, Tridge Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/smbd/password.c')
-rw-r--r--source3/smbd/password.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 34384342af..69b37596c5 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -644,7 +644,7 @@ bool authorise_login(struct smbd_server_connection *sconn,
get_session_workgroup(sconn),
user2,password)) {
ok = True;
- strlcpy(user,user2,sizeof(user));
+ strlcpy(user,user2,sizeof(fstring));
DEBUG(3,("authorise_login: ACCEPTED: session "
"list username (%s) and given "
"password ok\n", user));
@@ -695,7 +695,7 @@ bool authorise_login(struct smbd_server_connection *sconn,
get_session_workgroup(sconn),
user2,password)) {
ok = True;
- strlcpy(user,user2,sizeof(user));
+ strlcpy(user,user2,sizeof(fstring));
DEBUG(3,("authorise_login: ACCEPTED: "
"user list username and "
"given password ok (%s)\n",
@@ -714,7 +714,7 @@ bool authorise_login(struct smbd_server_connection *sconn,
fstrcpy(guestname,lp_guestaccount());
guest_pw = Get_Pwnam_alloc(talloc_tos(), guestname);
if (guest_pw != NULL) {
- strlcpy(user,guestname,sizeof(user));
+ strlcpy(user,guestname,sizeof(fstring));
ok = True;
DEBUG(3,("authorise_login: ACCEPTED: guest account "
"and guest ok (%s)\n", user));