mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 14:41:08 +01:00
When we decide to unlink socket file, sun_path must be set. If it is set,
but there is problem unlinking the file, log a warning. MFC after: 1 week
This commit is contained in:
parent
b24cc00190
commit
493812ee6e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=218474
@ -319,7 +319,12 @@ uds_close(void *ctx)
|
||||
*/
|
||||
if (uctx->uc_side == UDS_SIDE_SERVER_LISTEN &&
|
||||
uctx->uc_owner == getpid()) {
|
||||
(void)unlink(uctx->uc_sun.sun_path);
|
||||
PJDLOG_ASSERT(uctx->uc_sun.sun_path[0] != '\0');
|
||||
if (unlink(uctx->uc_sun.sun_path) == -1) {
|
||||
pjdlog_errno(LOG_WARNING,
|
||||
"Unable to unlink socket file %s",
|
||||
uctx->uc_sun.sun_path);
|
||||
}
|
||||
}
|
||||
uctx->uc_owner = 0;
|
||||
uctx->uc_magic = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user