[Pkg-zsh-devel] Bug#920836: zsh: locking failed for /dev/null: permission denied (regression in zsh 5.7)

Vincent Lefevre vincent at vinc17.net
Tue Jan 29 19:02:00 GMT 2019


Package: zsh
Version: 5.7-2
Severity: normal
Forwarded: http://www.zsh.org/mla/workers/2019/msg00060.html

The following function

append_file_to_hist()
{
  emulate -LR zsh
  local -a entries

  # Implementation issue:  read -r ignores backslash-newline
  # folding, but without -r embedded backslashes are stripped,
  # which seems a bigger problem.  Fix up $entries later.

  IFS=$'\n' read -r -d '' -A entries <$1
  (( $#entries )) || return

  # Must supply a file name here to set HISTSIZE and SAVEHIST
  fc -pa /dev/null $#entries $(( SAVEHIST + $#entries ))

  while (( $#entries ))
  do
    if [[ "$entries[1]" == *\\ ]] then
      entries[1,2]=( ${entries[1]%\\}$'\n'${entries[2]} )
    else
      print -r -S $entries[1]
      shift 1 entries
    fi
  done
  fc -A ${2:-$HISTFILE}

  # Reset SAVEHIST to avoid attempting to lock /dev/null
  SAVEHIST=0        # fc -p makes this implicitly local
}

(see http://www.zsh.org/mla/workers/2016/msg02070.html) now
yields the error:

append_file_to_hist:24: locking failed for /dev/null: permission denied

-- Package-specific info:

Packages which provide vendor completions:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=======================================================
ii  curl           7.63.0-1     amd64        command line tool for transferring data with URL syntax
ii  pulseaudio     12.2-3       amd64        PulseAudio sound server
ii  qpdf           8.3.0-2      amd64        tools for transforming and inspecting PDF files
ii  systemd        240-5        amd64        system and service manager
ii  udev           240-5        amd64        /dev/ and hotplug management daemon
ii  vlc-bin        3.0.6-1      amd64        binaries from VLC
ii  youtube-dl     2019.01.17-1 all          downloader of videos from YouTube and other sites

The following files were modified:

/etc/systemd/system.conf
/etc/systemd/logind.conf
/etc/systemd/journald.conf

dpkg-query: no path found matching pattern /usr/share/zsh/vendor-functions/


-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=POSIX (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages zsh depends on:
ii  libc6       2.28-5
ii  libcap2     1:2.25-1.2
ii  libtinfo6   6.1+20181013-1
ii  zsh-common  5.7-2

Versions of packages zsh recommends:
ii  libc6         2.28-5
ii  libncursesw6  6.1+20181013-1
ii  libpcre3      2:8.39-11

Versions of packages zsh suggests:
ii  zsh-doc  5.7-2

-- no debconf information



More information about the Pkg-zsh-devel mailing list