Summary: | Use MD5 digest for socket name | ||||||
---|---|---|---|---|---|---|---|
Product: | Claws Mail (GTK 2) | Reporter: | ratinox | ||||
Component: | Other | Assignee: | users | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | enhancement | ||||||
Priority: | P3 | ||||||
Version: | 3.9.1 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
ratinox
2012-11-28 20:03:54 UTC
Created attachment 1199 [details]
Include MD5 digest in lock socket name.
Quick review: - don't remove uid from socket name, just add the MD5, otherwise two different users could clash using the same dir. Agreed that this wouldn't be a common setup, but it costs very little to keep it and helps identifying stale sockets. - unified diff format preferred ;-) Hi, So, CVS now has rc_dir canonicalized. Two issues with that patch though: 1) unified diff please 2) the "normal", no alternate-config-dir-case socket is going to change name with that patch (from, for my example, /tmp/claws-mail-1000 to /tmp/claws-mail-SOMEHASH. That's a big problem for everyone who's going to upgrade his distro some day while Claws is running with a /tmp/claws-mail-1000 socket. After the upgrade, he'll click a mailto link in his browser, the new binary will see no /tmp/claws-mail-SOMEHASH socket, so will create it and start, and the poor user will have two claws-mail instances battling for his ~/.claws-mail. There is no doubt that data loss would occur. So, TL;DR for 2) is that the normal socket for normal RC dir must not change name until the sun goes red giant on us :) The claws-mail-uid/md5hashsocket which has been proposed on the users list solves this problem, as clashes with existing claws-mail-uid socket files. Furthermore, on detecting a file instead of a directory new versions can shutdown previous through the socket (probably asking/warning user) and continue loading. No fight would happen, and no need to wait for such astronomical events ;) Changes related to this bug have been committed. Please check latest CVS and update the bug accordingly. You can also get the patch from: http://www.claws-mail.org/tracker/ 2012-12-02 [colin] 3.9.0cvs36 * src/main.c Move control sockets inside their own directory, $TMPDIR/claws-mail-$UID/, and name them after the configuration directory md5 hash. That allows - cleaner separation of sockets and config dirs in case of alternate config directories - forward migration is handled: if $TMPDIR/claws-mail-$UID exists as a socket, use it to control the running entity - backwards migration is handled: starting an old Claws Mail version will bail out as creating the legacy socket won't be possible. - migration for alternate-config-dirs is not handled, which could be mentioned in release notes. Fixes bug #2828, "Use MD5 digest for socket name" |