delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/21/11:01:06

X-Spam-Check-By: sourceware.org
Date: Tue, 21 Aug 2007 17:00:31 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Shell scripts on FAT volumes
Message-ID: <20070821150031.GK23854@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <faetbb$q26$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
In-Reply-To: <faetbb$q26$1@sea.gmane.org>
User-Agent: Mutt/1.4.2.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Aug 21 15:37, Thorsten Kampe wrote:
> [Cygwin latest snapshot]
> 
> I just noticed (on two different Windows XP) Cygwin installation that 
> Shebang shell scripts are not executable on FAT32 volumes (like usb 
> drives). The mount man page says "Normally, files ending in certain 
> extensions (.exe, .com,  .bat,  .cmd) are  assumed  to be executable.  
> Files whose first two characters begin with  '#!' are also considered 
> to be executable."
> 
> Is that expected behaviour?

Right now, yes.  I have disabled code which sets the x bit by reading
the first bytes of a file to figure out if it starts with magic chars
like '#!'.  The reason I disabled this code in the first place is the
fact that it's not thread safe.  I even considered it entirely
unnecessary, but apparently it's not.  However, even though the scripts
don't have the x bit set, they are nevertheless executable.  Try it:

  (This is on FAT)
  $ cat > x.sh << EOF
  #!/bin/bash
  echo hallo
  EOF
  $ ls -l x.sh
  -rw-r--r-- 1 corinna users 23 Aug 21 16:55 x.sh
  $ ./x.sh
  hallo
  $


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019