Project

General

Profile

Actions

Bug #6248

closed

Truncation of log when null character included in stream

Added by rubysubmit (Ruby Submit) over 12 years ago. Updated over 12 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p290
Backport:
[ruby-core:44089]

Description

require 'syslog'

Syslog.open("n")
Syslog.info("everything is normal and fine\0 additional message")

This results in the following log message.

example n[9270]: everything is normal and fine

Updated by drbrain (Eric Hodel) over 12 years ago

  • Category set to ext
  • Status changed from Open to Third Party's Issue
  • Priority changed from 3 to Normal

=begin
Seems to be an issue of syslog(), not ruby:

$ cat t.c
#include <syslog.h>
#include <stdarg.h>

int main() {
openlog("test", LOG_PID, LOG_USER);

syslog(LOG_DEBUG, "%s", "hello\0world");

return 0;

}
$ gcc t.c && ./a.out
$ sudo grep test /var/log/all.log
Apr 2 16:03:38 ziz test[15322]: hello

=end

Actions

Also available in: Atom PDF

Like0
Like0