[Pkg-net-snmp-commits] r252 - branches/net-snmp54/debian/patches
jochen at alioth.debian.org
jochen at alioth.debian.org
Fri Aug 22 16:04:43 UTC 2008
Author: jochen
Date: 2008-08-22 16:04:42 +0000 (Fri, 22 Aug 2008)
New Revision: 252
Added:
branches/net-snmp54/debian/patches/51_allow_g_groupname.README
branches/net-snmp54/debian/patches/51_allow_g_groupname.patch
Log:
Add upstream changeset 17158 to support -g {groupname}
Added: branches/net-snmp54/debian/patches/51_allow_g_groupname.README
===================================================================
--- branches/net-snmp54/debian/patches/51_allow_g_groupname.README (rev 0)
+++ branches/net-snmp54/debian/patches/51_allow_g_groupname.README 2008-08-22 16:04:42 UTC (rev 252)
@@ -0,0 +1 @@
+Upstream Changeset 17158: snmpd: PATCH: 2014204: Support -g {groupname}
Added: branches/net-snmp54/debian/patches/51_allow_g_groupname.patch
===================================================================
--- branches/net-snmp54/debian/patches/51_allow_g_groupname.patch (rev 0)
+++ branches/net-snmp54/debian/patches/51_allow_g_groupname.patch 2008-08-22 16:04:42 UTC (rev 252)
@@ -0,0 +1,32 @@
+Index: agent/snmpd.c
+===================================================================
+--- net-snmp-5.4.1.orig/agent/snmpd.c (Revision 17157)
++++ net-snmp-5.4.1/agent/snmpd.c (Revision 17158)
+@@ -574,8 +574,26 @@
+ #if HAVE_UNISTD_H
+ case 'g':
+ if (optarg != NULL) {
++ char *ecp;
++ int gid;
++
++ gid = strtoul(optarg, &ecp, 10);
++ if (*ecp) {
++#if HAVE_GETPWNAM && HAVE_PWD_H
++ struct group *info;
++ info = getgrnam(optarg);
++ if (info) {
++ gid = info->gr_gid;
++ } else {
++#endif
++ fprintf(stderr, "Bad group id: %s\n", optarg);
++ exit(1);
++#if HAVE_GETPWNAM && HAVE_PWD_H
++ }
++#endif
++ }
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+- NETSNMP_DS_AGENT_GROUPID, atoi(optarg));
++ NETSNMP_DS_AGENT_GROUPID, gid);
+ } else {
+ usage(argv[0]);
+ }
More information about the Pkg-net-snmp-commits
mailing list