[Pm-utils] [PATCH 3/7] (pm-utils 1.2.4) hal-get-property runs just fine as a normal user

Victor Lowther victor.lowther at gmail.com
Thu Jan 29 16:01:04 PST 2009


On Thu, 2009-01-29 at 19:32 +0100, Michael Biebl wrote:
> 2009/1/29 Victor Lowther <victor.lowther at gmail.com>:
> > ---
> >  pm/pm-functions.in |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/pm/pm-functions.in b/pm/pm-functions.in
> > index f5cc400..9a3097e 100644
> > --- a/pm/pm-functions.in
> > +++ b/pm/pm-functions.in
> > @@ -79,7 +79,7 @@ done
> >
> >  . "${PM_FUNCTIONS}"
> >
> > -if [ "$(id -u)" = "0" ] && command_exists hal-get-property; then
> > +if command_exists hal-get-property; then
> >     export CHASSIS_TYPE="$(hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.chassis.type)"
> >  else
> >     export CHASSIS_TYPE=Unknown
> 
> Hi,
> 
> I think we should check the return code of hal-get-property and set
> CHASSIS_TYPE=Unknown if != 0
> We should also avoid to print error messages of hal-get-property to stderr.
> 
> See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=511466 for reference.

Will do.

> Cheers,
> Michael
> 
-- 
Victor Lowther
RHCE# 805008539634727
LPIC-2# LPI000140019



More information about the Pm-utils mailing list