Ticket #5216 (closed Bugs: fixed)

Opened 2 years ago

Last modified 2 years ago

AMPBIN vs. assuming ASTVARLIBDIR/bin with admin commands

Reported by: Lantizia Assigned to:
Priority: major Milestone: 2.10
Component: FreePBX Framework Version: 2.9-branch
Keywords: astvarlibdir ampbin admin amportal freepbx_engine Cc:
Confirmation: Unreviewed Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable):

Description

Similar bug to #5077 but this time $ASTVARLIBDIR/bin is being used in 5 other places that control what happens when you use the developer admin commands of freepbx_engine... rather than $AMPBIN which could cause issues.

So a change from this...

admin|a)
                case $2 in
                        reload|r)
                                $ASTVARLIBDIR/bin/module_admin reload
                        ;;
                        context|ctx)
                        case $3 in
                                list|l)
                                #asterisk -rx 'dialplan show'|grep Context|awk '{print $3}'|sed "s/'//g"|sort
                                        cat $ASTETCDIR/extensions*|grep '^\['|sed 's/[][]//g'|sort
                                ;;
                                contains|con)
                                        awk -v var="[$4]" 'f && /^;/{exit} f{print} index($0,var){f=1}' /etc/asterisk/extensions_additional.conf
                                ;;
                                *)
                                        for i in $ASTETCDIR/extensions*; do     awk -v "var=$3" '$0 ~ "^\\[" var "\\]", /^;/ { print }'  $i; done
                                ;;
                        esac
                        ;;
                        modadmin|ma)
                                $ASTVARLIBDIR/bin/module_admin $3 $4
                        ;;
                        freepbx_setting|fs)
                                $ASTVARLIBDIR/bin/freepbx_setting $3 $4
                        ;;
                        auth_database|ad)
                                $ASTVARLIBDIR/bin/freepbx_setting AUTHTYPE database
                        ;;
                        auth_none|an)
                                $ASTVARLIBDIR/bin/freepbx_setting AUTHTYPE none
                        ;;

Needs to be...

admin|a)
                case $2 in
                        reload|r)
                                $AMPBIN/module_admin reload
                        ;;
                        context|ctx)
                        case $3 in
                                list|l)
                                #asterisk -rx 'dialplan show'|grep Context|awk '{print $3}'|sed "s/'//g"|sort
                                        cat $ASTETCDIR/extensions*|grep '^\['|sed 's/[][]//g'|sort
                                ;;
                                contains|con)
                                        awk -v var="[$4]" 'f && /^;/{exit} f{print} index($0,var){f=1}' /etc/asterisk/extensions_additional.conf
                                ;;
                                *)
                                        for i in $ASTETCDIR/extensions*; do     awk -v "var=$3" '$0 ~ "^\\[" var "\\]", /^;/ { print }'  $i; done
                                ;;
                        esac
                        ;;
                        modadmin|ma)
                                $AMPBIN/module_admin $3 $4
                        ;;
                        freepbx_setting|fs)
                                $AMPBIN/freepbx_setting $3 $4
                        ;;
                        auth_database|ad)
                                $AMPBIN/freepbx_setting AUTHTYPE database
                        ;;
                        auth_none|an)
                                $AMPBIN/freepbx_setting AUTHTYPE none
                        ;;

Is required to fix this.

Change History

06/09/11 09:32:51 changed by mbrevda

  • status changed from new to closed.
  • resolution set to fixed.

(In [12224]) closes #5216 - use proper variable to point to asterisk's bin dir. Thanks Lantizia!

06/09/11 09:33:58 changed by mbrevda

Lantizia, This is almost (not quite though) a feature request, as the result is exactly the same. Unless I missed something?

06/09/11 10:58:24 changed by Lantizia

Nope, not a feature request... No part of FreePBX should be assuming the location of the FreePBX scripts should be $ASTVARLIBDIR/bin as the location of this directory can be set by using $AMPBIN and as a result may be elsewhere

For example my $ASTVARLIBDIR is /var/lib/asterisk

But I install the FreePBX scripts (by setting $AMPBIN in the amportal.conf before installation) to here... /usr/local/bin

Thus '$ASTVARLIBDIR/bin" != '$AMPBIN'

Same issue was seen in bug #5077 which was also fixed when it came to setting the correct permissions on the scripts in that directory.

06/09/11 11:27:18 changed by mbrevda

technically speaking, your 100% correct

06/10/11 11:54:22 changed by p_lindheimer

(In [12230]) Merged revisions 12212,12224 via svnmerge from http://www.freepbx.org/v2/svn/freepbx/trunk

........

r12212 | mbrevda | 2011-06-06 06:11:58 -0700 (Mon, 06 Jun 2011) | 1 line

closes #5140 - remove slashes before showing excaped fileds

........

r12224 | mbrevda | 2011-06-09 06:32:51 -0700 (Thu, 09 Jun 2011) | 1 line

closes #5216 - use proper variable to point to asterisk's bin dir. Thanks Lantizia!

........