Open Source Training Seminar FreePBX Paid Support

Ticket #2779 (closed Bugs: fixed)

Opened 5 months ago

Last modified 1 month ago

no check if indications.conf is writable

Reported by: tzafrir Assigned to: p_lindheimer
Priority: minor Milestone: 2.5
Component: Core Version: SVN-HEAD
Keywords: Cc:
Confirmation: Need Feedback SVN Revision (if applicable):
Backend Engine: All Backend Engine Version:

Description

While first running retrieve_conf I got the long stream of messages:

Warning: fopen(/etc/asterisk/indications.conf): failed to open stream: Permission denied in /usr/share/freepbx/modules/core/functions.inc.php on line 2707

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/share/freepbx/modules/core/functions.inc.php on line 2708

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/share/freepbx/modules/core/functions.inc.php on line 2712

[snip some 30 lines ]

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/share/freepbx/modules/core/functions.inc.php on line 2712

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/share/freepbx/modules/core/functions.inc.php on line 2712

Warning: fwrite(): supplied argument is not a valid stream resource in /usr/share/freepbx/modules/core/functions.inc.php on line 2712

Warning: fclose(): supplied argument is not a valid stream resource in /usr/share/freepbx/modules/core/functions.inc.php on line 2714

Naturally I missed the first line and was left wondering what this fuss is all about. The attached patch checks for the result of the fopen and exists from the function otherwise. I left this non-error handling, as it is the one currently used.

Attachments

checkperms_indications (0.6 kB) - added by tzafrir on 04/07/08 12:51:24.

Change History

04/07/08 12:51:24 changed by tzafrir

  • attachment checkperms_indications added.

07/01/08 15:59:52 changed by lazytt

  • confirmation changed from Unreviewed to Need Feedback.

shouldn't 'amportal start' take care of these perms?

07/01/08 17:09:37 changed by p_lindheimer

  • milestone changed from Cut Line to 3.0.

all files should be but I guess someone may make this read only for a reason. If someone wants to modify this to add a notification to the notification system we can add it to the code. You can find several examples of notifications in /var/www/html/functions.inc.php or in retrieve_conf for examples.

07/02/08 03:44:16 changed by tzafrir

Changing permissions in amportal.conf is a hack.

For instance, it may mean you'll have to fully restart asterisk simply because of a trivial configuration change from the GUI.

Hence that chown is not used in my packages. The files are installed with proper eprmissions in the first place and are generated with proper permissions when necessary.

And besides there might be other valid reasons for not being able to write to that file (no free disk space? read-only partition?). You should be able to properly fail with a decent error message.

07/02/08 06:33:53 changed by p_lindheimer

  • version changed from 2.3.1 to SVN-HEAD.

tzafrir,

as I mentioned, if you want to modify your patch to write the error into the notification system (and clear the error when it is successful) we'll put that in. There are plenty of examples that log to the notification system to cut and paste from if you haven't done that before.

07/15/08 17:31:30 changed by p_lindheimer

  • type changed from Patches to Bugs.

07/25/08 11:23:17 changed by p_lindheimer

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

(In [6181]) fixes #2779 create warning if indications.conf can't be written

07/25/08 11:45:36 changed by p_lindheimer

(In [6182]) re #2779 minor tweak in coding style to please tzafrir who know owes me a beer

Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads