TDB_DATA data;
struct file_id id;
struct db_context *db;
+ int ret = -1;
SMB_STRUCT_STAT sbuf;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
return NT_STATUS_INTERNAL_DB_CORRUPTION);
if (fsp && fsp->fh->fd != -1) {
- if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
- return map_nt_error_from_unix(errno);
- }
+ ret = SMB_VFS_FSTAT(fsp, &sbuf);
} else {
- if (SMB_VFS_STAT(handle->conn, name, &sbuf) == -1) {
- return map_nt_error_from_unix(errno);
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, name, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, name, &sbuf);
}
}
+
+ if (ret == -1) {
+ return map_nt_error_from_unix(errno);
+ }
+
id = vfs_file_id_from_sbuf(handle->conn, &sbuf);
/* For backwards compatibility only store the dev/inode. */
TDB_DATA data;
struct db_context *db;
struct db_record *rec;
+ int ret = -1;
DEBUG(10,("store_acl_blob_fsp: storing blob length %u on file %s\n",
(unsigned int)pblob->length, fsp->fsp_name));
return NT_STATUS_INTERNAL_DB_CORRUPTION);
if (fsp->fh->fd != -1) {
- if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
- return map_nt_error_from_unix(errno);
- }
+ ret = SMB_VFS_FSTAT(fsp, &sbuf);
} else {
- if (SMB_VFS_STAT(handle->conn, fsp->fsp_name, &sbuf) == -1) {
- return map_nt_error_from_unix(errno);
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, fsp->fsp_name, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, fsp->fsp_name, &sbuf);
}
}
+
+ if (ret == -1) {
+ return map_nt_error_from_unix(errno);
+ }
+
id = vfs_file_id_from_sbuf(handle->conn, &sbuf);
/* For backwards compatibility only store the dev/inode. */
SMB_STRUCT_STAT sbuf;
struct db_context *db;
struct db_record *rec;
+ int ret = -1;
DEBUG(10,("store_acl_blob_pathname: storing blob "
"length %u on file %s\n",
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
return NT_STATUS_INTERNAL_DB_CORRUPTION);
- if (SMB_VFS_STAT(handle->conn, fname, &sbuf) == -1) {
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, fname, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, fname, &sbuf);
+ }
+
+ if (ret == -1) {
return map_nt_error_from_unix(errno);
}
if (fsp && !fsp->is_directory && fsp->fh->fd != -1) {
ret = SMB_VFS_FSTAT(fsp, &sbuf);
} else {
- ret = SMB_VFS_STAT(handle->conn,fname, &sbuf);
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn,fname, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn,fname, &sbuf);
+ }
}
if (ret == -1) {
return map_nt_error_from_unix(errno);
{
SMB_STRUCT_STAT sbuf;
struct db_context *db;
- int ret;
+ int ret = -1;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
- if (SMB_VFS_STAT(handle->conn, path, &sbuf) == -1) {
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, path, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, path, &sbuf);
+ }
+
+ if (ret == -1) {
return -1;
}
SMB_STRUCT_STAT sbuf;
struct db_context *db;
- int ret;
+ int ret = -1;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
- if (SMB_VFS_STAT(handle->conn, path, &sbuf) == -1) {
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, path, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, path, &sbuf);
+ }
+
+ if (ret == -1) {
return -1;
}
return NT_STATUS_OK;
}
if (fsp->is_directory || fsp->fh->fd == -1) {
- ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf);
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(fsp->conn,fsp->fsp_name, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf);
+ }
} else {
ret = SMB_VFS_FSTAT(fsp, &sbuf);
}
{
SMB_STRUCT_STAT sbuf;
struct db_context *db;
- int ret;
+ int ret = -1;
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
- if (SMB_VFS_STAT(handle->conn, path, &sbuf) == -1) {
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(handle->conn, path, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(handle->conn, path, &sbuf);
+ }
+
+ if (ret == -1) {
return -1;
}
SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
if (fsp->is_directory || fsp->fh->fd == -1) {
- ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf);
+ if (lp_posix_pathnames()) {
+ ret = SMB_VFS_LSTAT(fsp->conn,fsp->fsp_name, &sbuf);
+ } else {
+ ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf);
+ }
} else {
ret = SMB_VFS_FSTAT(fsp, &sbuf);
}