[pbuilder] 01/01: modules: use `mount|grep` instead of `mountpoint` to detect whether /dev/ptmx and /dev/console are still mounted

Mattia Rizzolo mattia at debian.org
Sun Apr 23 16:30:48 UTC 2017


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch wip/ptmx-left-behind
in repository pbuilder.

commit 5d8fba482c54a33237348aa12b3e1ebba93dcf43
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sun Apr 23 18:24:13 2017 +0200

    modules: use `mount|grep` instead of `mountpoint` to detect whether /dev/ptmx and /dev/console are still mounted
    
    mountpoint(1) from initscripts as found in Debian jessie doesn't detect
    mounts over regular files as the version in util-linux (present in
    Debian stretch); this means those two checks could fail when run with
    initscripts' mountpoint(1).
    
    /dev/ptmx and /dev/console are the only mounts done by pbuilder over a
    regular file instead of a directory.
    
    Closes: #859766
    Signed-off-by: Mattia Rizzolo <mattia at debian.org>
---
 pbuilder-modules | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pbuilder-modules b/pbuilder-modules
index 00300b8..5a3d9c2 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -276,10 +276,10 @@ function umountproc () {
         umount_one "$SELINUX"
     fi
     if [ "$DEB_BUILD_ARCH_OS" = "linux" ] && [ "$USEDEVPTS" = "yes" ]; then
-        if mountpoint -q "$BUILDPLACE/dev/console"; then
+        if mount | grep -q -F " $(readlink -f "$BUILDPLACE")/dev/console"; then
             umount_one "dev/console"
         fi
-        if mountpoint -q "$BUILDPLACE/dev/ptmx"; then
+        if mount | grep -q -F " $(readlink -f "$BUILDPLACE")/dev/ptmx"; then
             umount_one "dev/ptmx"
         fi
         umount_one "dev/pts"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git



More information about the Pbuilder-maint mailing list