From bd688a9138a9ee8593a2eada158c2bcde2b59f4e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 May 2005 13:26:54 +0000 Subject: r6633: Added "check_path_syntax_posix()" in preparation for handling POSIX pathnames. Not yet used. Jeremy. (This used to be commit 381da9b55d6a3fda2ba4a3f12bee50853b7fd3b3) --- source3/smbd/nttrans.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'source3/smbd/nttrans.c') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index d747e84a3a..a37ae5548f 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -73,7 +73,6 @@ static char *nttrans_realloc(char **ptr, size_t size) return tptr; } - /**************************************************************************** Send the required number of replies back. We assume all fields other than the data fields are @@ -262,6 +261,15 @@ static int send_nt_replies(char *inbuf, char *outbuf, int bufsize, NTSTATUS nt_e return 0; } +/**************************************************************************** + Is it an NTFS stream name ? +****************************************************************************/ + +BOOL is_ntfs_stream_name(const char *fname) +{ + return (strchr_m(fname, ':') != NULL) ? True : False; +} + /**************************************************************************** Save case statics. ****************************************************************************/ @@ -668,7 +676,7 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib * Check to see if this is a mac fork of some kind. */ - if( strchr_m(fname, ':')) { + if( is_ntfs_stream_name(fname)) { END_PROFILE(SMBntcreateX); return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND); } @@ -717,7 +725,7 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib * Check to see if this is a mac fork of some kind. */ - if( strchr_m(fname, ':')) { + if( is_ntfs_stream_name(fname)) { #ifdef HAVE_SYS_QUOTAS if ((fake_file_type=is_fake_file(fname))!=FAKE_FILE_TYPE_NONE) { @@ -1329,8 +1337,9 @@ static int call_nt_transact_create(connection_struct *conn, char *inbuf, char *o * Check to see if this is a mac fork of some kind. */ - if( strchr_m(fname, ':')) + if( is_ntfs_stream_name(fname)) { return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND); + } return ERROR_DOS(ERRDOS,ERRbadfid); } @@ -1369,8 +1378,9 @@ static int call_nt_transact_create(connection_struct *conn, char *inbuf, char *o * Check to see if this is a mac fork of some kind. */ - if( strchr_m(fname, ':')) + if( is_ntfs_stream_name(fname)) { return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND); + } } /* @@ -1854,7 +1864,7 @@ int reply_ntrename(connection_struct *conn, return ERROR_NT(status); } - if( strchr_m(oldname, ':')) { + if( is_ntfs_stream_name(oldname)) { /* Can't rename a stream. */ END_PROFILE(SMBntrename); return ERROR_NT(NT_STATUS_ACCESS_DENIED); -- cgit