mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:55:07 -05:00
socket: remove unused chmod() call
Drop the SCK_FLAG_ALL_PERMISSIONS support from the socket code. chronyc is now calling chmod() on its socket itself in a hidden directory to mitigate the unsafe operation.
This commit is contained in:
6
socket.c
6
socket.c
@@ -641,12 +641,6 @@ bind_unix_address(int sock_fd, const char *addr, int flags)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allow access to everyone with access to the directory if requested */
|
|
||||||
if (flags & SCK_FLAG_ALL_PERMISSIONS && chmod(addr, 0666) < 0) {
|
|
||||||
DEBUG_LOG("Could not change permissions of %s : %s", addr, strerror(errno));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
socket.h
3
socket.h
@@ -34,8 +34,7 @@
|
|||||||
#define SCK_FLAG_BLOCK 1
|
#define SCK_FLAG_BLOCK 1
|
||||||
#define SCK_FLAG_BROADCAST 2
|
#define SCK_FLAG_BROADCAST 2
|
||||||
#define SCK_FLAG_RX_DEST_ADDR 4
|
#define SCK_FLAG_RX_DEST_ADDR 4
|
||||||
#define SCK_FLAG_ALL_PERMISSIONS 8
|
#define SCK_FLAG_PRIV_BIND 8
|
||||||
#define SCK_FLAG_PRIV_BIND 16
|
|
||||||
|
|
||||||
/* Flags for receiving and sending messages */
|
/* Flags for receiving and sending messages */
|
||||||
#define SCK_FLAG_MSG_ERRQUEUE 1
|
#define SCK_FLAG_MSG_ERRQUEUE 1
|
||||||
|
|||||||
Reference in New Issue
Block a user