Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <4172D969.8040107@x-ray.at>
Date: Sun, 17 Oct 2004 22:43:21 +0200
From: Reini Urban <rurban@x-ray.at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.8a3) Gecko/20040817
MIME-Version: 1.0
To: cygwin@cygwin.com
CC: marklist@fangorn.ca
Subject: su - coreutils?
References: <Pine.GSO.4.56.0403271502550.18236@slinky.cs.nyu.edu> <406C37A9.3030809@landheer.com> <20040401165235.GF2598@cygbert.vinschen.de> <406C7928.9070708@fangorn.ca> <20040402073643.GI2598@cygbert.vinschen.de> <406D6453.20104@fangorn.ca> <20040402141222.GA14036@cygbert.vinschen.de> <20040402160030.GD1144@coc.bosbc.com> <406DAD0C.6090402@fangorn.ca>
In-Reply-To: <406DAD0C.6090402@fangorn.ca>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

I've taken Mark's coreutils patches, the proposed fileutils patches, and 
some of Bas latest patches (ignore errors) and tried to build a package.
Builds fine, just some fixes for setuid processing in make install need 
to be done. (for su)

http://xarch.tu-graz.ac.at/publ/cygwin/coreutils/

But while we are here some questions, mostly to Corinna:

sync:
sync is a no-op in cygwin. Shouldn't we print a warning when calling 
sync.exe?

su:
ok, su was never ported to cygwin. I did read the archives, esp.
http://www.cygwin.com/ml/cygwin/2003-06/msg00897.html

I've taken the liberty to use some code form corinna's login package and 
applied these changes to su, to do something useful at the password 
prompt and the setuid then.
Without these patches the password prompt is entirely bogus.
Only a minor change from setuid to seteuid had to be done.

Also:
/* The user to become if none is specified.  */
#ifdef __CYGWIN__
#define DEFAULT_USER "Administrator"
#define ROOT_UID	18		// system
#else
#define DEFAULT_USER "root"
#define ROOT_UID	0
#endif

Idea: Logon as Administrator, not as SYSTEM.
But if already SYSTEM avoid asking for passwords.
And use the login cygwin_logon_user() code.

But: cygwin_logon_user always fails, even in a sysbash.

And, how to support empty password accounts?
cygwin_logon_user fails with set_errno(EINVAL);
   Can we use subauth/cygsuba.c then?
   Is there any template where this is used?

Or should we leave as is?
   (bogus getpassword for existing expect scripts, no setuid done)
-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

