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 [Thu, 23 Aug 2012 10:20:00 +0000 (12:20 +0200)]
Fix data corruption bug
Received data from the client was written to the read-ahead buffer
from dsi_peek() which caused data corrution.
Fix is: change the DSI command buffer from static 8192 bytes to
an allocated buffer of size DSI quantum and use this buffer in
dsi_write/write_fork. That just requires dsi_writeinit to use
memmove instead of memcpy, because now we use the same buffer.
The bug is caused by passing ADFLAGS_NOHF to ad_open() when opening a
files data fork. For files without metadata then ad_open() doesn't
return an error for the ADFLAGS_HF request to open the metadata. As a
result of the successfull ad_open return AFPFORK_META is set in the
fork struct, which implies the meta is open. Later afp_close looked at
that flag and added ADFLAGS_HF to ad_close flags, resulting in a
refcount decement of 2 although the ad_open only incremented by 1. Eg
opening such a file twice, then closing once, close the fork. Later
operations on the other still open fork fail.
afp_openfork opens the fork and metadata in one call to ad_open which
lead to an insane if/else and error checking code path. I've
seperated this in two distincs calls to ad_open(): the first opens the
fork (data or ressource), the second opens the metadata. This gives a
cleaner code path but it required a subtle modifications to the way we
refcount and flag forks as open inside ad_open: currently we use the
fd and it's recount but these do not differente between open data and
metadata in the case of adouble:ea as both use the data fork handle,
fd and it's refcount. Now we add real refcounting for the forks
different from the recount on the file fd by adding three refcounting
variables to struct.adouble and change the AD_XXX_OPEN macros to use
these.
Frank Lahm [Fri, 3 Aug 2012 06:01:07 +0000 (08:01 +0200)]
sendfile on Solaris may return EINTR with bytes written https://issues.apache.org/bugzilla/show_bug.cgi?id=44550 http://wesunsolve.net/bugid/id/6408517
Frank Lahm [Fri, 27 Jul 2012 10:01:35 +0000 (12:01 +0200)]
Reset signal handlers and alarm timer after successfull PAM authentication
Fixes a problem with AFP disconnects caused by pam_smbpass.so messing with
our handlers and timer.
Thomas Johnson [Sun, 15 Jul 2012 15:55:20 +0000 (17:55 +0200)]
LDAP: Support for Active Directory objectGUID
Adds optional "ldap uuid encoding = string | ms-guid" parameter to afp.conf,
allowing for usage of the binary objectGUID fields from Active Directory.
If left unspecified, "string" is the default, which passes through the ASCII
UUID returned by most other LDAP stores. If set to ms-guid, the internal UUID
representation is converted to and from the binary format used in the
objectGUID attribute found on objects in Active Directory when interacting
with the server.