Date: Wed, 24 Jan 2018 18:51:50 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224015] filemon(4) can't deal with newlines in paths Message-ID: <bug-224015-8-GqmJBjGUxb@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-224015-8@https.bugs.freebsd.org/bugzilla/> References: <bug-224015-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224015 --- Comment #2 from Jan Bramkamp <crest@bultmann.eu> --- There is no way an existing user of the filemon(4) API can correctly deal with newlines in paths. As such I would recommend the following changes to maintain compatiblity: * Drop paths incompatible with the current format from the event stream. This keeps existing code working for all paths encodable without violating data transparency. * The simplest solution would be to add an ioctl() switching the encoding to be used before attaching a file descriptor to the filemon file descriptor. It would be enough to just use NUL as separator between records. If records contain multiple NUL terminated string the the consumer would have to deduce the number of string arguments from the first byte of a record unless. But this is kind of encoding would still be a fragile hack and existing code couldn't skip over new record types. Because of this I would recommend fixing this problem in a way to minimize the impact of future changes by migrating the encoding to a stream of djb style netstrings. They are very easy to generate and fairly easy to parse without switching to a binary encoding. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-224015-8-GqmJBjGUxb>
