Date: Wed, 17 Oct 2007 22:42:52 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Artem Kuchin <matrix@itlegion.ru> Cc: josh.carroll@gmail.com, Andrey Chernov <ache@nagual.pp.ru>, freebsd-current@freebsd.org, ??? Bill Hacker <askbill@conducive.net> Subject: Re: Broken su in current - trying to fix myself, help needed! Message-ID: <20071017194252.GL6511@deviant.kiev.zoral.com.ua> In-Reply-To: <012c01c810f3$aafeecf0$0c00a8c0@Artem> References: <00bd01c810ec$10371230$0c00a8c0@Artem> <8cb6106e0710171143m3dff7546o457192ede76e6598@mail.gmail.com> <012c01c810f3$aafeecf0$0c00a8c0@Artem>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Wed, Oct 17, 2007 at 11:26:48PM +0400, Artem Kuchin wrote:
> >>if you try to run a very simple perl script:
> >>
> >>#!/usr/bin/perl
> >>$com="/usr/bin/su root -c 'echo heck'";
> >>system($com);
> >>print "done!\n";
> >
> >This works fine for me. If I run it as root (and change the user it's
> >su'ing to to a normal user), it runs find and prints:
> >
> >heck
> >done
> >
>
> OH MY GOD!!! I have posted this problem before and saw many 'me too'
> reponses and thought that this problem is everywhere. After your and
> Kostik's posts and decided to make a clean test. Turned off jails
> and all custom kernel sysctls. Entered shell and run this cript - it
> printed:
>
> heck
> done!
>
> I have rerun all configs and started jails - still works. Then i remembered
> that i have always run this script fro midnight commander.
> Started mc
> Pressed ENTER on this script and it got suspended.
>
> Now i am lost, whose problem is this? su's or mc's? or both?
> If i remove su from the script and run simply
> system('echo heck');
> from mc it work fine. With su it gets suspended.
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.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
iD8DBQFHFmW8C3+MBN1Mb4gRAt48AKDOl0SI5WxSq6uVhQnJqCG+UxfDMQCgzGjB
GnDIql7Ygtc9OabiMFX/S/k=
=YAZ8
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071017194252.GL6511>
