From 2fc8ad88871bf8287e22cc13cea5d4dc4ddbeb61 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 6 May 2011 14:00:27 +1000 Subject: 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 --- source3/smbd/password.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/smbd/password.c') 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)); -- cgit