[Dbconfig-common-devel] dbc_authmethod_user="password" problems

Finn Smith fcsmith at gmail.com
Wed Sep 27 18:33:13 UTC 2006


Hi,

I've been having trouble getting the package that I am building to
request a password for the app user when using postgresql on an
initial install. The config file in my debian dir is very simple. It
looks like this:

#!/bin/sh -e

# source debconf library
. /usr/share/debconf/confmodule
# source dbconfig library
. /usr/share/dbconfig-common/dpkg/config
# what dbs do we support
dbc_dbtypes="mysql, pgsql"
# use password auth with postgresql
dbc_authmethod_user="password"
# run dbconfig-common
dbc_go my-new-package $@

db_go || true

exit 0

Yet, the password is not prompted for at higher debconf priority
levels, and on dropping the debconf level to the point where a choice
can be made between "ident" and "password" for the app user, "ident"
is selected as the default. I spent a fair amount of time going
through /usr/share/dbconfig-common/dpkg/config and
/usr/share/dbconfig-common/dpkg/common and my conclusion is that the
dbc_authmethod_user variable I set in my config is never used. The
relevant code for an initial install seems to be this portion of
/usr/share/dbconfig-common/dpkg/config:

	# state 8 - pgsql auth stuff, part 2
	8)
		if [ "$dbc_dbtype" = "pgsql" ]; then
			db_get $dbc_package/pgsql/authmethod-admin
			authmethod_admin="$RET"
			# default the user auth method to the admin method
			# ...but only if they haven't set one already
			if [ ! "$dbc_authmethod_user" ]; then
				db_set $dbc_package/pgsql/authmethod-user "$authmethod_admin"
			fi
			db_input low $dbc_package/pgsql/authmethod-user || true
		fi
	;;
	# state 9 - pgsql auth part 3, admin/app user, dbname
	9)
		if [ "$dbc_dbtype" = "pgsql" ]; then
			db_get $dbc_package/pgsql/authmethod-user
			authmethod_user="$RET"

			# if we are using ident, we don't need passwords
			if [ "$authmethod_admin" = "ident" ]; then
				need_adminpw="false"
			fi

			if [ "$authmethod_user" = "ident" ]; then
				need_userpw="false"
			fi
		fi

In state 8 there is an if clause that sets
<package>/pgsql/authmethod-user to the value of
<package>/pgsql/authmethod-admin if $dbc_authmethod_user is *not* set.
However, I couldn't find anywhere in the code where
<package>/pgsql/authmethod-user is set to the value of
$dbc_authmethod_user if it *is* set.

Maybe I'm missing something obvious. Can someone confirm that they've
seen this problem and/or that my analysis is correct? If so I can
write up a bug report.

I am using version 1.8.11 of dbconfig-common, but I checked in the
latest version (1.8.23) and didn't see any substantive differences.

-F



More information about the Dbconfig-common-devel mailing list