tags 389815 + patch
thanks

Martin Michlmayr <[EMAIL PROTECTED]> writes:

> An old bug seems to be back again.  Something fails because /bin/zsh
> is called, which is my shell from the main system.

It turns out this is because sudo is also stripping SHELL from the
environment, and taking it from /etc/passwd.

Please could you try the attached patch?


Thanks,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 1014)
+++ debian/changelog	(working copy)
@@ -1,8 +1,10 @@
 sbuild (0.50) UNRELEASED; urgency=low
 
   * debian/copyright: Add Alioth file download location.
-  * chroot/add_sbuild_user: Fix chrapt command examples in output to use
-    correct option syntax, thanks to Matthias Julius (Closes: #381186).
+  * chroot/add_sbuild_user:
+    - Fix chrapt command examples in output to use correct option syntax,
+      thanks to Matthias Julius (Closes: #381186).
+    - Add SHELL to sudoers env_keep.
   * sbuild:
     - dsc_md5sums: Return hashref on failure, rather than -1.
     - verify_md5sums: Only run md5sum if there is one or more md5sum to
@@ -10,8 +12,11 @@
       files to check.  Thanks to Daniel Stone.
   * Sbuild.pm: Use new binNMU versioning scheme (+bn), taken from
     wanna-build SVN.  Thanks to Clint Adams (Closes: #384137).
+  * Sbuild/Conf.pm: Check sudo does not strip SHELL from the environment.
+  * sbuild-setup.7.in: Document needed addition of SHELL to sudoers
+    env_keep (Closes: #389815).
 
- -- Roger Leigh <[EMAIL PROTECTED]>  Tue, 22 Aug 2006 22:42:07 +0100
+ -- Roger Leigh <[EMAIL PROTECTED]>  Thu, 28 Sep 2006 11:26:41 +0100
 
 sbuild (0.49) unstable; urgency=low
 
Index: Sbuild/Conf.pm
===================================================================
--- Sbuild/Conf.pm	(revision 1014)
+++ Sbuild/Conf.pm	(working copy)
@@ -108,14 +108,17 @@
 		local (%ENV) = %ENV; # make local environment
 		$ENV{'DEBIAN_FRONTEND'} = "noninteractive";
 		$ENV{'APT_CONFIG'} = "test_apt_config";
+		$ENV{'SHELL'} = "/bin/sh";
 
 		chomp( my $test_df = `$Sbuild::Conf::sudo sh -c 'echo \$DEBIAN_FRONTEND'` );
 		chomp( my $test_ac = `$Sbuild::Conf::sudo sh -c 'echo \$APT_CONFIG'` );
+		chomp( my $test_sh = `$Sbuild::Conf::sudo sh -c 'echo \$SHELL'` );
 
 		if ($test_df ne "noninteractive" ||
-		    $test_ac ne "test_apt_config") {
-			print STDERR "$Sbuild::Conf::sudo is stripping APT_CONFIG and/or DEBIAN_FRONTEND from the environment\n";
-			print STDERR "'Defaults:$username env_keep+=\"APT_CONFIG DEBIAN_FRONTEND\"' is not set in /etc/sudoers\n";
+		    $test_ac ne "test_apt_config" ||
+		    $test_sh ne "/bin/sh") {
+			print STDERR "$Sbuild::Conf::sudo is stripping APT_CONFIG, DEBIAN_FRONTEND and/or SEHELL rom the environment\n";
+			print STDERR "'Defaults:$username env_keep+=\"APT_CONFIG DEBIAN_FRONTEND SHELL\"' is not set in /etc/sudoers\n";
 			die "$Sbuild::Conf::sudo is incorrectly configured"
 
 		}
Index: sbuild-setup.7.in
===================================================================
--- sbuild-setup.7.in	(revision 1014)
+++ sbuild-setup.7.in	(working copy)
@@ -252,7 +252,7 @@
 .PP
 \f[CR]\f[CI]username\fP  ALL=NOPASSWD: ALL\fP
 .br
-\f[CR]Defaults:\f[CI]username\fP env_keep+="APT_CONFIG DEBIAN_FRONTEND"\fP
+\f[CR]Defaults:\f[CI]username\fP env_keep+="APT_CONFIG DEBIAN_FRONTEND SHELL"\fP
 .br
 .PP
 where \fIusername\fP is the name of the user who will run sbuild.
Index: chroot/add_sbuild_user
===================================================================
--- chroot/add_sbuild_user	(revision 1014)
+++ chroot/add_sbuild_user	(working copy)
@@ -36,7 +36,7 @@
 # visudo  -- run this command as root and add the following lines:
 
 $USR ALL=NOPASSWD:  ALL
-Defaults:$USR env_keep+="APT_CONFIG DEBIAN_FRONTEND"
+Defaults:$USR env_keep+="APT_CONFIG DEBIAN_FRONTEND SHELL"
 
 You can do this in another shell or by suspending this script with
 ^Z (fg to return when done).

Attachment: pgpnMWPe2qwc8.pgp
Description: PGP signature

Reply via email to