Ralph Boehme [Thu, 18 Apr 2013 08:58:44 +0000 (10:58 +0200)]
Remove size check that required a costly fstat()
In case the client request count plus offset is large then the file,
we're supposed to send the available data and set AFP error to
AFPERR_EOF.
No need to use an extra fstat() for that, we can also simply check
the whether the amount of data read from the file matches the
requested amount.
Ralph Boehme [Tue, 26 Mar 2013 05:58:44 +0000 (06:58 +0100)]
Use ostat in the dircache
Fixes a possible crash in cname() where cname_mtouname calls
dirlookup() where the curdir is freed because the dircache
detected a dev/inode cache difference and evicted the object
from the cache.
Frank Lahm [Thu, 28 Feb 2013 07:02:48 +0000 (08:02 +0100)]
Enhance ACL mapping
Change globald ACL option 'map acl' to take the following options:
"none", "rights", "mode". The default is "rights".
none = no mapping, this resembles the previous false/no setting
rights = map ACLs to Finder UARights, this resembles the previous
true/yes setting. This is the default.
mode = map ACLs to Finder UARights and UNIX mode
Frank Lahm [Sat, 6 Apr 2013 15:08:37 +0000 (17:08 +0200)]
Fix an issue with filenames containing non-ASCII characters
Fix an issue with filenames containing non-ASCII characters that
lead to a failure setting the size of a files ressource fork.
This affected application like Adobe Photoshop where saving
files may fail. Fixes bug #511.
Ralph Boehme [Wed, 27 Mar 2013 16:18:22 +0000 (17:18 +0100)]
Opening files without metadata EA may result in broken metadata EA
ad_open_hf_ea() calls ad_flush() after initializing the new metadata,
but in ad_flush() ad_flush_ea() wasn't called because we didn't
yet increment the refcount.
Fix this by increasing the refcount in ad_open_hf() before calling
into ad_open_hf_ea(), decrementing it again in case of an error.
This ensure a valid metadata EA is created, but it still doesn't
set the CNID field values. Therefor in afp_openfork() we must check
whether the ad_open() created a metadata EA and then set the CNID
info.
Finally, check for malformed metadata EAs and delete them.
Ralph Boehme [Tue, 19 Mar 2013 14:26:03 +0000 (15:26 +0100)]
Increase IO size when sendfile() is not used
If sendfile() support is disabled, the current code results in an
IO size of 8k for transferring requested data to the client. Eg:
- client request to read DSI quantum size bytes (~250k) from a file
- afpd process loops read(8k, file) -> send(8k, client) until all
250k have been transferred
This should be modified to read the whole 250k in one swoop from the
file to a buffer and then send the whole buffer in one swoop to the
client.
Frank Lahm [Fri, 15 Mar 2013 08:19:40 +0000 (09:19 +0100)]
Use FreeBSD sendfile() capability to send protocol header
When transmitting file contents to a client with sendfile(), on
every platform other then Solaris (where we use sendfilev()), we
send the AFP the protocol header with an additional send with
MSG_MORE before calling sendfile().
FreeBSD sendfile() supports sending protocol header (and trailer)
data similarly to Solaris sendfilev().
Ralph Boehme [Mon, 11 Feb 2013 13:42:12 +0000 (14:42 +0100)]
Add dtrace provider 'afp' and dtrace probes
There are three dtrace probes:
- all AFP functions, passing the function name as argument
- AFP read and write, passing the IO size as argument
- all CNID functions
In order to be able to simply differintiate between disk IO and
network IO, replace all occurences of read and write on sockets
with send/recv, and replace the use of writev in the logging code
with two calls to write.
As a result, using dtrace probes for read() and write() syscalls
can be used to gather metrics for disk IO, while probing send(),
recv() and writev() probe network IO.
Ralph Boehme [Tue, 5 Feb 2013 16:25:27 +0000 (17:25 +0100)]
AFP statistics via dbus IPC
Fix PAM config installation. make distcheck was failing on Solaris
in uninstall, because the uninstall target ran some `rm -f PAMFILE`
where PAMFILE is hardcoded to /etc/pam.d. The resulting EPERM
causes the make target to fail.
Ralph Boehme [Tue, 19 Feb 2013 16:35:04 +0000 (17:35 +0100)]
Several fixes in ad_conv_dehex()
Testing whether we need to perform dehexing was done by a simple
strchr(':'), thus names only containing a single ':' would trigger
dehexing even though they might not contain the relevant strings
":2e" or :2f".
Also fix a ressource leak in bfindreplace() and simplify the
check whether a rename took place in enumerate.c.