]> granicus.if.org Git - python/commitdiff
Issue #10433: Document unique behavior of 'os.getgroups' on Mac OS X.
authorNed Deily <nad@acm.org>
Mon, 30 Apr 2012 18:14:02 +0000 (11:14 -0700)
committerNed Deily <nad@acm.org>
Mon, 30 Apr 2012 18:14:02 +0000 (11:14 -0700)
Doc/library/os.rst

index be322a01fef903df67ca217ae01090628cb64d4c..0b66d2bfaaeadd053b69d6bd56d09e450f4de469 100644 (file)
@@ -227,6 +227,20 @@ process and user.
 
    Availability: Unix.
 
+   .. note:: On Mac OS X, :func:`getgroups` behavior differs somewhat from
+      other Unix platforms. If the Python interpreter was built with a
+      deployment target of :const:`10.5` or earlier, :func:`getgroups` returns
+      the list of effective group ids associated with the current user process;
+      this list is limited to a system-defined number of entries, typically 16,
+      and may be modified by calls to :func:`setgroups` if suitably privileged.
+      If built with a deployment target greater than :const:`10.5`,
+      :func:`getgroups` returns the current group access list for the user
+      associated with the effective user id of the process; the group access
+      list may change over the lifetime of the process, it is not affected by
+      calls to :func:`setgroups`, and its length is not limited to 16.  The
+      deployment target value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be
+      obtained with :func:`sysconfig.get_config_var`.
+
 
 .. function:: initgroups(username, gid)
 
@@ -389,6 +403,10 @@ process and user.
 
    Availability: Unix.
 
+   .. note:: On Mac OS X, the length of *groups* may not exceed the
+      system-defined maximum number of effective group ids, typically 16.
+      See the documentation for :func:`getgroups` for cases where it may not
+      return the same group list set by calling setgroups().
 
 .. function:: setpgrp()