Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 18 Oct 2004 12:57:34 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: su - coreutils? Message-ID: <20041018105734.GB26101@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <406C37A9 DOT 3030809 AT landheer DOT com> <20040401165235 DOT GF2598 AT cygbert DOT vinschen DOT de> <406C7928 DOT 9070708 AT fangorn DOT ca> <20040402073643 DOT GI2598 AT cygbert DOT vinschen DOT de> <406D6453 DOT 20104 AT fangorn DOT ca> <20040402141222 DOT GA14036 AT cygbert DOT vinschen DOT de> <20040402160030 DOT GD1144 AT coc DOT bosbc DOT com> <406DAD0C DOT 6090402 AT fangorn DOT ca> <4172D969 DOT 8040107 AT x-ray DOT at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4172D969.8040107@x-ray.at> User-Agent: Mutt/1.4.2i On Oct 17 22:43, Reini Urban wrote: > 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? I don't think it's necessary. Since sync is a noop, it doesn't hurt to call it. I would go a step further. Just omit sync from the Cygwin release of coreutils. > 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. Hmm, it works in login(1) and in ftpd(8), right? However, this isn't really su functionality since you need special user rights which the standard user (even admin) doesn't have. The su functionality always needs a server application which has the permissions to create a new user token one way or the other. I would omit su from coreutils. There's no gain to support it in a windows environment. The functionality is a subset of what a local sshd installation allows, but with more security implications. > And, how to support empty password accounts? > cygwin_logon_user fails with set_errno(EINVAL); Is the account disabled, perhaps? Please note that there are additional Windows security settings which you have to take into account. > Can we use subauth/cygsuba.c then? No. It's dead, Jim. It's kept for historical purposes (like, say excavations of temples of the Cygwin sect in 1000+ years). If we ever get the input for how to create a real authentication module, we can probably resurrect parts of the existing code. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- 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/