From 70af7ac57edb5225426f48b19b625f4133bdf8d1 Mon Sep 17 00:00:00 2001 From: truckman Date: Mon, 13 Aug 2007 15:04:39 +0000 Subject: 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(-) (limited to 'usr.sbin/rpc.statd/file.c') diff --git a/usr.sbin/rpc.statd/file.c b/usr.sbin/rpc.statd/file.c index 991af88..efcaaaf 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); -- cgit v1.1