apache-config returns "you must be root" even if user is root : problem with $UID

Bug #186207 reported by Rémi BOULLE
6
Affects Status Importance Assigned to Milestone
wims (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: wims

Here are the steps :

1/ $sudo apt-get install wims (and all dependencies)
2/ $sudo su
3/ $./var/lib/wims/bin/apache-config

It returns : "This script adds WIMS-related definitions to Apache config. It must be run as root. su to root before running this script!"

The part of /var/lib/wims/bin/apache-config that seem to cause the problem is here :
********
if [ ! "$UID" = 0 ]; then
 echo
 echo This script adds WIMS-related definitions to Apache config.
 echo It must be run as root.
 echo
 echo su to root before running this script!
 echo
 echo
 exit
fi
*********
I just commented this out and it worked. Strange.

Tags: bitesize
Revision history for this message
Bernadette (bpr) wrote :

Replace
if [ ! "$UID" = 0 ]; then

by

if [ ! "$(id -ru )" = 0 ]; then

the first syntax seems to be a "bashism" not compatible with unbuntu

https://wiki.ubuntu.com/DashAsBinSh

It has been corrected in the svn version
http://sourcesup.cru.fr/projects/wimsdev

Bernadette

Daniel T Chen (crimsun)
Changed in wims:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote :

What version of wims were you using, and which version of ubuntu were you using when you encountered this bug?

Changed in wims (Ubuntu):
status: Triaged → Incomplete
Revision history for this message
callum (callumdryden) wrote :

This is fixed in the current wims package in Lucid

Changed in wims (Ubuntu):
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.