From 098935f8d59350a03a8d1337a1686974ff3edd9c Mon Sep 17 00:00:00 2001 From: Don Lewis Date: Mon, 13 Aug 2007 15:04:39 +0000 Subject: [PATCH] If the mmap() call in rpc.statd fails, rpc.statd prints a warning message and then dumps core because the subsequent code assumes that mmap() succeeded. Since rpc.statd does not have fallback code to implement the functionality needed to operate on the status file if it is not memory mapped, rpc.statd should use err() to force the process to exit if the mmap() call fails. PR: bin/115430 (mmap() failure previously fixed in statd.c 1.15) Approved by: re (kensmith) MFC after: 1 week --- usr.sbin/rpc.statd/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/rpc.statd/file.c b/usr.sbin/rpc.statd/file.c index 991af887e045..efcaaaf537b4 100644 --- a/usr.sbin/rpc.statd/file.c +++ b/usr.sbin/rpc.statd/file.c @@ -159,7 +159,7 @@ void init_file(const char *filename) mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED, status_fd, 0); if (status_info == (FileLayout *) MAP_FAILED) - warn("unable to mmap() status file"); + err(1, "unable to mmap() status file"); status_file_len = lseek(status_fd, 0L, SEEK_END);