mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-08 14:41:55 +00:00
ported uid/gid to new api
This commit is contained in:
@@ -149,9 +149,9 @@ static struct uwsgi_option uwsgi_base_options[] = {
|
||||
{"pidfile", required_argument, 0, "create pidfile (before privileges drop)", uwsgi_opt_set_str, &uwsgi.pidfile,0},
|
||||
{"pidfile2", required_argument, 0, "create pidfile (after privileges drop)", uwsgi_opt_set_str, &uwsgi.pidfile2,0},
|
||||
{"chroot", required_argument, 0, "chroot() to the specified directory", uwsgi_opt_set_str, &uwsgi.chroot,0},
|
||||
{"uid", required_argument, 0, "setuid to the specified user/uid", uwsgi_opt_set_uid, NULL, 0},
|
||||
{"gid", required_argument, 0, "setgid to the specified group/gid", uwsgi_opt_set_gid, NULL, 0},
|
||||
/*
|
||||
{"gid", required_argument, 0, LONG_ARGS_GID,0},
|
||||
{"uid", required_argument, 0, LONG_ARGS_UID,0},
|
||||
#ifdef UWSGI_CAP
|
||||
{"cap", required_argument,0, LONG_ARGS_CAP,0},
|
||||
#endif
|
||||
@@ -3295,6 +3295,20 @@ void uwsgi_opt_add_spooler(char *opt, char *directory, void *none) {
|
||||
|
||||
}
|
||||
|
||||
void uwsgi_opt_set_uid(char *opt, char *value, void *none) {
|
||||
|
||||
uwsgi.uid = atoi(value);
|
||||
if (!uwsgi.uid)
|
||||
uwsgi.uidname = value;
|
||||
}
|
||||
|
||||
void uwsgi_opt_set_gid(char *opt, char *value, void *none) {
|
||||
|
||||
uwsgi.gid = atoi(value);
|
||||
if (!uwsgi.gid)
|
||||
uwsgi.gidname = value;
|
||||
}
|
||||
|
||||
void uwsgi_opt_load_plugin(char *opt, char *value, void *none) {
|
||||
char *p = strtok(uwsgi_concat2(value, ""), ",");
|
||||
while (p != NULL) {
|
||||
|
||||
@@ -2508,6 +2508,8 @@ void uwsgi_opt_load_yml(char *, char *, void *);
|
||||
|
||||
void uwsgi_opt_set_umask(char *, char *, void *);
|
||||
void uwsgi_opt_add_spooler(char *, char *, void *);
|
||||
void uwsgi_opt_set_uid(char *, char *, void *);
|
||||
void uwsgi_opt_set_gid(char *, char *, void *);
|
||||
|
||||
#ifdef UWSGI_AS_SHARED_LIBRARY
|
||||
int uwsgi_init(int, char **, char **);
|
||||
|
||||
Reference in New Issue
Block a user