Bug 70712

Summary: irda initscript has wrong error handling
Product: [Retired] Red Hat Linux Reporter: Peter van Egdom <p.van.egdom>
Component: irda-utilsAssignee: wdovlrrw <brosenkr>
Status: CLOSED NOTABUG QA Contact: Jay Turner <jturner>
Severity: low Docs Contact:
Priority: medium    
Version: 8.0CC: srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-07-03 13:26:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.