All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] start-statd: Use bash as -p is no POSIX
@ 2011-08-06  9:59 Luk Claes
  2011-08-06 12:38 ` Jim Rees
  2011-08-29 16:05 ` Steve Dickson
  0 siblings, 2 replies; 4+ messages in thread
From: Luk Claes @ 2011-08-06  9:59 UTC (permalink / raw)
  To: Steve Dickson, linux-nfs; +Cc: Luk Claes

sh -p is not guaranteed to be provided by POSIX shells. dash for instance does not provide this, so use bash explicitly.

Signed-off-by: Luk Claes <luk@debian.org>
---
 utils/statd/start-statd |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/statd/start-statd b/utils/statd/start-statd
index c7805ee..1b345a5 100644
--- a/utils/statd/start-statd
+++ b/utils/statd/start-statd
@@ -1,8 +1,8 @@
-#!/bin/sh -p
+#!/bin/bash -p
 # nfsmount calls this script when mounting a filesystem with locking
 # enabled, but when statd does not seem to be running (based on
 # /var/run/rpc.statd.pid).
-# It should run run statd with whatever flags are apropriate for this
+# It should run statd with whatever flags are apropriate for this
 # site.
 PATH=/sbin:/usr/sbin
 exec rpc.statd --no-notify
-- 
1.7.5.4


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

* Re: [PATCH] start-statd: Use bash as -p is no POSIX
  2011-08-06  9:59 [PATCH] start-statd: Use bash as -p is no POSIX Luk Claes
@ 2011-08-06 12:38 ` Jim Rees
  2011-08-06 13:11   ` Luk Claes
  2011-08-29 16:05 ` Steve Dickson
  1 sibling, 1 reply; 4+ messages in thread
From: Jim Rees @ 2011-08-06 12:38 UTC (permalink / raw)
  To: Luk Claes; +Cc: Steve Dickson, linux-nfs

Luk Claes wrote:

  sh -p is not guaranteed to be provided by POSIX shells. dash for instance
  does not provide this, so use bash explicitly.

That's pretty funny.  The script requires a posix shell, which bash isn't by
default, so it provides an undocumented (in my ubuntu man page) option to
force bash into compliance.  Since the option itself isn't posix, we now
require the use of this non-posix shell so we can guarantee posix
compliance.

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

* Re: [PATCH] start-statd: Use bash as -p is no POSIX
  2011-08-06 12:38 ` Jim Rees
@ 2011-08-06 13:11   ` Luk Claes
  0 siblings, 0 replies; 4+ messages in thread
From: Luk Claes @ 2011-08-06 13:11 UTC (permalink / raw)
  To: Jim Rees; +Cc: Steve Dickson, linux-nfs

On 08/06/2011 02:38 PM, Jim Rees wrote:
> Luk Claes wrote:
> 
>   sh -p is not guaranteed to be provided by POSIX shells. dash for instance
>   does not provide this, so use bash explicitly.
> 
> That's pretty funny.  The script requires a posix shell, which bash isn't by
> default, so it provides an undocumented (in my ubuntu man page) option to
> force bash into compliance.  Since the option itself isn't posix, we now
> require the use of this non-posix shell so we can guarantee posix
> compliance.

That would even be worse as the -p option in bash has *nothing* to do
with posix:

set -p's documentation in bash's manual:

Turn  on  privileged  mode.   In this mode, the
$ENV and $BASH_ENV  files  are  not  processed,
shell  functions  are  not  inherited  from the
environment,  and  the   SHELLOPTS,   BASHOPTS,
CDPATH,   and  GLOBIGNORE  variables,  if  they
appear in the environment, are ignored.  If the
shell   is  started  with  the  effective  user
(group) id not equal to the real  user  (group)
id,  and  the  -p option is not supplied, these
actions are taken and the effective user id  is
set  to  the real user id.  If the -p option is
supplied at startup, the effective user  id  is
not  reset.  Turning this option off causes the
effective user and group ids to be set  to  the
real user and group ids.

Cheers

Luk

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

* Re: [PATCH] start-statd: Use bash as -p is no POSIX
  2011-08-06  9:59 [PATCH] start-statd: Use bash as -p is no POSIX Luk Claes
  2011-08-06 12:38 ` Jim Rees
@ 2011-08-29 16:05 ` Steve Dickson
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2011-08-29 16:05 UTC (permalink / raw)
  To: Luk Claes; +Cc: linux-nfs



On 08/06/2011 05:59 AM, Luk Claes wrote:
> sh -p is not guaranteed to be provided by POSIX shells. dash for instance does not provide this, so use bash explicitly.
> 
> Signed-off-by: Luk Claes <luk@debian.org>
> ---
>  utils/statd/start-statd |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/statd/start-statd b/utils/statd/start-statd
> index c7805ee..1b345a5 100644
> --- a/utils/statd/start-statd
> +++ b/utils/statd/start-statd
> @@ -1,8 +1,8 @@
> -#!/bin/sh -p
> +#!/bin/bash -p
>  # nfsmount calls this script when mounting a filesystem with locking
>  # enabled, but when statd does not seem to be running (based on
>  # /var/run/rpc.statd.pid).
> -# It should run run statd with whatever flags are apropriate for this
> +# It should run statd with whatever flags are apropriate for this
>  # site.
>  PATH=/sbin:/usr/sbin
>  exec rpc.statd --no-notify
Committed...

steved.

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

end of thread, other threads:[~2011-08-29 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-06  9:59 [PATCH] start-statd: Use bash as -p is no POSIX Luk Claes
2011-08-06 12:38 ` Jim Rees
2011-08-06 13:11   ` Luk Claes
2011-08-29 16:05 ` Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.