Problem with setuid/execv on Cygwin/Windows 7

Laurent Cocault laurent_cocault@yahoo.fr
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,
Laurent COCAULT
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.c
URL: <http://cygwin.com/pipermail/cygwin/attachments/20121109/6d7494df/attachment.c>
-------------- next part --------------
--
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


More information about the Cygwin mailing list