[Zope-Checkins] SVN: Zope/trunk/ make the initgroups extension a
package; zpkg is still happier working with
Fred L. Drake, Jr.
fdrake at gmail.com
Fri Aug 26 14:26:45 EDT 2005
Log message for revision 38106:
make the initgroups extension a package; zpkg is still happier working with
packages than single pieces
Changed:
D Zope/trunk/lib/Components/initgroups/
A Zope/trunk/lib/python/initgroups/
A Zope/trunk/lib/python/initgroups/__init__.py
A Zope/trunk/lib/python/initgroups/_initgroups.c
U Zope/trunk/setup.py
-=-
Added: Zope/trunk/lib/python/initgroups/__init__.py
===================================================================
--- Zope/trunk/lib/python/initgroups/__init__.py 2005-08-26 16:40:10 UTC (rev 38105)
+++ Zope/trunk/lib/python/initgroups/__init__.py 2005-08-26 18:26:45 UTC (rev 38106)
@@ -0,0 +1,15 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+from _initgroups import initgroups
Property changes on: Zope/trunk/lib/python/initgroups/__init__.py
___________________________________________________________________
Name: svn:mime-type
+ text/x-python
Name: svn:eol-style
+ native
Copied: Zope/trunk/lib/python/initgroups/_initgroups.c (from rev 38105, Zope/trunk/lib/Components/initgroups/initgroups.c)
===================================================================
--- Zope/trunk/lib/Components/initgroups/initgroups.c 2005-08-26 16:40:10 UTC (rev 38105)
+++ Zope/trunk/lib/python/initgroups/_initgroups.c 2005-08-26 18:26:45 UTC (rev 38106)
@@ -0,0 +1,61 @@
+/*****************************************************************************
+
+ Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
+
+ This software is subject to the provisions of the Zope Public License,
+ Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+ WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+ FOR A PARTICULAR PURPOSE
+
+ ****************************************************************************/
+
+#include "Python.h"
+
+#if defined(__unix__) || defined(unix) || defined(__NetBSD__) || defined(__MACH__) /* Mac OS X */
+
+#include <grp.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+static PyObject *
+initgroups_initgroups(PyObject *self, PyObject *args)
+{
+ char *username;
+ unsigned int igid;
+ gid_t gid;
+
+ if (!PyArg_ParseTuple(args, "sI:initgroups", &username, &igid))
+ return NULL;
+
+ gid = igid;
+
+ if (initgroups(username, gid) == -1)
+ return PyErr_SetFromErrno(PyExc_OSError);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
+static PyMethodDef InitgroupsMethods[] = {
+ {"initgroups", initgroups_initgroups, METH_VARARGS},
+ {NULL, NULL}
+};
+
+#else
+
+/* This module is empty on non-UNIX systems. */
+
+static PyMethodDef InitgroupsMethods[] = {
+ {NULL, NULL}
+};
+
+#endif /* defined(__unix__) || defined(unix) */
+
+void
+init_initgroups(void)
+{
+ Py_InitModule("_initgroups", InitgroupsMethods);
+}
+
Modified: Zope/trunk/setup.py
===================================================================
--- Zope/trunk/setup.py 2005-08-26 16:40:10 UTC (rev 38105)
+++ Zope/trunk/setup.py 2005-08-26 18:26:45 UTC (rev 38106)
@@ -1,4 +1,3 @@
-
#!/usr/bin/env python2.3
##############################################################################
@@ -347,8 +346,8 @@
depends=["ExtensionClass/ExtensionClass.h"]),
# initgroups
- Extension(name='initgroups',
- sources=['../Components/initgroups/initgroups.c']),
+ Extension(name='initgroups._initgroups',
+ sources=['initgroups/_initgroups.c']),
# indexes
Extension(name='Products.PluginIndexes.TextIndex.Splitter.ZopeSplitter.ZopeSplitter',
More information about the Zope-Checkins
mailing list