#1071177 syslog-ng-core: typo in shebang of tty10.sh

Package:
syslog-ng-core
Source:
syslog-ng-core
Description:
Enhanced system logging daemon (core)
Submitter:
Baptiste Camia
Date:
2024-05-15 13:27:03 UTC
Severity:
normal
#1071177#5
Date:
2024-05-15 13:22:56 UTC
From:
To:
Dear Maintainer,

* What led up to the situation?

Having the line `destination d_console_all { getvirtconsole(); };` in my
/etc/syslog-ng/syslog-ng.conf configuration file.

If I understand it correctly, this config calls, somehow,
/usr/share/syslog-ng/include/scl/getvirtconsole/plugin.conf which contains
'exec("`scl-root`/getvirtconsole/tty10.sh")' and therefore executes the
/usr/share/syslog-ng/include/scl/getvirtconsole/tty10.sh script.

* What exactly did you do (or not do) that was effective (or ineffective)?

I installed the syslog-ng-core package on a server with an auditd rule that
catches unusual execve errors, this rule triggered on the execution of
/usr/share/syslog-ng/include/scl/getvirtconsole/tty10.sh as shown in the
logs below:

```
type=PROCTITLE msg=audit(05/15/2024 00:00:15.740:644853) : proctitle=sh -c
/usr/share/syslog-ng/include/scl/getvirtconsole/tty10.sh
type=PATH msg=audit(05/15/2024 00:00:15.740:644853) : item=1
name=/usr/share/syslog-ng/include/scl/getvirtconsole/tty10.sh
inode=53505901 dev=fe:02 mode=file,755 ouid=root ogid=root rdev=00:00
nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=PATH msg=audit(05/15/2024 00:00:15.740:644853) : item=0
name=/usr/share/syslog-ng/include/scl/getvirtconsole/tty10.sh inode=XXX
dev=fe:02 mode=file,755 ouid=root ogid=root rdev=00:00 nametype=NORMAL
cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
type=CWD msg=audit(05/15/2024 00:00:15.740:644853) : cwd=/
type=SYSCALL msg=audit(05/15/2024 00:00:15.740:644853) : arch=x86_64
syscall=execve success=no exit=ENOEXEC(Exec format error) a0=XXX a1=XXX
a2=XXX a3=XXX items=2 ppid=XXX pid=XXX auid=unset uid=root gid=root
euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none)
ses=unset comm=sh exe=/usr/bin/dash subj=unconfined
key=hids_execve_anormal_error
```

* What was the outcome of this action?

The execution returns a ENOEXEC code

* What outcome did you expect instead?

The execution should not fail

* Fix

Simply patch the shebang as shown below:

```
# diff tty10.orig.sh tty10.sh
1c1
< #/bin/sh
---
```