Package: lilo
Version: 22.7.3-1.4
Severity: normal
Tags: patch

Hi,

my xsession's terminals (which I now and then run lilo from) happen
to inherit an inotify file descriptor from the window manager. Lilo
happens to encounter it when descending into /dev/fd, but unluckily
those fds return

] st_mode = 040600 (S_IFDIR | S_IRUSR | S_IWUSR)

when fstat()ed. This in turn causes lilo to try to descend into it,
which obviously fails:

] [EMAIL PROTECTED]:~# /sbin/lilo -v
] LILO version 22.7.3, Copyright (C) 1992-1998 Werner Almesberger
] Development beyond version 21 Copyright (C) 1999-2006 John Coffman
] Released 11-Aug-2006, and compiled at 10:06:46 on Feb  3 2007
] Debian GNU/Linux
] 
] Reading boot sector from /dev/hdf
] Fatal: opendir /dev/fd/3: Not a directory
] [EMAIL PROTECTED]:~# ll /dev/fd/
] total 0
] lrwx------ 1 root root 64 2007-02-06 23:21 0 -> /dev/pts/3
] lrwx------ 1 root root 64 2007-02-06 23:21 1 -> /dev/pts/3
] lrwx------ 1 root root 64 2007-02-06 23:21 2 -> /dev/pts/3
] lr-x------ 1 root root 64 2007-02-06 23:21 3 -> inotify
] lr-x------ 1 root root 64 2007-02-06 23:21 4 -> /proc/17696/fd
] [EMAIL PROTECTED]:~# strace -estat64 /sbin/lilo.real -v
] [...]
] stat64("/dev/fd/3", {st_mode=S_IFDIR|0600, st_size=0, ...}) = 0
] Fatal: opendir /dev/fd/3: Not a directory
] Process 17714 detached

While this behaviour of inotify fds is very strange, lilo shouldn't
descend into /dev/fd anyway. I'd suggest updating debian patch 17
to additionally exclude "fd" (besides ".udev"). An update of that dpatch
file is attached.


Regards,

Jan
#! /bin/sh -e
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Skip directories named .udev 

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as 
argument"
                exit 1;;
esac

exit 0
@DPATCH@

diff -urN lilo-22.7.3.orig/device.c lilo-22.7.3/device.c
--- lilo-22.7.3.orig/device.c   2006-12-03 20:30:37.924145000 +0000
+++ lilo-22.7.3/device.c        2006-12-03 20:31:05.443946970 +0000
@@ -101,7 +101,7 @@
                return 1;
            }
            if (S_ISDIR(dev->st.st_mode) && strcmp(dir->d_name,".") &&
-             strcmp(dir->d_name,"..")) {
+             strcmp(dir->d_name,"..") && strcmp(dir->d_name, ".udev") && 
strcmp(dir->d_name, "fd")) { 
                for (walk = next; walk; walk = walk->next)
                    if (stat_equal(&walk->st,&st.st)) break;
                if (!walk && scan_dir(&st,dev,parent,number)) {

Attachment: signature.asc
Description: Digital signature

Reply via email to