From 53f5361a409649e4182d9a7600185ce847eef442 Mon Sep 17 00:00:00 2001 From: cperciva Date: Fri, 19 Aug 2005 01:49:15 +0000 Subject: Pad the strings sccs[], version[], and osrelease[] up to a minimum of 128 bytes, 256 bytes, and 32 bytes respectively. This makes it much easier to identify when two kernels are identical apart from a version number bump (as often happens on security branches). Discussed on: freebsd-arch, in May 2005 --- sys/conf/newvers.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index 99367b4..036712d 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -33,6 +33,9 @@ TYPE="FreeBSD" REVISION="7.0" BRANCH="CURRENT" +if [ "X${BRANCH_OVERRIDE}" != "X" ]; then + BRANCH=${BRANCH_OVERRIDE} +fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" @@ -85,10 +88,14 @@ v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` i=`${MAKE:-make} -V KERN_IDENT` cat << EOF > vers.c $COPYRIGHT -char sccs[] = "@(#)${VERSION} #${v}: ${t}"; -char version[] = "${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n"; +#define SCCSSTR "@(#)${VERSION} #${v}: ${t}" +#define VERSTR "${VERSION} #${v}: ${t}\\n ${u}@${h}:${d}\\n" +#define RELSTR "${RELEASE}" + +char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR; +char version[sizeof(VERSTR) > 256 ? sizeof(VERSTR) : 256] = VERSTR; char ostype[] = "${TYPE}"; -char osrelease[] = "${RELEASE}"; +char osrelease[sizeof(RELSTR) > 32 ? sizeof(RELSTR) : 32] = RELSTR; int osreldate = ${RELDATE}; char kern_ident[] = "${i}"; EOF -- cgit v1.1