summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-08 14:08:04 -0700
committerTim Prouty <tprouty@samba.org>2009-07-08 21:36:04 -0700
commit161e182b65ceda833e0bebc48ef404cdd399f8d7 (patch)
treebd2d58a61d48839f74691305ed8f2072cc2bea37 /source3/smbd
parent1a1d10d22f7a2eebd22e76614c3c74b4d49e5c33 (diff)
downloadsamba-161e182b65ceda833e0bebc48ef404cdd399f8d7.tar.gz
samba-161e182b65ceda833e0bebc48ef404cdd399f8d7.tar.bz2
samba-161e182b65ceda833e0bebc48ef404cdd399f8d7.zip
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.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/nttrans.c49
-rw-r--r--source3/smbd/trans2.c3
2 files changed, 3 insertions, 49 deletions
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
@@ -272,53 +272,6 @@ void send_nt_replies(connection_struct *conn,
}
/****************************************************************************
- Is it an NTFS stream name ?
- An NTFS file name is <path>.<extention>:<stream name>:<stream type>
- $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.
***************************************************************************/
bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname)
@@ -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;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 62280ddde0..f22700deaa 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1421,6 +1421,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx,
&smb_fname);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(fname);
+ return false;
}
if (INFO_LEVEL_IS_UNIX(info_level)) {
@@ -5554,7 +5555,7 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
}
} else {
/* newname must *not* be a stream name. */
- if (is_ntfs_stream_name(newname)) {
+ if (newname[0] == ':') {
return NT_STATUS_NOT_SUPPORTED;
}