Skip to content

Commit cb99ff1

Browse files
committed
Use relative symlinks
Absolute symlinks are typically discouraged, as they are confusing in chroot environments. This is not a problem here, but there is also no reason to use an absolute symlink as a relative symlink does the job just as well.
1 parent d8881ca commit cb99ff1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

daemon/qrexec-daemon.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,12 @@ static int create_qrexec_socket(int domid, const char *domname)
193193
res = unlink(link_to_socket_name);
194194
if (res != 0 && !(res == -1 && errno == ENOENT))
195195
err(1, "unlink(%s)", link_to_socket_name);
196+
const char *symlink_target = socket_address + strlen(socket_dir) + 1;
196197

197198
/* When running as root, make the socket accessible; perms on /var/run/qubes still apply */
198199
umask(0);
199-
if (symlink(socket_address, link_to_socket_name)) {
200-
PERROR("symlink(%s,%s)", socket_address, link_to_socket_name);
200+
if (symlink(symlink_target, link_to_socket_name)) {
201+
PERROR("symlink(%s,%s)", symlink_target, link_to_socket_name);
201202
}
202203
int fd = get_server_socket(socket_address);
203204
umask(0077);

0 commit comments

Comments
 (0)