bug-bash
[Top][All Lists]
Advanced

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

Permission denied to execute script that is world executable


From: John Williams
Subject: Permission denied to execute script that is world executable
Date: Sat, 18 Jun 2011 13:37:18 -0700

I find that I cannot execute world-executable scripts when they are in
a directory which is mounted on a drive on an HBA (host bus adapter
card) in pass-thru mode, but the exact same scripts are executable
when they are in a directory on my boot drive (connected to
motherboard SATA).

Is this a bash bug, or intentional behavior?

The drives connected through the HBA work well for all other purposes
I have tried, except executing scripts. The only oddity I have noticed
is that the identification info stored by the kernel driver
(megaraid_sas) during boot cannot be read by hdparm, although hdparm
has no problem reading the info directly. Apparently, the megaraid_sas
kernel driver is not perfect, but why should this affect bash?

In the output below, the behavior is identical if the first line calls
bash, sh (symlink to bash), or zsh. I left it at zsh (below) to
eliminate ambiguity between the active shell (bash) and the script
shell.

What causes this behavior?

***

cmd$ pwd
/tmp

cmd$ ls -al
total 16
drwxrwxrwt  3 root    root  4096 Jun 18 13:13 .
drwxr-xr-x 25 root    root  4096 May  1 21:26 ..
-rwxr-xr-x  1 joe users   23 Jun 18 13:12 okay
drwx------  3 joe users 4096 Jun 17 19:13 spool_joe

cmd$ cat okay
#!/bin/zsh
echo "okay"

cmd$ ./okay
okay

cmd$ /tmp/okay
okay

cmd$ cp okay /mnt/r6c4/

cmd$ /mnt/r6c4/okay
bash: /mnt/r6c4/okay: Permission denied

cmd$ cd /mnt/r6c4

cmd$ ls -al
total 8
drwxr-xr-x  2 joe users    8 Jun 18 13:15 .
drwxr-xr-x 26 joe users 4096 Jun 16 22:44 ..
-rwxr-xr-x  1 joe users   23 Jun 18 13:15 okay

cmd$ ./okay
bash: ./okay: Permission denied

cmd$ /bin/bash okay
okay

cmd$ . okay
okay

cmd$ df /mnt/r6c4
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdh1       2.8T  350M  2.8T   1% /mnt/r6c4

$ sudo hdparm -i /dev/sdh

/dev/sdh:
 HDIO_GET_IDENTITY failed: Invalid argument

$ sudo hdparm -I /dev/sdh

/dev/sdh:

ATA device, with non-removable media
        Model Number:       Hitachi HDS5C3030ALA630
        Serial Number:      MJ1321YNG1ABJA
        Firmware Revision:  MEAOA580
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions,
SATA Rev 2.5, SATA Rev 2.6; Revision: ATA8-AST T13 Project D1697
Revision 0b
Standards:
        Used: unknown (minor revision code 0x0029)
        Supported: 8 7 6 5
        Likely used: 8
Configuration:
        Logical         max     current
        cylinders       16383   16383
        heads           16      16
        sectors/track   63      63
        --
        CHS current addressable sectors:   16514064
        LBA    user addressable sectors:  268435455
        LBA48  user addressable sectors: 5860533168
        Logical  Sector size:                   512 bytes
        Physical Sector size:                   512 bytes
        device size with M = 1024*1024:     2861588 MBytes
        device size with M = 1000*1000:     3000592 MBytes (3000 GB)
        cache/buffer size  = 26129 KBytes (type=DualPortCache)
        Form Factor: 3.5 inch
        Nominal Media Rotation Rate: 5700
Capabilities:
        LBA, IORDY(can be disabled)
        Queue depth: 32
        Standby timer values: spec'd by Standard, no device specific minimum
        R/W multiple sector transfer: Max = 16  Current = 0
        Advanced power management level: disabled
        DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
             Cycle time: min=120ns recommended=120ns
        PIO: pio0 pio1 pio2 pio3 pio4
             Cycle time: no flow control=120ns  IORDY flow control=120ns
Commands/features:
        Enabled Supported:
           *    SMART feature set
                Security Mode feature set
           *    Power Management feature set
           *    Write cache
           *    Look-ahead
           *    Host Protected Area feature set
           *    WRITE_BUFFER command
           *    READ_BUFFER command
           *    NOP cmd
           *    DOWNLOAD_MICROCODE
                Advanced Power Management feature set
                Power-Up In Standby feature set
           *    SET_FEATURES required to spinup after power up
                SET_MAX security extension
           *    48-bit Address feature set
           *    Device Configuration Overlay feature set
           *    Mandatory FLUSH_CACHE
           *    FLUSH_CACHE_EXT
           *    SMART error logging
           *    SMART self-test
                Media Card Pass-Through
           *    General Purpose Logging feature set
           *    WRITE_{DMA|MULTIPLE}_FUA_EXT
           *    64-bit World wide name
           *    URG for READ_STREAM[_DMA]_EXT
           *    URG for WRITE_STREAM[_DMA]_EXT
           *    WRITE_UNCORRECTABLE_EXT command
           *    {READ,WRITE}_DMA_EXT_GPL commands
           *    Segmented DOWNLOAD_MICROCODE
                unknown 119[7]
           *    Gen1 signaling speed (1.5Gb/s)
           *    Gen2 signaling speed (3.0Gb/s)
           *    Gen3 signaling speed (6.0Gb/s)
           *    Native Command Queueing (NCQ)
           *    Host-initiated interface power management
           *    Phy event counters
           *    NCQ priority information
                Non-Zero buffer offsets in DMA Setup FIS
           *    DMA Setup Auto-Activate optimization
                Device-initiated interface power management
                In-order data delivery
           *    Software settings preservation
           *    SMART Command Transport (SCT) feature set
           *    SCT LBA Segment Access (AC2)
           *    SCT Error Recovery Control (AC3)
           *    SCT Features Control (AC4)
           *    SCT Data Tables (AC5)
Security:
        Master password revision code = 65534
                supported
        not     enabled
        not     locked
        not     frozen
        not     expired: security count
        not     supported: enhanced erase
Logical Unit WWN Device Identifier: 5000cca228c09b4e
        NAA             : 5
        IEEE OUI        : 000cca
        Unique ID       : 228c09b4e
Checksum: correct



reply via email to

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