Commit Graph

345 Commits

Author SHA1 Message Date
Adolf Belka
01ed9ff321 urlfilterctrl: Fix bug#10649 - add option to remove urlfilter from fcron directories
- Currently if the urlfilter update is enabled then autoupdate.pl is renamed urlfilter and
   added into either the daily, weekly or monthly fcron directoiries. If the update is
   disabled then the urlfilter update script stays in the directory and is not removed.
- This patch adds in the option of remove to the urlfilterctrl program. The first part
   of the urlfilterctrl.c code removes any existing symlinks so all that needs to be done
   for the remove option is to not add any symlinks to the fcron directories.
- Confirmed in a vm testbed that the current approach leaves the symlink in place. Installed
   the changes from this and the previous patch and confirmed that when the url update is
   disabled the symlink is removed.

Fixes: Bug#10649
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-09-28 09:39:26 +00:00
Michael Tremer
ed1a24686c misc-progs: setuid: Return exit code from called process
This patch will return the exit code from the called process which has
not been done before. This made it more difficult to catch any
unsuccessful calls from the web UI.

Partly Fixes: #12863
Tested-by: Jon Murphy <jon.murphy@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-06-15 09:39:28 +00:00
Michael Tremer
a98b79f878 misc-progs: Fix path to killall binary in openvpnctrl
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-02-22 15:25:20 +00:00
Michael Tremer
435076bbb0 misc-progs: Kill OpenVPN Authenticator before OpenVPN
There used to be a time where the authenticator crashed when the OpenVPN
daemon went away which is causing issues.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2023-02-22 15:01:58 +00:00
Michael Tremer
77e1061bf9 misc-progs: wirelessctrl: Fix missing whitespace for log prefix
Fixes: #12978
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-11-03 15:13:10 +00:00
Robin Roevens
24168c8898 misc-progs: addonctrl: Add support for 'Services' metadata
* Addonctrl will now check in addon metadata for the exact initscript
  names (Services). If more than one initscript is defined for an addon,
  the requested action will be performed on all listed initscripts.
* Added posibility to perform action on a specific initscript of an
  addon instead of on all initscripts of the addon.
* New action 'list-services' to display a list of services related to
  an addon.
* New action 'boot-status' to display wether service(s) are enabled
  to start on boot or not.
* More error checking and cleaner error reporting to user
* General cleanup and code restructuring to avoid code duplication
* Updated and made usage instructions more verbose.

Fixes: Bug#12935
Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-10-29 08:56:48 +00:00
Michael Tremer
e420c103de openvpnctrl: Update CRL before starting the client daemon
If the CRL is outdated for some reason (e.g. a backup restored from ISO
where we don't run the migration scripts), this will update it on
reboot/restart of the service.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-10-24 09:06:16 +00:00
Michael Tremer
cc826e8628 setaliases: Use "secondary" flag instead of scope
The scope option does not seem to work at all now, which is surprising
since I tested it quite well.

The secondary flag cannot be set from userspace (aparently), but it
works, so I would prefer to go with this option for now.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-09-11 07:40:46 +00:00
Robin Roevens
85bfecc0ba Fix bug 12908 - Correct getipstat pcount 2022-08-17 21:21:32 +00:00
Michael Tremer
72696db892 aliases: Don't call arpping to announce new IP addresses
I am not sure what the rationale is here, but we should probably not do
this. Other hosts on the network will be able to update their ARP caches
properly.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-07-06 10:01:50 +00:00
Michael Tremer
6395bed8a4 aliases: Add support to assign aliases to multiple RED interfaces
This is a little patch which will extend the aliases page to offer an
interface selection if there are more than one RED interfaces.

This is a little hack to make configuration easier for users who have
manually set up more than one RED interface (e.g. for load balancing or
fail-over) and want to use the UI to configure firewall rules.

As a little benefit on the side, I had to rewrite setaliases.c to use
ip(8) instead of ifconfig(8).

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-07-06 10:01:50 +00:00
Michael Tremer
49471f05d5 misc-progs: Fix passing argument list
The run() function expects all arguments without the basename of the
program.

This regression was introduced in a609195a26.

Fixes: #12886
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-23 13:21:23 +00:00
Michael Tremer
a609195a26 misc-progs: Add path to executable to argv
Otherwise, the first argument would always be swollowed :(

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-06-17 16:39:12 +00:00
Michael Tremer
339b84d509 openvpn-2fa: Import a prototype of an authenticator
This script runs aside of OpenVPN and connects to the management socket.
On the socket, OpenVPN will post any new clients trying to authenticate
which will be handled by the authenticator.

If a client has 2FA enabled, it will be challanged for the current token
which will then be checked in a second pass.

Clients which do not have 2FA enabled will just be authenticated no
matter what and tls-verify will have handled the rest.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-06-17 10:20:18 +00:00
Peter Müller
ab1bdf3405 ipfirereboot.c: Remove orphaned comment
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-04-22 19:58:48 +00:00
Michael Tremer
136d91f346 misc-progs: Set a reasonable default PATH variable
We have some scripts in /usr/local/bin which cannot be found by any
misc-progs which is fixed by this patch.

Fixes: #12811
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2022-03-21 21:36:51 +00:00
Peter Müller
66c3619872 Early spring clean: Remove trailing whitespaces, and correct licence headers
Bumping across one of our scripts with very long trailing whitespaces, I
thought it might be a good idea to clean these up. Doing so, some
missing or inconsistent licence headers were fixed.

There is no need in shipping all these files en bloc, as their
functionality won't change.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-02-18 23:54:57 +00:00
Robin Roevens
8b68ed1226 misc-progs: getipstat: Refactor + extend
* Return output of iptables directly instead of writing it to files.
 * Make iptables wait for 5s if xtables is locked by another iptables
 process. (--wait 5 argument)
 * Add optional parameter "-x" to have iptables report exact numbers.
 * Add optional parameter "-f" to display  the filter table  (default).
 * Add optional parameter "-n" to display the nat table.
 * Add optional parameter "-m" to display the mangle table.
  * Adapt iptables.cgi and guardian.cgi to catch getipstat output
  instead of reading temp-files.

Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-05-04 14:27:27 +00:00
Michael Tremer
23f280b5e6 misc-progs: Call unpriv_system commands in a shell
Reported-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-02-07 16:46:55 +00:00
Michael Tremer
157d64250a misc-progs: addonctrl: Replace all sprintf() with snprintf()
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
37fe3658a0 samba: Add helper script to pipe password
It is complicated to set the password in the C helper binary.

Therefore it is being set by a helper script.

This is still not an optimal solution since the password might be
exposed to the shell environment, but has the advantage that shell
command injection is no longer possible.

Fixes: #12562
Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
354c3e2b45 samba: Remove option to chose user group and shell
There is no need for this being implemented and it is dangerous to allow
the user to create any shell accounts or users that belong to groups
with higher privileges.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
64883513d5 misc-progs: sambactrl: Sanitise username
Fixes: #12562
Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
8e4b2125cc misc-progs: sambactrl: Remove unused smbsafeconfpdc command
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
84de1f087c misc-progs: sshctrl: Sanitise runtime for "tempstart"
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
14dc1c68f7 misc-progs: smartctrl: Sanitise device name
Fixes: #12562
Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
5efedb5487 misc-progs: mpfirectrl: Use new run() function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
c651dd9b6b misc-progs: extrahdctrl: Use new run() function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
cf9efe511a misc-progs: addonctrl: Sanitise add-on names before use
Fixes: #12562
Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
db984059b2 misc-progs: Add functions to sanitise input arguments
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
6733d973d6 misc-progs: pakfire: Use new run() function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
c33f477f5b misc-progs: backupctrl: Use new run() function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
ca060524a7 misc-progs: Introduce run()
This function invokes a new command similar to safe_system()
but without launching a shell before.

That way, it is possible to execute commands without any risk
of shell command injection from nobody.

Fixes: #12562
Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
d9f9f16366 Drop launch-ether-wake
The helper binary is being dropped and etherwake is enabled
for CAP_NET_RAW. This allows execution by unprivileged users
as needed by the web user interface (nobody).

Reported-by: Albert Schwarzkopf <ipfire@quitesimple.org>
Fixes: #12562
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-27 21:06:57 +00:00
Michael Tremer
1a886f57d8 misc-progs: ipfirereboot: Remove unused cron functions
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-06 14:50:40 +00:00
Michael Tremer
81790c8a00 misc-progs: Set some defaults for CONFIG_ROOT and SNAME
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-06 14:50:19 +00:00
Michael Tremer
1a79ef8e43 misc-progs: Drop unused upnpctrl
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-06 14:50:07 +00:00
Michael Tremer
f0c39f1739 misc-progs: Drop unused updxsetperms
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-06 14:48:44 +00:00
Michael Tremer
7908de2a95 misc-progs: Drop unused ipfiredeath & ipfirerebirth
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-06 14:48:39 +00:00
Michael Tremer
5cef36ccb1 misc-progs: Drop unused applejuicectrl
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-01-06 14:48:34 +00:00
Peter Müller
fe0984e07b sshctrl: when enable or disable AllowTcpForwarding, change PermitOpen accordingly
Fixes: #12546

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-12-21 21:33:15 +00:00
Michael Tremer
36bcdbf7e4 samba: Refactor user management
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-13 17:06:19 +01:00
Michael Tremer
1c14930212 samba: Always show printer options
Samba is always linked against CUPS and therefore there is
no way to disable printing anyways.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-13 17:06:16 +01:00
Michael Tremer
5aa5f6777a samba: Remove reset options
This only requires that we have to change multiple files with
the same settings.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-13 17:06:16 +01:00
Michael Tremer
e0be282c09 sambactrl: Remove unused reset command
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-13 17:06:16 +01:00
Michael Tremer
b67f02d512 /var/ipfire/ethernet/settings: Drop BROADCAST variable
This variable is no longer being used and was only used to
assign IP addresses to the individual interfaces.

However, the kernel knows best which IP address to select
as broadcast address for each network. Therefore we depend
on the kernel which allows us to support RFC3021.

Fixes: #12486 - no /31 transfer net available on red
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-07 11:46:46 +00:00
Michael Tremer
b45faf9e70 IPsec: Bring down connections after reloading configuration
It could happen that the remote peer re-established the connection
before "ipsec reload" removed it from the daemon.

Now, we write the configuration files first, reload them
and then bring down any connections that are still established.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-24 17:36:38 +00:00
Stefan Schantl
bdb1f38a07 unboundctrl: Add support for calling reload.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2020-01-11 19:35:24 +01:00
Michael Tremer
5e39f3c08a sshctrl: Fix syntax of generated sed command
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-11 23:22:14 +01:00
Peter Müller
f9de28e6f0 change AllowAgentForwarding in SSHD configuration if, necessary
Fixes #11931

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-08 21:15:35 +01:00