1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

check for bad usernames early in session setup

(This used to be commit 657836599a)
This commit is contained in:
Andrew Tridgell 2001-07-04 04:17:58 +00:00
parent d972dc06a1
commit 59db9bcbf0

View File

@ -858,6 +858,12 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int
domain,native_os,native_lanman));
}
/* don't allow for weird usernames */
alpha_strcpy(user, user, ". _-", sizeof(user));
if (strstr(user, "..")) {
return bad_password_error(inbuf, outbuf);
}
DEBUG(3,("sesssetupX:name=[%s]\n",user));
/* If name ends in $ then I think it's asking about whether a */