goto out;
}
- if (smb_fname_tmp->flags & SMB_FILENAME_POSIX_PATH) {
- ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
- } else {
- ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
- }
-
+ ret = vfs_stat(handle->conn, smb_fname_tmp);
if (ret == -1) {
goto out;
}
return NT_STATUS_NO_MEMORY;
}
- if (smb_fname_cp->flags & SMB_FILENAME_POSIX_PATH) {
- ret = SMB_VFS_LSTAT(handle->conn, smb_fname_cp);
- } else {
- ret = SMB_VFS_STAT(handle->conn, smb_fname_cp);
- }
+ ret = vfs_stat(handle->conn, smb_fname_cp);
sbuf = smb_fname_cp->st;
TALLOC_FREE(smb_fname_cp);
}
return -1;
}
- if (smb_fname_base->flags & SMB_FILENAME_POSIX_PATH) {
- ret = SMB_VFS_LSTAT(handle->conn, smb_fname_base);
- } else {
- ret = SMB_VFS_STAT(handle->conn, smb_fname_base);
- }
+ ret = vfs_stat(handle->conn, smb_fname_base);
*sbuf = smb_fname_base->st;
if (ret == -1) {
DBG_DEBUG("smb_fname [%s]\n", smb_fname_str_dbg(state->smb_fname));
- if (state->posix_pathnames) {
- ret = SMB_VFS_LSTAT(state->conn, state->smb_fname);
- } else {
- ret = SMB_VFS_STAT(state->conn, state->smb_fname);
- }
+ ret = vfs_stat(state->conn, state->smb_fname);
if (ret == 0) {
/*
* It exists. it must either be a directory or this must
* if it exists. JRA.
*/
- if (state->posix_pathnames) {
- ret = SMB_VFS_LSTAT(state->conn, state->smb_fname);
- } else {
- ret = SMB_VFS_STAT(state->conn, state->smb_fname);
- }
-
+ ret = vfs_stat(state->conn, state->smb_fname);
if (ret != 0) {
SET_STAT_INVALID(state->smb_fname->st);
}
* there was one) and be done!
*/
- if (state->posix_pathnames) {
- ret = SMB_VFS_LSTAT(state->conn, state->smb_fname);
- } else {
- ret = SMB_VFS_STAT(state->conn, state->smb_fname);
- }
-
+ ret = vfs_stat(state->conn, state->smb_fname);
if (ret == 0) {
status = check_for_dot_component(state->smb_fname);
if (!NT_STATUS_IS_OK(status)) {
status = NT_STATUS_NO_MEMORY;
goto fail;
}
- if (state->posix_pathnames) {
- ret = SMB_VFS_LSTAT(state->conn,
- parent_fname);
- } else {
- ret = SMB_VFS_STAT(state->conn,
- parent_fname);
- }
+ ret = vfs_stat(state->conn, parent_fname);
TALLOC_FREE(parent_fname);
if (ret == -1) {
if (errno == ENOTDIR ||
status = NT_STATUS_NOT_A_DIRECTORY;
goto fail;
}
- if (req != NULL && req->posix_pathnames) {
- ret = SMB_VFS_LSTAT(conn, smb_fname);
- } else {
- ret = SMB_VFS_STAT(conn, smb_fname);
- }
-
+ ret = vfs_stat(conn, smb_fname);
if (ret == 0 && VALID_STAT_OF_DIR(smb_fname->st)) {
status = NT_STATUS_FILE_IS_A_DIRECTORY;
goto fail;
* so FILE_OPEN disposition knows the directory
* exists.
*/
- if (req->posix_pathnames) {
- ret = SMB_VFS_LSTAT(conn, smb_dname);
- } else {
- ret = SMB_VFS_STAT(conn, smb_dname);
- }
+ ret = vfs_stat(conn, smb_dname);
if (ret == -1) {
nt_status = map_nt_error_from_unix(errno);
reply_nterror(req, nt_status);
uint32_t dirtype_orig = dirtype;
NTSTATUS status;
int ret;
- bool posix_paths = (req != NULL && req->posix_pathnames);
struct smb2_create_blobs *posx = NULL;
DEBUG(10,("do_unlink: %s, dirtype = %d\n",
return NT_STATUS_MEDIA_WRITE_PROTECTED;
}
- if (posix_paths) {
- ret = SMB_VFS_LSTAT(conn, smb_fname);
- } else {
- ret = SMB_VFS_STAT(conn, smb_fname);
- }
+ ret = vfs_stat(conn, smb_fname);
if (ret != 0) {
return map_nt_error_from_unix(errno);
}
return NT_STATUS_OBJECT_NAME_INVALID;
#endif /* JRATEST */
- if (posix_paths) {
+ if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
status = make_smb2_posix_create_ctx(
talloc_tos(), &posx, 0777);
if (!NT_STATUS_IS_OK(status)) {
char *talloced = NULL;
long offset = 0;
int create_options = 0;
- bool posix_pathnames = (req != NULL && req->posix_pathnames);
struct smb2_create_blobs *posx = NULL;
int rc;
bool src_has_wild = false;
goto out;
}
- if (req != NULL && !req->posix_pathnames) {
+ if (!(smb_fname_src->flags & SMB_FILENAME_POSIX_PATH)) {
/*
* Check the wildcard mask *before*
* unmangling. As mangling is done
}
}
- if (posix_pathnames) {
+ if (smb_fname_src->flags & SMB_FILENAME_POSIX_PATH) {
status = make_smb2_posix_create_ctx(talloc_tos(), &posx, 0777);
if (!NT_STATUS_IS_OK(status)) {
DBG_WARNING("make_smb2_posix_create_ctx failed: %s\n",
}
ZERO_STRUCT(smb_fname_src->st);
- if (posix_pathnames) {
- rc = SMB_VFS_LSTAT(conn, smb_fname_src);
- } else {
- rc = SMB_VFS_STAT(conn, smb_fname_src);
- }
+
+ rc = vfs_stat(conn, smb_fname_src);
if (rc == -1) {
status = map_nt_error_from_unix_common(errno);
goto out;
smb_fname_dst->base_name = destname;
ZERO_STRUCT(smb_fname_src->st);
- if (posix_pathnames) {
- SMB_VFS_LSTAT(conn, smb_fname_src);
- } else {
- SMB_VFS_STAT(conn, smb_fname_src);
- }
+ vfs_stat(conn, smb_fname_src);
status = openat_pathref_fsp(conn->cwd_fsp, smb_fname_src);
if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
connection_struct *conn = smb2req->tcon->compat;
struct share_mode_lock *lck = NULL;
NTSTATUS status;
+ int ret;
req = tevent_req_create(mem_ctx, &state,
struct smbd_smb2_setinfo_state);
* handle (returned from an NT SMB). NT5.0 seems
* to do this call. JRA.
*/
- if (fsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH) {
- /* Always do lstat for UNIX calls. */
- if (SMB_VFS_LSTAT(conn, fsp->fsp_name)) {
- DEBUG(3,("smbd_smb2_setinfo_send: "
- "SMB_VFS_LSTAT of %s failed "
- "(%s)\n", fsp_str_dbg(fsp),
- strerror(errno)));
- status = map_nt_error_from_unix(errno);
- tevent_req_nterror(req, status);
- return tevent_req_post(req, ev);
- }
- } else {
- if (SMB_VFS_STAT(conn, fsp->fsp_name) != 0) {
- DEBUG(3,("smbd_smb2_setinfo_send: "
- "fileinfo of %s failed (%s)\n",
- fsp_str_dbg(fsp),
- strerror(errno)));
- status = map_nt_error_from_unix(errno);
- tevent_req_nterror(req, status);
- return tevent_req_post(req, ev);
- }
+ ret = vfs_stat(fsp->conn, fsp->fsp_name);
+ if (ret != 0) {
+ DBG_WARNING("vfs_stat() of %s failed (%s)\n",
+ fsp_str_dbg(fsp),
+ strerror(errno));
+ status = map_nt_error_from_unix(errno);
+ tevent_req_nterror(req, status);
+ return tevent_req_post(req, ev);
}
} else if (fsp->print_file) {
/*
struct file_quota_information info = {0};
SMB_NTQUOTA_STRUCT qt = {0};
enum ndr_err_code err;
- int ret;
if (!fsp->fake_file_handle) {
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
* so FILE_OPEN disposition knows the directory
* exists.
*/
- if (req->posix_pathnames) {
- ret = SMB_VFS_LSTAT(conn, smb_dname);
- } else {
- ret = SMB_VFS_STAT(conn, smb_dname);
- }
-
+ ret = vfs_stat(conn, smb_dname);
if (ret == -1) {
ntstatus = map_nt_error_from_unix(errno);
reply_nterror(req, ntstatus);