Skip to content
ᴀɴᴛᴏɴ ɴᴏᴠᴏᴊɪʟᴏᴠ edited this page Jun 23, 2024 · 3 revisions

Description

Checks for unclosed if conditions in scriptlets.

Problematic code

%postun
if [[ $1 -ge 1 ]] ; then
%{__sysctl} daemon-reload &>/dev/null || :

Correct code

%postun
if [[ $1 -ge 1 ]] ; then
%{__sysctl} daemon-reload &>/dev/null || :
fi

Rationale

Neither rpmlint nor rpmbuild does not check bash syntax in scriptlets. So it is possible to build a package with unclosed if condition inside scriptlets.

Clone this wiki locally