summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.statd
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2007-08-13 15:04:39 +0000
committertruckman <truckman@FreeBSD.org>2007-08-13 15:04:39 +0000
commit70af7ac57edb5225426f48b19b625f4133bdf8d1 (patch)
treea52c6c5d97084bdf5ff2d1796d25821805c8c6f7 /usr.sbin/rpc.statd
parent14bf51675994442afab747d26327e03f6ee26162 (diff)
downloadFreeBSD-src-70af7ac57edb5225426f48b19b625f4133bdf8d1.zip
FreeBSD-src-70af7ac57edb5225426f48b19b625f4133bdf8d1.tar.gz
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
Diffstat (limited to 'usr.sbin/rpc.statd')
-rw-r--r--usr.sbin/rpc.statd/file.c2
1 files changed, 1 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud