return -1;
}
-static int skel_rmdir(vfs_handle_struct *handle, const char *path)
+static int skel_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
errno = ENOSYS;
return -1;
return SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode);
}
-static int skel_rmdir(vfs_handle_struct *handle, const char *path)
+static int skel_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
- return SMB_VFS_NEXT_RMDIR(handle, path);
+ return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}
static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
const struct smb_filename * */
/* Version 35 - Change mkdir from const char *, to
const struct smb_filename * */
+/* Version 35 - Change rmdir from const char *, to
+ const struct smb_filename * */
#define SMB_VFS_INTERFACE_VERSION 35
int (*mkdir_fn)(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode);
- int (*rmdir_fn)(struct vfs_handle_struct *handle, const char *path);
+ int (*rmdir_fn)(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname);
int (*closedir_fn)(struct vfs_handle_struct *handle, DIR *dir);
void (*init_search_op_fn)(struct vfs_handle_struct *handle, DIR *dirp);
int smb_vfs_call_mkdir(struct vfs_handle_struct *handle,
const struct smb_filename *smb_fname,
mode_t mode);
-int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, const char *path);
+int smb_vfs_call_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname);
int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
DIR *dir);
void smb_vfs_call_init_search_op(struct vfs_handle_struct *handle,
#define SMB_VFS_NEXT_MKDIR(handle, smb_fname, mode) \
smb_vfs_call_mkdir((handle)->next,(smb_fname), (mode))
-#define SMB_VFS_RMDIR(conn, path) \
- smb_vfs_call_rmdir((conn)->vfs_handles, (path))
-#define SMB_VFS_NEXT_RMDIR(handle, path) \
- smb_vfs_call_rmdir((handle)->next, (path))
+#define SMB_VFS_RMDIR(conn, smb_fname) \
+ smb_vfs_call_rmdir((conn)->vfs_handles, (smb_fname))
+#define SMB_VFS_NEXT_RMDIR(handle, smb_fname) \
+ smb_vfs_call_rmdir((handle)->next, (smb_fname))
#define SMB_VFS_CLOSEDIR(conn, dir) \
smb_vfs_call_closedir((conn)->vfs_handles, dir)
become_root();
if (is_directory) {
- ret = SMB_VFS_NEXT_RMDIR(handle, final_component);
+ ret = SMB_VFS_NEXT_RMDIR(handle, &local_fname);
} else {
ret = SMB_VFS_NEXT_UNLINK(handle, &local_fname);
}
}
static int rmdir_acl_common(struct vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
int ret;
/* Try the normal rmdir first. */
- ret = SMB_VFS_NEXT_RMDIR(handle, path);
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
if (ret == 0) {
return 0;
}
/* Failed due to access denied,
see if we need to root override. */
return acl_common_remove_object(handle,
- path,
+ smb_fname->base_name,
true);
}
DEBUG(10,("rmdir_acl_common: unlink of %s failed %s\n",
- path,
+ smb_fname->base_name,
strerror(errno) ));
return -1;
}
On rmdir we need to delete the tdb record (if using tdb).
*********************************************************************/
-static int rmdir_acl_tdb(vfs_handle_struct *handle, const char *path)
+static int rmdir_acl_tdb(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
SMB_STRUCT_STAT sbuf;
struct db_context *db = acl_db;
int ret = -1;
- ret = vfs_stat_smb_basename(handle->conn, path, &sbuf);
+ ret = vfs_stat_smb_basename(handle->conn, smb_fname->base_name, &sbuf);
if (ret == -1) {
return -1;
}
- ret = rmdir_acl_common(handle, path);
+ ret = rmdir_acl_common(handle, smb_fname);
if (ret == -1) {
return -1;
}
return result;
}
-static int audit_rmdir(vfs_handle_struct *handle, const char *path)
+static int audit_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
int result;
- result = SMB_VFS_NEXT_RMDIR(handle, path);
+ result = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
syslog(audit_syslog_priority(handle), "rmdir %s %s%s\n",
- path,
+ smb_fname->base_name,
(result < 0) ? "failed: " : "",
(result < 0) ? strerror(errno) : "");
return SMB_VFS_NEXT_MKDIR(handle, cap_smb_fname, mode);
}
-static int cap_rmdir(vfs_handle_struct *handle, const char *path)
+static int cap_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
- char *cappath = capencode(talloc_tos(), path);
+ char *cappath = capencode(talloc_tos(), smb_fname->base_name);
+ struct smb_filename *cap_smb_fname = NULL;
if (!cappath) {
errno = ENOMEM;
return -1;
}
- return SMB_VFS_NEXT_RMDIR(handle, cappath);
+
+ cap_smb_fname = synthetic_smb_fname(talloc_tos(),
+ cappath,
+ NULL,
+ NULL);
+ if (cap_smb_fname == NULL) {
+ TALLOC_FREE(cappath);
+ errno = ENOMEM;
+ return -1;
+ }
+
+ return SMB_VFS_NEXT_RMDIR(handle, cap_smb_fname);
}
static int cap_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
}
static int catia_rmdir(vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
char *name = NULL;
NTSTATUS status;
int ret;
+ struct smb_filename *catia_smb_fname = NULL;
- status = catia_string_replace_allocate(handle->conn, path,
- &name, vfs_translate_to_unix);
+ status = catia_string_replace_allocate(handle->conn,
+ smb_fname->base_name,
+ &name,
+ vfs_translate_to_unix);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
return -1;
}
+ catia_smb_fname = synthetic_smb_fname(talloc_tos(),
+ name,
+ NULL,
+ NULL);
+ if (catia_smb_fname == NULL) {
+ TALLOC_FREE(name);
+ errno = ENOMEM;
+ return -1;
+ }
- ret = SMB_VFS_NEXT_RMDIR(handle, name);
+ ret = SMB_VFS_NEXT_RMDIR(handle, catia_smb_fname);
TALLOC_FREE(name);
+ TALLOC_FREE(catia_smb_fname);
return ret;
}
return result;
}
-static int cephwrap_rmdir(struct vfs_handle_struct *handle, const char *path)
+static int cephwrap_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
int result;
- DEBUG(10, ("[CEPH] rmdir(%p, %s)\n", handle, path));
- result = ceph_rmdir(handle->data, path);
+ DEBUG(10, ("[CEPH] rmdir(%p, %s)\n", handle, smb_fname->base_name));
+ result = ceph_rmdir(handle->data, smb_fname->base_name);
DEBUG(10, ("[CEPH] rmdir(...) = %d\n", result));
WRAP_RETURN(result);
}
return result;
}
-static int vfswrap_rmdir(vfs_handle_struct *handle, const char *path)
+static int vfswrap_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
int result;
START_PROFILE(syscall_rmdir);
- result = rmdir(path);
+ result = rmdir(smb_fname->base_name);
END_PROFILE(syscall_rmdir);
return result;
}
return result;
}
-static int audit_rmdir(vfs_handle_struct *handle, const char *path)
+static int audit_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
int result;
- result = SMB_VFS_NEXT_RMDIR(handle, path);
+ result = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
if (lp_syslog() > 0) {
syslog(audit_syslog_priority(handle), "rmdir %s %s%s\n",
- path,
+ smb_fname->base_name,
(result < 0) ? "failed: " : "",
(result < 0) ? strerror(errno) : "");
}
DEBUG(0, ("vfs_extd_audit: rmdir %s %s %s\n",
- path,
+ smb_fname->base_name,
(result < 0) ? "failed: " : "",
(result < 0) ? strerror(errno) : ""));
return rc;
}
-static int fruit_rmdir(struct vfs_handle_struct *handle, const char *path)
+static int fruit_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
DIR *dh = NULL;
struct dirent *de;
struct fruit_config_data *config;
+ const char *path = smb_fname->base_name;
SMB_VFS_HANDLE_GET_DATA(handle, config,
struct fruit_config_data, return -1);
if (dh) {
closedir(dh);
}
- return SMB_VFS_NEXT_RMDIR(handle, path);
+ return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}
static ssize_t fruit_pread(vfs_handle_struct *handle,
}
static int smb_full_audit_rmdir(vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
int result;
- result = SMB_VFS_NEXT_RMDIR(handle, path);
+ result = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
- do_log(SMB_VFS_OP_RMDIR, (result >= 0), handle, "%s", path);
+ do_log(SMB_VFS_OP_RMDIR, (result >= 0), handle, "%s",
+ smb_fname->base_name);
return result;
}
return glfs_mkdir(handle->data, smb_fname->base_name, mode);
}
-static int vfs_gluster_rmdir(struct vfs_handle_struct *handle, const char *path)
+static int vfs_gluster_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
- return glfs_rmdir(handle->data, path);
+ return glfs_rmdir(handle->data, smb_fname->base_name);
}
static int vfs_gluster_open(struct vfs_handle_struct *handle,
* Failure: set errno, return -1
*/
static int mh_rmdir(vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
int status;
- char *clientPath;
- TALLOC_CTX *ctx;
-
+ struct smb_filename *clientFname = NULL;
+ const char *path = smb_fname->base_name;
DEBUG(MH_INFO_DEBUG, ("Entering with path '%s'\n", path));
if (!is_in_media_files(path))
{
- status = SMB_VFS_NEXT_RMDIR(handle, path);
+ status = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
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_RMDIR(handle, clientPath);
+ status = SMB_VFS_NEXT_RMDIR(handle, clientFname);
err:
- TALLOC_FREE(clientPath);
+ TALLOC_FREE(clientFname);
out:
DEBUG(MH_INFO_DEBUG, ("Leaving with path '%s'\n", path));
return status;
return ret;
}
-static int atalk_rmdir(struct vfs_handle_struct *handle, const char *path)
+static int atalk_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
bool add = False;
TALLOC_CTX *ctx = 0;
+ const char *path = smb_fname->base_name;
char *dpath;
if (!handle->conn->cwd || !path) goto exit_rmdir;
exit_rmdir:
talloc_destroy(ctx);
- return SMB_VFS_NEXT_RMDIR(handle, path);
+ return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}
/* File operations */
/*
* On rmdir we need to delete the tdb record
*/
-static int posix_eadb_rmdir(vfs_handle_struct *handle, const char *path)
+static int posix_eadb_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
NTSTATUS status;
struct tdb_wrap *ea_tdb;
int ret;
+ const char *path = smb_fname->base_name;
SMB_VFS_HANDLE_GET_DATA(handle, ea_tdb, struct tdb_wrap, return -1);
tdb_transaction_cancel(ea_tdb->tdb);
}
- ret = SMB_VFS_NEXT_RMDIR(handle, path);
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
if (ret == -1) {
tdb_transaction_cancel(ea_tdb->tdb);
return ret;
}
-static int shadow_copy2_rmdir(vfs_handle_struct *handle, const char *fname)
+static int shadow_copy2_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
time_t timestamp;
char *stripped;
int ret, saved_errno;
char *conv;
+ struct smb_filename *conv_smb_fname = NULL;
- if (!shadow_copy2_strip_snapshot(talloc_tos(), handle, fname,
- ×tamp, &stripped)) {
+ if (!shadow_copy2_strip_snapshot(talloc_tos(),
+ handle,
+ smb_fname->base_name,
+ ×tamp,
+ &stripped)) {
return -1;
}
if (timestamp == 0) {
- return SMB_VFS_NEXT_RMDIR(handle, fname);
+ return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}
conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
TALLOC_FREE(stripped);
if (conv == NULL) {
return -1;
}
- ret = SMB_VFS_NEXT_RMDIR(handle, conv);
+ conv_smb_fname = synthetic_smb_fname(talloc_tos(),
+ conv,
+ NULL,
+ NULL);
+ if (conv_smb_fname == NULL) {
+ TALLOC_FREE(conv);
+ return -1;
+ }
+ ret = SMB_VFS_NEXT_RMDIR(handle, conv_smb_fname);
saved_errno = errno;
+ TALLOC_FREE(conv_smb_fname);
TALLOC_FREE(conv);
errno = saved_errno;
return ret;
return ret;
}
-static int snapper_gmt_rmdir(vfs_handle_struct *handle, const char *fname)
+static int snapper_gmt_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *fname)
{
time_t timestamp;
char *stripped;
int ret, saved_errno;
char *conv;
+ struct smb_filename *smb_fname = NULL;
- if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname,
+ if (!snapper_gmt_strip_snapshot(talloc_tos(), handle, fname->base_name,
×tamp, &stripped)) {
return -1;
}
if (conv == NULL) {
return -1;
}
- ret = SMB_VFS_NEXT_RMDIR(handle, conv);
- saved_errno = errno;
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ conv,
+ NULL,
+ NULL);
TALLOC_FREE(conv);
+ if (smb_fname == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
+ saved_errno = errno;
+ TALLOC_FREE(smb_fname);
errno = saved_errno;
return ret;
}
smb_fname_hash->base_name));
recursive_rmdir(talloc_tos(), handle->conn,
smb_fname_hash);
- SMB_VFS_NEXT_RMDIR(handle, smb_fname_hash->base_name);
+ SMB_VFS_NEXT_RMDIR(handle, smb_fname_hash);
} else {
newname = talloc_asprintf(talloc_tos(), "lost-%lu",
random());
&smb_fname_base->st, false);
if (dirname != NULL) {
- SMB_VFS_NEXT_RMDIR(handle, dirname);
+ struct smb_filename *smb_fname_dir =
+ synthetic_smb_fname(talloc_tos(),
+ dirname,
+ NULL,
+ NULL);
+ if (smb_fname_dir == NULL) {
+ TALLOC_FREE(smb_fname_base);
+ TALLOC_FREE(dirname);
+ errno = ENOMEM;
+ return -1;
+ }
+ SMB_VFS_NEXT_RMDIR(handle, smb_fname_dir);
+ TALLOC_FREE(smb_fname_dir);
}
TALLOC_FREE(dirname);
}
return ret;
}
-static int streams_depot_rmdir(vfs_handle_struct *handle, const char *path)
+static int streams_depot_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
struct smb_filename *smb_fname_base = NULL;
int ret = -1;
- DEBUG(10, ("streams_depot_rmdir called for %s\n", path));
+ DEBUG(10, ("streams_depot_rmdir called for %s\n",
+ smb_fname->base_name));
/*
* We potentially need to delete the per-inode streams directory
*/
- smb_fname_base = synthetic_smb_fname(talloc_tos(), path, NULL, NULL);
+ smb_fname_base = synthetic_smb_fname(talloc_tos(),
+ smb_fname->base_name,
+ NULL,
+ NULL);
if (smb_fname_base == NULL) {
errno = ENOMEM;
return -1;
return -1;
}
- ret = SMB_VFS_NEXT_RMDIR(handle, path);
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname_base);
if (ret == 0) {
char *dirname = stream_dir(handle, smb_fname_base,
&smb_fname_base->st, false);
if (dirname != NULL) {
- SMB_VFS_NEXT_RMDIR(handle, dirname);
+ struct smb_filename *smb_fname_dir =
+ synthetic_smb_fname(talloc_tos(),
+ dirname,
+ NULL,
+ NULL);
+ if (smb_fname_dir == NULL) {
+ TALLOC_FREE(smb_fname_base);
+ TALLOC_FREE(dirname);
+ errno = ENOMEM;
+ return -1;
+ }
+ SMB_VFS_NEXT_RMDIR(handle, smb_fname_dir);
+ TALLOC_FREE(smb_fname_dir);
}
TALLOC_FREE(dirname);
}
SYNCOPS_NEXT_SMB_FNAME(MKDIR, smb_fname, (handle, smb_fname, mode));
}
-static int syncops_rmdir(vfs_handle_struct *handle, const char *fname)
+static int syncops_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
- SYNCOPS_NEXT(RMDIR, fname, (handle, fname));
+ SYNCOPS_NEXT_SMB_FNAME(RMDIR, smb_fname, (handle, smb_fname));
}
/* close needs to be handled specially */
}
static int smb_time_audit_rmdir(vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
int result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_RMDIR(handle, path);
+ result = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
- smb_time_audit_log_fname("rmdir", timediff, path);
+ smb_time_audit_log_smb_fname("rmdir",
+ timediff,
+ smb_fname);
}
return result;
}
static int um_rmdir(vfs_handle_struct *handle,
- const char *path)
+ const struct smb_filename *smb_fname)
{
int status;
- char *clientPath;
- TALLOC_CTX *ctx;
-
+ const char *path = smb_fname->base_name;
+ struct smb_filename *client_fname = NULL;
DEBUG(10, ("Entering with path '%s'\n", path));
if (!is_in_media_files(path)) {
- return SMB_VFS_NEXT_RMDIR(handle, path);
+ return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
}
- 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,
+ &client_fname);
+ if (status != 0) {
goto err;
}
- status = SMB_VFS_NEXT_RMDIR(handle, clientPath);
+ status = SMB_VFS_NEXT_RMDIR(handle, client_fname);
err:
- TALLOC_FREE(clientPath);
+ TALLOC_FREE(client_fname);
DEBUG(10, ("Leaving with path '%s'\n", path));
return status;
}
/*
* On rmdir we need to delete the tdb record
*/
-static int xattr_tdb_rmdir(vfs_handle_struct *handle, const char *path)
+static int xattr_tdb_rmdir(vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
SMB_STRUCT_STAT sbuf;
struct file_id id;
struct db_context *db;
int ret;
+ const char *path = smb_fname->base_name;
TALLOC_CTX *frame = talloc_stackframe();
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
return -1;
}
- ret = SMB_VFS_NEXT_RMDIR(handle, path);
+ ret = SMB_VFS_NEXT_RMDIR(handle, smb_fname);
if (ret == -1) {
TALLOC_FREE(frame);
if(!recursive_rmdir(ctx, conn, smb_dname_full)) {
goto err_break;
}
- if(SMB_VFS_RMDIR(conn,
- smb_dname_full->base_name) != 0) {
+ if(SMB_VFS_RMDIR(conn, smb_dname_full) != 0) {
goto err_break;
}
} else if(SMB_VFS_UNLINK(conn, smb_dname_full) != 0) {
}
ret = SMB_VFS_UNLINK(conn, smb_dname);
} else {
- ret = SMB_VFS_RMDIR(conn, smb_dname->base_name);
+ ret = SMB_VFS_RMDIR(conn, smb_dname);
}
if (ret == 0) {
notify_fname(conn, NOTIFY_ACTION_REMOVED,
goto err_break;
}
if(SMB_VFS_RMDIR(conn,
- smb_dname_full->base_name) != 0) {
+ smb_dname_full) != 0) {
goto err_break;
}
} else if(SMB_VFS_UNLINK(conn, smb_dname_full) != 0) {
}
TALLOC_FREE(dir_hnd);
/* Retry the rmdir */
- ret = SMB_VFS_RMDIR(conn, smb_dname->base_name);
+ ret = SMB_VFS_RMDIR(conn, smb_dname);
}
err:
return handle->fns->mkdir_fn(handle, smb_fname, mode);
}
-int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, const char *path)
+int smb_vfs_call_rmdir(struct vfs_handle_struct *handle,
+ const struct smb_filename *smb_fname)
{
VFS_FIND(rmdir);
- return handle->fns->rmdir_fn(handle, path);
+ return handle->fns->rmdir_fn(handle, smb_fname);
}
int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
static NTSTATUS cmd_pathfunc(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
+ struct smb_filename *smb_fname = NULL;
int ret = -1;
if (argc != 2) {
return NT_STATUS_OK;
}
- if (strcmp("rmdir", argv[0]) == 0 ) {
- ret = SMB_VFS_RMDIR(vfs->conn, argv[1]);
- } else if (strcmp("unlink", argv[0]) == 0 ) {
- struct smb_filename *smb_fname;
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ argv[1],
+ NULL,
+ NULL);
- smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
- if (smb_fname == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ if (strcmp("rmdir", argv[0]) == 0 ) {
+ ret = SMB_VFS_RMDIR(vfs->conn, smb_fname);
+ TALLOC_FREE(smb_fname);
+ } else if (strcmp("unlink", argv[0]) == 0 ) {
ret = SMB_VFS_UNLINK(vfs->conn, smb_fname);
TALLOC_FREE(smb_fname);
} else if (strcmp("chdir", argv[0]) == 0 ) {