diff options
author | casper <none@none> | 2006-05-01 11:23:49 -0700 |
---|---|---|
committer | casper <none@none> | 2006-05-01 11:23:49 -0700 |
commit | 004388ebfdfe2ed7dfd2d153a876dfcc22d2c006 (patch) | |
tree | 9f3972760e2696f63065521871e50e1440bfbb75 /usr/src/lib/passwdutil/files_attr.c | |
parent | 0ade2cf005fcaecc5255dacf7d76683de855a9da (diff) | |
download | illumos-joyent-004388ebfdfe2ed7dfd2d153a876dfcc22d2c006.tar.gz |
4916205 libcmd should not use file operation routines from C library
6234782 Kerberos and GSSAPI should not use fopen
6259671 vold won't be killed by TERM signal when several removable devices are managed
6386770 pam_authenticate can fail if open files are >= 255 and the soft fd limit is greater than 256
6414401 Remove shadow stdio implementation obsoleted by PSARC 2006/162
6414404 __rpc_openchild never called and not exported by library
6416815 ON needs to be hardened against the 32-bit fopen/255 problem
--HG--
rename : usr/src/lib/libnsl/common/nsl_stdio_prv.c => deleted_files/usr/src/lib/libnsl/common/nsl_stdio_prv.c
rename : usr/src/lib/libnsl/include/nsl_stdio_prv.h => deleted_files/usr/src/lib/libnsl/include/nsl_stdio_prv.h
rename : usr/src/lib/libnsl/rpc/openchild.c => deleted_files/usr/src/lib/libnsl/rpc/openchild.c
rename : usr/src/lib/libnsl/rpc/xdr_stdio_prv.c => deleted_files/usr/src/lib/libnsl/rpc/xdr_stdio_prv.c
rename : usr/src/lib/libresolv2/req.flg => deleted_files/usr/src/lib/libresolv2/req.flg
rename : usr/src/lib/nsswitch/compat/req.flg => deleted_files/usr/src/lib/nsswitch/compat/req.flg
rename : usr/src/lib/nsswitch/files/req.flg => deleted_files/usr/src/lib/nsswitch/files/req.flg
rename : usr/src/lib/nsswitch/req.flg => deleted_files/usr/src/lib/nsswitch/req.flg
rename : usr/src/lib/nsswitch/user/req.flg => deleted_files/usr/src/lib/nsswitch/user/req.flg
Diffstat (limited to 'usr/src/lib/passwdutil/files_attr.c')
-rw-r--r-- | usr/src/lib/passwdutil/files_attr.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/usr/src/lib/passwdutil/files_attr.c b/usr/src/lib/passwdutil/files_attr.c index d5514d780d..9f1eab04f2 100644 --- a/usr/src/lib/passwdutil/files_attr.c +++ b/usr/src/lib/passwdutil/files_attr.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -156,7 +155,7 @@ private_getpwnam_r(const char *name, struct passwd *result, char *buffer, FILE *fp; int found; - if ((fp = fopen(PASSWD, "r")) == NULL) + if ((fp = fopen(PASSWD, "rF")) == NULL) return (NULL); found = 0; @@ -193,7 +192,7 @@ private_getspnam_r(const char *name, struct spwd *result, char *buffer, FILE *fp; int found; - fp = fopen(SHADOW, "r"); + fp = fopen(SHADOW, "rF"); if (fp == NULL) return (NULL); @@ -530,7 +529,7 @@ files_getattr(char *name, attrlist *items, pwu_repository_t *rep) debug("files_getattr: Get password history for %s ", name); - if ((history = fopen(HISTORY, "r")) == NULL) { + if ((history = fopen(HISTORY, "rF")) == NULL) { debug("files_getattr: %s not found", HISTORY); res = PWU_OPEN_FAILED; goto getattr_exit; @@ -927,12 +926,12 @@ files_update_shadow(char *name, struct spwd *spwd) } (void) fchown(tempfd, (uid_t)0, stbuf.st_gid); - if ((dst = fdopen(tempfd, "w")) == NULL) { + if ((dst = fdopen(tempfd, "wF")) == NULL) { err = PWU_OPEN_FAILED; goto shadow_exit; } - if ((src = fopen(SHADOW, "r")) == NULL) { + if ((src = fopen(SHADOW, "rF")) == NULL) { err = PWU_OPEN_FAILED; (void) fclose(dst); (void) unlink(SHADTEMP); @@ -1021,11 +1020,11 @@ files_update_passwd(char *name, struct passwd *pwd) err = PWU_OPEN_FAILED; goto passwd_exit; } - if ((dst = fdopen(tempfd, "w")) == NULL) { + if ((dst = fdopen(tempfd, "wF")) == NULL) { err = PWU_OPEN_FAILED; goto passwd_exit; } - if ((src = fopen(PASSWD, "r")) == NULL) { + if ((src = fopen(PASSWD, "rF")) == NULL) { err = PWU_OPEN_FAILED; (void) fclose(dst); (void) unlink(PASSTEMP); @@ -1163,12 +1162,12 @@ files_update_history(char *name, struct spwd *spwd) (void) fchown(tmpfd, (uid_t)0, (gid_t)0); /* get ready to copy */ - if (((src = fopen(HISTORY, "r")) == NULL) && + if (((src = fopen(HISTORY, "rF")) == NULL) && (errno != ENOENT)) { (void) unlink(HISTEMP); return (PWU_OPEN_FAILED); } - if ((dst = fdopen(tmpfd, "w")) == NULL) { + if ((dst = fdopen(tmpfd, "wF")) == NULL) { (void) fclose(src); (void) unlink(HISTEMP); return (PWU_OPEN_FAILED); |