From owner-p4-projects@FreeBSD.ORG Sun Feb 1 11:16:10 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1B77E1065672; Sun, 1 Feb 2009 11:16:10 +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 D04D4106564A for ; Sun, 1 Feb 2009 11:16:09 +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 BC7068FC13 for ; Sun, 1 Feb 2009 11:16:09 +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 n11BG9eS066982 for ; Sun, 1 Feb 2009 11:16:09 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 n11BG9Kh066980 for perforce@freebsd.org; Sun, 1 Feb 2009 11:16:09 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 1 Feb 2009 11:16:09 GMT Message-Id: <200902011116.n11BG9Kh066980@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 156989 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: Sun, 01 Feb 2009 11:16:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=156989 Change 156989 by rwatson@rwatson_freebsd_capabilities on 2009/02/01 11:15:48 Call init_rtld() before we evaluate whether or not a valid file descriptor has been passed in capability mode -- this improves our chances of printing an error message on a failure significantly. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf/rtld.c#6 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/libexec/rtld-elf/rtld.c#6 (text+ko) ==== @@ -346,6 +346,10 @@ aux_info[auxp->a_type] = auxp; } + /* Initialize and relocate ourselves. */ + assert(aux_info[AT_BASE] != NULL); + init_rtld((caddr_t) aux_info[AT_BASE]->a_un.a_ptr); + #ifdef IN_RTLD_CAP /* * In capability mode, the kernel has executed ld-elf-cap.so directly, @@ -367,10 +371,6 @@ } #endif - /* Initialize and relocate ourselves. */ - assert(aux_info[AT_BASE] != NULL); - init_rtld((caddr_t) aux_info[AT_BASE]->a_un.a_ptr); - /* XXXRW: Need to do something about program names in capability mode. */ __progname = obj_rtld.path; argv0 = argv[0] != NULL ? argv[0] : "(null)";