From a C program I would like to add "Read & execute" permission in Windows 7 for a file on a Samba drive. The "icacls" program is used in example below, but a C library call could also be a possibility if available.
The permissions can be changed for Windows users, for example Everyone, with the Windows "icacls" program (using system call), but when I try to change it for a Samba user, with name shown through Windows, then "icacls" returns:
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
Any idea about how I can add "Read & execute" permission to a file in Windows so the Samba (Linux) user and groups will get the Linux "x" permission set ?