| delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-Spam-Check-By: | sourceware.org |
| Date: | Fri, 9 Nov 2012 10:18:11 +0100 |
| From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: Problem with setuid/execv on Cygwin/Windows 7 |
| Message-ID: | <20121109091811.GE7431@calimero.vinschen.de> |
| Reply-To: | cygwin AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| References: | <1352451558 DOT 7009 DOT YahooMailNeo AT web133201 DOT mail DOT ir2 DOT yahoo DOT com> <20121109090859 DOT GA31762 AT calimero DOT vinschen DOT de> |
| MIME-Version: | 1.0 |
| In-Reply-To: | <20121109090859.GA31762@calimero.vinschen.de> |
| User-Agent: | Mutt/1.5.21 (2010-09-15) |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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 |
On Nov 9 10:08, Corinna Vinschen wrote:
> On Nov 9 08:59, Laurent Cocault wrote:
> > Hi Cygwin community,
> >
> > I am currently facing a problem with the combination of setuid/execv on a Cygwin/Windows 7.
> > [...]
> > char* args[1];
> > args[0] = NULL;
> > status = execv("/bin/bash", args);
>
> This is wrong. You should at least set args[0] since that what becomes
> argv[0] in the child process:
>
> char* args[2];
> args[1] = "bash";
> args[2] = NULL;
Ouch. ENOCOFFEE. Make that
args[0] = "bash";
args[1] = NULL;
> status = execv("/bin/bash", args);
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |