Message95818
This does seem to be a long standing Unix*-flavor behavior difference.
The open(2) man page on OS X (and presumably FreeBSD) reads:
When a new file is created, it is given the group of the directory
which contains it.
The Linux open(2) page has:
O_CREAT
If the file does not exist it will be created. The owner
(user ID) of
the file is set to the effective user ID of the process. The
group own‐
ership (group ID) is set either to the effective group ID of
the process
or to the group ID of the parent directory (depending on file
system type
and mount options, and the mode of the parent directory, see
the mount
options bsdgroups and sysvgroups described in mount(8)).
The Open Group Base Specifications (Issue 6, 2004) for open(1) has this
rationale:
"The POSIX.1-1990 standard required that the group ID of a newly created
file be set to the group ID of its parent directory or to the effective
group ID of the creating process. FIPS 151-2 required that
implementations provide a way to have the group ID be set to the group
ID of the containing directory, but did not prohibit implementations
also supporting a way to set the group ID to the effective group ID of
the creating process. Conforming applications should not assume which
group ID will be used. If it matters, an application can use chown() to
set the group ID after the file is created, or determine under what
conditions the implementation will set the desired group ID."
So the portable solution is to change the test to not assume which group
ID is used. |
|
Date |
User |
Action |
Args |
2009-11-29 21:58:11 | ned.deily | set | recipients:
+ ned.deily, loewis, db3l, titus, tarek |
2009-11-29 21:58:11 | ned.deily | set | messageid: <1259531891.32.0.757031822699.issue7408@psf.upfronthosting.co.za> |
2009-11-29 21:58:09 | ned.deily | link | issue7408 messages |
2009-11-29 21:58:08 | ned.deily | create | |
|