From 55bd0867d8610f75e2696b1539ca1b1ca3aa062d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 5 Jul 2001 04:34:50 +0000 Subject: use alpha_strcpy on the domain as it comes off the wire (This used to be commit 3b9eb528f56b325399e5a4588242bb6d9f9226e2) --- source3/smbd/reply.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index a331073093..b7291f5577 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -836,15 +836,10 @@ int reply_sesssetup_and_X(connection_struct *conn, char *inbuf,char *outbuf,int domain,native_os,native_lanman)); } - /* don't allow for weird usernames */ + /* don't allow for weird usernames or domains */ alpha_strcpy(user, user, ". _-", sizeof(user)); - if (strstr(user, "..")) { - return bad_password_error(inbuf, outbuf); - } - - /* don't allow for weird usernames */ - alpha_strcpy(user, user, ". _-", sizeof(user)); - if (strstr(user, "..")) { + alpha_strcpy(domain, domain, ". _-", sizeof(domain)); + if (strstr(user, "..") || strstr(domain,"..")) { return bad_password_error(inbuf, outbuf); } -- cgit