Menu

#350 FinderInfo flags vs AFPAttributes

closed
7
2012-08-27
2009-06-06
franklahm
No

If the setting for visibility in FIFlags and AFPAttributes don't match for a file, the result is a "dancing icon".

Steps to reproduce:

  • OS X 10.5.7 client with Netatalk HEAD as of today
  • mount volume on client, touch file from client
  • SetFile -a V file [1] to set the invisibe flag
  • this will result in the following values stored in our AppleDouble file
    FIFlags: 0x4000, AFPAttributes: 0x0001

Until now everything is fine, both are in sync. But the problem then arises when the AFP client manages to get them out of sync.

  • SetFile -a l file to disable the lock flag (which wasn't set) and now we have:
    FIFlags: 0x4000, AFPAttributes: 0x0000
  • open a Finder window with the file: it's there
  • click on it: it vanishes

Voila, out of sync. The SetFile command somehow got them out of sync. If it's a bug in SetFile ot in the AFP client doesn't matter because in the end it's our problem that we store the same flag, which just happens to be queried and set in two different structures, in two places.

To fix this we have to implement the proper syncing for reading and writing of this flags, which will be finicky. Afaict the only other flags stored in both places is "m", the shared flag:
/*
** best read monospaced **
SetFile Option FinderInfo AFP Attributes
============== ========== ==============

A Alias file FinderInfo.FFlags:0x8000
B Bundle FinderInfo.FFlags:0x2000
C Custom icon FinderInfo.FFlags:0x0400
D Desktop
FinderInfo.FFlags:0x0001
E Hidden extension FinderInfo.FFlags:0x0010
I Inited
FinderInfo.FFlags:0x0100
M Shared (can run multiple times) FinderInfo.FFlags:0x0040 Attributes:0x0002
N No INIT resources FinderInfo.FFlags:0x0080
L Locked Attributes:0x01a0
S System (name locked) FinderInfo.FFlags:0x1000
T Stationery FinderInfo.FFlags:0x0800
V Invisible FinderInfo.FFlags:0x4000 Attributes:0x0001
Z Busy
FxInfo.Fxflags: 0x0080
*/

[1]
SetFile and GetFileInfo from Apples DevTools

Discussion

  • franklahm

    franklahm - 2009-06-06

    Gnagh. sf.net doesn't like indentation. Check it out here if you like:
    http://docs.google.com/View?id=dgpmfmw6_1cgtxxfrg

     
  • franklahm

    franklahm - 2009-06-08

    This might also similarily effect our invisible dots option, because at least in get_finderinfo()/file.c we only adjust the FinderFlags and not the attributes if the name starts with a period.
    I'll have to check this out too while I'm at it.

     
  • franklahm

    franklahm - 2009-06-09

    This might also similarily effect our invisible dots option, ...

    In testing it worked as expected.

     
  • franklahm

    franklahm - 2009-06-19

    The final solution is more involved, but basically all that's been said still applies.

     

Log in to post a comment.

MongoDB Logo MongoDB