Problem with setuid/execv on Cygwin/Windows 7

Laurent Cocault
Fri Nov 9 08:59:00 GMT 2012

Hi Cygwin community,

I am currently facing a problem with the combination of setuid/execv on a Cygwin/Windows 7.

Here is the description of my configuration :
* Cygwin 1.7.17
* Windows 7 Pro (64 bits) - Service Pack 1
* Compilation (no option) and execution of a sample program using an admin account having the following privileges :
  - SeCreateTokenPrivilege
  - SeAssignPrimaryTokenPrivilege
  - SeTcbPrivilege
  - SeIncreaseQuotaPrivilege
  - SeRestorePrivilege
  - SeServiceLogonRight
  - SeBatchLogonRight

See attachment for the source code of the program.

An exemple of the observed output is the following :

  Parent / My child is 2380
  setuid returns 0
  Child exited with status 32512 and word 2380
  exited, status=127

The file /tmp/test.touched has not been created.

When executing the same code on an older configuration (Cygwin 1.5.25 / Windows XP Pro 2002 SP 2), the program runs correctly and produces the following output :

  Parent / My child is 1616
  setuid returns 0
  Child exited with status 6912 and word 1616
  exited, status=27

The file /tmp/test.touched has effectively been created.

Thanks for your help,
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.c
URL: <>
-------------- next part --------------
Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list