<commit_before># Start syslogd in foreground mode.
# The client writes a message to Sys::Syslog native method.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.
# Check ktrace for setting the correct uid and gid.
# Check fstat that the parent process has no inet sockets.

use strict;
use warnings;

our %args = (
    syslogd => {
	foreground => 1,
	ktrace => 1,
	fstat => 1,
    }
);

1;<commit_msg>Add foreground checks for fstat and ktrace.<commit_after># Start syslogd in foreground mode.
# The client writes a message to Sys::Syslog native method.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.
# Check fstat for the parent and child process.
# Check ktrace for setting the correct uid and gid.
# Check that stdio is dupped to /dev/null.

use strict;
use warnings;

our %args = (
    syslogd => {
	foreground => 1,
        fstat => {
            qr/^root .* wd / => 1,
            qr/^root .* root / => 0,
            qr/^root .* [012] .* null$/ => 3,
            qr/^root .* kqueue / => 0,
            qr/^root .* internet/ => 0,
            qr/^_syslogd .* wd / => 1,
            qr/^_syslogd .* root / => 1,
            qr/^_syslogd .* [012] .* null$/ => 3,
            qr/^_syslogd .* kqueue / => 1,
            qr/^_syslogd .* internet/ => 2,
        },
        ktrace => {
            qr/CALL  setresuid(.*"_syslogd".*){3}/ => 2,
            qr/CALL  setresgid(.*"_syslogd".*){3}/ => 2,
        },
    }
);

1;
{'fraction_non_alphanumeric': 0.12528344671201813, 'fraction_numerical': 0.01473922902494331, 'mean_word_length': 2.2032667876588024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6769662', 'n_tokens_mistral': 629, 'n_tokens_neox': 581, 'n_words': 220}