Skip to content
Snippets Groups Projects
  1. Jan 11, 2025
  2. Jul 05, 2024
  3. Mar 28, 2024
  4. Mar 25, 2024
  5. Feb 15, 2024
  6. Feb 14, 2024
  7. Dec 26, 2023
    • Levente Polyak's avatar
      fix(db-functions): fix locking issue that overwrote the same fd · 7e5df6a5
      Levente Polyak authored
      
      Calling `acquire_fd` in a subshell doesn't populate the global lockfd
      associate array properly. This resulted in the reuse of the same fd
      multiple times, effectively only holding a single latest lock and
      releasing any previous.
      
      Fix the issue by avoiding a global variable that causes issues in
      subshell calls by using the file descriptor table directly. Instead
      of storing file descriptors, the lookup call iterates through all fds
      and checks their handle. In case a file is not yet opened, allocate the
      next free fd between 4 and 1023.
      
      Operating directly on the file descriptor table has the nice side effect
      that we avoid reusing descriptors by accident in case they have been
      opened for none locking purpose within the statically defined range.
      
      Reported-by: Felix Yan's avatarFelix Yan <felixonmars@archlinux.org>
      Co-authored-by: Felix Yan's avatarFelix Yan <felixonmars@archlinux.org>
      Signed-off-by: Levente Polyak's avatarLevente Polyak <anthraxx@archlinux.org>
      Verified
      7e5df6a5
  8. Dec 23, 2023
  9. Dec 07, 2023
  10. Dec 06, 2023
  11. Dec 02, 2023
  12. Nov 04, 2023
  13. Oct 21, 2023
Loading