[SCM] Samba Shared Repository - branch v3-6-test updated

Jeremy Allison jra at samba.org
Fri Apr 29 10:52:11 MDT 2011


The branch, v3-6-test has been updated
       via  a02d916 s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
       via  51023a0 s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
       via  6b2730f s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
       via  983e1ac s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
       via  a0071e3 s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
       via  163267b s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
       via  2805f85 Add FILE_ATTRIBUTE_VOLUME.
      from  c3b2d25 s3-tevent: only include ../lib/util/tevent wrappers where needed.

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


- Log -----------------------------------------------------------------
commit a02d91689858e0195f660e9b7f5d88004c06c8e0
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 29 12:00:57 2011 +1000

    s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
    
    This means we use just one constant for this file attribute.
    
    Andrew Bartlett
    (cherry picked from commit 0520da2bbe246c45d89bfdec0d399862ecb867ba)

commit 51023a0d5a46334e6370b9dec9f9722ddb28c1d8
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 29 11:57:02 2011 +1000

    s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
    
    This means we use just one constant for this file attribute.
    
    Andrew Bartlett
    (cherry picked from commit 0eca33bbf620678759bbe39efaa74f33f96efb74)

commit 6b2730f1c6a32c198fa948749e9aed496e99366c
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 29 11:52:48 2011 +1000

    s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
    
    This means we use just one constant for this file attribute.
    
    Andrew Bartlett
    (cherry picked from commit 08c90d6f2df85499f43c5766a62839e80437290f)

commit 983e1ac9f0051e924890c64be99c9a4e35ee411a
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 29 13:23:14 2011 +1000

    s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
    
    This means we use just one constant for this file attribute.
    
    Andrew Bartlett
    (cherry picked from commit 0a3c84b554f3862b3e558f62e67ceb8311b248ce)

commit a0071e39d67411d578e34a7d03dff9906ff5ea94
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 29 11:43:35 2011 +1000

    s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
    
    This means we use just one constant for this file attribute.
    
    Andrew Bartlett
    (cherry picked from commit 317e19aeb3fbdb21573b6ef1bc8c2af646a7e61e)

commit 163267bb107368d5dd457cde5fbad40a6434752e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Apr 29 11:36:14 2011 +1000

    s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
    
    This means we use just one constant for this file attribute.
    
    Andrew Bartlett
    (cherry picked from commit 7f66ebde2e2975b079f6c135b131d064dab38624)

commit 2805f8596c42f2834db089c6f96a81651db6ad33
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 29 09:08:20 2011 -0700

    Add FILE_ATTRIBUTE_VOLUME.

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

Summary of changes:
 source3/client/client.c       |   40 ++++----
 source3/client/clitar.c       |   22 ++--
 source3/include/smb.h         |    9 +--
 source3/include/smb_macros.h  |   10 +-
 source3/lib/util.c            |   12 +-
 source3/libgpo/gpo_filesync.c |    4 +-
 source3/libsmb/clifile.c      |    6 +-
 source3/libsmb/libsmb_dir.c   |   18 ++--
 source3/locking/locking.c     |    2 +-
 source3/modules/onefs_acl.c   |    2 +-
 source3/modules/onefs_open.c  |    8 +-
 source3/smbd/dir.c            |    8 +-
 source3/smbd/dosmode.c        |   90 ++++++++--------
 source3/smbd/fileio.c         |    2 +-
 source3/smbd/nttrans.c        |    4 +-
 source3/smbd/open.c           |   10 +-
 source3/smbd/reply.c          |   40 ++++----
 source3/smbd/smb2_find.c      |    2 +-
 source3/smbd/trans2.c         |   18 ++--
 source3/torture/denytest.c    |    8 +-
 source3/torture/locktest.c    |    2 +-
 source3/torture/locktest2.c   |    2 +-
 source3/torture/mangle_test.c |   10 +-
 source3/torture/masktest.c    |   10 +-
 source3/torture/nbio.c        |    8 +-
 source3/torture/scanner.c     |    4 +-
 source3/torture/torture.c     |  228 ++++++++++++++++++++--------------------
 source3/torture/utable.c      |    8 +-
 source3/utils/net_rpc.c       |    4 +-
 source3/utils/smbcacls.c      |    2 +-
 30 files changed, 293 insertions(+), 300 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index a12f8a2..4c90716 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -505,7 +505,7 @@ static bool do_this_one(struct file_info *finfo)
 		return false;
 	}
 
-	if (finfo->mode & aDIR) {
+	if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
 		return true;
 	}
 
@@ -520,7 +520,7 @@ static bool do_this_one(struct file_info *finfo)
 		return false;
 	}
 
-	if ((archive_level==1 || archive_level==2) && !(finfo->mode & aARCH)) {
+	if ((archive_level==1 || archive_level==2) && !(finfo->mode & FILE_ATTRIBUTE_ARCHIVE)) {
 		DEBUG(3,("archive %s failed\n", finfo->name));
 		return false;
 	}
@@ -752,7 +752,7 @@ static NTSTATUS do_list_helper(const char *mntpoint, struct file_info *f,
 		*dir_end = '\0';
 	}
 
-	if (f->mode & aDIR) {
+	if (f->mode & FILE_ATTRIBUTE_DIRECTORY) {
 		if (do_list_dirs && do_this_one(f)) {
 			status = do_list_fn(cli_state, f, dir);
 			if (!NT_STATUS_IS_OK(status)) {
@@ -924,7 +924,7 @@ NTSTATUS do_list(const char *mask,
 static int cmd_dir(void)
 {
 	TALLOC_CTX *ctx = talloc_tos();
-	uint16 attribute = aDIR | aSYSTEM | aHIDDEN;
+	uint16 attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 	char *mask = NULL;
 	char *buf = NULL;
 	int rc = 1;
@@ -974,7 +974,7 @@ static int cmd_dir(void)
 static int cmd_du(void)
 {
 	TALLOC_CTX *ctx = talloc_tos();
-	uint16 attribute = aDIR | aSYSTEM | aHIDDEN;
+	uint16 attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 	char *mask = NULL;
 	char *buf = NULL;
 	NTSTATUS status;
@@ -1147,8 +1147,8 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
 		close(handle);
 	}
 
-	if (archive_level >= 2 && (attr & aARCH)) {
-		cli_setatr(cli, rname, attr & ~(uint16)aARCH, 0);
+	if (archive_level >= 2 && (attr & FILE_ATTRIBUTE_ARCHIVE)) {
+		cli_setatr(cli, rname, attr & ~(uint16)FILE_ATTRIBUTE_ARCHIVE, 0);
 	}
 
 	{
@@ -1233,7 +1233,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo,
 		return NT_STATUS_UNSUCCESSFUL;
 	}
 
-	if (finfo->mode & aDIR) {
+	if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
 		if (asprintf(&quest,
 			 "Get directory %s? ",finfo->name) < 0) {
 			return NT_STATUS_NO_MEMORY;
@@ -1251,7 +1251,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo,
 	}
 	SAFE_FREE(quest);
 
-	if (!(finfo->mode & aDIR)) {
+	if (!(finfo->mode & FILE_ATTRIBUTE_DIRECTORY)) {
 		rname = talloc_asprintf(ctx,
 				"%s%s",
 				client_get_cur_dir(),
@@ -1306,7 +1306,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	status = do_list(mget_mask, aSYSTEM | aHIDDEN | aDIR,do_mget,false, true);
+	status = do_list(mget_mask, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY,do_mget,false, true);
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
@@ -1395,13 +1395,13 @@ static int cmd_more(void)
 static int cmd_mget(void)
 {
 	TALLOC_CTX *ctx = talloc_tos();
-	uint16 attribute = aSYSTEM | aHIDDEN;
+	uint16 attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 	char *mget_mask = NULL;
 	char *buf = NULL;
 	NTSTATUS status = NT_STATUS_OK;
 
 	if (recurse) {
-		attribute |= aDIR;
+		attribute |= FILE_ATTRIBUTE_DIRECTORY;
 	}
 
 	abort_mget = false;
@@ -2306,12 +2306,12 @@ static NTSTATUS do_del(struct cli_state *cli_state, struct file_info *finfo,
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	if (finfo->mode & aDIR) {
+	if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
 		TALLOC_FREE(mask);
 		return NT_STATUS_OK;
 	}
 
-	status = cli_unlink(cli_state, mask, aSYSTEM | aHIDDEN);
+	status = cli_unlink(cli_state, mask, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s deleting remote file %s\n",
 			 nt_errstr(status), mask);
@@ -2330,10 +2330,10 @@ static int cmd_del(void)
 	char *mask = NULL;
 	char *buf = NULL;
 	NTSTATUS status = NT_STATUS_OK;
-	uint16 attribute = aSYSTEM | aHIDDEN;
+	uint16 attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 
 	if (recurse) {
-		attribute |= aDIR;
+		attribute |= FILE_ATTRIBUTE_DIRECTORY;
 	}
 
 	mask = talloc_strdup(ctx, client_get_cur_dir());
@@ -4516,7 +4516,7 @@ static NTSTATUS completion_remote_filter(const char *mnt,
 		return NT_STATUS_OK;
 	}
 
-	if ((info->dirmask[0] == 0) && !(f->mode & aDIR))
+	if ((info->dirmask[0] == 0) && !(f->mode & FILE_ATTRIBUTE_DIRECTORY))
 		info->matches[info->count] = SMB_STRDUP(f->name);
 	else {
 		TALLOC_CTX *ctx = talloc_stackframe();
@@ -4532,7 +4532,7 @@ static NTSTATUS completion_remote_filter(const char *mnt,
 			TALLOC_FREE(ctx);
 			return NT_STATUS_NO_MEMORY;
 		}
-		if (f->mode & aDIR) {
+		if (f->mode & FILE_ATTRIBUTE_DIRECTORY) {
 			tmp = talloc_asprintf_append(tmp, "%s",
 						     CLI_DIRSEP_STR);
 		}
@@ -4546,7 +4546,7 @@ static NTSTATUS completion_remote_filter(const char *mnt,
 	if (info->matches[info->count] == NULL) {
 		return NT_STATUS_OK;
 	}
-	if (f->mode & aDIR) {
+	if (f->mode & FILE_ATTRIBUTE_DIRECTORY) {
 		smb_readline_ca_char(0);
 	}
 	if (info->count == 1) {
@@ -4629,7 +4629,7 @@ static char **remote_completion(const char *text, int len)
 	if (!cli_resolve_path(ctx, "", auth_info, cli, dirmask, &targetcli, &targetpath)) {
 		goto cleanup;
 	}
-	status = cli_list(targetcli, targetpath, aDIR | aSYSTEM | aHIDDEN,
+	status = cli_list(targetcli, targetpath, FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN,
 			  completion_remote_filter, (void *)&info);
 	if (!NT_STATUS_IS_OK(status)) {
 		goto cleanup;
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 645899a..289e578 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -70,7 +70,7 @@ extern struct cli_state *cli;
 #define ATTRSET 1
 #define ATTRRESET 0
 
-static uint16 attribute = aDIR | aSYSTEM | aHIDDEN;
+static uint16 attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
 
 #ifndef CLIENT_TIMEOUT
 #define CLIENT_TIMEOUT (30*1000)
@@ -294,7 +294,7 @@ of link other than a GNUtar Longlink - ignoring\n"));
 
 	if ((unoct(hb->dbuf.mode, sizeof(hb->dbuf.mode)) & S_IFDIR) ||
 				(*(finfo->name+strlen(finfo->name)-1) == '\\')) {
-		finfo->mode=aDIR;
+		finfo->mode=FILE_ATTRIBUTE_DIRECTORY;
 	} else {
 		finfo->mode=0; /* we don't care about mode at the moment, we'll
 				* just make it a regular file */
@@ -686,13 +686,13 @@ static NTSTATUS do_atar(const char *rname_in, char *lname,
 
 	DEBUG(3,("file %s attrib 0x%X\n",finfo.name,finfo.mode));
 
-	if (tar_inc && !(finfo.mode & aARCH)) {
+	if (tar_inc && !(finfo.mode & FILE_ATTRIBUTE_ARCHIVE)) {
 		DEBUG(4, ("skipping %s - archive bit not set\n", finfo.name));
 		shallitime=0;
-	} else if (!tar_system && (finfo.mode & aSYSTEM)) {
+	} else if (!tar_system && (finfo.mode & FILE_ATTRIBUTE_SYSTEM)) {
 		DEBUG(4, ("skipping %s - system bit is set\n", finfo.name));
 		shallitime=0;
-	} else if (!tar_hidden && (finfo.mode & aHIDDEN)) {
+	} else if (!tar_hidden && (finfo.mode & FILE_ATTRIBUTE_HIDDEN)) {
 		DEBUG(4, ("skipping %s - hidden bit is set\n", finfo.name));
 		shallitime=0;
 	} else {
@@ -784,7 +784,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname,
 
 		/* if shallitime is true then we didn't skip */
 		if (tar_reset && !dry_run)
-			(void) do_setrattr(finfo.name, aARCH, ATTRRESET);
+			(void) do_setrattr(finfo.name, FILE_ATTRIBUTE_ARCHIVE, ATTRRESET);
 
 		clock_gettime_mono(&tp_end);
 		this_time = (tp_end.tv_sec - tp_start.tv_sec)*1000 + (tp_end.tv_nsec - tp_start.tv_nsec)/1000000;
@@ -852,7 +852,7 @@ static NTSTATUS do_tar(struct cli_state *cli_state, struct file_info *finfo,
 		TALLOC_FREE(exclaim);
 	}
 
-	if (finfo->mode & aDIR) {
+	if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) {
 		char *saved_curdir = NULL;
 		char *new_cd = NULL;
 		char *mtar_mask = NULL;
@@ -1405,16 +1405,16 @@ int cmd_setmode(void)
 					direct=0;
 					break;
 				case 'r':
-					attra[direct]|=aRONLY;
+					attra[direct]|=FILE_ATTRIBUTE_READONLY;
 					break;
 				case 'h':
-					attra[direct]|=aHIDDEN;
+					attra[direct]|=FILE_ATTRIBUTE_HIDDEN;
 					break;
 				case 's':
-					attra[direct]|=aSYSTEM;
+					attra[direct]|=FILE_ATTRIBUTE_SYSTEM;
 					break;
 				case 'a':
-					attra[direct]|=aARCH;
+					attra[direct]|=FILE_ATTRIBUTE_ARCHIVE;
 					break;
 				default:
 					DEBUG(0, ("setmode <filename> <perm=[+|-]rsha>\n"));
diff --git a/source3/include/smb.h b/source3/include/smb.h
index daf8211..281ce19 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -83,14 +83,6 @@ enum smb_read_errors {
 
 #define DIR_STRUCT_SIZE 43
 
-/* these define the attribute byte as seen by DOS */
-#define aRONLY (1L<<0)		/* 0x01 */
-#define aHIDDEN (1L<<1)		/* 0x02 */
-#define aSYSTEM (1L<<2)		/* 0x04 */
-#define aVOLID (1L<<3)		/* 0x08 */
-#define aDIR (1L<<4)		/* 0x10 */
-#define aARCH (1L<<5)		/* 0x20 */
-
 /* deny modes */
 #define DENY_DOS 0
 #define DENY_ALL 1
@@ -1086,6 +1078,7 @@ struct bitmap {
 #define FILE_ATTRIBUTE_READONLY		0x001L
 #define FILE_ATTRIBUTE_HIDDEN		0x002L
 #define FILE_ATTRIBUTE_SYSTEM		0x004L
+#define FILE_ATTRIBUTE_VOLUME		0x008L
 #define FILE_ATTRIBUTE_DIRECTORY	0x010L
 #define FILE_ATTRIBUTE_ARCHIVE		0x020L
 #define FILE_ATTRIBUTE_NORMAL		0x080L
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index 9f4b345..4718efd 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -28,11 +28,11 @@
 #define BITSETW(ptr,bit) ((SVAL(ptr,0) & (1<<(bit)))!=0)
 
 /* for readability... */
-#define IS_DOS_READONLY(test_mode) (((test_mode) & aRONLY) != 0)
-#define IS_DOS_DIR(test_mode)      (((test_mode) & aDIR) != 0)
-#define IS_DOS_ARCHIVE(test_mode)  (((test_mode) & aARCH) != 0)
-#define IS_DOS_SYSTEM(test_mode)   (((test_mode) & aSYSTEM) != 0)
-#define IS_DOS_HIDDEN(test_mode)   (((test_mode) & aHIDDEN) != 0)
+#define IS_DOS_READONLY(test_mode) (((test_mode) & FILE_ATTRIBUTE_READONLY) != 0)
+#define IS_DOS_DIR(test_mode)      (((test_mode) & FILE_ATTRIBUTE_DIRECTORY) != 0)
+#define IS_DOS_ARCHIVE(test_mode)  (((test_mode) & FILE_ATTRIBUTE_ARCHIVE) != 0)
+#define IS_DOS_SYSTEM(test_mode)   (((test_mode) & FILE_ATTRIBUTE_SYSTEM) != 0)
+#define IS_DOS_HIDDEN(test_mode)   (((test_mode) & FILE_ATTRIBUTE_HIDDEN) != 0)
 
 #define SMB_WARN(condition, message) \
     ((condition) ? (void)0 : \
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 71c1815..69568ce 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -308,12 +308,12 @@ char *attrib_string(uint16 mode)
 
 	attrstr[0] = 0;
 
-	if (mode & aVOLID) fstrcat(attrstr,"V");
-	if (mode & aDIR) fstrcat(attrstr,"D");
-	if (mode & aARCH) fstrcat(attrstr,"A");
-	if (mode & aHIDDEN) fstrcat(attrstr,"H");
-	if (mode & aSYSTEM) fstrcat(attrstr,"S");
-	if (mode & aRONLY) fstrcat(attrstr,"R");	  
+	if (mode & FILE_ATTRIBUTE_VOLUME) fstrcat(attrstr,"V");
+	if (mode & FILE_ATTRIBUTE_DIRECTORY) fstrcat(attrstr,"D");
+	if (mode & FILE_ATTRIBUTE_ARCHIVE) fstrcat(attrstr,"A");
+	if (mode & FILE_ATTRIBUTE_HIDDEN) fstrcat(attrstr,"H");
+	if (mode & FILE_ATTRIBUTE_SYSTEM) fstrcat(attrstr,"S");
+	if (mode & FILE_ATTRIBUTE_READONLY) fstrcat(attrstr,"R");
 
 	return talloc_strdup(talloc_tos(), attrstr);
 }
diff --git a/source3/libgpo/gpo_filesync.c b/source3/libgpo/gpo_filesync.c
index be964a2..e3d3ae6 100644
--- a/source3/libgpo/gpo_filesync.c
+++ b/source3/libgpo/gpo_filesync.c
@@ -150,7 +150,7 @@ static NTSTATUS gpo_sync_func(const char *mnt,
 	DEBUG(5,("gpo_sync_func: got mask: [%s], name: [%s]\n",
 		mask, info->name));
 
-	if (info->mode & aDIR) {
+	if (info->mode & FILE_ATTRIBUTE_DIRECTORY) {
 
 		DEBUG(3,("got dir: [%s]\n", info->name));
 
@@ -228,7 +228,7 @@ NTSTATUS gpo_sync_directories(TALLOC_CTX *mem_ctx,
 	ctx.cli 	= cli;
 	ctx.remote_path	= CONST_DISCARD(char *, nt_path);
 	ctx.local_path	= CONST_DISCARD(char *, local_path);
-	ctx.attribute 	= (aSYSTEM | aHIDDEN | aDIR);
+	ctx.attribute 	= (FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY);
 
 	ctx.mask = talloc_asprintf(mem_ctx,
 				"%s\\*",
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 6f1346e..7b39f50 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1136,7 +1136,7 @@ struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	SSVAL(state->vwv+0, 0, aSYSTEM | aHIDDEN | aDIR);
+	SSVAL(state->vwv+0, 0, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY);
 
 	bytes = talloc_array(state, uint8_t, 1);
 	if (tevent_req_nomem(bytes, req)) {
@@ -1261,7 +1261,7 @@ static struct tevent_req *cli_ntrename_internal_send(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
-	SSVAL(state->vwv+0, 0 ,aSYSTEM | aHIDDEN | aDIR);
+	SSVAL(state->vwv+0, 0 ,FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_DIRECTORY);
 	SSVAL(state->vwv+1, 0, rename_flag);
 
 	bytes = talloc_array(state, uint8_t, 1);
@@ -2117,7 +2117,7 @@ struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
 	SSVAL(state->vwv + 1, 0, 0);
 	SSVAL(state->vwv + 2, 0, 0);  /* no additional info */
 	SSVAL(state->vwv + 3, 0, accessmode);
-	SSVAL(state->vwv + 4, 0, aSYSTEM | aHIDDEN);
+	SSVAL(state->vwv + 4, 0, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
 	SSVAL(state->vwv + 5, 0, 0);
 	SIVAL(state->vwv + 6, 0, 0);
 	SSVAL(state->vwv + 8, 0, openfn);
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index c0c6e83..3d50107 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -245,7 +245,7 @@ dir_list_fn(const char *mnt,
 {
 
 	if (add_dirent((SMBCFILE *)state, finfo->name, "",
-		       (finfo->mode&aDIR?SMBC_DIR:SMBC_FILE)) < 0) {
+		       (finfo->mode&FILE_ATTRIBUTE_DIRECTORY?SMBC_DIR:SMBC_FILE)) < 0) {
 		SMBCFILE *dir = (SMBCFILE *)state;
 		return map_nt_error_from_unix(dir->dir_error);
 	}
@@ -816,7 +816,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
 			}
 
 			status = cli_list(targetcli, targetpath,
-					  aDIR | aSYSTEM | aHIDDEN,
+					  FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN,
 					  dir_list_fn, (void *)dir);
 			if (!NT_STATUS_IS_OK(status)) {
 				if (dir) {
@@ -1345,7 +1345,7 @@ SMBC_rmdir_ctx(SMBCCTX *context,
 			}
 
 			status = cli_list(targetcli, lpath,
-					  aDIR | aSYSTEM | aHIDDEN,
+					  FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN,
 					  rmdir_list_fn,
 					  &smbc_rmdir_dirempty);
 
@@ -1611,10 +1611,10 @@ SMBC_chmod_ctx(SMBCCTX *context,
 
 	mode = 0;
 
-	if (!(newmode & (S_IWUSR | S_IWGRP | S_IWOTH))) mode |= aRONLY;
-	if ((newmode & S_IXUSR) && lp_map_archive(-1)) mode |= aARCH;
-	if ((newmode & S_IXGRP) && lp_map_system(-1)) mode |= aSYSTEM;
-	if ((newmode & S_IXOTH) && lp_map_hidden(-1)) mode |= aHIDDEN;
+	if (!(newmode & (S_IWUSR | S_IWGRP | S_IWOTH))) mode |= FILE_ATTRIBUTE_READONLY;
+	if ((newmode & S_IXUSR) && lp_map_archive(-1)) mode |= FILE_ATTRIBUTE_ARCHIVE;
+	if ((newmode & S_IXGRP) && lp_map_system(-1)) mode |= FILE_ATTRIBUTE_SYSTEM;
+	if ((newmode & S_IXOTH) && lp_map_hidden(-1)) mode |= FILE_ATTRIBUTE_HIDDEN;
 
 	if (!NT_STATUS_IS_OK(cli_setatr(targetcli, targetpath, mode, 0))) {
 		errno = SMBC_errno(context, targetcli);
@@ -1803,7 +1803,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
 	}
 	/*d_printf(">>>unlink: resolved path as %s\n", targetpath);*/
 
-	if (!NT_STATUS_IS_OK(cli_unlink(targetcli, targetpath, aSYSTEM | aHIDDEN))) {
+	if (!NT_STATUS_IS_OK(cli_unlink(targetcli, targetpath, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
 
 		errno = SMBC_errno(context, targetcli);
 
@@ -2009,7 +2009,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
 		int eno = SMBC_errno(ocontext, targetcli1);
 
 		if (eno != EEXIST ||
-		    !NT_STATUS_IS_OK(cli_unlink(targetcli1, targetpath2, aSYSTEM | aHIDDEN)) ||
+		    !NT_STATUS_IS_OK(cli_unlink(targetcli1, targetpath2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN)) ||
 		    !NT_STATUS_IS_OK(cli_rename(targetcli1, targetpath1, targetpath2))) {
 
 			errno = eno;
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index f5892dd..232a8c3 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -1424,7 +1424,7 @@ NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode)
 	 * Only allow delete on close for writable files.
 	 */
 
-	if ((dosmode & aRONLY) &&
+	if ((dosmode & FILE_ATTRIBUTE_READONLY) &&
 	    !lp_delete_readonly(SNUM(fsp->conn))) {
 		DEBUG(10,("can_set_delete_on_close: file %s delete on close "
 			  "flag set but file attribute is readonly.\n",
diff --git a/source3/modules/onefs_acl.c b/source3/modules/onefs_acl.c
index e986b2a..f78d1f0 100644
--- a/source3/modules/onefs_acl.c
+++ b/source3/modules/onefs_acl.c
@@ -554,7 +554,7 @@ static bool add_sfs_aces(files_struct *fsp, struct ifs_security_descriptor *sd)
 
 		/* Use existing samba logic to derive the mode bits. */
 		file_mode = unix_mode(fsp->conn, 0, fsp->fsp_name, NULL);
-		dir_mode = unix_mode(fsp->conn, aDIR, fsp->fsp_name, NULL);
+		dir_mode = unix_mode(fsp->conn, FILE_ATTRIBUTE_DIRECTORY, fsp->fsp_name, NULL);
 
 		/* Initialize ACEs. */
 		new_aces[0] = onefs_init_ace(fsp->conn, file_mode, false, USR);
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index 80f799c..6ab47d7 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -498,9 +498,9 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 		unx_mode = (mode_t)(new_dos_attributes & ~FILE_FLAG_POSIX_SEMANTICS);
 		new_dos_attributes = 0;
 	} else {
-		/* We add aARCH to this as this mode is only used if the file is
+		/* We add FILE_ATTRIBUTE_ARCHIVE to this as this mode is only used if the file is
 		 * created new. */
-		unx_mode = unix_mode(conn, new_dos_attributes | aARCH,
+		unx_mode = unix_mode(conn, new_dos_attributes | FILE_ATTRIBUTE_ARCHIVE,
 				     smb_fname, parent_dir);
 	}
 
@@ -587,7 +587,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 
 	/* Setup dos_attributes to be set by ifs_createfile */
 	if (lp_store_dos_attributes(SNUM(conn))) {
-		createfile_attributes = (new_dos_attributes | aARCH) &
+		createfile_attributes = (new_dos_attributes | FILE_ATTRIBUTE_ARCHIVE) &
 		    ~(FILE_ATTRIBUTE_NONINDEXED | FILE_ATTRIBUTE_COMPRESSED);
 	}
 
@@ -1482,7 +1482,7 @@ static NTSTATUS onefs_open_directory(connection_struct *conn,
 		mode = (mode_t)(file_attributes & ~FILE_FLAG_POSIX_SEMANTICS);
 		file_attributes = 0;
 	} else {
-		mode = unix_mode(conn, aDIR, smb_dname, parent_dir);
+		mode = unix_mode(conn, FILE_ATTRIBUTE_DIRECTORY, smb_dname, parent_dir);
 	}
 
 	/*
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 5fc87a6..9969693 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -92,7 +92,7 @@ bool make_dir_struct(TALLOC_CTX *ctx,
 		return False;
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list