aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1995-08-16 06:31:50 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1995-08-16 06:31:50 +0000
commit1c7895ac5416022e7c57c65ebd208fea3e989ae9 (patch)
tree576f1039906dfd2348b24529eeb4748e4f315d16 /sbin
parentce19262d8c9ad48dce6ea5279af4d10c6ee99506 (diff)
downloadsrc-1c7895ac5416022e7c57c65ebd208fea3e989ae9.tar.gz
src-1c7895ac5416022e7c57c65ebd208fea3e989ae9.zip
Reset the umask before creating the output file; otherwise running
ldconfig as root with a restrictive umask yielded ld.so.hints unreadable by the world (and thus useless).
Notes
Notes: svn path=/head/; revision=10076
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ldconfig/ldconfig.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c
index f6eb84164f14..1b3f8f27a285 100644
--- a/sbin/ldconfig/ldconfig.c
+++ b/sbin/ldconfig/ldconfig.c
@@ -27,7 +27,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: ldconfig.c,v 1.8 1994/06/16 13:38:32 pk Exp $
+ * $Id: ldconfig.c,v 1.10 1995/06/24 10:08:44 asami Exp $
*/
#include <sys/param.h>
@@ -317,6 +317,7 @@ buildhints()
bp->hi_ndewey = shp->ndewey;
}
+ umask(022); /* ensure the file will be worl-readable */
tmpfile = concat(_PATH_LD_HINTS, "+", "");
if ((fd = open(tmpfile, O_RDWR|O_CREAT|O_TRUNC, 0444)) == -1) {
warn("%s", _PATH_LD_HINTS);