Your message dated Thu, 1 Jan 2009 22:33:58 +0100
with message-id <[email protected]>
and subject line Re: History file corruption on NFS
has caused the Debian Bug report #412875,
regarding zsh: corrupt history file under NFS because of the lack of locking
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
412875: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=412875
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: zsh
Version: 4.3.2-25
Severity: important

Under NFS, I often get corrupt history files (I use INC_APPEND_HISTORY).
After looking at the zsh source, though it has a lockhistfile function,
this function doesn't seem to lock the history file (it just calls link,
which isn't a NFS-safe system call). It should lock files with fcntl
(possibly with other mechanisms for very old machines, but personnally,
I don't mind).

I've attached a small program I wrote a few years ago to test fcntl
locking over NFS. See also:

  http://www.quepublishing.com/articles/article.asp?p=23618&seqNum=4&rl=1

(If no-one has worked on it, I'll probably look at that in a few days.)

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686-bigmem
Locale: LANG=POSIX, LC_CTYPE=en_US.ISO8859-1 (charmap=ISO-8859-1)

Versions of packages zsh depends on:
ii  debconf [debconf-2.0]       1.5.12       Debian configuration management sy
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries
ii  libncurses5                 5.5-5        Shared libraries for terminal hand

Versions of packages zsh recommends:
ii  libcap1                       1:1.10-14  support for getting/setting POSIX.
ii  libpcre3                      6.7-1      Perl 5 Compatible Regular Expressi

-- no debconf information
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>

int main (int argc, char *argv[])
{
  FILE *f;
  int fd;
  struct flock lck;

  if (argc != 3)
  {
    fprintf (stderr, "Usage: tfcntl <file> <sleeptime>\n");
    exit (1);
  }

  f = fopen (argv[1], "r+b");
  if (f == NULL)
  {
    fprintf (stderr, "tfcntl: can't open file %s\n", argv[1]);
    perror ("tfnctl");
    exit (2);
  }
  fd = fileno (f);

  memset (&lck, 0, sizeof (struct flock));
  lck.l_type = F_WRLCK;
  lck.l_whence = SEEK_SET;
  if (fcntl (fd, F_SETLK, &lck) == -1)
  {
    fprintf (stderr, "tfcntl: lock failed (errno = %d)\n", errno);
    perror ("tfnctl");
    exit (3);
  }

  sleep(atoi(argv[2]));

  memset (&lck, 0, sizeof (struct flock));
  lck.l_type = F_UNLCK;
  lck.l_whence = SEEK_SET;
  fcntl (fd, F_SETLK, &lck);

  return 0;
}

--- End Message ---
--- Begin Message ---
Version: 4.3.9-1

On Thu, Jan 1, 2009 at 18:27, Vincent Lefevre <[email protected]> wrote:

> Anyway, I could check that the upstream
> version (at least 4.3.8) solved the problem. So, something related
> to the history has been modified in the Debian, I suppose it is fixed
> as well in 4.3.9-1 (the HIST_FCNTL_LOCK option is listed).

Cool, thanks for checking. I closed the bug.


Richard


--- End Message ---

Reply via email to