Am 19.04.22 um 16:15 schrieb Wilko Meyer:
Package: rsyslog-pgsql
Version: 8.2102.0-2
Severity: minor

Dear Maintainer,

The postinst script fails under certain conditions due to the lack of
error handling in dbc_postinst_cleanup with a non-zero exit code:

Output with `set -x` set:

#+BEGIN_SRC

+ IFS=
+ printf %s\n RESET rsyslog-pgsql/app-password-confirm
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=10 rsyslog-pgsql/app-password-confirm doesn't exist
+ return 10
+ true
+ db_fset rsyslog-pgsql/app-password-confirm seen false
+ _db_cmd FSET rsyslog-pgsql/app-password-confirm seen false
+ _db_internal_IFS=

+ IFS=
+ printf %s\n FSET rsyslog-pgsql/app-password-confirm seen false
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=10 rsyslog-pgsql/app-password-confirm doesn't exist
+ return 10
+ true
+ db_reset rsyslog-pgsql/internal/skip-preseed
+ _db_cmd RESET rsyslog-pgsql/internal/skip-preseed
+ _db_internal_IFS=

+ IFS=
+ printf %s\n RESET rsyslog-pgsql/internal/skip-preseed
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=10 rsyslog-pgsql/internal/skip-preseed doesn't exist
+ return 10
+ db_reset rsyslog-pgsql/internal/reconfiguring
+ _db_cmd RESET rsyslog-pgsql/internal/reconfiguring
+ _db_internal_IFS=

+ IFS=
+ printf %s\n RESET rsyslog-pgsql/internal/reconfiguring
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=10 rsyslog-pgsql/internal/reconfiguring doesn't exist
+ return 10
+ return 10
dpkg: error processing package rsyslog-pgsql (--configure):
  installed rsyslog-pgsql package post-installation script subprocess returned 
error exit status 10

#+END_SRC

the last successful running part of the postinst script is the calling
of dbc_forget_app_password(), dbc_postinst_cleanup() is where 10 as an
exit code is returned and where the script fails.

As far as I can tell the error occurs because:

* db_reset $dbc_package/internal/reconfiguring returns 10, but the
   script fails to catch this by either appending || true nor by
   returning 0 at the end of the function.

This would mean ignoring an error.
Why do you think it is appropriate to ignore this failure?

* I also noticed that on systems where the postinst script is broken
   debconf does not hold any entries corresponding to the package;
   which may point into the right direction for a possible fix.

Is this maybe a bug in dbconfig-common?

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to