XForms: file selector behavior with unreadable directories

From: Tristan Savatier (tristan@mpegtv.com)
Date: Tue May 23 2000 - 16:47:56 EDT

  • Next message: Nicolas Castagne: "XForms: fl_circf"

    I think that the behavior of the Xforms file selector could be
    improved when it comes to accessing a directory that is not readable
    (because of permissions).

    Currently Xforms prints out a message on stdout (or stderr)
    like:

    In ReadDir [fselect.c 367] Can't read /home/tristan/mpg--Permission
    denied

    I think that the proper behavior would be to pop-up a window to
    inform the user of the problem (users generally do not read
    the standard-output messages of applications that use Xforms).

    Also, the problem has been reported to us by a user that
    in some occasions, Xforms does a segfault in this situation.

    This was reported on:
    Linux System.map 2.2.14 #1 Fri Mar 17 12:00:18 GMT 2000 i686 unknown
    when using the latest version of mtv (mtv-1.1.1.1).

    I have attached this bug report, but I have not been able to
    reproduce this problem on my systems.

    -t

    attached mail follows:



    Hi, I ran into this problem where mtv tried to look into /root (which is what
    .mtvrc entry pointed to), but since I wasn't logged as root, instead of giving a
    permission denied, the program would freeze. strace revealed something
    interesting.

    Here's the info the website requires:

    > mtvp -h | head
    MpegTV run-time Player - Version 1.1.1.1
    Copyright (c) 1997, MpegTV LLC
    ALL RIGHTS RESERVED

    > uname -a
    Linux System.map 2.2.14 #1 Fri Mar 17 12:00:18 GMT 2000 i686 unknown

    > ldd `which mtv`
            libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4001e000)
            libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x400c8000)
            libm.so.6 => /lib/libm.so.6 (0x400db000)
            libc.so.6 => /lib/libc.so.6 (0x400f8000)
            libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x401da000)
            libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x40226000)
            libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40231000)
            libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40249000)
            /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
    (this is glibc-2.1.3)

    > xdpyinfo
    name of display: :0.0
    version number: 11.0
    vendor string: The XFree86 Project, Inc; VMware, Inc
    vendor release number: 3430
    maximum request size: 4194300 bytes
    motion buffer size: 256
    bitmap unit, bit order, padding: 32, LSBFirst, 32
    image byte order: LSBFirst
    number of supported pixmap formats: 2
    supported pixmap formats:
        depth 1, bits_per_pixel 1, scanline_pad 32
        depth 16, bits_per_pixel 16, scanline_pad 32
    keycode range: minimum 8, maximum 134
    focus: window 0x3c0000d, revert to PointerRoot
    number of extensions: 19
        BIG-REQUESTS
        DOUBLE-BUFFER
        DPMS
        LBX
        MIT-SCREEN-SAVER
        MIT-SHM
        MIT-SUNDRY-NONSTANDARD
        RECORD
        SECURITY
        SHAPE
        SYNC
        XC-APPGROUP
        XC-MISC
        XFree86-DGA
        XFree86-Misc
        XFree86-VidModeExtension
        XInputExtension
        XKEYBOARD
        XTEST
    default screen number: 0
    number of screens: 1

    screen #0:
      dimensions: 1024x768 pixels (347x260 millimeters)
      resolution: 75x75 dots per inch
      depths (1): 16
      root window id: 0x26
      depth of root window: 16 planes
      number of colormaps: minimum 1, maximum 1
      default colormap: 0x23
      default number of colormap cells: 64
      preallocated pixels: black 0, white 65535
      options: backing-store YES, save-unders YES
      largest cursor: 64x64
      current input event mask: 0xf8603f
        KeyPressMask KeyReleaseMask ButtonPressMask
        ButtonReleaseMask EnterWindowMask LeaveWindowMask
        ButtonMotionMask KeymapStateMask SubstructureNotifyMask
        SubstructureRedirectMask FocusChangeMask PropertyChangeMask
        ColormapChangeMask
      number of visuals: 1
      default visual id: 0x22
      visual:
        visual id: 0x22
        class: TrueColor
        depth: 16 planes
        available colormap entries: 64 per subfield
        red, green, blue masks: 0xf800, 0x7e0, 0x1f
        significant bits in color specification: 6 bits

    Here's the system call trace where things hang:

    brk(0x80f4000) = 0x80f4000
    brk(0x80f5000) = 0x80f5000
    brk(0x80f6000) = 0x80f6000
    stat("/root", {st_mode=S_IFDIR|0711, st_size=2048, ...}) = 0
    open("/dev/null", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 ENOTDIR (Not a
    directory)
    open("/root/", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = -1 EACCES (Permission denied)
    --- SIGSEGV (Segmentation fault) ---
    sigreturn() = ? (mask now [])
    --- SIGSEGV (Segmentation fault) ---
    sigreturn() = ? (mask now [])
    --- SIGSEGV (Segmentation fault) ---
    sigreturn() = ? (mask now [])
    --- SIGSEGV (Segmentation fault) ---
    sigreturn() = ? (mask now [])

    The SigSev is endless. I have to kill -9 to stop mtv.

    Thank you,

    Nicolas

    --
    Nicolas St-Pierre
    Systems Engineer
    Internet Access Solutions Ltd.
    Tel (416) 621-7255
    Fax (416) 621-3509
    

    _________________________________________________ To unsubscribe, send the message "unsubscribe" to xforms-request@bob.usuhs.mil or see http://bob.usuhs.mil/mailserv/xforms.html XForms Home Page: http://world.std.com/~xforms List Archive: http://bob.usuhs.mil/mailserv/list-archives/



    This archive was generated by hypermail 2b29 : Tue May 23 2000 - 16:51:54 EDT