From owner-freebsd-questions@freebsd.org Wed Apr 27 08:22:33 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9399B1C5C8 for ; Wed, 27 Apr 2016 08:22:33 +0000 (UTC) (envelope-from fluca1978@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 824D21418 for ; Wed, 27 Apr 2016 08:22:33 +0000 (UTC) (envelope-from fluca1978@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id e201so10493719wme.2 for ; Wed, 27 Apr 2016 01:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=gIs1rXbccusB0HApu9wzpcTAVe8BmA0PpuVLf34c3NU=; b=kEEOavtE8Ym8+WUy1bOYOr5DHQnkgRE5E1u+q/LsGUfRoWMseayzj8c4MGBCp8uaqY M2mTP1lCuluB9hkPhs++t1vymfijTJixCQaNOGx2mnfDOWkCS0qXsxvJlTkJnok5kdGA sJYOckM8RlKAsXWbhzJ447odDe5t3newbwjMRlR5Y8/35dqIZXjp8oMRBkl/5C7uUVio K0wR6dxw9a1faSxb/vh2aCvP7TjpaSOM94iEELKJKEmYv8NDunguedf/HmVONfEhiL16 NEE2iM8DwpZP8Y1sFLMrDS56Owb0jINwpTemOdA9oOVj72XVobFjaeKc2d4mdgPXVe8b ZuOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=gIs1rXbccusB0HApu9wzpcTAVe8BmA0PpuVLf34c3NU=; b=hFbjz2ZosQ71g9YgHzpLGJi0amWQDHRxxTRbGQXhyNSnzHhglG1IaEG6EF3zgRVr/u hL2a7P0BmbbR5Nn/68bwlNYsgWYqMaYfQLSaXsB0Sf9wxhMPCI9aUpUW6YAJuGYRH0G4 nKbNYSclA/NTOGE2IFyPMyf6WrqZf8zVGfD0cT8MtVXq8HfvWUT+Gg8uCqoiVorMNrCE /aO9ijis11V2FkZTs66+fZJjN/hKwYAi/Kc2wUbYSKXjk1bKM6YwbwaTvbZQ5B7WvyQM 1bdTEBS1Jk526/V+ruKSNVPTiPMvdg/I1Zz8JL0gQlV3QYJlIQTUACwhjnlDbLY+cLF2 fCRA== X-Gm-Message-State: AOPr4FUKzNAwPtuKd3+qGY7FhS9br6q4zfMOmDhxM9GTj7eOXC7tBQ227i4XtcTjc3NewKphwQgGbnR9mj7pHQ== MIME-Version: 1.0 X-Received: by 10.194.170.5 with SMTP id ai5mr7700280wjc.75.1461745351908; Wed, 27 Apr 2016 01:22:31 -0700 (PDT) Sender: fluca1978@gmail.com Received: by 10.195.8.133 with HTTP; Wed, 27 Apr 2016 01:22:31 -0700 (PDT) In-Reply-To: <20160427082142.fd56427e6b96fb6fb2b29035@sohara.org> References: <20160426194048.GA31481@box-fra-01.niklaas.eu> <20160427082142.fd56427e6b96fb6fb2b29035@sohara.org> Date: Wed, 27 Apr 2016 10:22:31 +0200 X-Google-Sender-Auth: cNEmspqQR5Ubronu7_00l7sjyjE Message-ID: Subject: Re: Why is www's $PATH only /usr/bin:/bin? From: Luca Ferrari To: Niklaas Baudet von Gersdorff Cc: freebsd-questions Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 08:22:34 -0000 On Wed, Apr 27, 2016 at 9:21 AM, Steve O'Hara-Smith wrote: > On Tue, 26 Apr 2016 21:40:48 +0200 > ... and indeed cannot log in so the login.conf is not going to > apply. It is also possible (indeed likely) that the web server deliberately > minimises the path passed to CGI scripts for security. Exactly. You have to think that PATH can be changed by the running process, so there is no surprise that is either expanded or shrinked. >> The thing is that I want to run something in /usr/local/bin with PHP's >> >> shell_exec($cmd); >> >> but that's not working because it's not in $PATH. I would suggest to either add the path to the php config or to make a php function to build the absolute path for command based on your installation or some other condition. That would make the application portable. Luca