Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is 'test' broken or is this supposed to work this way?



I have a process that is setuid at one point (through NSAuthentication). It then executes a script.

At some point, there is a file foo, owned by root.admin:

-rw-r--r-- 1 root admin 2366 Jun 15 13:23 foo

I have uid 501

When I run sudo, both my real and effective uid become 0. If I then run test -w foo the result is true.

When I run a script from NSAuthentication, my real uid remains 501, but my effective uid becomes 0. If I run test -w foo the result is false.

In other words: test on Mac OS X tests against real uid and not against effective uid.

Is this supposed to work that way (and do I need to create a workaround) or is this a bug?

Thanks,

SH




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.