summaryrefslogtreecommitdiff
path: root/source3/modules/vfs_streams_xattr.c
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/modules/vfs_streams_xattr.c
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/modules/vfs_streams_xattr.c')
-rw-r--r--source3/modules/vfs_streams_xattr.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 74b14ff93f..eccc2379c9 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -128,29 +128,29 @@ static NTSTATUS streams_xattr_get_name(TALLOC_CTX *ctx,
static bool streams_xattr_recheck(struct stream_io *sio)
{
NTSTATUS status;
- char *base = NULL;
- char *sname = NULL;
+ struct smb_filename *smb_fname = NULL;
char *xattr_name = NULL;
if (sio->fsp->fsp_name == sio->fsp_name_ptr) {
return true;
}
- status = split_ntfs_stream_name(talloc_tos(), sio->fsp->fsp_name,
- &base, &sname);
+ status = create_synthetic_smb_fname_split(talloc_tos(),
+ sio->fsp->fsp_name, NULL,
+ &smb_fname);
if (!NT_STATUS_IS_OK(status)) {
return false;
}
- if (sname == NULL) {
+ if (smb_fname->stream_name == NULL) {
/* how can this happen */
errno = EINVAL;
return false;
}
- xattr_name = talloc_asprintf(talloc_tos(), "%s%s",
- SAMBA_XATTR_DOSSTREAM_PREFIX, sname);
- if (xattr_name == NULL) {
+ status = streams_xattr_get_name(talloc_tos(), smb_fname->stream_name,
+ &xattr_name);
+ if (!NT_STATUS_IS_OK(status)) {
return false;
}
@@ -159,9 +159,12 @@ static bool streams_xattr_recheck(struct stream_io *sio)
sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(sio->handle, sio->fsp),
xattr_name);
sio->base = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(sio->handle, sio->fsp),
- base);
+ smb_fname->base_name);
sio->fsp_name_ptr = sio->fsp->fsp_name;
+ TALLOC_FREE(smb_fname);
+ TALLOC_FREE(xattr_name);
+
if ((sio->xattr_name == NULL) || (sio->base == NULL)) {
return false;
}