mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 09:55:06 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e8541e3c4 | ||
|
|
e95d5a161d | ||
|
|
2c63dfee34 | ||
|
|
42e6b5577a | ||
|
|
830c8bb18a | ||
|
|
0289442998 |
2
client.c
2
client.c
@@ -270,7 +270,7 @@ open_unix_socket(char *server_path)
|
|||||||
if (snprintf(sock_dir1, sizeof (sock_dir1),
|
if (snprintf(sock_dir1, sizeof (sock_dir1),
|
||||||
"%s/chronyc.%d", sock_dir0, (int)getpid()) >= sizeof (sock_dir1) ||
|
"%s/chronyc.%d", sock_dir0, (int)getpid()) >= sizeof (sock_dir1) ||
|
||||||
snprintf(sock_dir2, sizeof (sock_dir2),
|
snprintf(sock_dir2, sizeof (sock_dir2),
|
||||||
"%s/%s", sock_dir1, rand_dir) >= sizeof (sock_dir1) ||
|
"%s/%s", sock_dir1, rand_dir) >= sizeof (sock_dir2) ||
|
||||||
snprintf(sock_path, sizeof (sock_path),
|
snprintf(sock_path, sizeof (sock_path),
|
||||||
"%s/sock", sock_dir2) >= sizeof (sock_path)) {
|
"%s/sock", sock_dir2) >= sizeof (sock_path)) {
|
||||||
LOG(LOGS_ERR, "Server socket path %s is too long", server_path);
|
LOG(LOGS_ERR, "Server socket path %s is too long", server_path);
|
||||||
|
|||||||
@@ -944,8 +944,7 @@ SYS_Linux_OpenPHC(const char *device, int flags)
|
|||||||
if (phc_fd < 0) {
|
if (phc_fd < 0) {
|
||||||
phc_fd = open_phc_by_iface_name(device, flags);
|
phc_fd = open_phc_by_iface_name(device, flags);
|
||||||
if (phc_fd < 0) {
|
if (phc_fd < 0) {
|
||||||
LOG(LOGS_ERR, "Could not open PHC of iface %s : %s",
|
LOG(LOGS_ERR, "Could not open PHC (of) %s", device);
|
||||||
device, strerror(errno));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
phc_fd = verify_fd_is_phc(phc_fd);
|
phc_fd = verify_fd_is_phc(phc_fd);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
This is a collection of simulation tests using the clknetsim simulator
|
This is a collection of simulation tests using the clknetsim simulator
|
||||||
(supported on Linux only).
|
(supported on Linux only).
|
||||||
|
|
||||||
https://github.com/mlichvar/clknetsim
|
https://gitlab.com/chrony/clknetsim
|
||||||
|
|
||||||
The CLKNETSIM_PATH environment variable should point to the directory where
|
The CLKNETSIM_PATH environment variable should point to the directory where
|
||||||
clknetsim was downloaded and compiled. If the variable is not set, the tests
|
clknetsim was downloaded and compiled. If the variable is not set, the tests
|
||||||
|
|||||||
@@ -213,7 +213,10 @@ generate_chrony_conf() {
|
|||||||
|
|
||||||
user=$(get_user)
|
user=$(get_user)
|
||||||
ntpport=$(get_free_port)
|
ntpport=$(get_free_port)
|
||||||
cmdport=$(get_free_port)
|
while true; do
|
||||||
|
cmdport=$(get_free_port)
|
||||||
|
[ "$ntpport" -ne "$cmdport" ] && break
|
||||||
|
done
|
||||||
|
|
||||||
echo "0.0 10000" > "$TEST_LIBDIR/driftfile"
|
echo "0.0 10000" > "$TEST_LIBDIR/driftfile"
|
||||||
echo "1 MD5 abcdefghijklmnopq" > "$TEST_DIR/keys"
|
echo "1 MD5 abcdefghijklmnopq" > "$TEST_DIR/keys"
|
||||||
|
|||||||
@@ -193,6 +193,8 @@ test_unit(void)
|
|||||||
|
|
||||||
server_cred = NKSN_CreateServerCertCredentials(&cert, &key, 1);
|
server_cred = NKSN_CreateServerCertCredentials(&cert, &key, 1);
|
||||||
client_cred = NKSN_CreateClientCertCredentials(&cert, &cert_id, 1, 0);
|
client_cred = NKSN_CreateClientCertCredentials(&cert, &cert_id, 1, 0);
|
||||||
|
TEST_CHECK(server_cred);
|
||||||
|
TEST_CHECK(client_cred);
|
||||||
|
|
||||||
TEST_CHECK(socketpair(AF_UNIX, SOCK_STREAM, 0, sock_fds) == 0);
|
TEST_CHECK(socketpair(AF_UNIX, SOCK_STREAM, 0, sock_fds) == 0);
|
||||||
TEST_CHECK(fcntl(sock_fds[0], F_SETFL, O_NONBLOCK) == 0);
|
TEST_CHECK(fcntl(sock_fds[0], F_SETFL, O_NONBLOCK) == 0);
|
||||||
|
|||||||
2
util.c
2
util.c
@@ -1203,7 +1203,7 @@ create_dir(char *p, mode_t mode, uid_t uid, gid_t gid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set its owner */
|
/* Set its owner */
|
||||||
if (chown(p, uid, gid) < 0) {
|
if (lchown(p, uid, gid) < 0) {
|
||||||
LOG(LOGS_ERR, "Could not change ownership of %s : %s", p, strerror(errno));
|
LOG(LOGS_ERR, "Could not change ownership of %s : %s", p, strerror(errno));
|
||||||
/* Don't leave it there with incorrect ownership */
|
/* Don't leave it there with incorrect ownership */
|
||||||
rmdir(p);
|
rmdir(p);
|
||||||
|
|||||||
Reference in New Issue
Block a user