Mailing Lists: Apple Mailing Lists

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

Re: pthread_getugid_np and pthread_setugid_np?




On Jan 27, 2008, at 4:47 PM, James Bucanek wrote:

Kaelin Colclasure <mailto:email@hidden> wrote (Saturday, January 26, 2008 5:02 PM -0800):
It's not a security mechanism-- a thread that had the privilege to set credentials can always revert back to its original credentials by calling:

pthread_setugid_np(KAUTH_UID_NONE, KAUTH_GID_NONE);

Sweet!

That's exactly what I was looking for. So can you tell me if that's documented anywhere -- or is this just in the collective knowledge of the Mac OS X Gestalt?


Do you consider the kernel sources documentation? ;-)

• /*
• * Set the per-thread override identity. The first parameter can be the
• * current real UID, KAUTH_UID_NONE, or, if the caller is priviledged, it
• * can be any UID. If it is KAUTH_UID_NONE, then as a special case, this
• * means "revert to the per process credential"; otherwise, if permitted,
• * it changes the effective, real, and saved UIDs and GIDs for the current
• * thread to the requested UID and single GID, and clears all other GIDs.
• */


This comment prefixes the implementation of settid in xnu/bsd/kern/ kern_prot.c.


I'll file a bug report on the lack of documentation for pthread_getugid_np/pthread_setugid_np.


Yes, please do... :-)


Thanks so very much for the info.


NP.

-- Kaelin

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: pthread_getugid_np and pthread_setugid_np? (From: James Bucanek <email@hidden>)



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.