diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-04-29 12:00:57 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-04-29 16:38:13 +1000 |
commit | 0520da2bbe246c45d89bfdec0d399862ecb867ba (patch) | |
tree | 7789cb1fdf01844b6b27efa33e370354eb4d2735 /source3/smbd | |
parent | 0eca33bbf620678759bbe39efaa74f33f96efb74 (diff) | |
download | samba-0520da2bbe246c45d89bfdec0d399862ecb867ba.tar.gz samba-0520da2bbe246c45d89bfdec0d399862ecb867ba.tar.bz2 samba-0520da2bbe246c45d89bfdec0d399862ecb867ba.zip |
s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
This means we use just one constant for this file attribute.
Andrew Bartlett
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/dir.c | 4 | ||||
-rw-r--r-- | source3/smbd/dosmode.c | 14 | ||||
-rw-r--r-- | source3/smbd/fileio.c | 2 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 2 | ||||
-rw-r--r-- | source3/smbd/open.c | 6 | ||||
-rw-r--r-- | source3/smbd/reply.c | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 83b6225aad..9969693e7b 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -878,9 +878,9 @@ bool dir_check_ftype(connection_struct *conn, uint32 mode, uint32 dirtype) /* Check the "must have" bits, which are the may have bits shifted eight */ /* If must have bit is set, the file/dir can not be returned in search unless the matching file attribute is set */ - mask = ((dirtype >> 8) & (FILE_ATTRIBUTE_DIRECTORY|aARCH|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)); /* & 0x37 */ + mask = ((dirtype >> 8) & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)); /* & 0x37 */ if(mask) { - if((mask & (mode & (FILE_ATTRIBUTE_DIRECTORY|aARCH|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM))) == mask) /* check if matching attribute present */ + if((mask & (mode & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM))) == mask) /* check if matching attribute present */ return True; else return False; diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 260909ec19..823d44d0aa 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -183,7 +183,7 @@ static uint32 dos_mode_from_sbuf(connection_struct *conn, } /* Else never set the readonly bit. */ if (MAP_ARCHIVE(conn) && ((smb_fname->st.st_ex_mode & S_IXUSR) != 0)) - result |= aARCH; + result |= FILE_ATTRIBUTE_ARCHIVE; if (MAP_SYSTEM(conn) && ((smb_fname->st.st_ex_mode & S_IXGRP) != 0)) result |= FILE_ATTRIBUTE_SYSTEM; @@ -202,7 +202,7 @@ static uint32 dos_mode_from_sbuf(connection_struct *conn, if (result & FILE_ATTRIBUTE_READONLY ) DEBUG(8, ("r")); if (result & FILE_ATTRIBUTE_SYSTEM) DEBUG(8, ("s")); if (result & FILE_ATTRIBUTE_DIRECTORY ) DEBUG(8, ("d")); - if (result & aARCH ) DEBUG(8, ("a")); + if (result & FILE_ATTRIBUTE_ARCHIVE ) DEBUG(8, ("a")); DEBUG(8,("\n")); return result; @@ -329,7 +329,7 @@ static bool get_ea_dos_attribute(connection_struct *conn, if (dosattr & FILE_ATTRIBUTE_READONLY ) DEBUG(8, ("r")); if (dosattr & FILE_ATTRIBUTE_SYSTEM) DEBUG(8, ("s")); if (dosattr & FILE_ATTRIBUTE_DIRECTORY ) DEBUG(8, ("d")); - if (dosattr & aARCH ) DEBUG(8, ("a")); + if (dosattr & FILE_ATTRIBUTE_ARCHIVE ) DEBUG(8, ("a")); DEBUG(8,("\n")); @@ -490,7 +490,7 @@ uint32 dos_mode_msdfs(connection_struct *conn, if (result & FILE_ATTRIBUTE_READONLY ) DEBUG(8, ("r")); if (result & FILE_ATTRIBUTE_SYSTEM) DEBUG(8, ("s")); if (result & FILE_ATTRIBUTE_DIRECTORY ) DEBUG(8, ("d")); - if (result & aARCH ) DEBUG(8, ("a")); + if (result & FILE_ATTRIBUTE_ARCHIVE ) DEBUG(8, ("a")); if (result & FILE_ATTRIBUTE_SPARSE ) DEBUG(8, ("[sparse]")); DEBUG(8,("\n")); @@ -507,7 +507,7 @@ int dos_attributes_to_stat_dos_flags(uint32_t dosmode) { uint32_t dos_stat_flags = 0; - if (dosmode & aARCH) + if (dosmode & FILE_ATTRIBUTE_ARCHIVE) dos_stat_flags |= UF_DOS_ARCHIVE; if (dosmode & FILE_ATTRIBUTE_HIDDEN) dos_stat_flags |= UF_DOS_HIDDEN; @@ -540,7 +540,7 @@ static bool get_stat_dos_flags(connection_struct *conn, smb_fname_str_dbg(smb_fname))); if (smb_fname->st.st_ex_flags & UF_DOS_ARCHIVE) - *dosmode |= aARCH; + *dosmode |= FILE_ATTRIBUTE_ARCHIVE; if (smb_fname->st.st_ex_flags & UF_DOS_HIDDEN) *dosmode |= FILE_ATTRIBUTE_HIDDEN; if (smb_fname->st.st_ex_flags & UF_DOS_RO) @@ -675,7 +675,7 @@ uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname) if (result & FILE_ATTRIBUTE_READONLY ) DEBUG(8, ("r")); if (result & FILE_ATTRIBUTE_SYSTEM) DEBUG(8, ("s")); if (result & FILE_ATTRIBUTE_DIRECTORY ) DEBUG(8, ("d")); - if (result & aARCH ) DEBUG(8, ("a")); + if (result & FILE_ATTRIBUTE_ARCHIVE ) DEBUG(8, ("a")); if (result & FILE_ATTRIBUTE_SPARSE ) DEBUG(8, ("[sparse]")); DEBUG(8,("\n")); diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index 16d8853b54..ea607d3d5d 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -322,7 +322,7 @@ ssize_t write_file(struct smb_request *req, int dosmode = dos_mode(fsp->conn, fsp->fsp_name); if (!IS_DOS_ARCHIVE(dosmode)) { file_set_dosmode(fsp->conn, fsp->fsp_name, - dosmode | aARCH, NULL, false); + dosmode | FILE_ATTRIBUTE_ARCHIVE, NULL, false); } } diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 858e19aeb3..f4bd969300 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1450,7 +1450,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, status = close_file(NULL, fsp2, NORMAL_CLOSE); - /* Grrr. We have to do this as open_file_ntcreate adds aARCH when it + /* Grrr. We have to do this as open_file_ntcreate adds FILE_ATTRIBUTE_ARCHIVE when it creates the file. This isn't the correct thing to do in the copy case. JRA */ if (!parent_dirname(talloc_tos(), smb_fname_dst->base_name, &parent, diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d1ac91c9c5..076ae1ff69 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1622,9 +1622,9 @@ static NTSTATUS 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); } @@ -2361,7 +2361,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, lp_store_dos_attributes(SNUM(conn))) { if (!posix_open) { if (file_set_dosmode(conn, smb_fname, - new_dos_attributes | aARCH, + new_dos_attributes | FILE_ATTRIBUTE_ARCHIVE, parent_dir, true) == 0) { unx_mode = smb_fname->st.st_ex_mode; } diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index cabf92d7af..db40539620 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2449,10 +2449,10 @@ static NTSTATUS do_unlink(connection_struct *conn, fattr = dos_mode(conn, smb_fname); if (dirtype & FILE_ATTRIBUTE_NORMAL) { - dirtype = FILE_ATTRIBUTE_DIRECTORY|aARCH|FILE_ATTRIBUTE_READONLY; + dirtype = FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY; } - dirtype &= (FILE_ATTRIBUTE_DIRECTORY|aARCH|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM); + dirtype &= (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM); if (!dirtype) { return NT_STATUS_NO_SUCH_FILE; } |