Index: head/security/nss/files/patch-bug301986 =================================================================== --- head/security/nss/files/patch-bug301986 (revision 479328) +++ head/security/nss/files/patch-bug301986 (revision 479329) @@ -1,11 +1,11 @@ ---- lib/util/nssilckt.h~ +--- lib/util/nssilckt.h.orig 2018-08-31 12:55:53 UTC +++ lib/util/nssilckt.h @@ -163,7 +163,7 @@ typedef enum { ** Declare the trace record */ struct pzTrace_s { - PRUint32 threadID; /* PR_GetThreadID() */ + pthread_t threadID; /* PR_GetThreadID() */ nssILockOp op; /* operation being performed */ nssILockType ltype; /* lock type identifier */ PRIntervalTime callTime; /* time spent in function */ Index: head/security/nss/files/patch-const =================================================================== --- head/security/nss/files/patch-const (revision 479328) +++ head/security/nss/files/patch-const (revision 479329) @@ -1,48 +1,54 @@ ---- cmd/modutil/modutil.h Sun Apr 25 11:02:47 2004 -+++ cmd/modutil/modutil.h Fri Jul 22 17:35:20 2005 -@@ -53,6 +53,6 @@ +--- cmd/modutil/modutil.h.orig 2018-08-31 12:55:53 UTC ++++ cmd/modutil/modutil.h +@@ -22,8 +22,8 @@ #include "error.h" + Error LoadMechanismList(void); -Error FipsMode(char *arg); -Error ChkFipsMode(char *arg); +Error FipsMode(const char *arg); +Error ChkFipsMode(const char *arg); Error AddModule(char *moduleName, char *libFile, char *ciphers, - char *mechanisms, char* modparms); ---- cmd/modutil/pk11.c Sun Apr 25 11:02:47 2004 -+++ cmd/modutil/pk11.c Fri Jul 22 17:36:48 2005 -@@ -53,5 +53,5 @@ + char *mechanisms, char *modparms); + Error DeleteModule(char *moduleName); +--- cmd/modutil/pk11.c.orig 2018-08-31 12:55:53 UTC ++++ cmd/modutil/pk11.c +@@ -16,7 +16,7 @@ + * disable FIPS mode on the internal module. */ Error -FipsMode(char *arg) +FipsMode(const char *arg) { char *internal_name; + @@ -25,16 +25,18 @@ FipsMode(char *arg) internal_name = PR_smprintf("%s", SECMOD_GetInternalModule()->commonName); if (SECMOD_DeleteInternalModule(internal_name) != SECSuccess) { - PR_fprintf(PR_STDERR, "%s\n", SECU_Strerror(PORT_GetError())); + PR_fprintf(PR_STDERR, "FipsMode(true): %s (%s)\n", SECU_Strerror(PORT_GetError()), internal_name); PR_smprintf_free(internal_name); PR_fprintf(PR_STDERR, errStrings[FIPS_SWITCH_FAILED_ERR]); return FIPS_SWITCH_FAILED_ERR; } - PR_smprintf_free(internal_name); if (!PK11_IsFIPS()) { + PR_fprintf(PR_STDERR, "FipsMode(true): in module %s", internal_name); + PR_smprintf_free(internal_name); PR_fprintf(PR_STDERR, errStrings[FIPS_SWITCH_FAILED_ERR]); return FIPS_SWITCH_FAILED_ERR; } + PR_smprintf_free(internal_name); PR_fprintf(PR_STDOUT, msgStrings[FIPS_ENABLED_MSG]); } else { PR_fprintf(PR_STDERR, errStrings[FIPS_ALREADY_ON_ERR]); -@@ -112,5 +114,5 @@ +@@ -75,7 +77,7 @@ FipsMode(char *arg) + * If arg=="false", verify FIPS mode is disabled on the internal module. */ Error -ChkFipsMode(char *arg) +ChkFipsMode(const char *arg) { - if(!PORT_Strcasecmp(arg, "true")) { + if (!PORT_Strcasecmp(arg, "true")) { + if (PK11_IsFIPS()) { Index: head/security/nss/files/patch-coreconf_FreeBSD.mk =================================================================== --- head/security/nss/files/patch-coreconf_FreeBSD.mk (revision 479328) +++ head/security/nss/files/patch-coreconf_FreeBSD.mk (revision 479329) @@ -1,52 +1,53 @@ ---- coreconf/FreeBSD.mk.orig 2009-08-22 07:33:09.000000000 +0200 -+++ coreconf/FreeBSD.mk 2010-03-28 23:01:33.000000000 +0200 -@@ -37,9 +37,9 @@ +--- coreconf/FreeBSD.mk.orig 2018-08-31 12:55:53 UTC ++++ coreconf/FreeBSD.mk +@@ -5,9 +5,9 @@ include $(CORE_DEPTH)/coreconf/UNIX.mk -DEFAULT_COMPILER = gcc -CC = gcc -CCC = g++ +DEFAULT_COMPILER = $(CC) +CC ?= gcc +CCC = $(CXX) RANLIB = ranlib CPU_ARCH = $(OS_TEST) -@@ -52,6 +52,16 @@ endif +@@ -20,7 +20,17 @@ endif ifeq ($(CPU_ARCH),amd64) CPU_ARCH = x86_64 endif +ifneq (,$(filter arm%, $(CPU_ARCH))) +CPU_ARCH = arm +endif +ifneq (,$(filter powerpc%, $(CPU_ARCH))) +CPU_ARCH = ppc +endif -+ + +ifneq (,$(filter %64, $(OS_TEST))) +USE_64 = 1 +endif ++ + OS_CFLAGS = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK - OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK - + DSO_CFLAGS = -fPIC @@ -46,7 +56,11 @@ else DLL_SUFFIX = so.1.0 endif -MKSHLIB = $(CC) $(DSO_LDOPTS) +ifneq (,$(filter alpha ia64,$(OS_TEST))) +MKSHLIB = $(CC) -Wl,-Bsymbolic -lc $(DSO_LDOPTS) +else +MKSHLIB = $(CC) -Wl,-Bsymbolic $(DSO_LDOPTS) +endif ifdef MAPFILE MKSHLIB += -Wl,--version-script,$(MAPFILE) endif -@@ -87,4 +100,5 @@ +@@ -55,4 +69,5 @@ PROCESS_MAP_FILE = grep -v ';-' $< | \ G++INCLUDES = -I/usr/include/g++ -INCLUDES += -I/usr/X11R6/include +USE_SYSTEM_ZLIB = 1 +ZLIB_LIBS = -lz Index: head/security/nss/files/patch-coreconf_UNIX.mk =================================================================== --- head/security/nss/files/patch-coreconf_UNIX.mk (revision 479328) +++ head/security/nss/files/patch-coreconf_UNIX.mk (revision 479329) @@ -1,13 +1,13 @@ ---- coreconf/UNIX.mk~ +--- coreconf/UNIX.mk.orig 2018-08-31 12:55:53 UTC +++ coreconf/UNIX.mk -@@ -42,10 +42,8 @@ AR = ar cr $@ +@@ -10,10 +10,8 @@ AR = ar cr $@ LDOPTS += -L$(SOURCE_LIB_DIR) ifdef BUILD_OPT - OPTIMIZER += -O DEFINES += -UDEBUG -DNDEBUG else - OPTIMIZER += -g USERNAME := $(shell whoami) USERNAME := $(subst -,_,$(USERNAME)) DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME) Index: head/security/nss/files/patch-coreconf_arch.mk =================================================================== --- head/security/nss/files/patch-coreconf_arch.mk (revision 479328) +++ head/security/nss/files/patch-coreconf_arch.mk (revision 479329) @@ -1,11 +1,11 @@ ---- coreconf/arch.mk.orig 2011-03-03 18:13:52.000000000 +0100 -+++ coreconf/arch.mk 2011-03-03 18:14:09.000000000 +0100 -@@ -66,7 +66,7 @@ +--- coreconf/arch.mk.orig 2018-08-31 12:55:53 UTC ++++ coreconf/arch.mk +@@ -26,7 +26,7 @@ OS_ARCH := $(subst /,_,$(shell uname -s)) # Attempt to differentiate between sparc and x86 Solaris # -OS_TEST := $(shell uname -m) +OS_TEST := $(shell uname -p) ifeq ($(OS_TEST),i86pc) OS_RELEASE := $(shell uname -r)_$(OS_TEST) else Index: head/security/nss/files/patch-coreconf_command.mk =================================================================== --- head/security/nss/files/patch-coreconf_command.mk (revision 479328) +++ head/security/nss/files/patch-coreconf_command.mk (revision 479329) @@ -1,11 +1,11 @@ ---- coreconf/command.mk Mon Oct 10 19:46:12 2005 -+++ coreconf/command.mk Wed Jan 18 17:23:28 2006 +--- coreconf/command.mk.orig 2018-08-31 12:55:53 UTC ++++ coreconf/command.mk @@ -12,7 +12,7 @@ AS = $(CC) ASFLAGS += $(CFLAGS) CCF = $(CC) $(CFLAGS) LINK_DLL = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS) $(XLDFLAGS) -CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \ +CFLAGS += $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \ $(DEFINES) $(INCLUDES) $(XCFLAGS) PERL = perl RANLIB = echo Index: head/security/nss/files/patch-coreconf_ruleset.mk =================================================================== --- head/security/nss/files/patch-coreconf_ruleset.mk (revision 479328) +++ head/security/nss/files/patch-coreconf_ruleset.mk (revision 479329) @@ -1,11 +1,11 @@ ---- coreconf/ruleset.mk~ +--- coreconf/ruleset.mk.orig 2018-08-31 12:55:53 UTC +++ coreconf/ruleset.mk -@@ -85,7 +85,7 @@ +@@ -53,7 +53,7 @@ # ifndef COMPILER_TAG - ifneq ($(DEFAULT_COMPILER), $(notdir $(firstword $(CC)))) + ifneq ($(DEFAULT_COMPILER), $(CC)) # # Temporary define for the Client; to be removed when binary release is used # Index: head/security/nss/files/patch-lib-freebl-Makefile =================================================================== --- head/security/nss/files/patch-lib-freebl-Makefile (revision 479328) +++ head/security/nss/files/patch-lib-freebl-Makefile (revision 479329) @@ -1,11 +1,11 @@ ---- lib/freebl/Makefile~ +--- lib/freebl/Makefile.orig 2018-08-31 12:55:53 UTC +++ lib/freebl/Makefile -@@ -201,7 +201,7 @@ ifeq ($(USE_N32),1) +@@ -215,7 +215,7 @@ ifeq ($(CPU_ARCH),x86) endif - endif + endif # Darwin -ifeq ($(OS_TARGET),Linux) +ifeq (,$(filter-out Linux FreeBSD, $(OS_TARGET))) ifeq ($(CPU_ARCH),x86_64) ASFILES = arcfour-amd64-gas.s mpi_amd64_gas.s - ASFLAGS += -march=opteron -m64 -fPIC -Wa,--noexecstack + ASFLAGS += -fPIC -Wa,--noexecstack Index: head/security/nss/files/patch-lib_freebl_mpi_mpcpucache.c =================================================================== --- head/security/nss/files/patch-lib_freebl_mpi_mpcpucache.c (revision 479328) +++ head/security/nss/files/patch-lib_freebl_mpi_mpcpucache.c (revision 479329) @@ -1,43 +1,43 @@ ---- lib/freebl/mpi/mpcpucache.c.orig 2010-06-11 22:39:33.000000000 +0200 -+++ lib/freebl/mpi/mpcpucache.c 2010-06-11 22:40:20.000000000 +0200 +--- lib/freebl/mpi/mpcpucache.c.orig 2018-08-31 12:55:53 UTC ++++ lib/freebl/mpi/mpcpucache.c @@ -705,6 +705,32 @@ s_mpi_getProcessorLineSize() #endif #if defined(__ppc64__) + +#if defined(__FreeBSD__) +#include +#include + +#include +#include + +unsigned long +s_mpi_getProcessorLineSize() +{ + static int cacheline_size = 0; + static int cachemib[] = { CTL_MACHDEP, CPU_CACHELINE }; + int clen; + + if (cacheline_size > 0) + return cacheline_size; + + clen = sizeof(cacheline_size); + if (sysctl(cachemib, sizeof(cachemib) / sizeof(cachemib[0]), + &cacheline_size, &clen, NULL, 0) < 0 || !cacheline_size) + return 128; /* guess */ + + return cacheline_size; +} +#else /* * Sigh, The PPC has some really nice features to help us determine cache * size, since it had lots of direct control functions to do so. The POWER @@ -758,6 +784,7 @@ s_mpi_getProcessorLineSize() } return 0; } +#endif #define MPI_GET_PROCESSOR_LINE_SIZE_DEFINED 1 #endif Index: head/security/nss/files/patch-lib_softoken_pkcs11c.c =================================================================== --- head/security/nss/files/patch-lib_softoken_pkcs11c.c (revision 479328) +++ head/security/nss/files/patch-lib_softoken_pkcs11c.c (revision 479329) @@ -1,22 +1,22 @@ ---- lib/softoken/pkcs11c.c.orig 2010-05-05 14:36:05.000000000 +0000 -+++ lib/softoken/pkcs11c.c 2010-05-05 14:37:25.000000000 +0000 -@@ -5679,9 +5679,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, S +--- lib/softoken/pkcs11c.c.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/pkcs11c.c +@@ -5772,9 +5772,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, SECItem *bpki) break; case NSSLOWKEYDSAKey: keyType = CKK_DSA; - crv = (sftk_hasAttribute(key, CKA_NETSCAPE_DB)) ? CKR_OK : CKR_KEY_TYPE_INCONSISTENT; - if (crv != CKR_OK) - break; crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &keyType, sizeof(keyType)); if (crv != CKR_OK) -@@ -5722,9 +5719,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, S - #ifndef NSS_DISABLE_ECC +@@ -5814,9 +5811,6 @@ sftk_unwrapPrivateKey(SFTKObject *key, SECItem *bpki) + /* what about fortezza??? */ case NSSLOWKEYECKey: keyType = CKK_EC; - crv = (sftk_hasAttribute(key, CKA_NETSCAPE_DB)) ? CKR_OK : CKR_KEY_TYPE_INCONSISTENT; - if (crv != CKR_OK) - break; crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &keyType, sizeof(keyType)); if (crv != CKR_OK) Index: head/security/nss/files/patch-sysdb =================================================================== --- head/security/nss/files/patch-sysdb (revision 479328) +++ head/security/nss/files/patch-sysdb (revision 479329) @@ -1,146 +1,145 @@ ---- lib/softoken/legacydb/cdbhdl.h.orig 2009-08-31 12:33:12.000000000 +0200 -+++ lib/softoken/legacydb/cdbhdl.h 2009-08-31 12:33:36.000000000 +0200 -@@ -43,7 +43,8 @@ +--- lib/softoken/legacydb/cdbhdl.h.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/cdbhdl.h +@@ -9,7 +9,8 @@ #define _CDBHDL_H_ #include "nspr.h" -#include "mcom_db.h" +#include +#include #include "pcertt.h" #include "prtypes.h" - ---- lib/softoken/legacydb/dbmshim.c.orig 2009-08-31 10:40:23.000000000 +0200 -+++ lib/softoken/legacydb/dbmshim.c 2009-08-31 10:40:35.000000000 +0200 -@@ -39,7 +39,8 @@ - * - * $Id: dbmshim.c,v 1.2 2007/06/13 00:24:57 rrelyea%redhat.com Exp $ +--- lib/softoken/legacydb/dbmshim.c.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/dbmshim.c +@@ -5,7 +5,8 @@ + /* + * Berkeley DB 1.85 Shim code to handle blobs. */ -#include "mcom_db.h" +#include +#include #include "secitem.h" #include "nssb64.h" #include "blapi.h" ---- lib/softoken/legacydb/keydb.c.orig 2009-08-31 10:40:04.000000000 +0200 -+++ lib/softoken/legacydb/keydb.c 2009-08-31 10:40:08.000000000 +0200 -@@ -43,7 +43,6 @@ +--- lib/softoken/legacydb/keydb.c.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/keydb.c +@@ -9,7 +9,6 @@ #include "blapi.h" #include "secitem.h" #include "pcert.h" -#include "mcom_db.h" #include "secerr.h" #include "keydbi.h" ---- lib/softoken/legacydb/keydbi.h.orig 2009-08-31 12:33:17.000000000 +0200 -+++ lib/softoken/legacydb/keydbi.h 2009-08-31 12:34:13.000000000 +0200 -@@ -43,5 +43,5 @@ +--- lib/softoken/legacydb/keydbi.h.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/keydbi.h +@@ -10,7 +10,7 @@ #include "nspr.h" #include "seccomon.h" -#include "mcom_db.h" +#include /* * Handle structure for open key databases ---- lib/softoken/legacydb/pcertdb.c.orig 2009-08-31 10:40:52.000000000 +0200 -+++ lib/softoken/legacydb/pcertdb.c 2009-08-31 10:41:26.000000000 +0200 -@@ -41,7 +41,8 @@ +--- lib/softoken/legacydb/pcertdb.c.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/pcertdb.c +@@ -7,7 +7,8 @@ */ #include "lowkeyti.h" #include "pcert.h" -#include "mcom_db.h" +#include +#include #include "pcert.h" #include "secitem.h" #include "secder.h" ---- lib/softoken/legacydb/pk11db.c.orig 2009-08-31 10:40:57.000000000 +0200 -+++ lib/softoken/legacydb/pk11db.c 2009-08-31 10:41:55.000000000 +0200 -@@ -41,7 +41,8 @@ +--- lib/softoken/legacydb/pk11db.c.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/pk11db.c +@@ -8,7 +8,8 @@ + */ - #include "pk11pars.h" #include "lgdb.h" -#include "mcom_db.h" +#include +#include #include "secerr.h" + #include "utilpars.h" - #define FREE_CLEAR(p) if (p) { PORT_Free(p); p = NULL; } ---- lib/ckfw/dbm/ckdbm.h.orig 2009-08-31 10:46:00.000000000 +0200 -+++ lib/ckfw/dbm/ckdbm.h 2009-08-31 10:46:22.000000000 +0200 -@@ -59,7 +59,7 @@ +--- lib/ckfw/dbm/ckdbm.h.orig 2018-08-31 12:55:53 UTC ++++ lib/ckfw/dbm/ckdbm.h +@@ -23,7 +23,7 @@ #include "ckt.h" #endif /* CKT_H */ -#include "mcom_db.h" +#include NSS_EXTERN_DATA NSSCKMDInstance nss_dbm_mdInstance; ---- lib/softoken/legacydb/config.mk.orig 2009-08-31 12:39:49.000000000 +0200 -+++ lib/softoken/legacydb/config.mk 2009-08-31 12:40:03.000000000 +0200 -@@ -40,7 +40,6 @@ +--- lib/softoken/legacydb/config.mk.orig 2018-08-31 12:55:53 UTC ++++ lib/softoken/legacydb/config.mk +@@ -8,7 +8,6 @@ CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX EXTRA_LIBS += \ $(CRYPTOLIB) \ - $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) \ $(NULL) # can't do this in manifest.mn because OS_TARGET isn't defined there. ---- lib/certdb/xauthkid.c.orig 2009-08-31 12:43:13.000000000 +0200 -+++ lib/certdb/xauthkid.c 2009-08-31 12:44:21.000000000 +0200 -@@ -39,7 +39,7 @@ +--- lib/certdb/xauthkid.c.orig 2018-08-31 12:55:53 UTC ++++ lib/certdb/xauthkid.c +@@ -7,7 +7,7 @@ * */ -#include "prtypes.h" +#include #include "seccomon.h" #include "secdert.h" #include "secoidt.h" ---- lib/certdb/xbsconst.c.orig 2009-08-31 12:43:22.000000000 +0200 -+++ lib/certdb/xbsconst.c 2009-08-31 12:44:41.000000000 +0200 -@@ -38,7 +38,7 @@ - * X.509 v3 Basic Constraints Extension +--- lib/certdb/xbsconst.c.orig 2018-08-31 12:55:53 UTC ++++ lib/certdb/xbsconst.c +@@ -6,7 +6,7 @@ + * X.509 v3 Basic Constraints Extension */ -#include "prtypes.h" +#include #include /* for LONG_MAX */ #include "seccomon.h" #include "secdert.h" ---- lib/certdb/xconst.c.orig 2009-08-31 12:43:46.000000000 +0200 -+++ lib/certdb/xconst.c 2009-08-31 12:44:50.000000000 +0200 -@@ -38,7 +38,7 @@ - * X.509 Extension Encoding +--- lib/certdb/xconst.c.orig 2018-08-31 12:55:53 UTC ++++ lib/certdb/xconst.c +@@ -6,7 +6,7 @@ + * X.509 Extension Encoding */ -#include "prtypes.h" +#include #include "seccomon.h" #include "secdert.h" #include "secoidt.h" ---- lib/manifest.mn~ +--- lib/manifest.mn.orig 2018-08-31 12:55:53 UTC +++ lib/manifest.mn -@@ -20,7 +20,7 @@ DIRS = \ - $(UTIL_SRCDIR) \ +@@ -20,7 +20,7 @@ ifndef NSS_BUILD_UTIL_ONLY + SOFTOKEN_SRCDIRS = \ $(FREEBL_SRCDIR) \ $(SQLITE_SRCDIR) \ - $(DBM_SRCDIR) \ + $(NULL) \ $(SOFTOKEN_SRCDIR) \ - base dev pki \ - libpkix \ ---- cmd/platlibs.mk.orig 2009-08-31 12:57:13.000000000 +0200 -+++ cmd/platlibs.mk 2009-08-31 12:57:29.000000000 +0200 -@@ -85,7 +85,7 @@ + $(NULL) + ifndef NSS_BUILD_SOFTOKEN_ONLY +--- cmd/platlibs.mk.orig 2018-08-31 12:55:53 UTC ++++ cmd/platlibs.mk +@@ -29,7 +29,7 @@ endif # BUILD_SUN_PKG ifdef NSS_DISABLE_DBM DBMLIB = $(NULL) else -DBMLIB = $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) +DBMLIB = $(NULL) endif - ifdef USE_STATIC_LIBS + ifeq ($(NSS_BUILD_UTIL_ONLY),1) Index: head/security/nss/files/patch-tests =================================================================== --- head/security/nss/files/patch-tests (revision 479328) +++ head/security/nss/files/patch-tests (revision 479329) @@ -1,10 +1,12 @@ ---- tests/common/init.sh Mon Apr 11 22:24:17 2005 -+++ tests/common/init.sh Fri Jul 22 16:55:36 2005 -@@ -197,5 +197,6 @@ - case $HOST in - *\.*) +--- tests/common/init.sh.orig 2018-08-31 12:55:53 UTC ++++ tests/common/init.sh +@@ -366,7 +366,8 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRU + if [ -z "${DOMSUF}" ]; then + DOMSUF=`echo $HOST | sed -e "s/^[^.]*\.//"` + fi - HOST=`echo $HOST | sed -e "s/\..*//"` + DOMSUF=${HOST#*.} # remove Smallest Prefix matching ``*.'' + HOST=${HOST%%.*} # remove Largest Suffix ``.*''. See sh(1) ;; ?*) + ;;