linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] e2scrub: Remove PATH setting from the scripts
@ 2020-04-02 13:47 Lukas Czerner
  2020-04-02 15:17 ` Darrick J. Wong
  2020-04-10 16:16 ` Theodore Y. Ts'o
  0 siblings, 2 replies; 4+ messages in thread
From: Lukas Czerner @ 2020-04-02 13:47 UTC (permalink / raw)
  To: linux-ext4; +Cc: Ted Tso

We don't want to override system setting by changing the PATH. This
should remain under administrator/user control.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 scrub/e2scrub.in     | 2 --
 scrub/e2scrub_all.in | 2 --
 2 files changed, 4 deletions(-)

diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in
index 30ab7cbd..7c3f46e9 100644
--- a/scrub/e2scrub.in
+++ b/scrub/e2scrub.in
@@ -23,8 +23,6 @@
 # check filesystems in VGs that have at least 256MB (or so) of
 # free space.
 
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-
 if (( $EUID != 0 )); then
     echo "e2scrub must be run as root"
     exit 1
diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
index 4288b969..b6a7d0ad 100644
--- a/scrub/e2scrub_all.in
+++ b/scrub/e2scrub_all.in
@@ -18,8 +18,6 @@
 #  along with this program; if not, write the Free Software Foundation,
 #  Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
 
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-
 if (( $EUID != 0 )); then
     echo "e2scrub_all must be run as root"
     exit 1
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] e2scrub: Remove PATH setting from the scripts
  2020-04-02 13:47 [PATCH] e2scrub: Remove PATH setting from the scripts Lukas Czerner
@ 2020-04-02 15:17 ` Darrick J. Wong
  2020-04-10 16:16 ` Theodore Y. Ts'o
  1 sibling, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2020-04-02 15:17 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4, Ted Tso

On Thu, Apr 02, 2020 at 03:47:16PM +0200, Lukas Czerner wrote:
> We don't want to override system setting by changing the PATH. This
> should remain under administrator/user control.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

Looks ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  scrub/e2scrub.in     | 2 --
>  scrub/e2scrub_all.in | 2 --
>  2 files changed, 4 deletions(-)
> 
> diff --git a/scrub/e2scrub.in b/scrub/e2scrub.in
> index 30ab7cbd..7c3f46e9 100644
> --- a/scrub/e2scrub.in
> +++ b/scrub/e2scrub.in
> @@ -23,8 +23,6 @@
>  # check filesystems in VGs that have at least 256MB (or so) of
>  # free space.
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> -
>  if (( $EUID != 0 )); then
>      echo "e2scrub must be run as root"
>      exit 1
> diff --git a/scrub/e2scrub_all.in b/scrub/e2scrub_all.in
> index 4288b969..b6a7d0ad 100644
> --- a/scrub/e2scrub_all.in
> +++ b/scrub/e2scrub_all.in
> @@ -18,8 +18,6 @@
>  #  along with this program; if not, write the Free Software Foundation,
>  #  Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
>  
> -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> -
>  if (( $EUID != 0 )); then
>      echo "e2scrub_all must be run as root"
>      exit 1
> -- 
> 2.21.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] e2scrub: Remove PATH setting from the scripts
  2020-04-02 13:47 [PATCH] e2scrub: Remove PATH setting from the scripts Lukas Czerner
  2020-04-02 15:17 ` Darrick J. Wong
@ 2020-04-10 16:16 ` Theodore Y. Ts'o
  2020-04-16  9:38   ` Lukas Czerner
  1 sibling, 1 reply; 4+ messages in thread
From: Theodore Y. Ts'o @ 2020-04-10 16:16 UTC (permalink / raw)
  To: Lukas Czerner; +Cc: linux-ext4

On Thu, Apr 02, 2020 at 03:47:16PM +0200, Lukas Czerner wrote:
> We don't want to override system setting by changing the PATH. This
> should remain under administrator/user control.
> 
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>

The reason why the PATH was added is because most users don't have
/sbin or /usr/sbin in their PATH, and if they run "sudo e2scrub",
finding commands like lvcreate, lvremove, et. al., wouldn't be there.

I suppose we could do something like

PATH=$PATH:/sbin:/usr/sbin

instead, but otherwise, users will see some unexpected failures.

	     		      	       	    	       - Ted

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] e2scrub: Remove PATH setting from the scripts
  2020-04-10 16:16 ` Theodore Y. Ts'o
@ 2020-04-16  9:38   ` Lukas Czerner
  0 siblings, 0 replies; 4+ messages in thread
From: Lukas Czerner @ 2020-04-16  9:38 UTC (permalink / raw)
  To: Theodore Y. Ts'o; +Cc: linux-ext4

On Fri, Apr 10, 2020 at 12:16:35PM -0400, Theodore Y. Ts'o wrote:
> On Thu, Apr 02, 2020 at 03:47:16PM +0200, Lukas Czerner wrote:
> > We don't want to override system setting by changing the PATH. This
> > should remain under administrator/user control.
> > 
> > Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> 
> The reason why the PATH was added is because most users don't have
> /sbin or /usr/sbin in their PATH, and if they run "sudo e2scrub",
> finding commands like lvcreate, lvremove, et. al., wouldn't be there.

I don't understand, e2scrub should be in be in sbin as well, right ?
Besides what if such user wants to run lvcreate, or lvremove ? This
seems like a problem that should be fixed somewhere else.

> 
> I suppose we could do something like
> 
> PATH=$PATH:/sbin:/usr/sbin

that's better than replacing it.

-Lukas

> 
> instead, but otherwise, users will see some unexpected failures.
> 
> 	     		      	       	    	       - Ted
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-16  9:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 13:47 [PATCH] e2scrub: Remove PATH setting from the scripts Lukas Czerner
2020-04-02 15:17 ` Darrick J. Wong
2020-04-10 16:16 ` Theodore Y. Ts'o
2020-04-16  9:38   ` Lukas Czerner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).