Creation of SNMPv3 user broken (Jammy/22.04)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
net-snmp (Debian) |
Fix Released
|
Unknown
|
|||
net-snmp (Ubuntu) |
Fix Released
|
High
|
Sergio Durigan Junior | ||
Impish |
Fix Released
|
High
|
Sergio Durigan Junior | ||
Jammy |
Fix Released
|
High
|
Sergio Durigan Junior |
Bug Description
[ Impact ]
When creating a SNMPv3 user, the net-snmp-
# net-snmp-
adding the following line to /var/lib/
createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
adding the following line to /snmp/snmpd.conf:
rouser ZZZZZ
touch: cannot touch '/snmp/snmpd.conf': No such file or directory
/usr/bin/
[ Test Plan ]
The bug affects Impish and Jammy. One can reproduce it by issuing the following commands:
$ lxc launch ubuntu-daily:jammy net-snmp-bug1969623-jammy
$ lxc shell net-snmp-bug1969623-jammy
# apt update
# apt install -y snmpd
# systemctl stop snmpd
# net-snmp-
You can verify that the command errors out with:
adding the following line to /var/lib/
createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
adding the following line to /snmp/snmpd.conf:
rouser ZZZZZ
touch: cannot touch '/snmp/snmpd.conf': No such file or directory
/usr/bin/
When using a fixed version of the package, the command should succeed with:
adding the following line to /var/lib/
createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
adding the following line to /usr/share/
rouser ZZZZZ
[ Where problems could occur ]
The fix is very trivial and shouldn't cause regressions in existing deployments; the only thing being patched is the net-snmp-
[ Other Info ]
The same bug has been reported in Debian, but the fix there is a bit different:
https:/
Debian's fix is arguably more correct because SNMPCONFPATH will expand to /etc/snmp/, which is the right directory to place configuration files in. However, since we're dealing with an SRU here, I chose to go with upstream's fix because it keeps the old behaviour of placing the config file inside /var/lib/snmp/. We will likely revisit this decision during the KK cycle.
[ Original Description ]
When creating a SNMPv3 user this error appears:
$ /usr/bin/
touch: cannot touch '/snmp/snmpd.conf': No such file or directory
/usr/bin/
Looking at /usr/bin/
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: snmpd 5.9.1+dfsg-1ubuntu2
ProcVersionSign
Uname: Linux 5.15.0-25-generic x86_64
ApportVersion: 2.20.11-0ubuntu82
Architecture: amd64
CasperMD5CheckR
Date: Wed Apr 20 13:34:44 2022
InstallationDate: Installed on 2022-04-20 (0 days ago)
InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Beta amd64 (20220330)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: net-snmp
UpgradeStatus: No upgrade log present (probably fresh install)
modified.
mtime.conffile.
Related branches
- Bryce Harrington (community): Approve
- Canonical Server: Pending requested
-
Diff: 64 lines (+42/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/lp1969623-net-snmp-create-v3-user-Fix-the-snmpd.conf-path.patch (+33/-0)
debian/patches/series (+1/-0)
- Bryce Harrington (community): Approve
- Canonical Server Core Reviewers: Pending requested
- Canonical Server: Pending requested
-
Diff: 65 lines (+43/-0)3 files modifieddebian/changelog (+8/-0)
debian/patches/lp1969623-net-snmp-create-v3-user-Fix-the-snmpd.conf-path.patch (+34/-0)
debian/patches/series (+1/-0)
Changed in net-snmp (Debian): | |
status: | Unknown → Fix Committed |
description: | updated |
description: | updated |
tags: |
added: verification-done-jammy removed: verification-needed-jammy |
Changed in net-snmp (Ubuntu Jammy): | |
status: | Fix Committed → Fix Released |
Changed in net-snmp (Debian): | |
status: | Fix Committed → Fix Released |
Hello Sascha and thanks for this bug report. I can reproduce it using LXD containers and the same dummy options from the bug description. This is a regression from Focal and likely from Impish, at least by looking at the version numbers.
== Focal ==
root@paride-f:~# net-snmp-config --create- snmpv3- user -ro -A MD5 -a XXXXXX -x YYYYY -X DES ZZZZZ snmp/snmpd. conf: snmp/snmpd. conf:
adding the following line to /var/lib/
createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
adding the following line to /usr/share/
rouser ZZZZZ
== Jammy ==
root@paride-j:~# net-snmp-config --create- snmpv3- user -ro -A MD5 -a XXXXXX -x YYYYY -X DES ZZZZZ snmp/snmpd. conf: net-snmp- create- v3-user: 146: cannot create /snmp/snmpd.conf: Directory nonexistent
adding the following line to /var/lib/
createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
adding the following line to /snmp/snmpd.conf:
rouser ZZZZZ
touch: cannot touch '/snmp/snmpd.conf': No such file or directory
/usr/bin/