Bug 574056

Summary: akonadi socket not network-fs friendly
Product: [Fedora] Fedora Reporter: Rex Dieter <rdieter>
Component: akonadiAssignee: Kevin Kofler <kevin>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: fedora, jreznik, kevin, ltinkl, rdieter, smparrish, stijn, than, tuju
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-13 13:58:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rex Dieter 2010-03-16 13:53:24 UTC
akonadi seems to make a socket by default at
~/.local/share/akonadi/akonadiserver.socket

which is not cool for network (e.g. nfs) $HOME

Comment 1 Rex Dieter 2010-03-16 13:56:17 UTC
https://bugs.kde.org/show_bug.cgi?id=179006#c5

contains a suggestion to customize socket location with by adding to akonadiserverrc:
[Connection]
SocketDirectory=/tmp/akonadi-myuser/

Comment 2 Kevin Kofler 2010-03-16 13:59:23 UTC
Yet upstream claims Akonadi works fine with NFS home. It seems they overlooked this particular detail.

Comment 3 Rex Dieter 2010-03-16 16:14:05 UTC
See also fedora-devel thread,
http://lists.fedoraproject.org/pipermail/devel/2010-March/133634.html

and another related upstream related bug/comment,
https://bugs.kde.org/show_bug.cgi?id=182292#c6

Comment 4 Kevin Kofler 2010-03-16 23:52:55 UTC
The problem with /tmp/akonadi-`whoami` is that it's a predictable name in what's usually a world-writable directory and so can be used for symlink attacks, or at least DoS attacks.

Using some unique name (e.g. from mkdtemp) and symlinking it to some fixed name below the home directory is probably the safest solution.

Comment 5 Juha Tuomala 2010-03-17 11:05:53 UTC
(In reply to comment #4)
> The problem with /tmp/akonadi-`whoami` is that it's a predictable name in
> what's usually a world-writable directory and so can be used for symlink
> attacks, or at least DoS attacks.

[Connection]                                                                                                                SocketDirectory=$(echo -c "echo /tmp/akonadi-$USER-$RANDOM-$RANDOM-$RANDOM/" )

> Using some unique name (e.g. from mkdtemp) and symlinking it 
> to some fixed name below the home directory is probably 
> the safest solution.    

How many chained symlinks do you recommend for added security? Three like in triple DES?

Comment 6 Kevin Kofler 2010-03-20 06:26:53 UTC
> How many chained symlinks do you recommend for added security? Three like in
> triple DES?

Nonsense. Further levels of symlinks don't add any security. You don't understand the issue at all! You just need 2 items:
* the directory in /tmp, which is a local directory, so it can contain Unix sockets, but which MUST NOT have a predictable file name because /tmp is world-writable.
* the symlink in ~, which is writable only by you (if your system setup is not screwed up), so it can safely use a predictable name, which can then be referenced in config files.

If my explanation is to terse for you, maybe you'll understand Lennart Poettering's better:
http://lists.fedoraproject.org/pipermail/devel/2010-March/133880.html

Comment 7 Kevin Kofler 2010-03-20 06:28:30 UTC
Oh, and:
SocketDirectory=$(echo -c "echo /tmp/akonadi-$USER-$RANDOM-$RANDOM-$RANDOM/" )
is extremely unreliable as the value of that config entry will be different each time it is evaluated. Please don't even THINK of such a broken setup.

Comment 9 Rex Dieter 2011-10-13 13:58:51 UTC
This seems resolved satisfactorily in akonadi-1.6.x, uses a scheme similar to kde symlinks put into ~/.kde/