diff --git a/.gitignore b/.gitignore index fff75a9..578ebc9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ libuser-0.56.16.tar.xz +/libuser-0.56.17.tar.xz diff --git a/libuser-0.56.16-id_t.patch b/libuser-0.56.16-id_t.patch deleted file mode 100644 index 0609283..0000000 --- a/libuser-0.56.16-id_t.patch +++ /dev/null @@ -1,119 +0,0 @@ -2010-07-02 Miloslav Trmač - - * python/libusermodule.c (libuser_validate_id_value): New function. - (libuser_methods): Add validateIdValue. - * python/modules.txt (libuser): Document validateIdValue. - * tests/files_test.py (Tests.testValidateIdValue): New test. - - * python/libusermodule.c (initlibuser): Provide VALUE_INVALID_ID. - * python/modules.txt (libuser): Document VALUE_INVALID_ID. - -diff -u b/python/libusermodule.c b/python/libusermodule.c ---- b/python/libusermodule.c Fri Jul 02 17:38:47 2010 +0200 -+++ b/python/libusermodule.c Fri Jul 02 18:35:45 2010 +0200 -@@ -58,6 +58,36 @@ - return ret; - } - -+static PyObject * -+libuser_validate_id_value(PyObject *self, PyObject *value) -+{ -+ PY_LONG_LONG ll; -+ -+ DEBUG_ENTRY; -+ ll = PyLong_AsLongLong(value); -+ if (PyErr_Occurred()) -+ goto error; -+ -+ if ((id_t)ll != ll) { -+ PyErr_SetString(PyExc_OverflowError, _("Value out of range")); -+ goto error; -+ } -+ if (ll < 0) { -+ PyErr_SetString(PyExc_ValueError, _("ID must not be negative")); -+ goto error; -+ } -+ if (ll == LU_VALUE_INVALID_ID) { -+ PyErr_SetString(PyExc_ValueError, _("Invalid ID value")); -+ goto error; -+ } -+ DEBUG_EXIT; -+ Py_RETURN_NONE; -+ -+error: -+ DEBUG_EXIT; -+ return NULL; -+} -+ - static PyMethodDef libuser_methods[] = { - {"admin", (PyCFunction) libuser_admin_new, METH_VARARGS | METH_KEYWORDS, - "create a new administration context"}, -@@ -71,6 +101,8 @@ - "create and return a new prompt record"}, - {"getUserShells", libuser_get_user_shells, METH_NOARGS, - "return a list of valid shells"}, -+ {"validateIdValue", libuser_validate_id_value, METH_O, -+ "validate an id_t value"}, - {NULL, NULL, 0, NULL}, - }; - -@@ -145,6 +177,8 @@ - - /* Miscellaneous. */ - PyDict_SetItemString(dict, "UT_NAMESIZE", PyInt_FromLong(UT_NAMESIZE)); -+ PyDict_SetItemString(dict, "VALUE_INVALID_ID", -+ PyLong_FromLongLong(LU_VALUE_INVALID_ID)); - - DEBUG_EXIT; - } -diff -u b/python/modules.txt b/python/modules.txt ---- b/python/modules.txt Fri Jul 02 17:38:47 2010 +0200 -+++ b/python/modules.txt Fri Jul 02 18:35:45 2010 +0200 -@@ -28,6 +28,7 @@ - - SHADOWWARNING - - - UT_NAMESIZE -+ - VALUE_INVALID_ID - - Methods: - - getUserShells: Returns a list of valid shells for users on -@@ -48,6 +49,10 @@ - Arguments: - None. - Returns: a libuser.Prompt object. -+ - validateIdValue: Verifies an id_t value is in the valid range. -+ Arguments: -+ id_t integer value -+ Returns: None. Raises an exception on error. - Types: - - Admin - An administrative context. - Methods: ---- a/tests/files_test.py Fri Jul 02 17:38:47 2010 +0200 -+++ b/tests/files_test.py Fri Jul 02 18:35:45 2010 +0200 -@@ -1229,6 +1229,26 @@ - self.a.addGroup(e) - self.assertEqual(self.a.enumerateGroupsFull('group31_3:*'), []) - -+ # ValidateIdValue is unrelated to the files module. -+ def testValidateIdValue(self): -+ libuser.validateIdValue(0) -+ libuser.validateIdValue(1) -+ libuser.validateIdValue(500) -+ libuser.validateIdValue(500L) -+ self.assertRaises(TypeError, libuser.validateIdValue, 'abc') -+ # OverflowError if id_t is signed, ValueError otherwise -+ self.assertRaises((ValueError, OverflowError), libuser.validateIdValue, -+ -1) -+ self.assertRaises((ValueError, OverflowError), libuser.validateIdValue, -+ -2) -+ self.assertRaises(ValueError, libuser.validateIdValue, -+ libuser.VALUE_INVALID_ID) -+ if libuser.VALUE_INVALID_ID > 0: -+ libuser.validateIdValue(libuser.VALUE_INVALID_ID - 1) -+ if libuser.VALUE_INVALID_ID < 2 ** 64 - 1: -+ self.assertRaises(OverflowError, libuser.validateIdValue, -+ 2 ** 64 - 1) -+ - def tearDown(self): - del self.a - diff --git a/libuser.spec b/libuser.spec index 8531e65..c3435d1 100644 --- a/libuser.spec +++ b/libuser.spec @@ -1,15 +1,12 @@ %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: libuser -Version: 0.56.16 -Release: 3%{?dist} +Version: 0.56.17 +Release: 1%{?dist} Group: System Environment/Base License: LGPLv2+ URL: https://fedorahosted.org/libuser/ Source: https://fedorahosted.org/releases/l/i/libuser/libuser-%{version}.tar.xz -# Upstream changesets 7be31ab1b558f1b506d9d00f650961c637c1ba8e and -# 072fc6a4a53a1a06281b35820fead48774fc80b2 -Patch0: libuser-0.56.16-id_t.patch BuildRequires: glib2-devel, linuxdoc-tools, pam-devel, popt-devel, python2-devel BuildRequires: cyrus-sasl-devel, libselinux-devel, openldap-devel # To make sure the configure script can find it @@ -46,7 +43,6 @@ administering user and group accounts. %prep %setup -q -%patch0 -p1 -b .id_t %build %configure --with-selinux --with-ldap --with-html-dir=%{_datadir}/gtk-doc/html @@ -102,6 +98,9 @@ python -c "import libuser" %{_datadir}/gtk-doc/html/* %changelog +* Thu Aug 26 2010 Miloslav Trmač - 0.56.17-1 +- Update to libuser-0.56.17 + * Wed Jul 21 2010 David Malcolm - 0.56.16-3 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild diff --git a/sources b/sources index b30029f..604420e 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -13af405b7743f35c9bec5294ecf8bbf5 libuser-0.56.16.tar.xz +9218d09478954bd56d8dcc6eb004a551 libuser-0.56.17.tar.xz