nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] dot locking broken?

2015-02-13 08:00:56
Marcin wrote:

Here's what I'd do:

diff --git a/sbr/lock_file.c b/sbr/lock_file.c
index a8a9811..68205ac 100644
--- a/sbr/lock_file.c
+++ b/sbr/lock_file.c
@@ -561,8 +561,8 @@ lockit (struct lockinfo *li)
     curlock = li->curlock;

     if ((tmpfile = m_mktemp(li->tmplock, &fd, NULL)) == NULL) {
-        advise(NULL, "unable to create temporary file in %s", li->tmplock);
-       return -1;
+        adios(NULL, "unable to create temporary file in %s", li->tmplock);
+       /* NOTREACHED */
     }

 #if 0

it affects all locking clients, but not other users of m_mktemp().

With a failing setgid() (fixed by another patch already) I am getting:

% inc
inc: unable to set group to 6 setegid: Operation not permitted
inc: unable to create temporary file in /var/mail/,LCK.XXXXXX
inc: unable to set group to 6 setegid: Operation not permitted
%

instead of

% inc
inc: unable to set group to 6 setegid: Operation not permitted
inc: unable to create temporary file in /var/mail/,LCK.XXXXXX
(1 second)
inc: unable to create temporary file in /var/mail/,LCK.XXXXXX
(1 second)
inc: unable to create temporary file in /var/mail/,LCK.XXXXXX
(1 second)
inc: unable to create temporary file in /var/mail/,LCK.XXXXXX
(1 second)
inc: unable to lock and fopen /var/mail/sapern
inc: unable to set group to 6 setegid: Operation not permitted
%

Which configuration (with or without your patch above) produces the
following line?

inc: unable to lock and fopen /var/mail/sapern

David

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>