From e71106998a0bef1b3d4fb112432c85dfcb8d590e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Jacke?= Date: Fri, 17 Apr 2015 14:44:17 +0200 Subject: [PATCH 2/2] smbd/mangle/hash2: tailing period and space are allowed these days BUG: https://bugzilla.samba.org/show_bug.cgi?id=11207 Signed-off-by: Bjoern Jacke --- source3/smbd/mangle_hash2.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c index ac1f4b0..953e2ca 100644 --- a/source3/smbd/mangle_hash2.c +++ b/source3/smbd/mangle_hash2.c @@ -619,10 +619,6 @@ static bool is_reserved_name(const char *name) static bool is_legal_name(const char *name) { - const char *dot_pos = NULL; - bool alldots = True; - size_t numdots = 0; - while (*name) { if (((unsigned int)name[0]) > 128 && (name[1] != 0)) { /* Possible start of mb character. */ @@ -643,27 +639,9 @@ static bool is_legal_name(const char *name) if (FLAG_CHECK(name[0], FLAG_ILLEGAL)) { return False; } - if (name[0] == '.') { - dot_pos = name; - numdots++; - } else { - alldots = False; - } - if ((name[0] == ' ') && (name[1] == '\0')) { - /* Can't end in ' ' */ - return False; - } name++; } - if (dot_pos) { - if (alldots && (numdots == 1 || numdots == 2)) - return True; /* . or .. is a valid name */ - - /* A valid long name cannot end in '.' */ - if (dot_pos[1] == '\0') - return False; - } return True; } -- 2.3.0