[SCM] Samba Shared Repository - branch v3-4-test updated -
release-4-0-0alpha7-986-g99771d2
Jeremy Allison
jra at samba.org
Thu May 14 23:51:48 GMT 2009
The branch, v3-4-test has been updated
via 99771d2e23b476d1a7becd9f394421363dd0dffe (commit)
via 82d9d7b2136a236d3f2b7b1255a920a1ef394ffe (commit)
from f81698c70e2513c4699048263c0d6d57a5a9bc64 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test
- Log -----------------------------------------------------------------
commit 99771d2e23b476d1a7becd9f394421363dd0dffe
Author: Jeremy Allison <jra at samba.org>
Date: Thu May 14 16:50:50 2009 -0700
Turn on SHORTNAME-TEST in torture.
Jeremy.
commit 82d9d7b2136a236d3f2b7b1255a920a1ef394ffe
Author: Jeremy Allison <jra at samba.org>
Date: Thu May 14 16:49:18 2009 -0700
Make us pass SHORTNAME-TEST.
Jeremy
-----------------------------------------------------------------------
Summary of changes:
source3/script/tests/test_smbtorture_s3.sh | 1 +
source3/smbd/mangle_hash2.c | 20 +++++++++++++++++---
2 files changed, 18 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/script/tests/test_smbtorture_s3.sh b/source3/script/tests/test_smbtorture_s3.sh
index 70c6d34..fee9260 100755
--- a/source3/script/tests/test_smbtorture_s3.sh
+++ b/source3/script/tests/test_smbtorture_s3.sh
@@ -28,6 +28,7 @@ tests="$tests OPLOCK1 OPLOCK2 OPLOCK3"
tests="$tests DIR DIR1 TCON TCONDEV RW1 RW2 RW3"
tests="$tests OPEN XCOPY RENAME DELETE PROPERTIES W2K"
tests="$tests TCON2 IOCTL CHKPATH FDSESS LOCAL-SUBSTITUTE CHAIN1"
+tests="$tests POSIX UID-REGRESSION-TEST SHORTNAME-TEST"
skipped1="RANDOMIPC NEGNOWAIT NBENCH ERRMAPEXTRACT TRANS2SCAN NTTRANSSCAN"
skipped2="DENY1 DENY2 OPENATTR CASETABLE EATEST"
diff --git a/source3/smbd/mangle_hash2.c b/source3/smbd/mangle_hash2.c
index 3a3939c..b9e7d63 100644
--- a/source3/smbd/mangle_hash2.c
+++ b/source3/smbd/mangle_hash2.c
@@ -250,12 +250,17 @@ static bool is_mangled(const char *name, const struct share_params *parm)
/*
- see if a filename is an allowable 8.3 name.
+ see if a filename is an allowable 8.3 name to return to the client.
+ Note this is not testing if this is a valid Samba mangled name, so
+ the rules are different for is_mangled.
we are only going to allow ascii characters in 8.3 names, as this
simplifies things greatly (it means that we know the string won't
get larger when converted from UNIX to DOS formats)
*/
+
+static char force_shortname_chars[] = " +,[];=";
+
static bool is_8_3(const char *name, bool check_case, bool allow_wildcards, const struct share_params *p)
{
int len, i;
@@ -307,9 +312,18 @@ static bool is_8_3(const char *name, bool check_case, bool allow_wildcards, cons
/* the length are all OK. Now check to see if the characters themselves are OK */
for (i=0; name[i]; i++) {
+ if (FLAG_CHECK(name[i], FLAG_ILLEGAL)) {
+ return false;
+ }
/* note that we may allow wildcard petterns! */
- if (!FLAG_CHECK(name[i], FLAG_ASCII|(allow_wildcards ? FLAG_WILDCARD : 0)) && name[i] != '.') {
- return False;
+ if (!allow_wildcards && FLAG_CHECK(name[i], FLAG_WILDCARD)) {
+ return false;
+ }
+ if (((unsigned char)name[i]) > 0x7e) {
+ return false;
+ }
+ if (strchr(force_shortname_chars, name[i])) {
+ return false;
}
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list