tags 381695 + patch
thanks

Helge Kreutzmann <[EMAIL PROTECTED]> writes:

> helge != root, user inside and outside the same:
>
> [EMAIL PROTECTED]:~$ whoami
> helge
> [EMAIL PROTECTED]:~$ dchroot -d whoami
> I: [ia32 chroot] Starte Kommando: »whoami«
> helge
>
> (still) produces in /var/log/syslog:
> Oct  1 18:43:02 remaxp schroot[26127]: [ia32 chroot] (helge->helge)
> Running command: "/bin/bash -c whoami"

Ah, yes.  The patch also needed adding to the dchroot and dchroot-dsa
sources.  I've attached the patch for this.


Regards,
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: dchroot/dchroot-session.cc
===================================================================
--- dchroot/dchroot-session.cc	(revision 1023)
+++ dchroot/dchroot-session.cc	(working copy)
@@ -116,8 +116,9 @@
   std::string commandstring = sbuild::string_list_to_string(command, " ");
   sbuild::log_debug(sbuild::DEBUG_NOTICE)
     << format("Running command: %1%") % commandstring << endl;
-  syslog(LOG_USER|LOG_NOTICE, "[%s chroot] (%s->%s) Running command: \"%s\"",
-	 session_chroot->get_name().c_str(), get_ruser().c_str(), get_user().c_str(), commandstring.c_str());
+  if (get_uid() == 0 || get_ruid() != get_uid())
+    syslog(LOG_USER|LOG_NOTICE, "[%s chroot] (%s->%s) Running command: \"%s\"",
+	   session_chroot->get_name().c_str(), get_ruser().c_str(), get_user().c_str(), commandstring.c_str());
 
   if (get_verbosity() != auth::VERBOSITY_QUIET)
     {
Index: dchroot-dsa/dchroot-dsa-session.cc
===================================================================
--- dchroot-dsa/dchroot-dsa-session.cc	(revision 1023)
+++ dchroot-dsa/dchroot-dsa-session.cc	(working copy)
@@ -124,8 +124,9 @@
   std::string commandstring = sbuild::string_list_to_string(command, " ");
   sbuild::log_debug(sbuild::DEBUG_NOTICE)
     << format("Running command: %1%") % commandstring << endl;
-  syslog(LOG_USER|LOG_NOTICE, "[%s chroot] (%s->%s) Running command: \"%s\"",
-	 session_chroot->get_name().c_str(), get_ruser().c_str(), get_user().c_str(), commandstring.c_str());
+  if (get_uid() == 0 || get_ruid() != get_uid())
+    syslog(LOG_USER|LOG_NOTICE, "[%s chroot] (%s->%s) Running command: \"%s\"",
+	   session_chroot->get_name().c_str(), get_ruser().c_str(), get_user().c_str(), commandstring.c_str());
 
   if (get_verbosity() != auth::VERBOSITY_QUIET)
     {

Attachment: pgpnJAIBvd2fX.pgp
Description: PGP signature

Reply via email to