From f0ed8401e854e1cbd23b2fb5dca5e88dec2df7c4 Mon Sep 17 00:00:00 2001 From: Ben Myers Date: Fri, 3 Apr 2009 15:13:10 -0400 Subject: Mountd should use separate lockfiles Mountd keeps file descriptors used for locks separate from those used for io and seems to assume that the lock will only be released on close of the file descriptor that was used with fcntl. Actually the lock is released when any file descriptor for that file is closed. When setexportent() is called after xflock() he closes and reopens the io file descriptor and defeats the lock. This patch fixes that by using a separate file for locking, cleaning them up when finished. Signed-off-by: Ben Myers Signed-off-by: Steve Dickson --- support/export/rmtab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'support/export/rmtab.c') diff --git a/support/export/rmtab.c b/support/export/rmtab.c index e11a22a..b49e1aa 100644 --- a/support/export/rmtab.c +++ b/support/export/rmtab.c @@ -57,7 +57,7 @@ rmtab_read(void) file. */ int lockid; FILE *fp; - if ((lockid = xflock(_PATH_RMTAB, "w")) < 0) + if ((lockid = xflock(_PATH_RMTABLCK, "w")) < 0) return -1; rewindrmtabent(); if (!(fp = fsetrmtabent(_PATH_RMTABTMP, "w"))) { -- cgit