-
Type:
Service Pack Request
-
Status: Closed
-
Resolution: Won't Fix
-
Affects Version/s: 5.1.1
-
Fix Version/s: None
-
Component/s: Installer
-
Labels:None
-
Bug Priority:
-
ACT Numbers:
00784120
The alfresco.sh script has a typo that causes the root execution prevention to fail. The "$2" should be "$1". Specifically, this section from the alfresco.sh script contains an error:
# Avoid root execution if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ] && [ $2 != "stop" ]; then echo "Execution by root not allowed" exit 1 fi
This should be:
# Avoid root execution if [ `id|sed -e s/uid=//g -e s/\(.*//g` -eq 0 ] && [ $1 != "stop" ]; then echo "Execution by root not allowed" exit 1 fi
[Steps to reproduce]
1. Install Alfresco 5.1 on Linux as a non-root user
2. Switch to the root user ("su")
3. As root, attempt to start Alfresco using the alfresco.sh script:
./alfresco.sh start
[Expected Behaviour]
The alfresco.sh script should prevent root execution:
[root@localhost alfresco-5.1.1.4]# ./alfresco.sh start
Execution by root not allowed
[Observed Behaviour]
The following message is displayed, then Alfresco starts as expected:
[root@localhost alfresco-5.1.1.4]# ./alfresco.sh start
./alfresco.sh: line 4: [: !=: unary operator expected