From d0716c74b5fa2aead849fc4132a0f7fdfce02575 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 15 Feb 2016 20:46:12 +0100 Subject: Make fakeroot forward send errors instead of crashing * trans/fakeroot.c (netfs_demuxer): When forwarding an unknown request fail, forward the error instead of crashing. --- trans/fakeroot.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'trans') diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 64f32081..cb4f818d 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -1032,10 +1032,12 @@ netfs_demuxer (mach_msg_header_t *inp, err = mach_msg (inp, MACH_SEND_MSG, inp->msgh_size, 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); - assert_perror (err); /* XXX should synthesize reply */ + if (err) + ((mig_reply_header_t *) outp)->RetCode = err; + else + /* We already sent the message, so the server loop shouldn't do it again. */ + ((mig_reply_header_t *) outp)->RetCode = MIG_NO_REPLY; ports_port_deref (cred); - /* We already sent the message, so the server loop shouldn't do it again. */ - ((mig_reply_header_t *) outp)->RetCode = MIG_NO_REPLY; return 1; } } -- cgit v1.2.3