NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

install/55700: postinstall doesn't work correctly with BSD grep(1)



>Number:         55700
>Category:       install
>Synopsis:       postinstall doesn't work correctly with BSD grep(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    install-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 07 16:05:00 +0000 2020
>Originator:     Michael Scholz
>Release:        NetBSD 9.99.73
>Organization:
>Environment:
System: NetBSD pumpkin.fth-devel.net 9.99.73 NetBSD 9.99.73 (PUMPKIN) #0: Mon Oct 5 18:14:49 CEST 2020 toor%pumpkin.fth-devel.net@localhost:/usr/obj/usr/src/sys/arch/amd64/compile/PUMPKIN amd64
Architecture: x86_64
Machine: amd64
>Description:

With MKBSDGREP=yes in /etc/mk.conf, after compiling and installing the
system and calling postinstall, /usr/sbin/postinstall reports at least
two times:

	grep: repetition-operator operand invalid

This happens during "obsolete check" in exclude_libs(); the '++' in
libc++.so* etc should be escaped to prevent regcomp(3) from using it as
a repetition operator, I think.

>How-To-Repeat:

Compile and install the system with MKBSDGREP=yes and call:

	postinstall -s /usr/src/ -d check

>Fix:

In function exclude_libs() add '-e s/\\++/\\\\++/g' to the sed utility
to escape '++':

--- /usr/sbin/postinstall	2020-09-04 11:52:53.000000000 +0200
+++ postinstall	2020-10-07 17:34:53.405233356 +0200
@@ -593,7 +593,7 @@
 exclude_libs() {
 	local target="$(ls -l -d lib*.so.* 2> /dev/null \
 	    | ${AWK} '{ print $11; }' \
-	    | ${SED} -e 's@.*/@@' | ${SORT} -u)"
+	    | ${SED} -e 's@.*/@@' -e s/\\++/\\\\++/g | ${SORT} -u)"
 	exclude -t ${target}
 }



Home | Main Index | Thread Index | Old Index