Subject: bin/17885: open() with O_CREAT but no mode argument
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin J. Laubach <mjl@celery.emsi.priv.at>
List: netbsd-bugs
Date: 08/08/2002 23:48:00
>Number:         17885
>Category:       bin
>Synopsis:       open() with O_CREAT but no mode argument
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 08 14:49:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Martin J. Laubach
>Release:        NetBSD 1.6D
>Organization:
>Environment:
System: NetBSD celery.emsi.priv.at 1.6D NetBSD 1.6D (CELERY) #8: Mon Aug 5 04:53:51 CEST 2002 mjl@celery.emsi.priv.at:/home/users/mjl/netbsd/src/sys/arch/macppc/compile/CELERY macppc
Architecture: powerpc
Machine: macppc
>Description:

  An automated audit of our source tree brought the list below
of open() calls with O_CREAT but no third (mode) argument, thus
using some random value on the stack as the (new) file modes.

  This PR is mainly to remind me to look at that, but if someone
beats me to it, feel free!



! ./crypto/dist/heimdal/appl/dceutils/k5dcecon.c: (("/tmp/k5dce.debug",O_WRONLY|O_CREAT|O_APPEND))
! ./crypto/dist/heimdal/appl/kauth/kauth.c: ((tf, O_CREAT|O_EXCL|O_RDWR))
! ./crypto/dist/krb4/appl/afsutil/pagsh.c: ((tf, O_CREAT|O_EXCL|O_RDWR))
! ./crypto/dist/krb4/appl/kauth/kauth.c: ((tf, O_CREAT|O_EXCL|O_RDWR))
! ./lib/libc/gen/utmpx.c: ((fname, O_RDWR|O_CREAT|O_EXLOCK, 0, DB_HASH, NULL))
! ./usr.sbin/sup/source/supcmeat.c: ((tname, O_WRONLY | O_CREAT | O_TRUNC))
! ./gnu/dist/gdb/29k-share/udi/udip2soc.c: ((soc_con[cnt].tip_string, O_CREAT))
! ./gnu/dist/toolchain/gcc/collect2.c: ((redir, O_WRONLY | O_TRUNC | O_CREAT))
! ./gnu/dist/toolchain/gdb/29k-share/udi/udip2soc.c: ((soc_con[cnt].tip_string, O_CREAT))

>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: