9front - general discussion about 9front
 help / color / mirror / Atom feed
From: covertusername967@gmail.com
To: covertusername976@gmail.com, 9front@9front.org
Subject: kernel: postnote patch
Date: Sat, 4 Apr 2020 23:48:26 -0500	[thread overview]
Message-ID: <06E1942FE9510AF49AD5A0548E38DB3F@gmail.com> (raw)

Currently, if you do a zero-sized write into the /proc/$pid/note file,
it will post the empty note successfully and cause the process to exit
with no status code.  This patch disables zero-sized note strings
altogether.

diff -r f3cc6939a481 sys/src/9/port/proc.c
--- a/sys/src/9/port/proc.c	Wed Apr 01 22:57:15 2020 +1030
+++ b/sys/src/9/port/proc.c	Sat Apr 04 23:31:39 2020 -0500
@@ -903,6 +903,9 @@
 		return 0;
 	}
 
+	if(strlen(n) == 0)
+		return 0;
+
 	if(n != nil && flag != NUser && (p->notify == nil || p->notified))
 		p->nnote = 0;



             reply	other threads:[~2020-04-05  4:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-05  4:48 covertusername967 [this message]
2020-04-06 14:07 covertusername967

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06E1942FE9510AF49AD5A0548E38DB3F@gmail.com \
    --to=covertusername967@gmail.com \
    --cc=9front@9front.org \
    --cc=covertusername976@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).