Bug#657626: debconf: Does not show "unsupported command" error in DEBCONF_DEBUG=developer output

January 27th, 2012 - 10:10 am ET by Matthijs Kooijman | Report spam
Package: debconf
Version: 1.5.41
Severity: minor
Tags: patch

Hi folks,

just ran into an issue with debconf's debug logging, which I'm preparing
a patch for.

The issue is simple: When confmodule sends an unknown command to
debconf, it replies with:

"Unsupported command \"$command\" (full line was \"$_\") received from confmodule.";

However, this is only sent to confmodule (and possibly ignored there).
You would expect anything sent to confmodule to be printed when setting
DEBCONF_DEBUG=developer, but that doesn't happen for this error.

To reproduce, create this 'unknown-command' script:

#!/bin/sh

. /usr/share/debconf/confmodule

echo foo >&3

Then run debconf:

matthijs@grubby:~$ DEBCONF_DEBUG=developer debconf ./unknown-command
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
debconf (developer): starting ./unknown-command
debconf (developer): <-- foo

Notice that no reply is shown for the "foo" command. When injecting a
tee into the stdin of ./unknown-command, you'll see that there is
really an error reply.

I'm working on the simple patch now, I'll git-sendmail it over when I finish it
in a minute.

Gr.

Matthijs



To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 1 replyReplies Make a reply

Similar topics

Replies

#1 Matthijs Kooijman
January 27th, 2012 - 10:40 am ET | Report spam
Before, unknown commands or invalid commandlines could cause an error to
be sent to the confmodule, but not printed with DEBCONF_DEBUG=developer,
making debugging such an error hard.

Debconf/ConfModule.pm | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Debconf/ConfModule.pm b/Debconf/ConfModule.pm
index b3989a6..61f8b98 100644
a/Debconf/ConfModule.pm
+++ b/Debconf/ConfModule.pm
@@ -236,8 +236,10 @@ sub process_command {
($command, @params)=split(' ', $_);
}
if (! defined $command) {
- return $codes{syntaxerror}.' '.
+ my $ret = $codes{syntaxerror}.' '.
"Bad line \"$_\" received from confmodule.";
+ debug developer => "--> $ret";
+ return $ret;
}
$command=lc($command);
# This command could not be handled by a sub.
@@ -246,8 +248,10 @@ sub process_command {
}
# Make sure that the command is valid.
if (! $this->can("command_$command")) {
- return $codes{syntaxerror}.' '.
+ my $ret = $codes{syntaxerror}.' '.
"Unsupported command \"$command\" (full line was \"$_\") received from confmodule.";
+ debug developer => "--> $ret";
+ return $ret;
}
# Now call the subroutine for the command.
$command="command_$command";
1.7.7.3




To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search