#include "system/filesys.h"
#include "vfstest.h"
#include "../lib/util/util_pw.h"
+#include "libcli/security/security.h"
+#include "passdb/machine_sid.h"
static const char *null_string = "";
printf("show_data: error=-1 (not enough data in buffer)\n");
return NT_STATUS_UNSUCCESSFUL;
}
- dump_data(0, (uint8 *)(vfs->data) + offset, len);
+ dump_data(0, (uint8_t *)(vfs->data) + offset, len);
return NT_STATUS_OK;
}
return NT_STATUS_OK;
}
- diskfree = SMB_VFS_DISK_FREE(vfs->conn, argv[1], False, &bsize, &dfree, &dsize);
+ diskfree = SMB_VFS_DISK_FREE(vfs->conn, argv[1], &bsize, &dfree, &dsize);
printf("disk_free: %lu, bsize = %lu, dfree = %lu, dsize = %lu\n",
(unsigned long)diskfree,
(unsigned long)bsize,
static NTSTATUS cmd_mkdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
+ struct smb_filename *smb_fname = NULL;
+
if (argc != 2) {
printf("Usage: mkdir <path>\n");
return NT_STATUS_OK;
}
- if (SMB_VFS_MKDIR(vfs->conn, argv[1], 00755) == -1) {
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ argv[1],
+ NULL,
+ NULL);
+
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ if (SMB_VFS_MKDIR(vfs->conn, smb_fname, 00755) == -1) {
printf("mkdir error=%d (%s)\n", errno, strerror(errno));
return NT_STATUS_UNSUCCESSFUL;
}
}
fsp->conn = vfs->conn;
- status = create_synthetic_smb_fname_split(NULL, argv[1], NULL,
- &smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
+ smb_fname = synthetic_smb_fname_split(NULL, argv[1], NULL);
+ if (smb_fname == NULL) {
TALLOC_FREE(fsp);
- return status;
+ return NT_STATUS_NO_MEMORY;
}
fsp->fsp_name = smb_fname;
return NT_STATUS_UNSUCCESSFUL;
}
+ status = NT_STATUS_OK;
ret = SMB_VFS_FSTAT(fsp, &smb_fname->st);
if (ret == -1) {
/* If we have an fd, this stat should succeed. */
errno = EISDIR;
status = NT_STATUS_FILE_IS_A_DIRECTORY;
}
-
+
if (!NT_STATUS_IS_OK(status)) {
SMB_VFS_CLOSE(fsp);
TALLOC_FREE(fsp);
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 = NULL;
- NTSTATUS status;
+ struct smb_filename *smb_fname;
- status = create_synthetic_smb_fname_split(mem_ctx, argv[1],
- NULL, &smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
}
ret = SMB_VFS_UNLINK(vfs->conn, smb_fname);
int ret;
struct smb_filename *smb_fname_src = NULL;
struct smb_filename *smb_fname_dst = NULL;
- NTSTATUS status;
if (argc != 3) {
printf("Usage: rename <old> <new>\n");
return NT_STATUS_OK;
}
- status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL,
- &smb_fname_src);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ smb_fname_src = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
+ if (smb_fname_src == NULL) {
+ return NT_STATUS_NO_MEMORY;
}
- status = create_synthetic_smb_fname_split(mem_ctx, argv[2], NULL,
- &smb_fname_dst);
- if (!NT_STATUS_IS_OK(status)) {
+ smb_fname_dst = synthetic_smb_fname_split(mem_ctx, argv[2], NULL);
+ if (smb_fname_dst == NULL) {
TALLOC_FREE(smb_fname_src);
- return status;
+ return NT_STATUS_NO_MEMORY;
}
ret = SMB_VFS_RENAME(vfs->conn, smb_fname_src, smb_fname_dst);
struct smb_filename *smb_fname = NULL;
SMB_STRUCT_STAT st;
time_t tmp_time;
- NTSTATUS status;
if (argc != 2) {
printf("Usage: stat <fname>\n");
return NT_STATUS_OK;
}
- status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL,
- &smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
}
ret = SMB_VFS_STAT(vfs->conn, smb_fname);
struct smb_filename *smb_fname = NULL;
SMB_STRUCT_STAT st;
time_t tmp_time;
- NTSTATUS status;
if (argc != 2) {
printf("Usage: lstat <path>\n");
return NT_STATUS_OK;
}
- status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL,
- &smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
}
if (SMB_VFS_LSTAT(vfs->conn, smb_fname) == -1) {
}
+static NTSTATUS cmd_chmod_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
+{
+ mode_t mode;
+ if (argc != 3) {
+ printf("Usage: chmod_acl <path> <mode>\n");
+ return NT_STATUS_OK;
+ }
+
+ mode = atoi(argv[2]);
+ if (SMB_VFS_CHMOD_ACL(vfs->conn, argv[1], mode) == -1) {
+ printf("chmod_acl: error=%d (%s)\n", errno, strerror(errno));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ printf("chmod_acl: ok\n");
+ return NT_STATUS_OK;
+}
+
+
+static NTSTATUS cmd_fchmod_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
+{
+ int fd;
+ mode_t mode;
+ if (argc != 3) {
+ printf("Usage: fchmod_acl <fd> <mode>\n");
+ return NT_STATUS_OK;
+ }
+
+ fd = atoi(argv[1]);
+ mode = atoi(argv[2]);
+ if (fd < 0 || fd >= 1024) {
+ printf("fchmod_acl: error=%d (file descriptor out of range)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+ if (vfs->files[fd] == NULL) {
+ printf("fchmod_acl: error=%d (invalid file descriptor)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+
+ if (SMB_VFS_FCHMOD_ACL(vfs->files[fd], mode) == -1) {
+ printf("fchmod_acl: error=%d (%s)\n", errno, strerror(errno));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ printf("fchmod_acl: ok\n");
+ return NT_STATUS_OK;
+}
+
+
static NTSTATUS cmd_chown(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
{
uid_t uid;
{
struct smb_file_time ft;
struct smb_filename *smb_fname = NULL;
- NTSTATUS status;
if (argc != 4) {
printf("Usage: utime <path> <access> <modify>\n");
ft.atime = convert_time_t_to_timespec(atoi(argv[2]));
ft.mtime = convert_time_t_to_timespec(atoi(argv[3]));
- status = create_synthetic_smb_fname_split(mem_ctx, argv[1],
- NULL, &smb_fname);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+ smb_fname = synthetic_smb_fname_split(mem_ctx, argv[1], NULL);
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
}
if (SMB_VFS_NTIMES(vfs->conn, smb_fname, &ft) != 0) {
return NT_STATUS_OK;
}
+static NTSTATUS cmd_fget_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ int fd;
+ NTSTATUS status;
+ struct security_descriptor *sd;
+
+ if (argc != 2) {
+ printf("Usage: fget_nt_acl <fd>\n");
+ return NT_STATUS_OK;
+ }
+
+ fd = atoi(argv[1]);
+ if (fd < 0 || fd >= 1024) {
+ printf("fget_nt_acl: error=%d (file descriptor out of range)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+ if (vfs->files[fd] == NULL) {
+ printf("fget_nt_acl: error=%d (invalid file descriptor)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+
+ status = SMB_VFS_FGET_NT_ACL(vfs->files[fd],
+ SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL,
+ talloc_tos(), &sd);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("fget_nt_acl returned (%s)\n", nt_errstr(status));
+ return status;
+ }
+ printf("%s\n", sddl_encode(talloc_tos(), sd, get_global_sam_sid()));
+ TALLOC_FREE(sd);
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS cmd_get_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ NTSTATUS status;
+ struct security_descriptor *sd;
+ struct smb_filename *smb_fname = NULL;
+
+ if (argc != 2) {
+ printf("Usage: get_nt_acl <path>\n");
+ return NT_STATUS_OK;
+ }
+
+ smb_fname = synthetic_smb_fname(talloc_tos(),
+ argv[1],
+ NULL,
+ NULL);
+
+ if (smb_fname == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ status = SMB_VFS_GET_NT_ACL(vfs->conn, smb_fname,
+ SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL,
+ talloc_tos(), &sd);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("get_nt_acl returned (%s)\n", nt_errstr(status));
+ return status;
+ }
+ printf("%s\n", sddl_encode(talloc_tos(), sd, get_global_sam_sid()));
+ TALLOC_FREE(sd);
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS cmd_fset_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ int fd;
+ NTSTATUS status;
+ struct security_descriptor *sd;
+
+ if (argc != 3) {
+ printf("Usage: fset_nt_acl <fd> <sddl>\n");
+ return NT_STATUS_OK;
+ }
+
+ fd = atoi(argv[1]);
+ if (fd < 0 || fd >= 1024) {
+ printf("fset_nt_acl: error=%d (file descriptor out of range)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+ if (vfs->files[fd] == NULL) {
+ printf("fset_nt_acl: error=%d (invalid file descriptor)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+
+ sd = sddl_decode(talloc_tos(), argv[2], get_global_sam_sid());
+ if (!sd) {
+ printf("sddl_decode failed to parse %s as SDDL\n", argv[2]);
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ status = SMB_VFS_FSET_NT_ACL(vfs->files[fd], SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, sd);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("fset_nt_acl returned (%s)\n", nt_errstr(status));
+ return status;
+ }
+ TALLOC_FREE(sd);
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
+{
+ int flags;
+ int ret;
+ mode_t mode;
+ files_struct *fsp;
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
+ struct security_descriptor *sd = NULL;
+
+ if (argc != 3) {
+ printf("Usage: set_nt_acl <file> <sddl>\n");
+ return NT_STATUS_OK;
+ }
+
+ mode = 00400;
+
+ fsp = talloc_zero(vfs, struct files_struct);
+ if (fsp == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ fsp->fh = talloc_zero(fsp, struct fd_handle);
+ if (fsp->fh == NULL) {
+ TALLOC_FREE(fsp);
+ return NT_STATUS_NO_MEMORY;
+ }
+ fsp->conn = vfs->conn;
+
+ smb_fname = synthetic_smb_fname_split(NULL, argv[1], NULL);
+ if (smb_fname == NULL) {
+ TALLOC_FREE(fsp);
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ fsp->fsp_name = smb_fname;
+
+#ifdef O_DIRECTORY
+ flags = O_RDONLY|O_DIRECTORY;
+#else
+ /* POSIX allows us to open a directory with O_RDONLY. */
+ flags = O_RDONLY;
+#endif
+
+ fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, O_RDWR, mode);
+ if (fsp->fh->fd == -1 && errno == EISDIR) {
+ fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, flags, mode);
+ }
+ if (fsp->fh->fd == -1) {
+ printf("open: error=%d (%s)\n", errno, strerror(errno));
+ TALLOC_FREE(fsp);
+ TALLOC_FREE(smb_fname);
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ status = NT_STATUS_OK;
+ ret = SMB_VFS_FSTAT(fsp, &smb_fname->st);
+ if (ret == -1) {
+ /* If we have an fd, this stat should succeed. */
+ DEBUG(0,("Error doing fstat on open file %s "
+ "(%s)\n",
+ smb_fname_str_dbg(smb_fname),
+ strerror(errno) ));
+ status = map_nt_error_from_unix(errno);
+ }
+
+ if (!NT_STATUS_IS_OK(status)) {
+ goto out;
+ }
+
+ fsp->file_id = vfs_file_id_from_sbuf(vfs->conn, &smb_fname->st);
+ fsp->vuid = UID_FIELD_INVALID;
+ fsp->file_pid = 0;
+ fsp->can_lock = True;
+ fsp->can_read = True;
+ fsp->can_write = True;
+ fsp->print_file = NULL;
+ fsp->modified = False;
+ fsp->sent_oplock_break = NO_BREAK_SENT;
+ fsp->is_directory = S_ISDIR(smb_fname->st.st_ex_mode);
+
+
+ sd = sddl_decode(talloc_tos(), argv[2], get_global_sam_sid());
+ if (!sd) {
+ printf("sddl_decode failed to parse %s as SDDL\n", argv[2]);
+ status = NT_STATUS_INVALID_PARAMETER;
+ goto out;
+ }
+
+ status = SMB_VFS_FSET_NT_ACL(fsp, SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, sd);
+ if (!NT_STATUS_IS_OK(status)) {
+ printf("fset_nt_acl returned (%s)\n", nt_errstr(status));
+ goto out;
+ }
+out:
+ TALLOC_FREE(sd);
+
+ ret = SMB_VFS_CLOSE(fsp);
+ if (ret == -1 )
+ printf("close: error=%d (%s)\n", errno, strerror(errno));
+
+ TALLOC_FREE(fsp);
+
+ return status;
+}
+
+
+
+static NTSTATUS cmd_sys_acl_get_fd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ int fd;
+ SMB_ACL_T acl;
+ char *acl_text;
+
+ if (argc != 2) {
+ printf("Usage: sys_acl_get_fd <fd>\n");
+ return NT_STATUS_OK;
+ }
+
+ fd = atoi(argv[1]);
+ if (fd < 0 || fd >= 1024) {
+ printf("sys_acl_get_fd: error=%d (file descriptor out of range)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+ if (vfs->files[fd] == NULL) {
+ printf("sys_acl_get_fd: error=%d (invalid file descriptor)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+
+ acl = SMB_VFS_SYS_ACL_GET_FD(vfs->files[fd], talloc_tos());
+ if (!acl) {
+ printf("sys_acl_get_fd failed (%s)\n", strerror(errno));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+ acl_text = sys_acl_to_text(acl, NULL);
+ printf("%s", acl_text);
+ TALLOC_FREE(acl);
+ SAFE_FREE(acl_text);
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS cmd_sys_acl_get_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ SMB_ACL_T acl;
+ char *acl_text;
+ int type;
+ if (argc != 3) {
+ printf("Usage: sys_acl_get_file <path> <type>\n");
+ return NT_STATUS_OK;
+ }
+
+ type = atoi(argv[2]);
+ acl = SMB_VFS_SYS_ACL_GET_FILE(vfs->conn, argv[1], type, talloc_tos());
+ if (!acl) {
+ printf("sys_acl_get_file failed (%s)\n", strerror(errno));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+ acl_text = sys_acl_to_text(acl, NULL);
+ printf("%s", acl_text);
+ TALLOC_FREE(acl);
+ SAFE_FREE(acl_text);
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS cmd_sys_acl_blob_get_file(struct vfs_state *vfs,
+ TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ char *description;
+ DATA_BLOB blob;
+ int ret;
+ size_t i;
+
+ if (argc != 2) {
+ printf("Usage: sys_acl_get_file <path>\n");
+ return NT_STATUS_OK;
+ }
+
+ ret = SMB_VFS_SYS_ACL_BLOB_GET_FILE(vfs->conn, argv[1], talloc_tos(),
+ &description, &blob);
+ if (ret != 0) {
+ printf("sys_acl_blob_get_file failed (%s)\n", strerror(errno));
+ return map_nt_error_from_unix(errno);
+ }
+ printf("Description: %s\n", description);
+ for (i = 0; i < blob.length; i++) {
+ printf("%.2x ", blob.data[i]);
+ }
+ printf("\n");
+
+ return NT_STATUS_OK;
+}
+
+static NTSTATUS cmd_sys_acl_blob_get_fd(struct vfs_state *vfs,
+ TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ int fd;
+ char *description;
+ DATA_BLOB blob;
+ int ret;
+ size_t i;
+
+ if (argc != 2) {
+ printf("Usage: sys_acl_blob_get_fd <fd>\n");
+ return NT_STATUS_OK;
+ }
+
+ fd = atoi(argv[1]);
+ if (fd < 0 || fd >= 1024) {
+ printf("sys_acl_blob_get_fd: error=%d "
+ "(file descriptor out of range)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+ if (vfs->files[fd] == NULL) {
+ printf("sys_acl_blob_get_fd: error=%d "
+ "(invalid file descriptor)\n", EBADF);
+ return NT_STATUS_OK;
+ }
+
+ ret = SMB_VFS_SYS_ACL_BLOB_GET_FD(vfs->files[fd], talloc_tos(),
+ &description, &blob);
+ if (ret != 0) {
+ printf("sys_acl_blob_get_fd failed (%s)\n", strerror(errno));
+ return map_nt_error_from_unix(errno);
+ }
+ printf("Description: %s\n", description);
+ for (i = 0; i < blob.length; i++) {
+ printf("%.2x ", blob.data[i]);
+ }
+ printf("\n");
+
+ return NT_STATUS_OK;
+}
+
+
+
+static NTSTATUS cmd_sys_acl_delete_def_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ int ret;
+
+ if (argc != 2) {
+ printf("Usage: sys_acl_delete_def_file <path>\n");
+ return NT_STATUS_OK;
+ }
+
+ ret = SMB_VFS_SYS_ACL_DELETE_DEF_FILE(vfs->conn, argv[1]);
+ if (ret == -1) {
+ printf("sys_acl_delete_def_file failed (%s)\n", strerror(errno));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+ return NT_STATUS_OK;
+}
+
+/* Afaik translate name was first introduced with vfs_catia, to be able
+ to translate unix file/dir-names, containing invalid windows characters,
+ to valid windows names.
+ The used translation direction is always unix --> windows
+*/
+static NTSTATUS cmd_translate_name(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ int ret;
+ struct dirent *dent = NULL;
+ SMB_STRUCT_STAT st;
+ bool found = false;
+ char *translated = NULL;
+ NTSTATUS status;
+
+ if (argc != 2) {
+ DEBUG(0, ("Usage: translate_name unix_filename\n"));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ vfs->currentdir = SMB_VFS_OPENDIR(vfs->conn, ".", NULL, 0);
+ if (vfs->currentdir == NULL) {
+ DEBUG(0, ("cmd_translate_name: opendir error=%d (%s)\n",
+ errno, strerror(errno)));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ while (true) {
+ dent = SMB_VFS_READDIR(vfs->conn, vfs->currentdir, &st);
+ if (dent == NULL) {
+ break;
+ }
+ if (strcmp (dent->d_name, argv[1]) == 0) {
+ found = true;
+ break;
+ }
+ };
+
+ if (!found) {
+ DEBUG(0, ("cmd_translate_name: file '%s' not found.\n",
+ argv[1]));
+ status = NT_STATUS_UNSUCCESSFUL;
+ goto cleanup;
+ }
+ status = SMB_VFS_TRANSLATE_NAME(vfs->conn, dent->d_name,
+ vfs_translate_to_windows,
+ talloc_tos(), &translated);
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+ DEBUG(0, ("cmd_translate_name: file '%s' cannot be "
+ "translated\n", argv[1]));
+ TALLOC_FREE(translated);
+ goto cleanup;
+ }
+ /* translation success. But that could also mean
+ that translating "aaa" to "aaa" was successful :-(
+ */
+ DEBUG(0, ("cmd_translate_name: file '%s' --> '%s'\n",
+ argv[1], translated));
+
+ TALLOC_FREE(translated);
+
+cleanup:
+ ret = SMB_VFS_CLOSEDIR(vfs->conn, vfs->currentdir);
+ if (ret == -1) {
+ DEBUG(0, ("cmd_translate_name: closedir failure: %s\n",
+ strerror(errno)));
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
+ vfs->currentdir = NULL;
+ return status;;
+}
+
+
struct cmd_set vfs_commands[] = {
{ "VFS Commands" },
{ "mkdir", cmd_mkdir, "VFS mkdir()", "mkdir <path>" },
{ "rmdir", cmd_pathfunc, "VFS rmdir()", "rmdir <path>" },
{ "closedir", cmd_closedir, "VFS closedir()", "closedir" },
- { "open", cmd_open, "VFS open()", "open <fname>" },
+ { "open", cmd_open, "VFS open()", "open <fname> <flags> <mode>" },
{ "close", cmd_close, "VFS close()", "close <fd>" },
{ "read", cmd_read, "VFS read()", "read <fd> <size>" },
{ "write", cmd_write, "VFS write()", "write <fd> <size>" },
"setxattr <path> <name> <value> [<flags>]" },
{ "removexattr", cmd_removexattr, "VFS removexattr()",
"removexattr <path> <name>\n" },
+ { "fget_nt_acl", cmd_fget_nt_acl, "VFS fget_nt_acl()",
+ "fget_nt_acl <fd>\n" },
+ { "get_nt_acl", cmd_get_nt_acl, "VFS get_nt_acl()",
+ "get_nt_acl <path>\n" },
+ { "fset_nt_acl", cmd_fset_nt_acl, "VFS fset_nt_acl()",
+ "fset_nt_acl <fd>\n" },
+ { "set_nt_acl", cmd_set_nt_acl, "VFS open() and fset_nt_acl()",
+ "set_nt_acl <file>\n" },
+ { "fchmod_acl", cmd_fchmod_acl, "VFS fchmod_acl()", "fchmod_acl <fd> <mode>" },
+ { "chmod_acl", cmd_chmod_acl, "VFS chmod_acl()", "chmod_acl <path> <mode>" },
+ { "sys_acl_get_file", cmd_sys_acl_get_file, "VFS sys_acl_get_file()", "sys_acl_get_file <path>" },
+ { "sys_acl_get_fd", cmd_sys_acl_get_fd, "VFS sys_acl_get_fd()", "sys_acl_get_fd <fd>" },
+ { "sys_acl_blob_get_file", cmd_sys_acl_blob_get_file,
+ "VFS sys_acl_blob_get_file()", "sys_acl_blob_get_file <path>" },
+ { "sys_acl_blob_get_fd", cmd_sys_acl_blob_get_fd,
+ "VFS sys_acl_blob_get_fd()", "sys_acl_blob_get_fd <path>" },
+ { "sys_acl_delete_def_file", cmd_sys_acl_delete_def_file, "VFS sys_acl_delete_def_file()", "sys_acl_delete_def_file <path>" },
+
+
{ "test_chain", cmd_test_chain, "test chain code",
"test_chain" },
+ { "translate_name", cmd_translate_name, "VFS translate_name()", "translate_name unix_filename" },
{ NULL }
};