diff --git a/CHANGES b/CHANGES index 978dea5..7f06f20 100644 --- a/CHANGES +++ b/CHANGES @@ -49,6 +49,11 @@ Corrections: derived from option commonname or rom target server name. This is not useful with IP addresses, which Socat now checks and avoids. + Socat options -L and -W create lock files using mkstemp(), so they had + permissions 600. There does not seem to be a good reason for this + restrictive mode. Furthermore Silla Rizzoli experienced that Minicom + ignores lock files with mode 600, so it is set to 644 now. + Features: VSOCK, VSOCK-L support options pf, socktype, prototype (currently useless) diff --git a/xiolockfile.c b/xiolockfile.c index 13a42b6..b2471e8 100644 --- a/xiolockfile.c +++ b/xiolockfile.c @@ -51,14 +51,14 @@ int xiogetlock(const char *lockfile) { } pid = Getpid(); - bytes = sprintf(pidbuf, F_pid, pid); + bytes = sprintf(pidbuf, F_pid"\n", pid); if (writefull(fd, pidbuf, bytes) < 0) { Error4("write(%d, %p, "F_Zu"): %s", fd, pidbuf, bytes, strerror(errno)); return -1; } + Fchmod(fd, 0644); Close(fd); - /* Chmod(lockfile, 0600); */ if (Link(s, lockfile) < 0) { int _errno = errno; Error3("link(\"%s\", \"%s\"): %s", s, lockfile, strerror(errno));