This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Problem with setuid/execv on Cygwin/Windows 7
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Fri, 9 Nov 2012 10:08:59 +0100
- Subject: Re: Problem with setuid/execv on Cygwin/Windows 7
- References: <1352451558.7009.YahooMailNeo@web133201.mail.ir2.yahoo.com>
- Reply-to: cygwin at cygwin dot com
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;
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