You are not logged in.

#1 2013-07-09 05:54:42

Archdove
Member
Registered: 2011-09-23
Posts: 118

How is a user set as owner to a file? Technically.

Hello

I have to create some debian packages out of a Cygwin environment. To Create those packages properly, chown root:root has to be set for each file (it seems). Otherwise lintian will throw warnings.

Since there is no root user in cygwin, this is a bit of a problem and thus my Questian:
How is the owner set to a file on the file? Is it simply by name like in the /etc/groups file or is it by UID? Can i fake or force this, since the UID of root will always be 0?

Regards, Dove

Offline

#2 2013-07-09 13:01:26

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: How is a user set as owner to a file? Technically.

Have you searched for a solution to your problem on the Internet? A quick search for "cygwin change file ownership" gave me this and many other results. A lot of people use cygwin, so someone's probably run into this problem before. wink

Offline

#3 2013-07-09 14:05:20

Archdove
Member
Registered: 2011-09-23
Posts: 118

Re: How is a user set as owner to a file? Technically.

i may not have made my problem clear enough.

Setting file permissions is not an issue. The problem is that i need to set the owner of a file to root while there is no user named root on the system. I could create such a user in windows but its UID couldn't possibly be 0.

So the question is:
On a system without root how do i do this:

chown root:root foo

Plus to my other question:
How is the owner of a file saved. Ist it by name or by UID?

Offline

#4 2013-07-09 14:13:57

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: How is a user set as owner to a file? Technically.

http://stackoverflow.com/questions/4090 … -in-cygwin

Seems rather relevant, and was the first google result for "cygwin root user"

More generally, user and group ownership are stored as numeric values. Files like /etc/passwd and /etc/group merely serve to provide mappings of human readable names to numbers.

Offline

#5 2013-07-09 19:30:34

deepsoul
Member
From: Earth
Registered: 2012-12-23
Posts: 67
Website

Re: How is a user set as owner to a file? Technically.

Have you tried:

chown 0.0 file

I am not sure if you have to be logged in as a user with (Windoze) administrator privileges to use chown in Cygwin.  (On the machine where I use it, I usually have those.)  Anyway, under Linux chown accepts non-existent user IDs when given numerically.

The more general solution to this class of problems is of course fakeroot (1), but I do not know if Cygwin provides it.


Officer, I had to drive home - I was way too drunk to teleport!

Offline

Board footer

Powered by FluxBB