delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/11/29/18:55:05

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <50092.200.158.224.232.1196380473.squirrel@mail2.icmc.usp.br>
In-Reply-To: <49223.200.158.224.232.1196366961.squirrel@mail2.icmc.usp.br>
References: <49223 DOT 200 DOT 158 DOT 224 DOT 232 DOT 1196366961 DOT squirrel AT mail2 DOT icmc DOT usp DOT br>
Date: Thu, 29 Nov 2007 21:54:33 -0200 (BRST)
Subject: Re: root privileges
From: "Jorge Marques Pelizzoni" <jpeliz AT icmc DOT usp DOT br>
To: cygwin AT cygwin DOT com
User-Agent: SquirrelMail/1.4.7
MIME-Version: 1.0
X-IsSubscribed: yes
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

First of all, please believe that I spent almost three hours going through
the mailing list archives before asking this. It's just that I (and many
others) have not been able to find a solution there.

I'm not running a program that tests for rootness in some non-portable
way. I'm just calling an innocent ioctl directly into cygwin, which tells
me I need more permissions. Just for clarification, here is the problem
code:

ioctl(fd,TIOCMGET,&status);
status &= ~TIOCM_RTS;
ioctl(fd, TIOCMSET, &status); // returns -EPERM

Apart from having a privileged (administrator) windows account, should I
understand (from http://cygwin.com/cygwin-ug-net/ntsec.html) that all
cygwin asks for is that I should get things right in /etc/passwd and
/etc/group?

Please take a look at what I've tried so far:

in /etc/passwd:

  (original)
jorge:*:1008:513:Jorge,U-QUICKSILVER\jorge,S-1-5-21-1450639292-781126914-3756273746-1008:/home/jorge:/bin/bash
  (1st try) 
jorge:*:1008:544:Jorge,U-QUICKSILVER\jorge,S-1-5-21-1450639292-781126914-3756273746-1008:/home/jorge:/bin/bash
  (2nd try) 
jorge:*:100:0:Jorge,U-QUICKSILVER\jorge,S-1-5-21-1450639292-781126914-3756273746-1008:/home/jorge:/bin/bash
  (3rd try) 
jorge:*:0:0:Jorge,U-QUICKSILVER\jorge,S-1-5-21-1450639292-781126914-3756273746-1008:/home/jorge:/bin/bash

in /etc/group (for the 2nd and 3rd tries above, I added the following line):
  root:S-1-5-32-544:0:

Finally, I even tried running the program from a "SYSTEM-owned shell", to
no avail.

Thanks in advance for any pointers. Cheers,

Jorge.

Jorge Marques Pelizzoni escreveu:
>
> Hi all!
>
> I am developing a program that requires root privileges to run (e.g. it
> calls ioctl to set communication lines at a serial port). Even though I am
> an administrator of my WinXP workstation, cygwin keeps giving me EPERM.
> Ok, I've read:
>
> http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-mapping
>
> but wasn't able to sove my problem anyway. I even tried changing my user
> group from 513 to 544 in /dev/passwd by directly editing this file...
>
> I'd rather not change the program (as it runs fine on linux) but just be
> recognized as root to have it going on Windows. Is that possible?
>
> Thanks in advance. Cheers,
>
> Jorge.
>
>



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019