delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Message-ID: | <003801c1e6a1$e0706530$45b0fc3e@nori> |
From: | "Sam Edge" <sam DOT edge AT ntlworld DOT com> |
To: | <cygwin AT cygwin DOT com> |
References: | <Pine DOT LNX DOT 4 DOT 33 DOT 0204171951080 DOT 1389-100000 AT denzel DOT in> |
Subject: | Re: will bash honor the suid bit or not? |
Date: | Thu, 18 Apr 2002 07:25:46 +0100 |
MIME-Version: | 1.0 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-MimeOLE: | Produced By Microsoft MimeOLE V6.00.2600.0000 |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id g3I6QFY13639 |
> And you were right to guess that I already set ntsec in CYGWIN - it was my > first move. That, and to put the definition in the systems env. vars, so > other users who log in without Administrator privilege can't change it. I also set the CYGWIN environment in the "system variables" section of the NT configuration simply so that I can run Cygwin executables under any account without having to worry about it. However, this doesn't prevent ordinary users from changing its value prior to running Cygwin programs. Open an NT command prompt (CMD.EXE), type "SET CYGWIN=" and then "bash" and you'll see. > I am apparently ignorant of how to handle a case like this on NT/2000, nor > do I even know where to look. This problem must be solved for many uses > already. I would think that a great many services have this same problem. > It's an exceptionally common need to have a non-privileged user run a > program and get privileged results. The way it's normally done on NT is by installing a service - a special type of application that runs under the NT Service Manager susbsystem. (This is designed for processes that run independently of interactive users. It's used to implement the equivalent of UNIX daemon processes and other "system" facilities.) The service runs as SYSTEM or some other priveleged account and user processes use IPC to access its facilities in a controlled manner. > From where I sit, it sure looks like this problem should be solved for the > BASH shell. Under UNIX-like systems it's not bash that modifies the UID/GID of the created process but the operating system when asked to exec() a file with the appropriate suid/sgid bit set. Non-superuser processes can't call setXid() with an ID other than one of their own anyway. If they try, the call fails with errno == EPERM. (Otherwise any user could write a program that runs with the priveleges of any other!) > Perhaps it should become a service? I dunno! LOL. It's certainly not a good idea to start making major architectural changes in the shell program! > It'd be great to hear from more of you: Anyone else care to confirm > Larry's suggestion that giving privileges to users is the solution in this > case? If it's a security application then no. A better solution for NT would be to split the program into a client application and a non-Cygwin-based server service and have them communicate via whatever IPC mechanism with which you're happy. If you used TCP/IP sockets the client could remain a Cygwin application and you would be able to write a UNIX version of the server at some point too. An NT-specific solution might find RPC more appropriate though. You could write a standard UNIX-style daemon as a Cygwin application that uses sockets and install it as an NT service using cygrunsrv but this isn't a secure solution. The Cygwin documentation tells us that all Cygwin processes have access to shared memory resources and can compromise each others integrity. -- Sam Edge -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |