drop privileges after chown-socket (second-try)

This commit is contained in:
roberto@centos6
2011-07-12 20:58:40 +02:00
parent f25d147908
commit 3d2b7c136a
+6 -3
View File
@@ -1731,9 +1731,6 @@ int uwsgi_start(void *v_argv) {
uwsgi_sock->family = AF_UNIX;
if (uwsgi.chown_socket) {
uwsgi_chown(uwsgi_sock->name, uwsgi.chown_socket);
if (!uwsgi.master_as_root) {
uwsgi_as_root();
}
}
uwsgi_log("uwsgi socket %d bound to UNIX address %s fd %d\n", uwsgi_get_socket_num(uwsgi_sock), uwsgi_sock->name, uwsgi_sock->fd);
}
@@ -1752,6 +1749,12 @@ int uwsgi_start(void *v_argv) {
uwsgi_sock = uwsgi_sock->next;
}
if (uwsgi.chown_socket) {
if (!uwsgi.master_as_root) {
uwsgi_as_root();
}
}
int zero_used = 0;
uwsgi_sock = uwsgi.sockets;
while (uwsgi_sock) {