]> granicus.if.org Git - python/commitdiff
Issue #4591: Uid and gid values larger than 2**31 are supported now.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 10 Feb 2013 20:03:08 +0000 (22:03 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 10 Feb 2013 20:03:08 +0000 (22:03 +0200)
1  2 
Lib/test/test_posix.py
Makefile.pre.in
Misc/NEWS
Modules/posixmodule.c
Modules/pwdmodule.c
Modules/signalmodule.c

Simple merge
diff --cc Makefile.pre.in
Simple merge
diff --cc Misc/NEWS
Simple merge
index 2e65da2a5f6e9b11ee2831d2322d882b90a98de5,7e36df5da6a283154f23ba113549c88fe5fce95e..2d31c94f8040aef64a066f7d29ba32304c240d4c
@@@ -2896,24 -3211,23 +3020,26 @@@ Equivalent to os.chown(path, uid, gid, 
  static PyObject *
  posix_lchown(PyObject *self, PyObject *args)
  {
 -    PyObject *opath;
 -    char *path;
 +    path_t path;
-     long uid, gid;
+     uid_t uid;
+     gid_t gid;
      int res;
-     if (!PyArg_ParseTuple(args, "O&ll:lchown",
 +    memset(&path, 0, sizeof(path));
 +    path.function_name = "lchown";
 -                          PyUnicode_FSConverter, &opath,
+     if (!PyArg_ParseTuple(args, "O&O&O&:lchown",
-                           &uid, &gid))
 +                          path_converter, &path,
+                           _Py_Uid_Converter, &uid,
+                           _Py_Gid_Converter, &gid))
          return NULL;
 -    path = PyBytes_AsString(opath);
      Py_BEGIN_ALLOW_THREADS
-     res = lchown(path.narrow, (uid_t) uid, (gid_t) gid);
 -    res = lchown(path, uid, gid);
++    res = lchown(path.narrow, uid, gid);
      Py_END_ALLOW_THREADS
 -    if (res < 0)
 -        return posix_error_with_allocated_filename(opath);
 -    Py_DECREF(opath);
 +    if (res < 0) {
 +        path_error(&path);
 +        path_cleanup(&path);
 +        return NULL;
 +    }
 +    path_cleanup(&path);
      Py_INCREF(Py_None);
      return Py_None;
  }
Simple merge
Simple merge