Re-add umask() setting, and parameterize it so that pkgsrc/bootstrap based

pkgsrc platforms can override the value.
This commit is contained in:
tv 2004-04-09 18:27:48 +00:00
parent 9b2972c08e
commit 94b8c2cf60
3 changed files with 11 additions and 6 deletions

View File

@ -1,11 +1,11 @@
/* $NetBSD: perform.c,v 1.95 2004/03/29 21:41:39 tv Exp $ */
/* $NetBSD: perform.c,v 1.96 2004/04/09 18:27:48 tv Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.95 2004/03/29 21:41:39 tv Exp $");
__RCSID("$NetBSD: perform.c,v 1.96 2004/04/09 18:27:48 tv Exp $");
#endif
#endif
@ -704,6 +704,7 @@ ignore_replace_depends_check:
if (!NoRecord && !Fake) {
char contents[FILENAME_MAX];
umask(DEF_UMASK);
#ifndef __INTERIX
if (getuid() != 0)
warnx("not running as root - trying to record install anyway");

View File

@ -1,11 +1,11 @@
/* $NetBSD: perform.c,v 1.38 2003/09/02 07:34:53 jlam Exp $ */
/* $NetBSD: perform.c,v 1.39 2004/04/09 18:27:48 tv Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.38 2003/09/02 07:34:53 jlam Exp $");
__RCSID("$NetBSD: perform.c,v 1.39 2004/04/09 18:27:48 tv Exp $");
#endif
#endif
@ -326,7 +326,7 @@ pkg_perform(lpkg_head_t *pkgs)
/* Make first "real contents" pass over it */
check_list(Home, &plist, basename_of(pkg));
(void) umask(022); /* make sure gen'ed directories, files
(void) umask(DEF_UMASK);/* make sure gen'ed directories, files
* don't have group or other write bits. */
/* Now put the release specific items in */

View File

@ -1,4 +1,4 @@
/* $NetBSD: lib.h,v 1.67 2004/01/15 09:33:39 agc Exp $ */
/* $NetBSD: lib.h,v 1.68 2004/04/09 18:27:48 tv Exp $ */
/* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
@ -56,6 +56,10 @@
#define OPSYS_NAME "NetBSD"
#endif
#ifndef DEF_UMASK
#define DEF_UMASK 022
#endif
/* Usually "rm", but often "echo" during debugging! */
#define REMOVE_CMD "rm"