[Bug 1915923] Re: [SRU] update-pciids in pciutils fails to create hard link

Launchpad Bug Tracker 1915923 at bugs.launchpad.net
Tue Apr 13 17:30:07 UTC 2021


This bug was fixed in the package pciutils - 1:3.6.4-1ubuntu0.20.04.1

---------------
pciutils (1:3.6.4-1ubuntu0.20.04.1) focal; urgency=medium

  * Fix patch to ln -f (LP: #1915923)

 -- Erich Eickmeyer <eeickmeyer at ubuntu.com>  Wed, 31 Mar 2021 15:55:11
-0700

** Changed in: pciutils (Ubuntu Focal)
       Status: Fix Committed => Fix Released

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

Title:
  [SRU] update-pciids in pciutils fails to create hard link

Status in pciutils package in Ubuntu:
  Fix Released
Status in pciutils source package in Focal:
  Fix Released

Bug description:
  [Impact]

   * People who use update-pciids more than once are unable to run it a
  second time without errors due to a missing "-f" in the "ln" line
  being called as the symlink already exists. This was identified
  upstream and fixed in later versions, but was not implemented in
  Focal. The patch in question is fixed in a new upload and attached
  patch.

  [Test Plan]

   * Install pciutils
   * Run 'sudo update-pciids'
   * Run 'sudo update-pciids' a second time.
   * "ln" will return an error explaining the hardlink already exists.

  [Where problems could occur]

   * If this patch is in error, then the entire command will cause the
  same problem or the link of the '.old' file will be erased entirely.
  This is highly unlikely.

  [Other Info]

   * Corrected patch is attached to this bug.

  ------
  Original bug report:

  Running on Ubuntu 20.04 LTS, the `.old` file does not seem to be
  cleaned up properly.

  It seems someone forgot to add the "-f" from the respective upstream
  commit:
  https://github.com/pciutils/pciutils/commit/b6a0091e4a17dcc01c84dfe233e861fe6e82b1c4

  First run:
  ```
  $ sudo sh -x /usr/sbin/update-pciids
  + set -e
  + SRC=https://pci-ids.ucw.cz/v2.2/pci.ids
  + DEST=/usr/share/misc/pci.ids
  + PCI_COMPRESSED_IDS=
  + GREP=grep
  + [  = -q ]
  + quiet=false
  + touch /usr/share/misc/pci.ids
  + [  = 1 ]
  + which bzip2
  + DECOMP=bzip2 -d
  + SRC=https://pci-ids.ucw.cz/v2.2/pci.ids.bz2
  + which curl
  + DL=curl -o /usr/share/misc/pci.ids.new https://pci-ids.ucw.cz/v2.2/pci.ids.bz2
  + false
  + curl -o /usr/share/misc/pci.ids.new https://pci-ids.ucw.cz/v2.2/pci.ids.bz2
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  265k  100  265k    0     0   634k      0 --:--:-- --:--:-- --:--:--  635k
  + bzip2 -d
  + grep ^C  /usr/share/misc/pci.ids.neww
  + [ -f /usr/share/misc/pci.ids ]
  + ln /usr/share/misc/pci.ids /usr/share/misc/pci.ids.old
  + chmod -f --reference=/usr/share/misc/pci.ids.old /usr/share/misc/pci.ids.neww
  + mv /usr/share/misc/pci.ids.neww /usr/share/misc/pci.ids
  + rm /usr/share/misc/pci.ids.new
  + [ /usr/share/misc/pci.ids != /usr/share/misc/pci.ids ]
  + false
  + echo Done.
  Done.
  ```

  Second run:
  ```
  $ sudo sh -x /usr/sbin/update-pciids
  + set -e
  + SRC=https://pci-ids.ucw.cz/v2.2/pci.ids
  + DEST=/usr/share/misc/pci.ids
  + PCI_COMPRESSED_IDS=
  + GREP=grep
  + [  = -q ]
  + quiet=false
  + touch /usr/share/misc/pci.ids
  + [  = 1 ]
  + which bzip2
  + DECOMP=bzip2 -d
  + SRC=https://pci-ids.ucw.cz/v2.2/pci.ids.bz2
  + which curl
  + DL=curl -o /usr/share/misc/pci.ids.new https://pci-ids.ucw.cz/v2.2/pci.ids.bz2
  + false
  + curl -o /usr/share/misc/pci.ids.new https://pci-ids.ucw.cz/v2.2/pci.ids.bz2
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  100  265k  100  265k    0     0   420k      0 --:--:-- --:--:-- --:--:--  419k
  + bzip2 -d
  + grep ^C  /usr/share/misc/pci.ids.neww
  + [ -f /usr/share/misc/pci.ids ]
  + ln /usr/share/misc/pci.ids /usr/share/misc/pci.ids.old
  ln: failed to create hard link '/usr/share/misc/pci.ids.old': File exists
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pciutils/+bug/1915923/+subscriptions



More information about the foundations-bugs mailing list