Bug 70712 - irda initscript has wrong error handling
Summary: irda initscript has wrong error handling
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: irda-utils
Version: 8.0
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: wdovlrrw
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-04 14:20 UTC by Peter van Egdom
Modified: 2015-01-07 23:58 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-07-03 13:26:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Peter van Egdom 2002-08-04 14:20:15 UTC
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:
Always

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

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 22:18:09 UTC
Still occurs in Red Hat Linux 8.0.

Comment 2 Karsten Hopp 2003-07-03 13:26:35 UTC
You can't restart services as a normal user. That's not limited to irda. 

Comment 3 Peter van Egdom 2003-07-03 20:35:57 UTC
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.