bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rbash misbehave in pipelines when commands have /


From: hchcheng
Subject: rbash misbehave in pipelines when commands have /
Date: Tue, 12 Nov 2002 22:21:46 -0500

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE  -I.  -I. -I./include 
-I./lib -O2 -march=i386 -mcpu=i686
uname output: Linux scg7 2.4.18-17.7.x #1 Tue Oct 8 13:33:14 EDT 2002 i686 
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

Description:
        restricted bash does not behave in pipelines when commands have
        /

Repeat-By:
        In rbash, try

        1. /bin/ls | wc -l
           rbash: /bin/ls: restricted: cannot specify `/' in command names
           rbash: cannot duplicate fd 3 to fd 0: Bad file descriptor

           The shell hangs, need to press ^C.

        2. ls | /usr/bin/wc -l
           rbash: /usr/bin/wc: restricted: cannot specify `/' in command names
           [test]$ a
           rbash: ./a: Permission denied
           [test]$ b
           rbash: ./b: Permission denied
           [test]$ c
           rbash: ./c: Permission denied
           [test]$ exit

           The directory has 3 files, a, b, and c.

Fix:
        It seems that execute_disk_command in execute_cmd.c returns too
        early in the restricted shell check.  If I instead exit with
        EXECUTION_FAILURE in the child branch of the fork, it seems to
        have fixed the problem.  But I have to admit that I don't really
        know what I am doing.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]