From owner-p4-projects@FreeBSD.ORG Thu Feb 5 23:36:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9E9EF1065673; Thu, 5 Feb 2009 23:36:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A2F7106566C for ; Thu, 5 Feb 2009 23:36:36 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 469268FC19 for ; Thu, 5 Feb 2009 23:36:36 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n15NaaTh026712 for ; Thu, 5 Feb 2009 23:36:36 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n15Naaw4026710 for perforce@freebsd.org; Thu, 5 Feb 2009 23:36:36 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Thu, 5 Feb 2009 23:36:36 GMT Message-Id: <200902052336.n15Naaw4026710@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 157245 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 23:36:37 -0000 http://perforce.freebsd.org/chv.cgi?CH=157245 Change 157245 by rwatson@rwatson_freebsd_capabilities on 2009/02/05 23:36:22 In a sandbox, access to the hints file is neither possible nor useful, that will be done by the proxy service. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf/rtld.c#10 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf/rtld.c#10 (text+ko) ==== @@ -93,7 +93,9 @@ static char *errmsg_save(void); static void *fill_search_info(const char *, size_t, void *); static char *find_library(const char *, const Obj_Entry *); +#ifndef IN_RTLD_CAP static const char *gethints(void); +#endif static void init_dag(Obj_Entry *); static void init_dag1(Obj_Entry *, Obj_Entry *, DoneList *); static void init_rtld(caddr_t); @@ -1045,7 +1047,9 @@ if ((pathname = search_library_path(name, ld_library_path)) != NULL || (refobj != NULL && (pathname = search_library_path(name, refobj->rpath)) != NULL) || +#ifndef IN_RTLD_CAP (pathname = search_library_path(name, gethints())) != NULL || +#endif (pathname = search_library_path(name, STANDARD_LIBRARY_PATH)) != NULL) return pathname; @@ -1134,6 +1138,7 @@ return def; } +#ifndef IN_RTLD_CAP /* * Return the search path from the ldconfig hints file, reading it if * necessary. Returns NULL if there are problems with the hints file, @@ -1172,6 +1177,7 @@ } return hints[0] != '\0' ? hints : NULL; } +#endif static void init_dag(Obj_Entry *root) @@ -2258,7 +2264,9 @@ path_enumerate(ld_library_path, fill_search_info, &args); path_enumerate(obj->rpath, fill_search_info, &args); +#ifndef IN_RTLD_CAP path_enumerate(gethints(), fill_search_info, &args); +#endif path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args); @@ -2286,9 +2294,11 @@ if (path_enumerate(obj->rpath, fill_search_info, &args) != NULL) return (-1); +#ifndef IN_RTLD_CAP args.flags = LA_SER_CONFIG; if (path_enumerate(gethints(), fill_search_info, &args) != NULL) return (-1); +#endif args.flags = LA_SER_DEFAULT; if (path_enumerate(STANDARD_LIBRARY_PATH, fill_search_info, &args) != NULL)