diff options
author | Guido van Rossum <guido@python.org> | 1993-11-10 09:23:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-10 09:23:53 (GMT) |
commit | a3d78fb268da5cf7cd4d990cf118bfc01650a8d9 (patch) | |
tree | 8b72efe5cef9a755ab55dd919f7e0591235b0345 /Modules/posixmodule.c | |
parent | b2e358d433e0ddbfc870d1a6ce12e7917388c2fe (diff) | |
download | cpython-a3d78fb268da5cf7cd4d990cf118bfc01650a8d9.zip cpython-a3d78fb268da5cf7cd4d990cf118bfc01650a8d9.tar.gz cpython-a3d78fb268da5cf7cd4d990cf118bfc01650a8d9.tar.bz2 |
* posixmodule.c: added set{uid,gid}.
* {tuple,list,mapping,array}object.c: call printobject with 0 for flags
* compile.c (parsestr): use quote instead of '\'' at one crucial point
* arraymodule.c (array_getattr): Added __members__ attribute
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d84360b..00b8369 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -866,6 +866,34 @@ posix_popen(self, args) } static object * +posix_setuid(self, args) + object *self; + object *args; +{ + int uid; + if (!getargs(args, "i", &uid)) + return NULL; + if (setuid(uid) < 0) + return posix_error(); + INCREF(None); + return None; +} + +static object * +posix_setgid(self, args) + object *self; + object *args; +{ + int gid; + if (!getargs(args, "i", &gid)) + return NULL; + if (setgid(gid) < 0) + return posix_error(); + INCREF(None); + return None; +} + +static object * posix_waitpid(self, args) object *self; object *args; @@ -1288,6 +1316,8 @@ static struct methodlist posix_methods[] = { {"getuid", posix_getuid}, {"kill", posix_kill}, {"popen", posix_popen}, + {"setuid", posix_setuid}, + {"setgid", posix_setgid}, {"setpgrp", posix_setpgrp}, {"wait", posix_wait}, {"waitpid", posix_waitpid}, |