X-Git-Url: http://git.samba.org/samba.git/?p=kamenim%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=source3%2Fmodules%2Fvfs_media_harmony.c;h=37b396a5bea8a8713c57e91f6bb2cbdedda1c2d4;hp=3c330201f06baf7f3dbd1c48ab2b1247368f9922;hb=730de8e091879a53493a0c96b542603cd52174a2;hpb=12b801d9d7856f1bb50619962f7e9cb94e75087f diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 3c330201f06..37b396a5bea 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -1853,34 +1853,31 @@ out: * Failure: set errno, return -1 */ static int mh_mknod(vfs_handle_struct *handle, - const char *pathname, + const struct smb_filename *smb_fname, mode_t mode, SMB_DEV_T dev) { int status; - char *clientPath; + struct smb_filename *clientFname = NULL; TALLOC_CTX *ctx; DEBUG(MH_INFO_DEBUG, ("Entering mh_mknod\n")); - if (!is_in_media_files(pathname)) - { - status = SMB_VFS_NEXT_MKNOD(handle, pathname, mode, dev); + if (!is_in_media_files(smb_fname->base_name)) { + status = SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev); goto out; } - clientPath = NULL; ctx = talloc_tos(); - if ((status = alloc_get_client_path(handle, ctx, - pathname, - &clientPath))) - { + if ((status = alloc_get_client_smb_fname(handle, ctx, + smb_fname, + &clientFname))) { goto err; } - status = SMB_VFS_NEXT_MKNOD(handle, clientPath, mode, dev); + status = SMB_VFS_NEXT_MKNOD(handle, clientFname, mode, dev); err: - TALLOC_FREE(clientPath); + TALLOC_FREE(clientFname); out: return status; } @@ -1926,33 +1923,30 @@ out: * Failure: set errno, return -1 */ static int mh_chflags(vfs_handle_struct *handle, - const char *path, + const struct smb_filename *smb_fname, unsigned int flags) { int status; - char *clientPath; + struct smb_filename *clientFname = NULL; TALLOC_CTX *ctx; DEBUG(MH_INFO_DEBUG, ("Entering mh_chflags\n")); - if (!is_in_media_files(path)) - { - status = SMB_VFS_NEXT_CHFLAGS(handle, path, flags); + if (!is_in_media_files(smb_fname->base_name)) { + status = SMB_VFS_NEXT_CHFLAGS(handle, smb_fname, flags); goto out; } - clientPath = NULL; ctx = talloc_tos(); - if ((status = alloc_get_client_path(handle, ctx, - path, - &clientPath))) - { + if ((status = alloc_get_client_smb_fname(handle, ctx, + smb_fname, + &clientFname))) { goto err; } - status = SMB_VFS_NEXT_CHFLAGS(handle, clientPath, flags); + status = SMB_VFS_NEXT_CHFLAGS(handle, clientFname, flags); err: - TALLOC_FREE(clientPath); + TALLOC_FREE(clientFname); out: return status; } @@ -2205,37 +2199,33 @@ out: * In this case, "name" is an attr name. */ static ssize_t mh_getxattr(struct vfs_handle_struct *handle, - const char *path, + const struct smb_filename *smb_fname, const char *name, void *value, size_t size) { + int status; + struct smb_filename *clientFname = NULL; ssize_t ret; - char *clientPath; - TALLOC_CTX *ctx; DEBUG(MH_INFO_DEBUG, ("Entering mh_getxattr\n")); - if (!is_in_media_files(path)) - { - ret = SMB_VFS_NEXT_GETXATTR(handle, path, name, value, - size); + if (!is_in_media_files(smb_fname->base_name)) { + ret = SMB_VFS_NEXT_GETXATTR(handle, smb_fname, + name, value, size); goto out; } - clientPath = NULL; - ctx = talloc_tos(); - - if (alloc_get_client_path(handle, ctx, - path, - &clientPath)) - { + status = alloc_get_client_smb_fname(handle, + talloc_tos(), + smb_fname, + &clientFname); + if (status != 0) { ret = -1; goto err; } - - ret = SMB_VFS_NEXT_GETXATTR(handle, clientPath, name, value, size); + ret = SMB_VFS_NEXT_GETXATTR(handle, clientFname, name, value, size); err: - TALLOC_FREE(clientPath); + TALLOC_FREE(clientFname); out: return ret; } @@ -2313,38 +2303,33 @@ out: * In this case, "name" is an attr name. */ static int mh_setxattr(struct vfs_handle_struct *handle, - const char *path, + const struct smb_filename *smb_fname, const char *name, const void *value, size_t size, int flags) { int status; - char *clientPath; - TALLOC_CTX *ctx; + struct smb_filename *clientFname = NULL; DEBUG(MH_INFO_DEBUG, ("Entering mh_setxattr\n")); - if (!is_in_media_files(path)) - { - status = SMB_VFS_NEXT_SETXATTR(handle, path, name, value, + if (!is_in_media_files(smb_fname->base_name)) { + status = SMB_VFS_NEXT_SETXATTR(handle, smb_fname, name, value, size, flags); goto out; } - clientPath = NULL; - ctx = talloc_tos(); - - if ((status = alloc_get_client_path(handle, ctx, - path, - &clientPath))) - { + status = alloc_get_client_smb_fname(handle, + talloc_tos(), + smb_fname, + &clientFname); + if (status != 0) { goto err; } - - status = SMB_VFS_NEXT_SETXATTR(handle, clientPath, name, value, + status = SMB_VFS_NEXT_SETXATTR(handle, clientFname, name, value, size, flags); err: - TALLOC_FREE(clientPath); + TALLOC_FREE(clientFname); out: return status; }