From owner-freebsd-bugs Tue Jan 11 1:20: 4 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9925615191 for ; Tue, 11 Jan 2000 01:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA91335; Tue, 11 Jan 2000 01:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from mailgate.rz.uni-karlsruhe.de (mailgate.rz.uni-karlsruhe.de [129.13.64.97]) by hub.freebsd.org (Postfix) with ESMTP id 4682614F25 for ; Tue, 11 Jan 2000 01:16:08 -0800 (PST) (envelope-from p@i609.hadiko.de) Received: from nce2.hadiko.de (hadince2.hadiko.uni-karlsruhe.de [172.20.32.2]) by mailgate.rz.uni-karlsruhe.de with esmtp (Exim 3.02 #2) id 127xPL-0006Wg-00; Tue, 11 Jan 2000 10:16:07 +0100 Received: from i609.hadiko.de (hadii609.hadiko.uni-karlsruhe.de [172.20.44.159]) by nce2.hadiko.de (8.9.3/8.9.3) with ESMTP id KAA19968 for ; Tue, 11 Jan 2000 10:16:05 +0100 (MET) Received: (from p@localhost) by i609.hadiko.de (8.9.3/8.9.3) id KAA57093; Tue, 11 Jan 2000 10:16:05 +0100 (CET) (envelope-from p) Message-Id: <200001110916.KAA57093@i609.hadiko.de> Date: Tue, 11 Jan 2000 10:16:05 +0100 (CET) From: un1i@rz.uni-karlsruhe.de Reply-To: un1i@rz.uni-karlsruhe.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/16056: [patch] ldconfig skips all command line params. if one is nonexistent Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 16056 >Category: bin >Synopsis: [patch] ldconfig skips all command line params. if one is nonexistent >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 11 01:20:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Philipp Mergenthaler >Release: FreeBSD 4.0-CURRENT i386 >Organization: >Environment: FreeBSD i609.hadiko.de 4.0-CURRENT FreeBSD 4.0-CURRENT #120: Mon Jan 10 07:34:19 CET 2000 p@i609.hadiko.de:/usr/src/sys/compile/I609 i386 /usr/src/sbin/ldconfig/elfhints.c.orig: $FreeBSD: src/sbin/ldconfig/elfhints.c,v 1.2 1999/08/28 00:13:20 peter Exp $ >Description: If one (or more) of the directories/files given as command line parameters doesn't exist, ldconfig doesn't evaluate the others either. This doesn't happen in -aout mode or when giving a file to ldconfig where one directory entry doesn't exist. In these cases, ldconfig gives an error message and treats the other files/directories correctly, i.e. enters them into var/run/ld-elf.so.hints (resp. /var/run/ld.so.hints). >How-To-Repeat: ldconfig -r | wc 2 3 47 ldconfig /usr/lib /foo ldconfig: /foo: No such file or directory ldconfig -r | wc 2 3 47 #for comparison: echo /foo > ld echo /usr/lib >> ld ldconfig ld ldconfig -r | wc 67 199 2595 >Fix: --- elfhints.c.orig Tue Jan 11 09:37:29 2000 +++ elfhints.c Tue Jan 11 09:34:34 2000 @@ -216,12 +216,14 @@ for (i = 0; i < argc; i++) { struct stat s; - if (stat(argv[i], &s) == -1) - err(1, "%s", argv[i]); - if (S_ISREG(s.st_mode)) - read_dirs_from_file(hintsfile, argv[i]); - else - add_dir(hintsfile, argv[i]); + if (stat(argv[i], &s) == -1) { + warn("%s", argv[i]); + } else { + if (S_ISREG(s.st_mode)) + read_dirs_from_file(hintsfile, argv[i]); + else + add_dir(hintsfile, argv[i]); + } } write_elf_hints(hintsfile); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message