Ralph Boehme [Wed, 28 Nov 2012 13:23:33 +0000 (14:23 +0100)]
Add option 'ad domain'
Add option 'ad domain' similar to 'nt domain'. Useful when
authenticating against Netatalk on Solaris in case the OS is bound
to Active Directory. Currently users have to type in their full AD
name user@domain. Adding an option 'ad domain' would allows users
to login giving just their usernames.
Ralph Boehme [Tue, 27 Nov 2012 17:04:29 +0000 (18:04 +0100)]
Don't convert AppleDouble v2 file of symlinks, delete it
Netatalk 2.x created AppleDouble files for symlinks. Netatalk's 3
autoconversion of AppleDouble files to AppleDouble metadata
extended attributes failed to do the conversion in ad_convert()
because some filesystem may not support EAs on symlinks.
The new behaviour is to ignore symlinks in ad_convert().
Frank Lahm [Tue, 20 Nov 2012 17:19:33 +0000 (18:19 +0100)]
Ensure pthread support compiler and linker flags are correct
On some platforms using AC_SEARCH_LIBS is not sufficient for
finding the linker flags for linking with a pthread library.
Add macro ax_pthread.m4 from GNU autoconf macro archive and
use the macro AX_PTHREAD.
Fix compiler and linker flags for afpd and libatalk.
Ralph Boehme [Thu, 22 Nov 2012 10:31:49 +0000 (11:31 +0100)]
Fix SIGHUP config reloading
Add SIGHUP handler to master 'netatalk' process and let it distribute
the signal to it's childs, eg afpd.
Add function afp_config_free() which releases ressources allocated
by afp_config_parse().
Additionally fix configinit()/configfree() which deal with ressources
only used in the afpd fileserver (eg sockets, zeroconf registration).
Fix an error in the mdns unregister code where pthread_kill() was
used but that somehow killed the whole process not just the mdns
thread. Use pthread_cancel() instead which seems to work.
Ralph Boehme [Mon, 26 Nov 2012 15:19:02 +0000 (16:19 +0100)]
Fix a ressource leak
Due to the ordering and multiplexing of data- and metadata handle
closing in ad_close(), a datafork lock handle was not released.
Releasing lock handles is now done when the logic fork counter
hits zero, not when the underlying filedescriptor referencing handle
count reaches zero.
Ralph Boehme [Fri, 23 Nov 2012 17:23:24 +0000 (18:23 +0100)]
Reloading volumes from config file was broken
load_volumes() is supposed to be a "reenetrant" function called from
various places in different programs (afpd, cnid_metad) to reload the
config for updating the volume list.
Fix the loop freeing volumes that are deleted.
Simplify the loop checking for paths and volume names in createvol().
This is also the loop which checks if a volume is already loaded
when config has been loaded before.
Ralph Boehme [Fri, 23 Nov 2012 09:23:27 +0000 (10:23 +0100)]
Remove lenght limitation of options like "valid users"
The options "valid users", "rolist" and others use the function
accessvol() for parsing the options string. accessfull uses
a static buffer limited to MAXPATHLEN which limits the maximum
length of these options.
Ralph Boehme [Fri, 23 Nov 2012 07:15:51 +0000 (08:15 +0100)]
"valid users" options and friends only use ',' as field delimiter
Netatalk 3 uses ',' and ' ' as field delimiter in the "valid users",
"invalid users", "rolist" and "rwlist" option for consistency with
other options that also allow the use of ' ' as field delimiter.
But as user and groupnames may contain spaces, we need to revert
to the Netatalk 2 behaviour where only ',' was used as delimiter.
Frank Lahm [Fri, 9 Nov 2012 11:48:53 +0000 (12:48 +0100)]
Fix pathname bug for FCE modified event
It's not guaranteed that cwd is the forks parent directory, thus
we can't use the fullpathname(forkname) wrapper.
Instead we use the DID stored in the ofork structure to dirlookup
the directory and use it's fullpath together with the fork's name.
Frank Lahm [Thu, 22 Nov 2012 08:58:02 +0000 (09:58 +0100)]
Use sigaction() instead of signal() for ignoring SIGPIPE
Move the code to ignore SIGPIPE from the DSI sesssion setup stage
to the main signal handling code in main() and avoid the use
of deprecated signal() function and use sigaction.
Frank Lahm [Sat, 17 Nov 2012 11:30:18 +0000 (12:30 +0100)]
Fix a bug where copying packages to a Netatalk share fails
The bug was caused by the 10.6 client trying to set the creation
date on a symlink in the package. This caused our setmetadata
routine to require a valid adouble handle for the symlink which is
not possible as symlink may not allow creating an EA, depending
on the filesystem. At least ZFS on Solaris doesnt.
The fix is to check whether the adouble handle creation failed
on a symlink and ignore the error.
Frank Lahm [Sat, 17 Nov 2012 13:14:17 +0000 (14:14 +0100)]
Always generate all initscripts
initscripts are now all created with variable substitution from
the templates, but they're not installed. Installation happens
only if the configure arg for the platform is used.
This should help packagers picking up an initscript for a package.
Frank Lahm [Fri, 9 Nov 2012 10:53:24 +0000 (11:53 +0100)]
FCE API change and cleanup
Change the FCE API by using a single function (fce_register()) as
a single point for callers to register events.
Remove all individual event functions.
Add types for events and file/directoy flag.
Use standard bool type instead of special defines FCE_TRUE/FALSE.
Frank Lahm [Wed, 24 Oct 2012 07:38:31 +0000 (09:38 +0200)]
Fix searching from OS X cmdline
Searching from OS X cmdline with `mdfind` will generate queries with
an empty query attribute array. In that case we must add a nil element
for every query match to the filemeta array.
Also fixed:
* marshalling of empty CNID arrays and filemeta
* return 0x23 instead of 0 when returning a non empty result list, this
is was traces of an OS X AFP server show
Frank Lahm [Tue, 23 Oct 2012 19:59:10 +0000 (21:59 +0200)]
Initialize Spotlight from session child
Spotlight initialisation must be perfomed in the session childs.
Wrap all Tracker calls between become_root()/unbecome_root().
Force bus SPARQL backend, as direct connections cause problems
with some SPARQL queries.
Frank Lahm [Wed, 17 Oct 2012 21:06:21 +0000 (23:06 +0200)]
Support for FTS and filename search
Map * and kMDItemTextContent to SPARQL FTS, map kMDItemDisplayName to SPARQL
nfo:fileName. The SPARQL query for the latter doesn't work from afpd, but
it does work with tracker-sparql.
Frank Lahm [Tue, 9 Oct 2012 16:23:57 +0000 (18:23 +0200)]
Fix a bug where Mac OS X ZIP archives can't be extracted on Netatalk shares
Mac OS X ZIP archives may contain split AppleDouble forks named "._XXX".
The client needs to be able to fully access these files but we currently
prevent access to any valid AppleDouble file whose name starts with "._".
In order to distinguish our own ._ files from the one created by OS X,
we look at the filler bytes: luckily OS X stores a string "Mac OS X" there
which can be used to detect them.
Frank Lahm [Thu, 11 Oct 2012 11:02:55 +0000 (13:02 +0200)]
Fix check for nested and duplicated volume paths
The previous modification was based on ensuring the volume paths are
'/' terminated. That allowed for a simple and quick implementation of
the neccessary tests. Unfortunately that completely broke the whole
directory machinery and cache.
This patch reverts the previous change and tries another simple
implementation that avoid copying the paths.
Frank Lahm [Wed, 10 Oct 2012 13:34:34 +0000 (15:34 +0200)]
Ensure the volume path is '/' terminated and allow nested volumes
The previos change to the way checking for duplicate and nested paths only
works if the path is terminated with a '/'.
Allow nested volumes. This was working in 2.2 and can be used eg for sharing
a ZFS snapshot directory of a volume. Afaict it only works with sane AFP
semantics by adding 'cnid sheme = tdb' to the nested volume which also
makes it read-only and by adding the name of the nested directory to
the veto name list.
Frank Lahm [Wed, 10 Oct 2012 11:51:34 +0000 (13:51 +0200)]
Remove unneccessary call to getcwd()
getcwd() was called after a chdir(vol->v_path) in order to copy
the path to vol->v_path. But as v_path is now already set in netatalk_conf.c
when parsing the volumes config, this is not neccessary anymore.