Larry Hastings <la...@hastings.org> added the comment:

I don't think "k" is the right answer.

POSIX defines the user and group parameters as uid_t and gid_t respectively; in 
turn, uid_t and gid_t are defined as "integers", pointedly omitting the either 
of the words "signed" or "unsigned".  So POSIX makes no guarantee that uid_t 
and gid_t are unsigned.

On the other hand: chown takes special values defined as "(uid_t)-1" and 
"(gid_t)-1" to indicate "don't change this value".  If we change chown to use 
"k" for uid and gid, then in order to use this value you'd have to pass in the 
equivalent unsigned value.  And that'd require you to know the size of an int 
on the local platform.  Yuck!

If this is a genuine problem, then I think we have to take "O" (or "O!") and 
convert the long by hand.  If it's -1, use "(uid_t)-1" (etc), otherwise convert 
as unsigned.  On the other hand, if this is only a theoretical problem then I'd 
prefer to wontfix and keep the code simple.

p.s. find uid_t / gid_t here: 
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html
chown here:
http://pubs.opengroup.org/onlinepubs/009695399/functions/chown.html

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15301>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to