connection_struct *conn = handle->conn;
uint32_t caps = FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
struct smb_filename *smb_fname_cpath = NULL;
+ struct vfs_statvfs_struct statbuf;
NTSTATUS status;
- int ret = -1;
+ int ret;
-#if defined(DARWINOS) || (defined(BSD) && defined(BSD_STATVFS_BSIZE))
- struct vfs_statvfs_struct statbuf;
ZERO_STRUCT(statbuf);
- sys_statvfs(conn->connectpath, &statbuf);
- caps = statbuf.FsCapabilities;
-#endif
+ ret = sys_statvfs(conn->connectpath, &statbuf);
+ if (ret == 0) {
+ caps = statbuf.FsCapabilities;
+ }
*p_ts_res = TIMESTAMP_SET_SECONDS;
statbuf->TotalFileNodes = statvfs_buf.f_files;
statbuf->FreeFileNodes = statvfs_buf.f_ffree;
statbuf->FsIdentifier = statvfs_buf.f_fsid;
-
- /* Good defaults for Linux filesystems are case sensitive
- * and case preserving.
+ /* Try to extrapolate some of the fs flags into the
+ * capabilities
*/
statbuf->FsCapabilities =
FILE_CASE_SENSITIVE_SEARCH | FILE_CASE_PRESERVED_NAMES;
+#ifdef ST_QUOTA
+ if (statvfs_buf.f_flag & ST_QUOTA)
+ statbuf->FsCapabilities |= FILE_VOLUME_QUOTAS;
+#endif
+ if (statvfs_buf.f_flag & ST_RDONLY)
+ statbuf->FsCapabilities |= FILE_READ_ONLY_VOLUME;
}
return result;
}