Mercurial > illumos > illumos-gate
changeset 13245:24c98ecd58de
424 svr4pkg should remove ALLOW_EXCEPTION_LIST_PKG
Reviewed by: albert.lee@nexenta.com
Approved by: gwr@nexenta.com
author | Garrett D'Amore <garrett@nexenta.com> |
---|---|
date | Fri, 19 Nov 2010 14:02:57 -0800 |
parents | 664a5b7b18e3 |
children | fe5d6e0b0bce |
files | usr/src/cmd/svr4pkg/installf/main.c usr/src/cmd/svr4pkg/pkgchk/main.c usr/src/cmd/svr4pkg/pkginstall/main.c usr/src/cmd/svr4pkg/pkgmk/main.c usr/src/cmd/svr4pkg/pkgremove/main.c usr/src/cmd/svr4pkg/pkgtrans/main.c |
diffstat | 6 files changed, 16 insertions(+), 135 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/svr4pkg/installf/main.c Fri Nov 19 19:58:46 2010 +0100 +++ b/usr/src/cmd/svr4pkg/installf/main.c Fri Nov 19 14:02:57 2010 -0800 @@ -358,17 +358,6 @@ exit(1); } -#ifdef ALLOW_EXCEPTION_PKG_LIST - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ - /* Until 2.9, set it from the execption list */ - if (pkginst && exception_pkg(pkginst, LINK)) - set_nonABI_symlinks(); -#endif /* * This maps the client filesystems into the server's space. */
--- a/usr/src/cmd/svr4pkg/pkgchk/main.c Fri Nov 19 19:58:46 2010 +0100 +++ b/usr/src/cmd/svr4pkg/pkgchk/main.c Fri Nov 19 14:02:57 2010 -0800 @@ -449,18 +449,6 @@ for (n = 0; pkg[n]; n++) { char locenv[PATH_MAX]; - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ -#ifdef ALLOW_EXCEPTION_PKG_LIST - /* Until 2.9, set it from the execption list */ - if (exception_pkg(pkg[n], LINK)) - set_nonABI_symlinks(); -#endif - if (pkgfmt) (void) printf( gettext(MSG_CHK_DIR), pkg[n], device);
--- a/usr/src/cmd/svr4pkg/pkginstall/main.c Fri Nov 19 19:58:46 2010 +0100 +++ b/usr/src/cmd/svr4pkg/pkginstall/main.c Fri Nov 19 14:02:57 2010 -0800 @@ -197,11 +197,6 @@ #define MALSIZ 4 /* best guess at likely maximum value of MAXINST */ #define LSIZE 256 /* maximum line size supported in copyright file */ -#ifdef ALLOW_EXCEPTION_PKG_LIST -#define SCRIPT 0 /* which exception_pkg() pkg list to use (SCRIPTS) */ -#define LINK 1 /* which exception_pkg() pkg list to use (SYMLINKS) */ -#endif - #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ #define TEXT_DOMAIN "SYS_TEST" #endif @@ -1246,43 +1241,11 @@ non_abi_scripts = 1; } -#ifdef ALLOW_EXCEPTION_PKG_LIST - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ - - else if (exception_pkg(srcinst, SCRIPT)) { - /* - * Until on1095, set it from exception package names as - * well. - */ - putparam("NONABI_SCRIPTS", "TRUE"); - script_in = PROC_XSTDIN; - non_abi_scripts = 1; - } -#endif - /* Set symlinks to be processed the old way */ if (abi_sym_ptr && strncasecmp(abi_sym_ptr, "TRUE", 4) == 0) { set_nonABI_symlinks(); } - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ - -#ifdef ALLOW_EXCEPTION_PKG_LIST - else if (exception_pkg(srcinst, LINK)) { - /* Until 2.9, set it from the execption list */ - putparam("PKG_NONABI_SYMLINKS", "TRUE"); - set_nonABI_symlinks(); - } -#endif + /* * At this point, script_in, non_abi_scripts & the environment are * all set correctly for the ABI status of the package.
--- a/usr/src/cmd/svr4pkg/pkgmk/main.c Fri Nov 19 19:58:46 2010 +0100 +++ b/usr/src/cmd/svr4pkg/pkgmk/main.c Fri Nov 19 14:02:57 2010 -0800 @@ -454,19 +454,6 @@ quit(1); } - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ - -#ifdef ALLOW_EXCEPTION_PKG_LIST - /* Until 2.9, set it from the execption list */ - if (exception_pkg(pkginst, LINK)) - set_nonABI_symlinks(); -#endif - if ((pkgname = getenv("NAME")) == NULL) { progerr(gettext(ERR_NOPARAM), "NAME", svept->path); quit(1);
--- a/usr/src/cmd/svr4pkg/pkgremove/main.c Fri Nov 19 19:58:46 2010 +0100 +++ b/usr/src/cmd/svr4pkg/pkgremove/main.c Fri Nov 19 14:02:57 2010 -0800 @@ -76,11 +76,6 @@ #define DEFPATH "/sbin:/usr/sbin:/usr/bin" -#ifdef ALLOW_EXCEPTION_PKG_LIST -#define SCRIPT 0 /* Tells exception_pkg() which pkg list to use */ -#define LINK 1 -#endif - #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ #define TEXT_DOMAIN "SYS_TEST" #endif @@ -728,38 +723,10 @@ /* * If pkginfo says it's not compliant then set non_abi_scripts. - * Oh, for two releases, set it from exception package names as - * well. */ - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ - -#ifdef ALLOW_EXCEPTION_PKG_LIST - if (exception_pkg(pkginst, SCRIPT) || - (abi_comp_ptr && strncmp(abi_comp_ptr, "TRUE", 4) == 0)) - script_in = PROC_XSTDIN; -#else if (abi_comp_ptr && strncmp(abi_comp_ptr, "TRUE", 4) == 0) { script_in = PROC_XSTDIN; } -#endif - /* - * ********************************************************************* - * this feature is removed starting with Solaris 10 - there is no built - * in list of packages that should be run "the old way" - * ********************************************************************* - */ - -#ifdef ALLOW_EXCEPTION_PKG_LIST - /* Until 2.9, set it from the execption list */ - if (exception_pkg(pkginst, LINK)) { - set_nonABI_symlinks(); - } -#endif /* * Since this is a removal, we can tell whether it's absolute or
--- a/usr/src/cmd/svr4pkg/pkgtrans/main.c Fri Nov 19 19:58:46 2010 +0100 +++ b/usr/src/cmd/svr4pkg/pkgtrans/main.c Fri Nov 19 14:02:57 2010 -0800 @@ -27,6 +27,9 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ +/* + * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + */ #include <locale.h> #include <libintl.h> @@ -40,6 +43,7 @@ #include <pkglocs.h> #include <libadm.h> #include <libinst.h> +#include <messages.h> static int options; static keystore_handle_t keystore = NULL; @@ -47,13 +51,7 @@ static void usage(void); static void trap(int signo); -#define PASSWD_CMDLINE \ - "## WARNING: USING <%s> MAKES PASSWORD " \ - "VISIBLE TO ALL USERS." - -#define PASSPHRASE_PROMPT "Enter keystore password:" #define KEYSTORE_OPEN "Retrieving signing certificates from keystore <%s>" -#define PARAM_LEN "Parameter <%s> too long" int main(int argc, char *argv[]) @@ -67,7 +65,7 @@ boolean_t create_sig = B_FALSE; char *homedir = NULL; PKG_ERR *err; - int ret, len, homelen; + int ret, len; (void) setlocale(LC_ALL, ""); @@ -116,7 +114,7 @@ * passwords on the command line are highly * insecure. complain. */ - logerr(gettext(PASSWD_CMDLINE), "pass:<pass>"); + logerr(PASSWD_CMDLINE, "pass:<pass>"); } break; @@ -132,9 +130,7 @@ (void) signal(SIGQUIT, trap); (void) signal(SIGTERM, trap); (void) signal(SIGPIPE, trap); -#ifndef SUNOS41 (void) signal(SIGPWR, trap); -#endif if ((argc-optind) < 2) { usage(); @@ -150,33 +146,24 @@ if (geteuid() == 0) { /* we are superuser, so use their keystore */ keystore_file = PKGSEC; - } else { - if ((homedir = getenv("HOME")) == NULL) { + + } else if ((homedir = getenv("HOME")) == NULL) { /* * not superuser, but no home dir, so * use superuser's keystore */ - keystore_file = PKGSEC; - } else { - /* $HOME/.pkg/security\0 */ - homelen = strlen(homedir) + 15; - keystore_file = - malloc(strlen(homedir) + 15); - if (((len = snprintf(keystore_file, - homelen, "%s/%s", homedir, - ".pkg/security")) < 0) || - (len >= homelen)) { - logerr(gettext(PARAM_LEN), - "$HOME"); - quit(1); - } - } + keystore_file = PKGSEC; + + } else if (asprintf(&keystore_file, "%s/.pkg/security", + homedir) < 0) { + logerr(ERR_MEM); + quit(1); } } logerr(gettext(KEYSTORE_OPEN), keystore_file); - set_passphrase_prompt(gettext(PASSPHRASE_PROMPT)); + set_passphrase_prompt(MSG_PASSPROMPT); /* open keystore for reading */ if (open_keystore(err, keystore_file, get_prog_name(),