[Samba] Fruit & uchg

Perttu Aaltonen perttu.aaltonen at mac.com
Wed Apr 28 12:30:19 UTC 2021


> On 28. Apr 2021, at 14.39, Andrew Walker <walker.aj325 at gmail.com> wrote:
> 
> 
> 
> On Wed, Apr 28, 2021 at 7:24 AM Perttu Aaltonen <perttu.aaltonen at mac.com <mailto:perttu.aaltonen at mac.com>> wrote:
> 
> I thought it might have something to do with ZoL or getfattr not showing everything.
> No. I was merely mentioning that some ZFS attributes are not visible / settable in Linux. Samba does not rely on these. As I mentioned earlier, the readonly attribute is stored in user.DOSATTRIB. Sorry if I muddied the waters. You can verify that "readonly" is being toggled via the "allinfo" command (or simple "ls") using smbclient ("smbclient //<server>/<share> -U <username>”).
> 

OK, got it. And actually I can see the change in the user.DOSATTRIB when reading it with getfattr, it was just so small I didn’t notice it earlier.

Looks like I could write a script that would set it with "setfattr -n user.DOSATTRIB -v '"0x1”’ somefile.txt” on the server side. But that overwrites the whole thing and doesn’t look the same as setting it from the Finder.

What’s all the other stuff in there by default when a file is copied to the share?

For example:

getfattr -n user.DOSATTRIB -e base64 test.png
# file: test.png
user.DOSATTRIB=0sAAAEAAQAAABRAAAAIAAAAOtbg2soPNcBgJ4dRCQ81wE=

smb: \> allinfo test.png 
altname: test.png
create_time:    Wed Apr 28 02:47:29 PM 2021 EEST
access_time:    Wed Apr 28 03:17:13 PM 2021 EEST
write_time:     Wed Apr 28 02:47:29 PM 2021 EEST
change_time:    Wed Apr 28 02:47:29 PM 2021 EEST
attributes: A (20)
stream: [:com.apple.macl:$DATA], 72 bytes
stream: [::$DATA], 78071 bytes

setfattr -n user.DOSATTRIB -v '"0x21"’ test.png

getfattr -n user.DOSATTRIB -e base64 test.png 
# file: test.png
user.DOSATTRIB=0sMHgyMQ==

smb: \> allinfo test.png 
altname: test.png
create_time:    Wed Apr 28 02:47:29 PM 2021 EEST
access_time:    Wed Apr 28 03:17:13 PM 2021 EEST
write_time:     Wed Apr 28 02:47:29 PM 2021 EEST
change_time:    Wed Apr 28 02:47:29 PM 2021 EEST
attributes: RA (21)
stream: [:com.apple.macl:$DATA], 72 bytes
stream: [::$DATA], 78071 bytes

After unchecking “Locked” in the Finder it goes back to the longer form.

A script could of course set the flag completely from the client side, finding files through AFP that have uchg set and set it on the same file through SMB. Probably easier to do it that way anyway but I’m still interested what actually gets stored in that attribute.

-Perttu


More information about the samba mailing list