locking: put the Solaris share reservation after our locking stuff

Fix for Bug 560: put the Solaris share reservation after our locking stuff.
Note that this still leaves room for a race condition where between placing our own
locks above and putting the Solaris share move below another client puts a lock.
We then end up with set locks from above and return with an error code, the proper
fix requires a sane cleanup function for the error path in this function.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Merge branch 'sharemodes-bug560' into branch-netatalk-3-1
quotas: improve Linux quota behaviour

Signed-off-by: Ralph Boehme <rb@sernet.de>
xattrs on BSD, bug #562

Signed-off-by: Ralph Boehme <rb@sernet.de>
Support for using $u username variable in AFP volume definitions

* Prepare CNID backend dbd for user variable expansion
* Store a struct vol pointer in the CNID db handles.
* Pass three arguments to the CNID daemon:
  - the afp.conf volume section name
  - the volume path
  - an optional username

* Rename several struct elements by prefixing them with a struct tag,
  helps catching bad or missing assignments.

* Disable uniconv, doesn't use laod_volumes() and thus wont work with
  the new CNID dbd backend.

From FR#90.

Signed-off-by: Ralph Boehme <rb@sernet.de>
dbd: two fixes for new user option

* initialize user variable with NULL
* add -u to option summary line

Signed-off-by: Ralph Boehme <rb@sernet.de>
getvolbypath returns incorrect volume, bug #563

getvolbypath() would match a given path "/foo/barbaz" with an existing
volume path of "/foo/bar" because the strings where compared with
strnlen() where n is the length of "/foo/bar", ie we did a substring
match.

I faintly remember there was a reason for this, but I couldn't come up
with any sensible configuration of usage of dbd that would not also
work by simply using strcmp() instead of strmcmp().

Of course, in order for dbd to work with paths that included a
trailing slash, there's a need to adding some slash stripping code,
because our code (somehow) ensures (hopefully!) that in struct
vol.v_path is always stored with trailinsh slashes stripped.

Signed-off-by: Ralph Boehme <rb@sernet.de>
fd leak when using appledouble = v2, bug #554

With appledouble = v2 in afp.conf there is an fd leak in certain
circumstances while using the Finder, from Daniel Hazelbaker.

Signed-off-by: Ralph Boehme <rb@sernet.de>
New options that control whether dbus and Tracker are started

'start dbus' and 'start tracker', both default to yes, FR#91

Signed-off-by: Ralph Boehme <sloowfranklin@gmail.com>