On Fri, Oct 17, 2014 at 05:51:08AM -0600, David Coppa wrote:
> > From: Thorsten Glaser <t...@mirbsd.org>
> > Date: Fri, Oct 17, 2014 at 10:44 AM
> > Subject: Re: sudo bad practice or inconsistency?
> > To: misc@openbsd.org
> > 
> > 
> > Alessandro DE LAURENZIS <just22.adl <at> gmail.com> writes:
> > 
> > (line-wrapped because of GMane)
> > 
> > > #define SUDOCMD "-fn 7x14 -geometry 60x4 -e sudo su -c 'nohup \
> > > xfe >& /dev/null & sleep 1'"
> >       ^^
> > 
> > Note that this will not work on OpenBSD anyway; even mksh, which
> > does implement this bashism, will not parse this as expected in
> > POSIX mode.
> > 
> > So, besides the changes the others already pointed out:
> > 
> > #define SUDOCMD "-fn 7x14 -geometry 60x4 -e sudo su root -c 'nohup \
> > xfe >/dev/null 2>&1 & sleep 1'"

As I read the man page for su it is the target's login shell that is
invoked, and it need not always be /bin/sh - it can be changed.

Therefore I suspect that you want "-s /bin/sh " between "su " and "root".

> 
> 
> Brian et al., ok for the diff below?
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/x11/xfe/Makefile,v
> retrieving revision 1.33
> diff -u -p -u -p -r1.33 Makefile
> --- Makefile  25 Nov 2013 18:39:02 -0000      1.33
> +++ Makefile  17 Oct 2014 11:45:34 -0000
> @@ -3,7 +3,7 @@
>  COMMENT=     MS-Explorer like file manager for X
>  
>  DISTNAME=    xfe-1.37
> -REVISION=    0
> +REVISION=    1
>  CATEGORIES=  x11
>  
>  HOMEPAGE=    http://roland65.free.fr/xfe/
> Index: patches/patch-src_xfedefs_h
> ===================================================================
> RCS file: patches/patch-src_xfedefs_h
> diff -N patches/patch-src_xfedefs_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_xfedefs_h       17 Oct 2014 11:45:35 -0000
> @@ -0,0 +1,20 @@
> +$OpenBSD$
> +
> +Unbreak launching Xfe as root with sudo or su
> +
> +--- src/xfedefs.h.orig       Fri Oct 17 13:41:26 2014
> ++++ src/xfedefs.h    Fri Oct 17 13:43:44 2014
> +@@ -157,11 +157,11 @@
> + 
> + // Command to launch Xfe as root with sudo or su, using Xvt as a terminal
> + #ifndef SUDOCMD
> +-#define SUDOCMD "-fn 7x14 -geometry 60x4 -e sudo su -c 'nohup xfe >& 
> /dev/null & sleep 1'"
> ++#define SUDOCMD "-fn 7x14 -geometry 60x4 -e sudo su root -c 'nohup xfe 
> >/dev/null 2>&1 & sleep 1'"
> + #endif
> + 
> + #ifndef SUCMD
> +-#define SUCMD "-fn 7x14 -geometry 60x4 -e su -c 'nohup xfe >& /dev/null & 
> sleep 1'"
> ++#define SUCMD "-fn 7x14 -geometry 60x4 -e su root -c 'nohup xfe >/dev/null 
> 2>&1 & sleep 1'"
> + #endif
> + 
> + // Tooltips setup time and duration

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Reply via email to