From 161e182b65ceda833e0bebc48ef404cdd399f8d7 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Wed, 8 Jul 2009 14:08:04 -0700 Subject: s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name() Actually I moved split_ntfs_stream_name into torture.c which is the one consumer of it. This could probably be changed at some point. --- source3/smbd/nttrans.c | 49 +------------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) (limited to 'source3/smbd/nttrans.c') diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index e28e6f3a84..b65af26eca 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -271,53 +271,6 @@ void send_nt_replies(connection_struct *conn, } } -/**************************************************************************** - Is it an NTFS stream name ? - An NTFS file name is .:: - $DATA can be used as both a stream name and a stream type. A missing stream - name or type implies $DATA. - - Both Windows stream names and POSIX files can contain the ':' character. - This function first checks for the existence of a colon in the last component - of the given name. If the name contains a colon we differentiate between a - stream and POSIX file by checking if the latter exists through a POSIX stat. - - Function assumes we've already chdir() to the "root" directory of fname. -****************************************************************************/ - -bool is_ntfs_stream_name(const char *fname) -{ - const char *lastcomp; - SMB_STRUCT_STAT sbuf; - - /* If all pathnames are treated as POSIX we ignore streams. */ - if (lp_posix_pathnames()) { - return false; - } - - /* Find the last component of the name. */ - if ((lastcomp = strrchr_m(fname, '/')) != NULL) - ++lastcomp; - else - lastcomp = fname; - - /* If there is no colon in the last component, it's not a stream. */ - if (strchr_m(lastcomp, ':') == NULL) - return false; - - /* - * If file already exists on disk, it's not a stream. The stat must - * bypass the vfs layer so streams modules don't intefere. - */ - if (sys_stat(fname, &sbuf) == 0) { - DEBUG(5, ("is_ntfs_stream_name: file %s contains a ':' but is " - "not a stream\n", fname)); - return false; - } - - return true; -} - /**************************************************************************** Simple check to determine if the filename is a stream. ***************************************************************************/ @@ -1454,7 +1407,7 @@ void reply_ntrename(struct smb_request *req) } /* The new name must begin with a ':' if the old name is a stream. */ - if (is_ntfs_stream_name(oldname) && (newname[0] != ':')) { + if (is_ntfs_stream_smb_fname(smb_fname_old) && (newname[0] != ':')) { reply_nterror(req, NT_STATUS_INVALID_PARAMETER); END_PROFILE(SMBntrename); return; -- cgit