[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#2408: Pine does not correctly lock mailboxes

Package: pine
Version: 3.91-3

richard@sfere:mail$ ls -l /usr/bin/pine
-rwxr-xr-x   1 root     root       860164 May 14  1995 /usr/bin/pine*

Pine is not setgid mail and therefore can't lock mailboxes.
(/var/spool/mail is 2775 root.mail.)  Therefore if delivery occurs at
the wrong time, mail will be lost.

strace'ing it suggests that it attempts to lock it but then ignores
the failure response, though I don't know if I'm interpreting this

10314 uname({sys="Linux", node="sfere", ...}) = 0
10314 open("/var/spool/mail/richard.lock.825271063.10314.sfere", O_WRONLY|O_CREAT|O_EXCL, 0666) = -1 EACCES (Permission denied)
10314 stat("/var/spool/mail/richard.lock.825271063.10314.sfere", 0xbfffe718) = -1 ENOENT (No such file or directory)
10314 open("/var/spool/mail/richard", O_RDWR) = 5
10314 fcntl(5, F_SETLKW, {type=F_SHLCK, whence=SEEK_SET, start=0, len=0}) = 0
10314 fstat(5, {st_mode=S_IFREG|0660, st_size=368, ...}) = 0
10314 lseek(5, 0, SEEK_SET)             = 0
10314 read(5, "From richard Sun Feb 25 17:57:42"..., 368) = 368

Looks like it's backing off to fcntl based locking, which is wrong and
won't work; see mailers.txt, we should be using .lock-convention

I don't know if making Pine setgid mail would have any other
detrimental side-effects.

Richard Kettlewell
http://www.elmail.co.uk/staff/richard/                    richard@uk.geeks.org
                                        Take the longest day/Waste it all away
                                      I can't stand it/But I can't do anything

Reply to: