如何在 Windows 7 中為 Samba 磁碟機上的檔案新增「讀取和執行」權限

如何在 Windows 7 中為 Samba 磁碟機上的檔案新增「讀取和執行」權限

我想從 C 程式中為 Samba 磁碟機上的檔案新增 Windows 7 中的「讀取和執行」權限。下面的範例中使用了「icacls」程序,但如果可用,也可以呼叫 C 庫。

可以使用Windows「icacls」程式(使用系統呼叫)來變更Windows使用者的權限,例如每個人,但當我嘗試為Samba使用者變更權限時,透過Windows顯示名稱,然後「icacls」返回:

U:\temp>icacls hello.exe /grant smbuser:RX
user: No mapping between account names and security IDs was done.
Successfully processed 0 files; Failed processing 1 files

知道如何在 Windows 中的檔案中新增「讀取和執行」權限,以便 Samba (Linux) 使用者和群組獲得 Linux「x」權限集嗎?

相關內容