]> git.ipfire.org Git - thirdparty/systemd.git/commit
rpm: avoid odd symbols in EOF indicator
authorMikhail Novosyolov <m.novosyolov@rosalinux.ru>
Sat, 11 Jul 2020 14:08:00 +0000 (17:08 +0300)
committerMikhail Novosyolov <m.novosyolov@rosalinux.ru>
Sat, 11 Jul 2020 14:20:16 +0000 (17:20 +0300)
commit93406fd379d3ba184eec2eb664729edef1bca995
tree8c1e4ce79a89ab88f7fba52e98acc9b5844de1e1
parentb159831b6131fc514e6696862bf5f150372ba7b9
rpm: avoid odd symbols in EOF indicator

The last line in this macros was actually "SYSTEMD_INLINE_EOF " with a space at the end,
but the shell was instructed to look for a line without space.

Macros %sysusers_create_inline and %tmpfiles_create_inline did not have this mistake.

An example:
[root@rosa-2019 bind-server]# cat /etc/passwd | grep named
[root@rosa-2019 bind-server]# cat /tmp/bs
systemd-sysusers --replace=/usr/lib/sysusers.d/named.conf - <<SYSTEMD_INLINE_EOF >/dev/null 2>&1 || :
u named - "BIND DNS Server" /var/lib/named
g named - -
m named named
SYSTEMD_INLINE_EOF
[root@rosa-2019 bind-server]# sh /tmp/bs
/tmp/bs: line 5: warning: here-document at line 1 delimited by end-of-file (wanted `SYSTEMD_INLINE_EOF')
[root@rosa-2019 bind-server]# bash /tmp/bs
/tmp/bs: line 5: warning: here-document at line 1 delimited by end-of-file (wanted `SYSTEMD_INLINE_EOF')
[root@rosa-2019 bind-server]# bash --version
GNU bash, version 5.0.17(1)-release (x86_64-openmandriva-linux-gnu)

The user and group named were NOT created!

Now I remove the trailing space after "SYSTEMD_INLINE_EOF" and rerun:
[root@rosa-2019 bind-server]# sh /tmp/bs
[root@rosa-2019 bind-server]# tail -n 1 /etc/group
named:x:485:named
[root@rosa-2019 bind-server]#

The user and group have been created correctly.

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
src/core/macros.systemd.in