Fix smb-server xattr: dereference Arc<Dir> before as_std_path()
This commit is contained in:
10
vendor/smb-server/src/fs/local.rs
vendored
10
vendor/smb-server/src/fs/local.rs
vendored
@@ -435,8 +435,8 @@ impl ShareBackend for LocalFsBackend {
|
|||||||
let xattr_name = name.to_string();
|
let xattr_name = name.to_string();
|
||||||
|
|
||||||
spawn_blocking(move || {
|
spawn_blocking(move || {
|
||||||
// Get absolute path using as_std_path()
|
// Get absolute path: dereference Arc first
|
||||||
let full_path = root.as_std_path().join(&rel);
|
let full_path = (*root).as_std_path().join(&rel);
|
||||||
|
|
||||||
// Use xattr::get which returns Option<Vec<u8>>
|
// Use xattr::get which returns Option<Vec<u8>>
|
||||||
match xattr::get(&full_path, &xattr_name) {
|
match xattr::get(&full_path, &xattr_name) {
|
||||||
@@ -460,7 +460,7 @@ impl ShareBackend for LocalFsBackend {
|
|||||||
let value = value.to_vec();
|
let value = value.to_vec();
|
||||||
|
|
||||||
spawn_blocking(move || {
|
spawn_blocking(move || {
|
||||||
let full_path = root.as_std_path().join(&rel);
|
let full_path = (*root).as_std_path().join(&rel);
|
||||||
xattr::set(&full_path, &xattr_name, &value)
|
xattr::set(&full_path, &xattr_name, &value)
|
||||||
.map_err(|e| SmbError::Io(e.into()))
|
.map_err(|e| SmbError::Io(e.into()))
|
||||||
})
|
})
|
||||||
@@ -478,7 +478,7 @@ impl ShareBackend for LocalFsBackend {
|
|||||||
let xattr_name = name.to_string();
|
let xattr_name = name.to_string();
|
||||||
|
|
||||||
spawn_blocking(move || {
|
spawn_blocking(move || {
|
||||||
let full_path = root.as_std_path().join(&rel);
|
let full_path = (*root).as_std_path().join(&rel);
|
||||||
xattr::remove(&full_path, &xattr_name)
|
xattr::remove(&full_path, &xattr_name)
|
||||||
.map_err(|e| SmbError::Io(e.into()))
|
.map_err(|e| SmbError::Io(e.into()))
|
||||||
})
|
})
|
||||||
@@ -491,7 +491,7 @@ impl ShareBackend for LocalFsBackend {
|
|||||||
let root = Arc::clone(&self.root);
|
let root = Arc::clone(&self.root);
|
||||||
|
|
||||||
spawn_blocking(move || {
|
spawn_blocking(move || {
|
||||||
let full_path = root.as_std_path().join(&rel);
|
let full_path = (*root).as_std_path().join(&rel);
|
||||||
|
|
||||||
// xattr::list returns iterator of OsString
|
// xattr::list returns iterator of OsString
|
||||||
let attrs: Vec<String> = xattr::list(&full_path)
|
let attrs: Vec<String> = xattr::list(&full_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user