NetBSD Problem Report #37

From gnats  Sun Dec  5 15:02:06 1993
Received: from forte (forte.mathematik.uni-Bremen.de [134.102.232.1]) by sun-lamp.cs.berkeley.edu (8.6.4/8.6.4) with ESMTP id PAA11134 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Sun, 5 Dec 1993 15:02:02 -0800
Message-Id: <199312052301.AAA07113@forte>
Date: Mon, 6 Dec 1993 00:01:49 +0100
From: thomas@mathematik.uni-Bremen.de
Reply-To: thomas@mathematik.uni-Bremen.de
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: at lock file created with random modes
X-Send-Pr-Version: 3.01.6

>Number:         37
>Category:       bin
>Synopsis:       at lock file created with random modes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 05 15:05:04 +0000 1993
>Closed-Date:    Wed Dec 08 13:50:05 +0000 1993
>Last-Modified:  
>Originator:     Thomas Eberhardt
>Release:        
>Organization:
CeVis, University of Bremen, Germany
>Environment:

System: NetBSD ed209 0.9a ED209#0 i386

Machine: i386
>Description:
	The lock file for at is created with random modes because of a
	missing argument to open.  Also IMHO the lock structure for
	the fcntl F_SETLKW call should not be left uninitialized.
>How-To-Repeat:

>Fix:
*** at.c-	Sun Dec  5 12:36:38 1993
--- at.c	Sun Dec  5 23:53:49 1993
***************
*** 184,190 ****

  	PRIV_START

! 	    if ((lockdes = open(_PATH_LOCKFILE, O_WRONLY | O_CREAT)) < 0)
  		perr2("Cannot open lockfile ", _PATH_LOCKFILE);

  	act.sa_handler = alarmc;
--- 184,190 ----

  	PRIV_START

! 	    if ((lockdes = open(_PATH_LOCKFILE, O_WRONLY | O_CREAT, 0600)) < 0)
  		perr2("Cannot open lockfile ", _PATH_LOCKFILE);

  	act.sa_handler = alarmc;
***************
*** 197,202 ****
--- 197,206 ----
  	 */
  	sigaction(SIGALRM, &act, NULL);
  	alarm(ALARMC);
+ 	lock.l_type = F_WRLCK;
+ 	lock.l_whence = SEEK_SET;
+ 	lock.l_start = 0;
+ 	lock.l_len = 0;
  	fcntl(lockdes, F_SETLKW, &lock);
  	alarm(0);

>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->feedback
State-Changed-By: jtc
State-Changed-When: Mon Dec  6 11:33:29 1993
State-Changed-Why:
Fix checked in by cgd.

State-Changed-From-To: feedback->closed
State-Changed-By: jtc
State-Changed-When: Wed Dec  8 13:50:05 1993
State-Changed-Why:
Unfortunately, didn't ask for feedback.  The fix seems to work.  If there
is another bug, it will be submitted again.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.