diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2019-04-08 18:16:49 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2019-04-08 18:16:49 +0000 |
| commit | 7bead17ddc28dbbd27424a098f3a8834500351bf (patch) | |
| tree | ca0df38ceba56b9f10934e4ddb178a3c50537e63 /sbin/mount | |
| parent | 5ffc99e2e4e63ee13bc99e337010716585df2332 (diff) | |
Notes
Diffstat (limited to 'sbin/mount')
| -rw-r--r-- | sbin/mount/mount.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index a44a6fe8571f..adab70d5eba5 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -227,6 +227,7 @@ restart_mountd(void) struct pidfh *pfh; pid_t mountdpid; + mountdpid = 0; pfh = pidfile_open(_PATH_MOUNTDPID, 0600, &mountdpid); if (pfh != NULL) { /* Mountd is not running. */ @@ -237,6 +238,16 @@ restart_mountd(void) /* Cannot open pidfile for some reason. */ return; } + + /* + * Refuse to send broadcast or group signals, this has + * happened due to the bugs in pidfile(3). + */ + if (mountdpid <= 0) { + warnx("mountd pid %d, refusing to send SIGHUP", mountdpid); + return; + } + /* We have mountd(8) PID in mountdpid varible, let's signal it. */ if (kill(mountdpid, SIGHUP) == -1) err(1, "signal mountd"); |
