netatalk icon indicating copy to clipboard operation
netatalk copied to clipboard

Restore AppleTalk functionality in afpd

Open rdmark opened this issue 1 year ago • 4 comments

Very much a work in progress, but putting up this PR since the code compiles at least. (Although the tests are failing on some platforms.)

A few memos...

I chose not to port over srvloc, authprintdir or icon features. Maybe for later.

Mostly not touched desktop.c, volume.c, and uam.c yet because code has moved around alot.

The big commit where all the AppleTalk stuff got removed first is https://github.com/Netatalk/netatalk/commit/be96d276348da0a7e66eeec844b306e8a5fa8fac which served as a good reference.

The AFPobj struct got rejigged a lot, removing AppleTalk functionality when the ini parsing was rewritten https://github.com/Netatalk/netatalk/commit/df7560dfdb12b06090dc4b2c6e88d0858930b591#diff-ad0729adb892a8c3518ab325a752d53b59c6778afe97b76a32207d2c99bbb0d3

This was renamed: afp_options->ipaddr -> afp_options->listen

Two commits dealing with old charsets that we should check if they should be reverted: https://github.com/Netatalk/netatalk/commit/778588234ea038cae2ae0ca3cce1c61773154df4 https://github.com/Netatalk/netatalk/commit/f6f22820647c9654afa07c30a4d05441609b1f82

rdmark avatar Aug 04 '24 11:08 rdmark

Originally, afpd supported multiple "virtual" servers and multiple protocols using an AFPConfig struct for each server and protocol that wrapped around an AFPObj struct. When AppleTalk was removed, the code was simplified to directly call an AFPObj and the protocol handle was hard coded to a DSI handle, with only one server available. Quite a bit of refactoring in afp_config.c and main.c simplified things as well. More refactoring of afp_config.c occurred here, this commit killed off AFPConfig objects for good: https://github.com/Netatalk/netatalk/commit/a2ddc8384c1881c66db1fbba6698bfd09da84b64

First off, the afp_options_parse_cmdline() function now directly packs an AFPObj with command line options. This was changed to fix a bug here: https://github.com/Netatalk/netatalk/commit/7db833b1021f3daa8e30966e6f025b2a894348dc

A few new features appeared after these changes that need to be maintained: -The GSS UAM saw changes, which requires passing an AFPObj to uam_load() in uam.c. See: https://github.com/Netatalk/netatalk/commit/53e7f8a164ca820d5dfe41b7d39ffba8fb056a72 and https://github.com/Netatalk/netatalk/blob/main/etc/uams/uams_gss.c#L619 -An "afp interfaces" configuration option was introduced to allow listening on multiple network interfaces: https://github.com/Netatalk/netatalk/commit/21058d44aabd9f97e2edfd245770584412c30f2d -socket.c was rewritten and simplified. Just need to make sure the new function calls are used: https://github.com/Netatalk/netatalk/commit/e9391ff790167e35ff92adc20d4779f1d9d651aa

NJRoadfan avatar Aug 04 '24 12:08 NJRoadfan

Regarding charsets, I wouldn't worry about it as afpd configures them directly from settings in afpd.conf now. ATALK_MAC_CHARSET and ATALK_UNIX_CHARSET aren't being set in the modern init scripts anyway.

NJRoadfan avatar Aug 04 '24 13:08 NJRoadfan

Originally, afpd supported multiple "virtual" servers and multiple protocols using an AFPConfig struct for each server and protocol that wrapped around an AFPObj struct. When AppleTalk was removed, the code was simplified to directly call an AFPObj and the protocol handle was hard coded to a DSI handle, with only one server available.

This explains a lot. I think it will suffice for afpd to support exactly one DSI and one ASP server. No need to bring back the ability to spawn an arbitrary number of servers.

rdmark avatar Aug 05 '24 12:08 rdmark

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

sonarqubecloud[bot] avatar Aug 16 '24 07:08 sonarqubecloud[bot]

Handled in https://github.com/Netatalk/netatalk/pull/1435

rdmark avatar Sep 07 '24 00:09 rdmark