integ/base/net-snmp/centos/meta_patches/run-snmpd-as-non-root-user.patch
slin14 342ddde7e4 rebase net-snmp patch to CentOS7.5
Story: 2003389
Task: 24478

Change-Id: I88d46685c0c293dd6201b9a1575d7d3815489725
Signed-off-by: slin14 <shuicheng.lin@intel.com>
2018-08-22 14:58:59 +08:00

42 lines
1.4 KiB
Diff

From 5dc19ad10a3f91803116a88c303134e9ff361bd5 Mon Sep 17 00:00:00 2001
From: Scott Little <scott.little@windriver.com>
Date: Mon, 2 Oct 2017 17:05:59 -0400
Subject: [PATCH] WRS: run-snmpd-as-non-root-user.patch
Conflicts:
SPECS/net-snmp.spec
---
SOURCES/snmpd.service | 2 +-
SPECS/net-snmp.spec | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/SOURCES/snmpd.service b/SOURCES/snmpd.service
index 84b6ca3..ad689c8 100644
--- a/SOURCES/snmpd.service
+++ b/SOURCES/snmpd.service
@@ -4,7 +4,7 @@ After=syslog.target network.target
[Service]
Type=notify
-Environment=OPTIONS="oamcontroller -Lsd -Lf /dev/null -p /var/run/snmpd.pid"
+Environment=OPTIONS="oamcontroller -u snmpd -Lsd -Lf /dev/null -p /var/run/snmpd.pid"
EnvironmentFile=-/etc/sysconfig/snmpd
ExecStart=/etc/init.d/snmpd start
ExecStop=/etc/init.d/snmpd stop
diff --git a/SPECS/net-snmp.spec b/SPECS/net-snmp.spec
index 3e36cb5..9b313cb 100644
--- a/SPECS/net-snmp.spec
+++ b/SPECS/net-snmp.spec
@@ -428,7 +428,7 @@ install -m 644 %SOURCE6 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf
# WRS
install -m 644 %SOURCE12 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmpd.conf
-chmod 600 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/snmptrapd.conf
+chmod 660 ${RPM_BUILD_ROOT}%{_sysconfdir}/snmp/*
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d
install -m 755 %SOURCE13 ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d/snmpd
--
2.7.4