diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 16:28:20 +0000 |
commit | dcc721a95bef6f0d8e6d8775b8efe33e5aecd562 (patch) | |
tree | 66a2774cd0ee294d019efd71d2544c70f42b2842 /tests/glbl-umask.sh | |
parent | Initial commit. (diff) | |
download | rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.tar.xz rsyslog-dcc721a95bef6f0d8e6d8775b8efe33e5aecd562.zip |
Adding upstream version 8.2402.0.upstream/8.2402.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/glbl-umask.sh')
-rwxr-xr-x | tests/glbl-umask.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/glbl-umask.sh b/tests/glbl-umask.sh new file mode 100755 index 0000000..dcea2a1 --- /dev/null +++ b/tests/glbl-umask.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# addd 2017-03-06 by RGerhards, released under ASL 2.0 + +# Note: we need to inject a somewhat larger number of messages in order +# to ensure that we receive some messages in the actual output file, +# as batching can (validly) cause a larger loss in the non-writable +# file + +. ${srcdir:=.}/diag.sh init +generate_conf +add_conf ' +global(umask="0077") + +template(name="outfmt" type="string" string="%msg:F,58:2%\n") +:msg, contains, "msgnum:" { + action(type="omfile" template="outfmt" file=`echo $RSYSLOG_OUT_LOG`) +} +' +startup +injectmsg 0 1 +shutdown_when_empty +wait_shutdown + +if [ `ls -l $RSYSLOG_OUT_LOG|$RS_HEADCMD -c 10 ` != "-rw-------" ]; then + echo "invalid file permission (umask), $RSYSLOG_OUT_LOG has:" + ls -l $RSYSLOG_OUT_LOG + error_exit 1 +fi; +exit_test |