netatalk icon indicating copy to clipboard operation
netatalk copied to clipboard

TimeMachine volumes don't get a service announcement if they contain "$u"

Open faceless2 opened this issue 8 years ago • 1 comments

If a TimeMachine volume is set up with "$u" in the path, it is not being added to the volume list: at the end of "readvolfile" (libatalk/util/netatalk_conf.c, around line 1226) we call realpath_safe, but as we're not doing any special handling of the "$u" variable in the path, this method invariably returns null and the path is not added to the volume linked list.

Later we traverse that list in etc/avahi/afp_avahi.c to look for time machine volumes, and we don't find any so we never announce the _adisk._tcp service, which means the clients can't see the folder.

I don't have a solution except to artificially create a folder that literally matches the path specified in the afp.conf - in my case, mkdir '/home/timemachine/$u'

This applies to 3.1.11 and head.

(aside: posted this on the netatalk sourceforge list before I saw this had moved to github. Would perhaps be useful to use one or the other issue lists, not both. I suspect I am not the first to suggest this)

faceless2 avatar Apr 25 '17 11:04 faceless2

In my case, I tried $u so that the config would be generic and as I add new users to the system I wouldn't need to neither update the config file nor reload Netatalk service.

However, I found that the variable/regex is not smart and I shouldn't try to be smart. So now I just put username explicitly and restart the service.

SuperShinyEyes avatar Mar 04 '18 20:03 SuperShinyEyes