prepare for before_privileges_drop plugins

This commit is contained in:
roberto@quantal64
2012-08-09 17:25:05 +02:00
parent 36c79b100e
commit e3014bd0dc
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -636,6 +636,14 @@ void uwsgi_as_root() {
}
// ok try to call some special hook before finally dropping privileges
int i;
for (i = 0; i < uwsgi.gp_cnt; i++) {
if (uwsgi.gp[i]->before_privileges_drop) {
uwsgi.gp[i]->before_privileges_drop();
}
}
if (uwsgi.gid) {
if (!uwsgi.master_as_root)
uwsgi_log("setgid() to %d\n", uwsgi.gid);
+1
View File
@@ -690,6 +690,7 @@ struct uwsgi_plugin {
uint16_t(*rpc) (void *, uint8_t, char **, uint16_t *, char *);
void (*jail) (int (*)(void *), char **);
void (*before_privileges_drop)(void);
int (*mule)(char *);
int (*mule_msg)(char *, size_t);