From owner-freebsd-current@FreeBSD.ORG Thu Oct 18 07:04:15 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B8FC16A418 for ; Thu, 18 Oct 2007 07:04:15 +0000 (UTC) (envelope-from matrix@itlegion.ru) Received: from corpmail.itlegion.ru (corpmail.itlegion.ru [84.21.226.211]) by mx1.freebsd.org (Postfix) with SMTP id D021313C461 for ; Thu, 18 Oct 2007 07:04:14 +0000 (UTC) (envelope-from matrix@itlegion.ru) Received: (qmail 53922 invoked from network); 18 Oct 2007 11:04:12 +0400 Received: from unknown (HELO Artem) (192.168.0.12) by 84.21.226.211 with SMTP; 18 Oct 2007 11:04:12 +0400 X-AntiVirus: Checked by Dr.Web [version: 4.44, engine: 4.44.0.09170, virus records: 249971, updated: 18.10.2007] Message-ID: <001c01c81155$1393ba00$0c00a8c0@Artem> From: "Artem Kuchin" To: =?UTF-8?B?6Z+T5a625qiZIEJpbGwgSGFja2Vy?= References: <00bd01c810ec$10371230$0c00a8c0@Artem> <8cb6106e0710171143m3dff7546o457192ede76e6598@mail.gmail.com> <012c01c810f3$aafeecf0$0c00a8c0@Artem> <20071017194252.GL6511@deviant.kiev.zoral.com.ua> <007001c810fc$97cf3000$0c00a8c0@Artem> <471676A1.4030300@conducive.net> Date: Thu, 18 Oct 2007 11:04:04 +0400 Organization: IT Legion MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Cc: josh.carroll@gmail.com, Kostik Belousov , freebsd-current@freebsd.org, Andrey Chernov Subject: Re: Broken su in current - trying to fix myself, help needed! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2007 07:04:15 -0000 韓家標 Bill Hacker wrote: > Artem Kuchin wrote: >>> Ah, mc. >>> Ok, it is reproducable in the following way: >>> pooma% sh >>> +m ~ $ ~/work/scratch/su.pl >>> Password: >>> heck >>> done! >>> $ [1] + 1725 suspended (tty input) sh +m >>> pooma% >>> >>> Note the +m, that turns off the job control. >> >> I switched from csh (which is tcsh) > > Mmy PowerBook and my Beastie boxen don't *quite* agree on that point, > but 'close enough' ordinarily... > > to sh and run >> the script from midnight commander. >> I got: >> >> heck >> done! >> Press any key to continue...[1] + Stopped (tty output) mc >> >> So, script finished and midnight commander get suspended now. >> > > Not exactly what I *suspected* would be found when I asked if we were > chasing the right animal --- but not an su or tsch issue, either. > > What happens if you play with '&' '&&' 'exit' or even just a > in the script at the right places? still using /bin/sh as shell script is called a.pl 1) exit at the end of the script does not change anything 2) ./a.pl && does not change anything 3) ./a.pl & alsmost the same except thart order changes a bit # ./a.pl & Press any key to continue...heck done! 'Press any key to continues' comes from mc 4) if i chane the script $com="/usr/bin/su root -c 'echo heck' &"; (note & is related to shell in su, not to echo) # ./a.pl done! Press any key to continue...heck [1] + Stopped (tty input) mc # After heck it wait or ENTER to be pressed. This is interesting, because it means control is returned to mc and it wait for the key, but after i press ENTER i get stopped. 5) $com="/usr/bin/su root -c 'echo heck' &&"; does not change anything 6) & and && in echo like 'echo heck &' do no change anything -- Artem