Bug 11318 - Temporary textfiles for 'iptables', 'iptablesmangle' and iptablesnat' are not deleted after use.
Summary: Temporary textfiles for 'iptables', 'iptablesmangle' and iptablesnat' are not...
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: iptables (show other bugs)
Version: 2
Hardware: all Linux
: - Unknown - Minor Usability
Assignee: Assigned to nobody - feel free to grab it and work on it
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-16 00:50 UTC by Matthias Fischer
Modified: 2017-04-21 11:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Fischer 2017-04-16 00:50:50 UTC
Hi,

when opening 'iptables.cgi', three text files are created through '/usr/local/bin/getipstat' in directory '/srv/web/ipfire/html'.

These are 'iptables.txt', 'iptablesmangle.txt' and 'iptablesnat.txt', see line 47 in '/srv/web/ipfire/cgi-bin/iptables'.

After closing 'iptables.cgi', these three files are not needed anymore and should be deleted by the last three lines (437-439) in 'iptables,cgi':

...
system(rm -f "/srv/web/ipfire/html/iptables.txt");
system(rm -f "/srv/web/ipfire/html/iptablesmangle.txt");
system(rm -f "/srv/web/ipfire/html/iptablesnat.txt");
...

This doesn't work, files stay where they are, nothing happens.

Changing the code to:

...
unlink("/srv/web/ipfire/html/iptables.txt");
unlink("/srv/web/ipfire/html/iptablesmangle.txt");
unlink("/srv/web/ipfire/html/iptablesnat.txt");
...

had no effect, either - '/var/log/httpd/error_log' says:

...
cannot unlink '/srv/web/ipfire/html/...
: Permission denied, referer: https:...
...

Same things seem to happen in '/srv/web/ipfire/cgi-bin/guardian.cgi', line 986 and line 1022-1024.

Best,
Matthias