shell: add preceding newline to delimiter
at uses heredoc redirection to pass the script being executed into user's defined $SHELL. However, the heredoc delimiter is directly concatenated to the script's contents; if these contents do not end with a newline, the delimiter is attached to the last line of the script. This patch adds a single newline to be always emmited before the delimiter. This guarantees the delimiter is always on it's own line. In case a newline is already present at the end of the original script, this simply adds a single empty line; I cannot think of any complication that could result from that. Resolves: rhbz#2070450
This commit is contained in:
parent
41850fcf84
commit
d72ffaead4
@ -41,7 +41,7 @@ diff -ur b/at.c a/at.c
|
||||
fprintf(stderr, "<EOT>\n");
|
||||
}
|
||||
- fprintf(fp, "\n");
|
||||
+ fprintf(fp, "marcinDELIMITER%08lx\n", i);
|
||||
+ fprintf(fp, "\nmarcinDELIMITER%08lx\n", i);
|
||||
if (ferror(fp))
|
||||
panic("Output error");
|
||||
fflush(fp);
|
||||
|
5
at.spec
5
at.spec
@ -3,7 +3,7 @@
|
||||
Summary: Job spooling tools
|
||||
Name: at
|
||||
Version: 3.2.5
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
# http://packages.debian.org/changelogs/pool/main/a/at/current/copyright
|
||||
# + install-sh is MIT license with changes under Public Domain
|
||||
License: GPLv3+ and GPLv2+ and ISC and MIT and Public Domain
|
||||
@ -164,6 +164,9 @@ chown root:root %{_localstatedir}/spool/at/.SEQ
|
||||
%attr(0644,root,root) /%{_unitdir}/atd.service
|
||||
|
||||
%changelog
|
||||
* Thu Mar 31 2022 Jan Staněk <jstanek@redhat.com> - 3.2.5-3
|
||||
- Add preceding newline to delimiter in at-3.2.2-shell.patch
|
||||
|
||||
* Tue Mar 08 2022 Ondřej Pohořelský <opohorel@redhat.com> - 3.2.5-2
|
||||
- Add mising directory and batch-job script into at-3.2.5-make.patch
|
||||
- Defined datadir in %%install section and listed batch-job in %%files section
|
||||
|
Loading…
Reference in New Issue
Block a user