mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
simplified umask
This commit is contained in:
@@ -204,6 +204,7 @@ use-utmp = true
|
||||
pid-file = /var/run/ocserv.pid
|
||||
|
||||
# socket file used for IPC, will be appended with .PID
|
||||
# It must be accessible within the chroot environment (if any)
|
||||
socket-file = /var/run/ocserv-socket
|
||||
|
||||
# The user the worker processes will be run as.
|
||||
|
||||
@@ -162,7 +162,6 @@ gnutls_datum_t data, out;
|
||||
uint16_t length;
|
||||
struct iovec iov[2];
|
||||
int sd;
|
||||
int mask;
|
||||
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
signal(SIGINT, SIG_DFL);
|
||||
@@ -194,14 +193,13 @@ int mask;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
mask = umask(066);
|
||||
umask(066);
|
||||
ret = bind(sd, (struct sockaddr *)&sa, SUN_LEN(&sa));
|
||||
if (ret == -1) {
|
||||
e = errno;
|
||||
syslog(LOG_ERR, "could not bind socket '%s': %s", socket_file, strerror(e));
|
||||
exit(1);
|
||||
}
|
||||
umask(mask);
|
||||
|
||||
ret = chown(socket_file, config->uid, config->gid);
|
||||
if (ret == -1) {
|
||||
|
||||
Reference in New Issue
Block a user