The following code in postinst script is buggy and doesn't do what is expected:
=====
add_group_if_missing() {
if [ -x /usr/sbin/addgroup ]; then
if ! id -g motion >/dev/null 2>&1; then addgroup --force-badname motion || true
fi
fi
}
=====
'id -g' returns the effective group id whatever it is. The goal of this function should be to test is the group "motion" exists and create it if it is not the case.
If the group "motion" doesn't exists before the upgrade but the user "motion" does then this function doesn't create the group and the call to "chown motion:motion" fails
The following code in postinst script is buggy and doesn't do what is expected:
===== if_missing( ) {
addgroup --force-badname motion || true
add_group_
if [ -x /usr/sbin/addgroup ]; then
if ! id -g motion >/dev/null 2>&1; then
fi
fi
}
=====
'id -g' returns the effective group id whatever it is. The goal of this function should be to test is the group "motion" exists and create it if it is not the case.
If the group "motion" doesn't exists before the upgrade but the user "motion" does then this function doesn't create the group and the call to "chown motion:motion" fails