[SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3-2-119-g6c9713b

Karolin Seeger kseeger at samba.org
Wed Apr 1 06:51:17 GMT 2009


The branch, v3-3-stable has been updated
       via  6c9713b603b295680d80a39c0d21c69ce2e95eed (commit)
       via  9e3e89cd09b0efa7e95b3efca2366c6eacfc6d3d (commit)
       via  7a5fc51abf03fa85ba209be850c5bf71d149d28f (commit)
       via  768d94963495bc83850e1603598c752bb9da568f (commit)
       via  9dfdad26a67d8bee893e23b1c9dbdc4ffc690e73 (commit)
       via  74e70606367886ed6dbcda82e9a9a736c72bf158 (commit)
       via  d5ef2e4cbfac6962b647a220047eb27f1786a1b4 (commit)
       via  595e8876aecfab12b40fec5c9d8737af1b8a1bab (commit)
      from  7bca88a1ae2145a9983fcb81e4e926341c5ebd5d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-stable


- Log -----------------------------------------------------------------
commit 6c9713b603b295680d80a39c0d21c69ce2e95eed
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Apr 1 08:50:03 2009 +0200

    VERSION: Raise version number up to 3.3.3.
    
    Karolin
    (cherry picked from commit 9d647667a5e4814a6e80b9d3b6507f9ccccfe9ee)

commit 9e3e89cd09b0efa7e95b3efca2366c6eacfc6d3d
Author: Karolin Seeger <kseeger at samba.org>
Date:   Wed Apr 1 08:47:34 2009 +0200

    WHATSNEW: Update changes since 3.3.2.
    
    Karolin
    (cherry picked from commit 9356163d00a18c2d34e6df259e189b95fd5ad162)

commit 7a5fc51abf03fa85ba209be850c5bf71d149d28f
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 31 18:29:30 2009 -0700

    Tidy up some convert_string_internal error cases, found by Andrew Bartlett.
    Jeremy.
    (cherry picked from commit e0f3ed481137d83087c4c6da6526eae3b9265838)

commit 768d94963495bc83850e1603598c752bb9da568f
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 31 16:44:19 2009 +0200

    s3:build: fix build of pam_winbind.so with static linking
    
    Static talloc libs were missing since conversion to talloc.
    
    Michael
    (cherry picked from commit 51b10a39a764e91303ee40fde1b0c4b3a6f4574c)

commit 9dfdad26a67d8bee893e23b1c9dbdc4ffc690e73
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 30 15:09:10 2009 -0700

    Ensure files starting with multiple dots are hidden
    if "hide dot files" is set. Thanks to Barry Kelly <bkelly.ie at gmail.com>
    for pointing this one out.
    Jeremy.
    (cherry picked from commit beeb86618e3af1478708d996b118856a4f9a0c0b)

commit 74e70606367886ed6dbcda82e9a9a736c72bf158
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 27 21:28:01 2009 -0700

    Fix the problem of 3.0.x passdb databases being version
    3 but using a different hash calculation than 3.2.x passwd
    databases (also version 3). Introduces a minor version
    number.
    Jeremy.
    (cherry picked from commit d30f1fc69dd1e56d46f90f7e60f13c1d383f6376)

commit d5ef2e4cbfac6962b647a220047eb27f1786a1b4
Author: Derrell Lipman <derrell at dworkin.(none)>
Date:   Fri Mar 27 16:56:33 2009 -0400

    [Bug 6228] SMBC_open_ctx failure due to path resolve failure doesn't set errno
    
    Fixed.
    
    It turns out there were a number of places where cli_resolve_path() was called
    and the error path upon that function failing did not set errno. There were a
    couple of places the failure handling code did set errno to ENOENT, so I made
    them all consistent, although I think better errno choices for this condition
    exist, e.g.  EHOSTUNREACH.
    
    Derrell
    (cherry picked from commit d72271908e0d67eb31fbc1d818d6f2c720bd7fbb)

commit 595e8876aecfab12b40fec5c9d8737af1b8a1bab
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 27 12:11:24 2009 -0700

    Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb correctly. For the clustering case.
    Clustered setups should have only ever used
    the unsigned version of TDB_DATA in the
    first place so they can't be in this mess :-).
    Just do the normal upgrade in the clustered case.
    Jeremy.
    (cherry picked from commit 58d3ec1cb81d6086d65cd12acd16cd591cf0c71f)

-----------------------------------------------------------------------

Summary of changes:
 WHATSNEW.txt                |   10 +++++++-
 source/Makefile.in          |    2 +-
 source/VERSION              |    2 +-
 source/include/dbwrap.h     |    2 +
 source/lib/charcnv.c        |   25 ++++++++++++++++-----
 source/lib/dbwrap.c         |   27 ++++++++++++++++++++++
 source/libsmb/libsmb_dir.c  |    8 ++++++-
 source/libsmb/libsmb_file.c |    7 ++++++
 source/libsmb/libsmb_stat.c |    1 +
 source/passdb/pdb_tdb.c     |   51 +++++++++++++++++++++++++++++++++++++-----
 source/smbd/dosmode.c       |   12 ++++++---
 11 files changed, 127 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 1979443..374f5f5 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -10,7 +10,7 @@ Major enhancements in Samba 3.3.3 include:
     o Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb
       correctly (bug #6195).
     o Fix serving of files with colons to CIFS/VFS client (bug #6196).
-
+    o Fix "map readonly" (bug #6186).
 
 
 ######################################################################
@@ -34,6 +34,8 @@ o   Michael Adam <obnox at samba.org>
     * Reduce memory usage of "net conf import".
     * Registry cleanup.
     * Fix handling of SAMBA_VERSION_VENDOR_PATCH.
+    * Fix build of pam_winbind.so with static linking.
+    * Tidy up some convert_string_internal error cases.
 
 
 o   Jeremy Allison <jra at samba.org>
@@ -46,6 +48,7 @@ o   Jeremy Allison <jra at samba.org>
     * Allow DFS client paths to work when POSIX pathnames have been
       selected.
     * Try and fix the build farm RAW-STREAMS errors.
+    * Ensure files starting with multiple dots are hidden.
 
 
 o   Günther Deschner <gd at samba.org>
@@ -89,6 +92,11 @@ o   Volker Lendecke <vl at samba.org>
     * Fix a scary "fill_share_mode_lock failed" message.
 
 
+o   Derrell Lipman <derrell at dworkin.(none)>
+    * BUG 6228: Fix SMBC_open_ctx failure due to path resolve failure doesn't set
+      errno.
+
+
 o   Stefan Metzmacher <metze at samba.org>
     * Don't use reserved words in smbconftort.
     * Fix smb signing for fragmented trans/trans2/nttrans requests.
diff --git a/source/Makefile.in b/source/Makefile.in
index 0500d73..792943b 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -792,7 +792,7 @@ RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
 	     $(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(LDB_OBJ) 
 
 PAM_WINBIND_OBJ = nsswitch/pam_winbind.o localedir.o $(WBCOMMON_OBJ) \
-		  $(LIBREPLACE_OBJ) @BUILD_INIPARSER@
+		  $(LIBREPLACE_OBJ) @BUILD_INIPARSER@ @LIBTALLOC_STATIC@
 
 LIBSMBCLIENT_OBJ0 = \
 		    libsmb/libsmb_cache.o \
diff --git a/source/VERSION b/source/VERSION
index 358c3af..65dadee 100644
--- a/source/VERSION
+++ b/source/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=3
 SAMBA_VERSION_MINOR=3
-SAMBA_VERSION_RELEASE=2
+SAMBA_VERSION_RELEASE=3
 
 ########################################################
 # Bug fix releases use a letter for the patch revision #
diff --git a/source/include/dbwrap.h b/source/include/dbwrap.h
index 3381d2d..2208d6e 100644
--- a/source/include/dbwrap.h
+++ b/source/include/dbwrap.h
@@ -53,6 +53,8 @@ struct db_context {
 	bool persistent;
 };
 
+bool db_is_local(const char *name);
+
 struct db_context *db_open(TALLOC_CTX *mem_ctx,
 			   const char *name,
 			   int hash_size, int tdb_flags,
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c
index c3b3451..03b32c1 100644
--- a/source/lib/charcnv.c
+++ b/source/lib/charcnv.c
@@ -242,7 +242,7 @@ static size_t convert_string_internal(charset_t from, charset_t to,
 					DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
 				if (allow_bad_conv)
 					goto use_as_is;
-				break;
+				return (size_t)-1;
 			case E2BIG:
 				reason="No more room"; 
 				if (!conv_silent) {
@@ -263,11 +263,12 @@ static size_t convert_string_internal(charset_t from, charset_t to,
 					DEBUG(3,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
 				if (allow_bad_conv)
 					goto use_as_is;
-				break;
+				
+				return (size_t)-1;
 			default:
 				if (!conv_silent)
 					DEBUG(0,("convert_string_internal: Conversion error: %s(%s)\n",reason,inbuf));
-				break;
+				return (size_t)-1;
 		}
 		/* smb_panic(reason); */
 	}
@@ -412,7 +413,11 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
 				goto general_case;
 #else
-				return retval + convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+				size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+				if (ret == (size_t)-1) {
+					return ret;
+				}
+				return retval + ret;
 #endif
 			}
 		}
@@ -448,7 +453,11 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
 				goto general_case;
 #else
-				return retval + convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+				size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+				if (ret == (size_t)-1) {
+					return ret;
+				}
+				return retval + ret;
 #endif
 			}
 		}
@@ -484,7 +493,11 @@ size_t convert_string(charset_t from, charset_t to,
 #ifdef BROKEN_UNICODE_COMPOSE_CHARACTERS
 				goto general_case;
 #else
-				return retval + convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+				size_t ret = convert_string_internal(from, to, p, slen, q, dlen, allow_bad_conv);
+				if (ret == (size_t)-1) {
+					return ret;
+				}
+				return retval + ret;
 #endif
 			}
 		}
diff --git a/source/lib/dbwrap.c b/source/lib/dbwrap.c
index 055f554..126b5c1 100644
--- a/source/lib/dbwrap.c
+++ b/source/lib/dbwrap.c
@@ -65,6 +65,33 @@ static int dbwrap_fallback_parse_record(struct db_context *db, TDB_DATA key,
 	return res;
 }
 
+bool db_is_local(const char *name)
+{
+#ifdef CLUSTER_SUPPORT
+	const char *sockname = lp_ctdbd_socket();
+
+	if(!sockname || !*sockname) {
+		sockname = CTDB_PATH;
+	}
+
+	if (lp_clustering() && socket_exist(sockname)) {
+		const char *partname;
+		/* ctdb only wants the file part of the name */
+		partname = strrchr(name, '/');
+		if (partname) {
+			partname++;
+		} else {
+			partname = name;
+		}
+		/* allow ctdb for individual databases to be disabled */
+		if (lp_parm_bool(-1, "ctdb", partname, True)) {
+			return false;
+		}
+	}
+#endif
+	return true;
+}
+
 /**
  * open a database
  */
diff --git a/source/libsmb/libsmb_dir.c b/source/libsmb/libsmb_dir.c
index 89782ce..8846abb 100644
--- a/source/libsmb/libsmb_dir.c
+++ b/source/libsmb/libsmb_dir.c
@@ -1169,7 +1169,8 @@ SMBC_mkdir_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
-		TALLOC_FREE(frame);
+                errno = ENOENT;
+                TALLOC_FREE(frame);
 		return -1;
 	}
 	/*d_printf(">>>mkdir: resolved path as %s\n", targetpath);*/
@@ -1276,6 +1277,7 @@ SMBC_rmdir_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -1558,6 +1560,7 @@ SMBC_chmod_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -1749,6 +1752,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -1921,6 +1925,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
 	if (!cli_resolve_path(frame, "", srv->cli, path1,
                               &targetcli1, &targetpath1)) {
 		d_printf("Could not resolve %s\n", path1);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -1936,6 +1941,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
 	if (!cli_resolve_path(frame, "", srv->cli, path2,
                               &targetcli2, &targetpath2)) {
 		d_printf("Could not resolve %s\n", path2);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
diff --git a/source/libsmb/libsmb_file.c b/source/libsmb/libsmb_file.c
index 1bbb47d..8741ed6 100644
--- a/source/libsmb/libsmb_file.c
+++ b/source/libsmb/libsmb_file.c
@@ -118,6 +118,7 @@ SMBC_open_ctx(SMBCCTX *context,
 		if (!cli_resolve_path(frame, "", srv->cli, path,
                                       &targetcli, &targetpath)) {
 			d_printf("Could not resolve %s\n", path);
+                        errno = ENOENT;
 			SAFE_FREE(file);
 			TALLOC_FREE(frame);
 			return NULL;
@@ -298,6 +299,7 @@ SMBC_read_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", file->srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -387,6 +389,7 @@ SMBC_write_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", file->srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -462,6 +465,7 @@ SMBC_close_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", file->srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
@@ -544,6 +548,7 @@ SMBC_getatr(SMBCCTX * context,
 	if (!cli_resolve_path(frame, "", srv->cli, fixedpath,
                               &targetcli, &targetpath)) {
 		d_printf("Couldn't resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return False;
 	}
@@ -756,6 +761,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
 		if (!cli_resolve_path(frame, "", file->srv->cli, path,
                                       &targetcli, &targetpath)) {
 			d_printf("Could not resolve %s\n", path);
+                        errno = ENOENT;
 			TALLOC_FREE(frame);
 			return -1;
 		}
@@ -847,6 +853,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", file->srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
diff --git a/source/libsmb/libsmb_stat.c b/source/libsmb/libsmb_stat.c
index 64ddc78..9e081af 100644
--- a/source/libsmb/libsmb_stat.c
+++ b/source/libsmb/libsmb_stat.c
@@ -260,6 +260,7 @@ SMBC_fstat_ctx(SMBCCTX *context,
 	if (!cli_resolve_path(frame, "", file->srv->cli, path,
                               &targetcli, &targetpath)) {
 		d_printf("Could not resolve %s\n", path);
+                errno = ENOENT;
 		TALLOC_FREE(frame);
 		return -1;
 	}
diff --git a/source/passdb/pdb_tdb.c b/source/passdb/pdb_tdb.c
index de49ed2..1f3441a 100644
--- a/source/passdb/pdb_tdb.c
+++ b/source/passdb/pdb_tdb.c
@@ -4,7 +4,7 @@
  * Copyright (C) Andrew Tridgell   1992-1998
  * Copyright (C) Simo Sorce        2000-2003
  * Copyright (C) Gerald Carter     2000-2006
- * Copyright (C) Jeremy Allison    2001
+ * Copyright (C) Jeremy Allison    2001-2009
  * Copyright (C) Andrew Bartlett   2002
  * Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2005
  * 
@@ -38,7 +38,9 @@ static int tdbsam_debug_level = DBGC_ALL;
 #endif
 
 #define TDBSAM_VERSION	4	/* Most recent TDBSAM version */
+#define TDBSAM_MINOR_VERSION	0	/* Most recent TDBSAM minor version */
 #define TDBSAM_VERSION_STRING	"INFO/version"
+#define TDBSAM_MINOR_VERSION_STRING	"INFO/minor_version"
 #define PASSDB_FILE_NAME	"passdb.tdb"
 #define USERPREFIX		"USER_"
 #define USERPREFIX_LEN		5
@@ -322,7 +324,8 @@ static bool tdbsam_convert(struct db_context **pp_db, const char *name, int32 fr
 	struct db_context *db = NULL;
 	int ret;
 
-	if (!tdbsam_convert_backup(name, pp_db)) {
+	/* We only need the update backup for local db's. */
+	if (db_is_local(name) && !tdbsam_convert_backup(name, pp_db)) {
 		DEBUG(0, ("tdbsam_convert: Could not backup %s\n", name));
 		return false;
 	}
@@ -358,6 +361,12 @@ static bool tdbsam_convert(struct db_context **pp_db, const char *name, int32 fr
 		goto cancel;
 	}
 
+	if (dbwrap_store_int32(db, TDBSAM_MINOR_VERSION_STRING,
+			       TDBSAM_MINOR_VERSION) != 0) {
+		DEBUG(0, ("tdbsam_convert: Could not store tdbsam minor version\n"));
+		goto cancel;
+	}
+
 	if (db->transaction_commit(db) != 0) {
 		DEBUG(0, ("tdbsam_convert: Could not commit transaction\n"));
 		return false;
@@ -381,6 +390,7 @@ static bool tdbsam_convert(struct db_context **pp_db, const char *name, int32 fr
 static bool tdbsam_open( const char *name )
 {
 	int32	version;
+	int32	minor_version;
 
 	/* check if we are already open */
 
@@ -403,6 +413,12 @@ static bool tdbsam_open( const char *name )
 		version = 0;	/* Version not found, assume version 0 */
 	}
 
+	/* Get the minor version */
+	minor_version = dbwrap_fetch_int32(db_sam, TDBSAM_MINOR_VERSION_STRING);
+	if (minor_version == -1) {
+		minor_version = 0; /* Minor version not found, assume 0 */
+	}
+
 	/* Compare the version */
 	if (version > TDBSAM_VERSION) {
 		/* Version more recent than the latest known */
@@ -411,7 +427,9 @@ static bool tdbsam_open( const char *name )
 		return false;
 	}
 
-	if ( version < TDBSAM_VERSION ) {
+	if ( version < TDBSAM_VERSION ||
+			(version == TDBSAM_VERSION &&
+			 minor_version < TDBSAM_MINOR_VERSION) ) {
 		/*
 		 * Ok - we think we're going to have to convert.
 		 * Due to the backup process we now must do to
@@ -436,6 +454,12 @@ static bool tdbsam_open( const char *name )
 			version = 0;	/* Version not found, assume version 0 */
 		}
 
+		/* Re-check the minor version */
+		minor_version = dbwrap_fetch_int32(db_sam, TDBSAM_MINOR_VERSION_STRING);
+		if (minor_version == -1) {
+			minor_version = 0; /* Minor version not found, assume 0 */
+		}
+
 		/* Compare the version */
 		if (version > TDBSAM_VERSION) {
 			/* Version more recent than the latest known */
@@ -445,9 +469,24 @@ static bool tdbsam_open( const char *name )
 			return false;
 		}
 
-		if ( version < TDBSAM_VERSION ) {
-			DEBUG(1, ("tdbsam_open: Converting version %d database to "
-				  "version %d.\n", version, TDBSAM_VERSION));
+		if ( version < TDBSAM_VERSION ||
+				(version == TDBSAM_VERSION &&
+				 minor_version < TDBSAM_MINOR_VERSION) ) {
+			/*
+			 * Note that minor versions we read that are greater
+			 * than the current minor version we have hard coded
+			 * are assumed to be compatible if they have the same
+			 * major version. That allows previous versions of the
+			 * passdb code that don't know about minor versions to
+			 * still use this database. JRA.
+			 */
+
+			DEBUG(1, ("tdbsam_open: Converting version %d.%d database to "
+				  "version %d.%d.\n",
+					version,
+					minor_version,
+					TDBSAM_VERSION,
+					TDBSAM_MINOR_VERSION));
 
 			if ( !tdbsam_convert(&db_sam, name, version) ) {
 				DEBUG(0, ("tdbsam_open: Error when trying to convert "
diff --git a/source/smbd/dosmode.c b/source/smbd/dosmode.c
index 69100bf..8a5a7b0 100644
--- a/source/smbd/dosmode.c
+++ b/source/smbd/dosmode.c
@@ -319,8 +319,10 @@ uint32 dos_mode_msdfs(connection_struct *conn, const char *path,SMB_STRUCT_STAT
 		} else {
 			p = path;
 		}
-		
-		if (p[0] == '.' && p[1] != '.' && p[1] != 0) {
+
+		/* Only . and .. are not hidden. */
+		if (p[0] == '.' && !((p[1] == '\0') ||
+				(p[1] == '.' && p[2] == '\0'))) {
 			result |= aHIDDEN;
 		}
 	}
@@ -371,8 +373,10 @@ uint32 dos_mode(connection_struct *conn, const char *path,SMB_STRUCT_STAT *sbuf)
 		} else {
 			p = path;
 		}
-		
-		if (p[0] == '.' && p[1] != '.' && p[1] != 0) {
+
+		/* Only . and .. are not hidden. */
+		if (p[0] == '.' && !((p[1] == '\0') ||
+				(p[1] == '.' && p[2] == '\0'))) {
 			result |= aHIDDEN;
 		}
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list