Ticket #1878 (closed Bugs: fixed)

Opened 6 years ago

Last modified 6 years ago

Installation free pbx 2.21

Reported by: carribbrother Assigned to: RobThomas
Priority: minor Milestone: 2.2
Component: Installation Version: 2.3-branch
Keywords: Cc:
Confirmation: Distro:
Backend Engine: All Distro Ver:
Backend Ver: SVN Revision (if applicable): 3927

Description (Last modified by diego_iastrubni)

Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..PHP Warning:  file(/etc/amportal.conf): failed to open stream: Permission denied in /var/lib/asterisk/bin/retrieve_conf on line 41
PHP Warning:  Invalid argument supplied for foreach() in /var/lib/asterisk/bin/retrieve_conf on line 42
OK
Reading /etc/asterisk/asterisk.conf..OK
Connecting to database..PHP Notice:  Undefined index:  AMPDBUSER in /var/lib/asterisk/bin/retrieve_conf on line 199
PHP Notice:  Undefined index:  AMPDBPASS in /var/lib/asterisk/bin/retrieve_conf on line 200
PHP Notice:  Undefined index:  AMPDBHOST in /var/lib/asterisk/bin/retrieve_conf on line 201

Change History

03/30/07 18:04:32 changed by p_lindheimer

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

there's nothing actionable here. Installation works although something is wrong with your setup. Get onto #freepbx or the forum to seek help.

03/31/07 09:08:32 changed by vgster

chmod 644 /etc/amportal.conf perhaps?

04/14/07 16:49:30 changed by eil

I had the same problem today.

# ls -l /etc/amportal.conf
-rw-r----- 1 root root 4919 2007-04-14 22:39 amportal.conf

The solution, though, was to do this:

chown root:asterisk /etc/amportal.conf

If you set the permissions to 644 as vgster suggests, you make it world-readable which is Really Bad because this file contains passwords that will allow a skilled attacker to do anything they want to your PBX.

04/14/07 23:34:39 changed by vgster

You are correct chown root:asterisk and a chmod 640 is a better way of doing it. Either way this needs to be sorted in the installation.

04/18/07 03:42:51 changed by pnlarsson

  • priority changed from major to minor.
  • resolution deleted.
  • status changed from closed to reopened.
  • component changed from - choose - to Installation.
  • svn_rev set to 3927.

This is something that is a problem for us that are running apache with another user that asterisk. All the other files in the freepbx install are chmod g+rw or g+r to make it possible to do adduser www-data asterisk.

I think this should be treated as an bug.

Index: amportal
===================================================================
--- amportal    (revision 3927)
+++ amportal    (arbetskopia)
@@ -34,6 +34,7 @@

 chown_asterisk() {
        echo SETTING FILE PERMISSIONS
+       chown g+r /etc/amportal.conf
        chown -R asterisk:asterisk $ASTRUNDIR
        chown -R asterisk:asterisk /etc/asterisk
        chmod -R g+w /etc/asterisk

04/18/07 03:44:36 changed by pnlarsson

Next time test before submit...

Index: amportal
===================================================================
--- amportal    (revision 3927)
+++ amportal    (arbetskopia)
@@ -34,6 +34,7 @@

 chown_asterisk() {
        echo SETTING FILE PERMISSIONS
+       chmod g+r /etc/amportal.conf
        chown -R asterisk:asterisk $ASTRUNDIR
        chown -R asterisk:asterisk /etc/asterisk
        chmod -R g+w /etc/asterisk

04/18/07 21:20:31 changed by diego_iastrubni

  • description changed.

fixed by changeset 3931 in the trunk (will close when someone backports to the branch if it's needed)

04/21/07 22:15:14 changed by pnlarsson

It's even better to fix this in install_amp.

798	        chmod(AMP_CONF, 0640);

should be followed by an chown to asterisk...

04/24/07 22:28:19 changed by vgster

Has the latest fix for this got anything to do with

Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Running module install.php and install.sql scripts
Checking for /etc/amportal.conf..OK
Reading /etc/amportal.conf..PHP Warning:  file(/etc/amportal.conf): failed to open stream: Permission denied in /var/lib/asterisk/bin/retrieve_conf on line 43
PHP Warning:  Invalid argument supplied for foreach() in /var/lib/asterisk/bin/retrieve_conf on line 44
OK
PHP Notice:  Undefined index:  ASTETCDIR in /var/lib/asterisk/bin/retrieve_conf on line 177
Reading /asterisk.conf..PHP Warning:  file(/asterisk.conf): failed to open stream: No such file or directory in /var/lib/asterisk/bin/retrieve_conf on line 71
PHP Warning:  Invalid argument supplied for foreach() in /var/lib/asterisk/bin/retrieve_conf on line 72
PHP Notice:  Undefined variable:  conf in /var/lib/asterisk/bin/retrieve_conf on line 77

04/24/07 22:29:28 changed by vgster

It still appears to not be setting the /etc/amportal.conf properly on first install.

06/10/07 03:49:45 changed by vgster

  • version changed from 2.2.1 to 2.3-branch.

This doesnt appear to be an issue with 2.3. I've tried it with a couple of clean installs and amportal.conf is 640 asterisk:asterisk.

06/11/07 02:13:09 changed by vgster

Hmm I was wrong. When amportal.conf is first copied in it's root:asterisk but then once updated its root:root.

06/27/07 03:30:20 changed by gregmac

vgster: Once updated by what?

06/27/07 03:36:41 changed by vgster

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