#901438 bash: enable compile-time syslog shopt

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Luca Boccassi
Date:
2018-12-25 18:39:06 UTC
Severity:
wishlist
#901438#5
Date:
2018-06-13 10:40:57 UTC
From:
To:
Dear Maintainer,

bash 5.0 introduced a new build-time config-top.h option to allow users
to optionally enable sending the bash history to syslog via a new shopt
variable.
Given it's generally undesirable on user's machines, even if compiled
in the feature is off by default at runtime. It can be checked
trivially with "shopt -p | grep syslog".

But this feature is often necessary and required on mission critical
equipment due to auditing rules®ulations. For example in my case, to
use vanilla Debian on servers inside a large ISP we need this option.
Given Debian aims to be a Universal Operating System, it would be
really great if such option were available without having to rebuild
bash manually. :-)

Please consider the inlined diff for the deb-bash-config.diff patch,
that will build the support but of course will leave it disabled by
default. I have tested it and it works as expected.

Thank you!
--- debian/patches/deb-bash-config.diff
+++ debian/patches/deb-bash-config.diff
@@ -14,6 +14,10 @@
 # DP:
 # DP: - don't define a default DEFAULT_MAIL_DIRECTORY, because it
 # DP:   can cause a timeout on NFS mounts.
+# DP:
+# DP: - build with runtime option to enable sending history to syslog
+# DP:   and disable it by default. Can be enabled by a user with
+# DP:   shopt -s syslog_history

 Index: b/config-bot.h
 ===================================================================
@@ -54,3 +58,21 @@

  /* Define if you want the case-capitalizing operators (~[~]) and the
     `capcase' variable attribute (declare -c). */
+@@ -117,7 +117,7 @@
+
+ /* Define if you want each line saved to the history list in bashhist.c:
+    bash_add_history() to be sent to syslog(). */
+-/* #define SYSLOG_HISTORY */
++#define SYSLOG_HISTORY
+ #if defined (SYSLOG_HISTORY)
+ #  define SYSLOG_FACILITY LOG_USER
+ #  define SYSLOG_LEVEL LOG_INFO
+@@ -128,7 +128,7 @@
+    shell option; if defined, the value is the default for the syslog_history
+    shopt option */
+ #if defined (SYSLOG_HISTORY)
+-/* #define SYSLOG_SHOPT 1 */
++#  define SYSLOG_SHOPT 0
+ #endif
+
+ /* Define if you want to include code in shell.c to support wordexp(3) */

#901438#10
Date:
2018-09-19 17:01:29 UTC
From:
To:
users
shopt
to
syslog
the
bashhist.c:
syslog_history

Dear Maintainer,

Bash 5.0-beta is out - I've just tested it to make sure this patch
still applies and works, and it does.

Would be fantastic if it could be considered for the eventual upload of
5.0-beta.

Thank you!

#901438#15
Date:
2018-11-28 17:56:33 UTC
From:
To:
Dear Maintainer,

bash 5.0-beta2 is out, I've tested the above small patch with it and I
can confirm again that it works as expected. It would be great if it
could be included in the next upload to experimental.

Thank you!

#901438#20
Date:
2018-12-25 18:36:57 UTC
From:
To:
Dear Maintainer,

Just tested with 5.0-rc1 and it works fine as well. rc1 also fixes the
build failures on armhf/armel BTW.

Thanks and happy holidays!