delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/09/14/05:09:52

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=Zm
BgF67S0uvR9aoKm55yq4Sjqv3niBI9Guup/LcHlRtKjpiinh9ZcEgQRQS8EaSdh/
hdAAgfan1VLRrG7nNML/o73tWvZq3sfIC0sGGSgZyadpTRXs7xwWN/m02purnIq3
wghI4wWrfMKnow+Bt/qTQkKM2+aalx0B46jORF04k=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=CNczQz4a
yb1J5O7GxANrZ5K5XKM=; b=Q6D0gfrCEwiMxn3Za0NEbe2A+l0wjJt0vjOW2Qi2
OUtIdFdt6MV2JmYCll4X+CH/SLOBlQ6Et37oniY+Gnzd47hp2GGiMVMPA6tMydZi
W0/Qb0oU92WazOek47SMY5dAfIbJ3ZMW4ZXBD0dQSOwpbmiIbbaKWQar6u5tqn8M
ALQ=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2
X-HELO: mail-wg0-f52.google.com
MIME-Version: 1.0
X-Received: by 10.194.236.35 with SMTP id ur3mr4807wjc.127.1410685765625; Sun, 14 Sep 2014 02:09:25 -0700 (PDT)
In-Reply-To: <54134A83.80107@redhat.com>
References: <5413271B DOT 1010109 AT t-online DOT de> <54134A83 DOT 80107 AT redhat DOT com>
Date: Sun, 14 Sep 2014 11:09:25 +0200
Message-ID: <CAEhDDbAk8iSeG6CaSDBY8o-DLUUd+xJaATDbP=rBG9qUfFLe+A@mail.gmail.com>
Subject: Re: Cannot exec() program outside of /bin if PATH is unset
From: Csaba Raduly <rcsaba AT gmail DOT com>
To: cygwin list <cygwin AT cygwin DOT com>

On Fri, Sep 12, 2014 at 9:33 PM, Eric Blake  wrote:
> On 09/12/2014 11:02 AM, Christian Franke wrote:
(snip)
>>
>> int main()
>> {
>>   unsetenv("PATH");
>
> This is undefined behavior, per POSIX.  POSIX recommends that you always
> leave PATH defined to at least a bare minimum of the results of
> confstr(_CS_PATH, ...); it also states that implementations are free to
> do what they want (in this case, crash) if you don't follow the
> recommendation:
>
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
> "If PATH is unset or is set to null, the path search is
> implementation-defined."

Nitpick: undefined != implementation-defined

Csaba
-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

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

- Raw text -


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