Page MenuHomeDevCentral

D3392.id8753.diff
No OneTemporary

D3392.id8753.diff

diff --git a/hotfixes/files/T1991-egrep.patch b/hotfixes/files/T1991-egrep.patch
new file mode 100644
--- /dev/null
+++ b/hotfixes/files/T1991-egrep.patch
@@ -0,0 +1,35 @@
+diff --git a/modules/csf.py b/modules/csf.py
+index 0f7a27c..5fd8b21 100644
+--- a/modules/csf.py
++++ b/modules/csf.py
+@@ -71,7 +71,7 @@ def exists(
+ ip, port, proto, direction, port_origin, ip_origin, comment
+ )
+ return _exists_with_port(method, rule)
+- exists = __salt__["cmd.run_all"](f"egrep ^'{ip} +' /etc/csf/csf.{method}")
++ exists = __salt__["cmd.run_all"](f"grep -E ^'{ip} +' /etc/csf/csf.{method}")
+ return not bool(exists["retcode"])
+
+
+diff --git a/modules/selinux.py b/modules/selinux.py
+index 8201d87..8364141 100644
+--- a/modules/selinux.py
++++ b/modules/selinux.py
+@@ -616,7 +616,7 @@ def _fcontext_add_or_delete_policy(
+ if "add" == action:
+ # need to use --modify if context for name file exists, otherwise ValueError
+ filespec = re.escape(name)
+- cmd = f"semanage fcontext -l | egrep '{filespec}'"
++ cmd = f"semanage fcontext -l | grep -E '{filespec}'"
+ current_entry_text = __salt__["cmd.shell"](cmd, ignore_retcode=True)
+ if current_entry_text != "":
+ action = "modify"
+@@ -762,7 +762,7 @@ def port_get_policy(name, sel_type=None, protocol=None, port=None):
+ "port": port,
+ }
+ cmd = (
+- "semanage port -l | egrep "
++ "semanage port -l | grep -E "
+ + "'^{sel_type}{spacer}{protocol}{spacer}((.*)*)[ ]{port}($|,)'".format(
+ **cmd_kwargs
+ )
diff --git a/hotfixes/init.sls b/hotfixes/init.sls
--- a/hotfixes/init.sls
+++ b/hotfixes/init.sls
@@ -7,6 +7,7 @@
# -------------------------------------------------------------
include:
+ - .salt
- .CVE-2017-6074
- .T1261-srv-data
- .T1345-drop-jails-from-ysul
diff --git a/hotfixes/salt.sls b/hotfixes/salt.sls
new file mode 100644
--- /dev/null
+++ b/hotfixes/salt.sls
@@ -0,0 +1,23 @@
+# -------------------------------------------------------------
+# Salt — Hotfixes to mitigate bugs and security issues
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# T1991 :: egrep -> grep -E
+#
+# Patch is for Salt 3007+.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+{% if salt["pkg.version_cmp"](grains["saltversion"], "3007") >= 0 %}
+
+T1991_egrep_patch:
+ file.patch:
+ - name: {{ grains.saltpath }}
+ - source: salt://hotfixes/files/T1991-egrep.patch
+ - strip: 1
+
+{% endif %}

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 21, 13:52 (6 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2591678
Default Alt Text
D3392.id8753.diff (2 KB)

Event Timeline