Bug 70712 - irda initscript has wrong error handling
irda initscript has wrong error handling
Product: Red Hat Linux
Classification: Retired
Component: irda-utils (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: wdovlrrw
Jay Turner
Depends On:
  Show dependency treegraph
Reported: 2002-08-04 10:20 EDT by Peter van Egdom
Modified: 2015-01-07 18:58 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-07-03 09:26:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Peter van Egdom 2002-08-04 10:20:15 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1b) Gecko/20020721

Description of problem:
[peterve@limbo-pc init.d]$ ./irda start
touch: creating `/var/lock/subsys/irda': Toegang geweigerd [  OK  ]

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. as a normal user "irda start"

Actual Results:
touch: creating `/var/lock/subsys/irda': Toegang geweigerd [  OK  ]

Expected Results:
touch: creating `/var/lock/subsys/irda': Toegang geweigerd [FAILED]

Additional info:

Source RPM: irda-utils-0.9.14-6.src.rpm
Comment 1 Peter van Egdom 2002-11-01 17:18:09 EST
Still occurs in Red Hat Linux 8.0.
Comment 2 Karsten Hopp 2003-07-03 09:26:35 EDT
You can't restart services as a normal user. That's not limited to irda. 
Comment 3 Peter van Egdom 2003-07-03 16:35:57 EDT
With this Bugzilla report I specifically meant the exit handling of this
initscript. The use of "/etc/rc.d/init.d/irda start" as a normal user results in
the following strange error :

    touch: cannot touch `/var/lock/subsys/irda': Permission deniedOK '

It would be 'tidier' to patch the script as follows :

<         echo -n $"Starting $prog: "
<         daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
<       touch /var/lock/subsys/irda
<         echo
>         ID=`id -u`
>         if [ $ID -eq 0 ]; then
>               echo -n $"Starting $prog: "
>               daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
>               touch /var/lock/subsys/irda
>               echo
>         else
>           echo $"You need to be root to start this script ! "
>         fi

Of course, this is only for the start parameter of the script, but if the script
is called this way (a a normal user) it will at least give a proper error message.

Note You need to log in before you can comment on or make changes to this bug.