** Description changed:

  [ Impact ]
  
  When creating a SNMPv3 user, the net-snmp-create-v3-user script fails to
  write the generated configuration file with the following error:
  
  # net-snmp-create-v3-user -ro -A MD5 -a XXXXXX -x YYYYY -X DES ZZZZZ
  adding the following line to /var/lib/snmp/snmpd.conf:
-    createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
+    createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
  adding the following line to /snmp/snmpd.conf:
-    rouser ZZZZZ
+    rouser ZZZZZ
  touch: cannot touch '/snmp/snmpd.conf': No such file or directory
  /usr/bin/net-snmp-create-v3-user: 144: cannot create /snmp/snmpd.conf: 
Directory nonexistent
  
  [ 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 update
  # apt install -y snmpd
  # systemctl stop snmpd
  # net-snmp-create-v3-user -ro -A MD5 -a XXXXXX -x YYYYY -X DES ZZZZZ
  
  You can verify that the command errors out with:
  
  adding the following line to /var/lib/snmp/snmpd.conf:
-    createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
+    createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
  adding the following line to /snmp/snmpd.conf:
-    rouser ZZZZZ
+    rouser ZZZZZ
  touch: cannot touch '/snmp/snmpd.conf': No such file or directory
  /usr/bin/net-snmp-create-v3-user: 146: cannot create /snmp/snmpd.conf: 
Directory nonexistent
  
  When using a fixed version of the package, the command should succeed
  with:
  
  adding the following line to /var/lib/snmp/snmpd.conf:
-    createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
+    createUser ZZZZZ MD5 "XXXXXX" DES "YYYYY"
  adding the following line to /usr/share/snmp/snmpd.conf:
-    rouser ZZZZZ
+    rouser ZZZZZ
  
  [ Where problems could occur ]
  
  The fix is very trivial and shouldn't cause regressions in existing
- deployments.  If the user has made local modifications to the
+ deployments; the only thing being patched is the net-snmp-create-v3-user
+ script, so in the unlikely case that a regression occurs it should be
+ limited to the script.  If the user has made local modifications to
  /usr/bin/net-snmp-create-v3-user in order to workaround the problem,
  they will lose those modifications when updating the package.
  
  [ Other Info ]
  
  The same bug has been reported in Debian, but the fix there is a bit
  different:
  
  https://salsa.debian.org/debian/net-
  snmp/-/commit/b4281b2fc9b7ae7897a01d8be586711df98abad7
  
  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/net-snmp-config --create-snmpv3-user -ro -A MD5 -a XXXXXX -x YYYYY 
-X DES ZZZZZ
  touch: cannot touch '/snmp/snmpd.conf': No such file or directory
  /usr/bin/net-snmp-create-v3-user: 146: cannot create /snmp/snmpd.conf: 
Directory nonexistent
  
  Looking at /usr/bin/net-snmp-create-v3-user line 146, it seems that
  $outfile references ${datarootdir} in line 139, which is undefined.
  Further outfile is already defined at line 121.
  
  ProblemType: Bug
  DistroRelease: Ubuntu 22.04
  Package: snmpd 5.9.1+dfsg-1ubuntu2
  ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
  Uname: Linux 5.15.0-25-generic x86_64
  ApportVersion: 2.20.11-0ubuntu82
  Architecture: amd64
  CasperMD5CheckResult: pass
  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-256color
-  PATH=(custom, no user)
-  LANG=en_US.UTF-8
-  SHELL=/bin/bash
+  TERM=xterm-256color
+  PATH=(custom, no user)
+  LANG=en_US.UTF-8
+  SHELL=/bin/bash
  SourcePackage: net-snmp
  UpgradeStatus: No upgrade log present (probably fresh install)
  modified.conffile..etc.snmp.snmpd.conf: [modified]
  mtime.conffile..etc.snmp.snmpd.conf: 2022-04-20T12:50:27.596000

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1969623

Title:
  Creation of SNMPv3 user broken (Jammy/22.04)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/net-snmp/+bug/1969623/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to