mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
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>
This commit is contained in:
@@ -27,7 +27,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
const char* name = argv[1];
|
||||
|
||||
|
||||
if (strlen(name) > 32) {
|
||||
fprintf(stderr, "\nString to large.\n\naddonctrl addon (start|stop|restart|reload|enable|disable)\n\n");
|
||||
exit(1);
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* (c) IPFire Team, 2011
|
||||
*
|
||||
* Simple program that calls "sendprofile" as the root user.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "setuid.h"
|
||||
|
||||
@@ -16,8 +16,8 @@ int main(void)
|
||||
{
|
||||
if (!(initsetuid()))
|
||||
exit(1);
|
||||
|
||||
|
||||
safe_system("/usr/bin/sendprofile");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* IPFire helper program - IPStat
|
||||
*
|
||||
* Get the list from IPTABLES -L
|
||||
*
|
||||
*
|
||||
* Optional commandline parameters:
|
||||
* -x
|
||||
* -x
|
||||
* instruct iptables to expand numbers
|
||||
* -f
|
||||
* display filter table
|
||||
* -f
|
||||
* display filter table
|
||||
* -n
|
||||
* display nat table
|
||||
* -m
|
||||
@@ -33,7 +33,7 @@ int main(int argc, char** argv)
|
||||
unsigned int table_set = 0;
|
||||
|
||||
int opt;
|
||||
|
||||
|
||||
if (!(initsetuid()))
|
||||
exit(1);
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
* (c) Lawrence Manning, 2001
|
||||
* Installer helper for redirecting stdout/stderr to a file/terminal.
|
||||
* init calls ash through this program to shove it on a tty.
|
||||
*
|
||||
*
|
||||
* $Id: iowrap.c,v 1.2 2001/11/27 15:20:50 riddles Exp $
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -23,7 +23,7 @@ int main(int argc, char *argv[])
|
||||
if (argc >= 2)
|
||||
{
|
||||
int fd;
|
||||
|
||||
|
||||
if ((fd = open(argv[1], O_RDWR)) == -1)
|
||||
{
|
||||
printf("Couldn't open device\n");
|
||||
@@ -34,8 +34,8 @@ int main(int argc, char *argv[])
|
||||
dup2(fd, 2);
|
||||
/* Now its sending/reading on that device. */
|
||||
}
|
||||
|
||||
if (argc >= 3)
|
||||
|
||||
if (argc >= 3)
|
||||
execvp(argv[2], &argv[2]);
|
||||
else
|
||||
printf("No command\n");
|
||||
|
||||
@@ -40,7 +40,7 @@ int main(int argc, char**argv)
|
||||
|
||||
// Check what command is asked
|
||||
if (argc==1)
|
||||
{
|
||||
{
|
||||
fprintf (stderr, "Missing reboot command!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
|
||||
/*
|
||||
This module is responsible for start stop of the vpn system.
|
||||
|
||||
|
||||
1) it allows AH & ESP to get in from interface where a vpn is mounted
|
||||
The NAT traversal is used on the udp 4500 port.
|
||||
|
||||
2) it starts the ipsec daemon
|
||||
The RED interface is a problem because it can be up or down a startup.
|
||||
Then, the state change and it must not affect other VPN mounted on
|
||||
Then, the state change and it must not affect other VPN mounted on
|
||||
other interface.
|
||||
Unfortunatly, openswan 1 cannot do that correctly. It cannot use an
|
||||
interface without restarting everything.
|
||||
@@ -55,7 +55,7 @@ static void ipsec_reload() {
|
||||
/*
|
||||
return values from the vpn config file or false if not 'on'
|
||||
*/
|
||||
int decode_line (char *s,
|
||||
int decode_line (char *s,
|
||||
char **key,
|
||||
char **name,
|
||||
char **type
|
||||
@@ -85,7 +85,7 @@ int decode_line (char *s,
|
||||
// check other syntax
|
||||
if (! *name)
|
||||
return 0;
|
||||
|
||||
|
||||
if (strspn(*name, LETTERS_NUMBERS) != strlen(*name)) {
|
||||
fprintf(stderr, "Bad connection name: %s\n", *name);
|
||||
return 0;
|
||||
@@ -112,7 +112,7 @@ void turn_connection_on(char *name, char *type) {
|
||||
char command[STRING_SIZE];
|
||||
|
||||
// Bring down the connection (if established).
|
||||
snprintf(command, STRING_SIZE - 1,
|
||||
snprintf(command, STRING_SIZE - 1,
|
||||
"/usr/sbin/ipsec down %s >/dev/null", name);
|
||||
safe_system(command);
|
||||
|
||||
@@ -145,7 +145,7 @@ void turn_connection_off (char *name) {
|
||||
ipsec_reload();
|
||||
|
||||
// Bring down the connection.
|
||||
snprintf(command, STRING_SIZE - 1,
|
||||
snprintf(command, STRING_SIZE - 1,
|
||||
"/usr/sbin/ipsec down %s >/dev/null", name);
|
||||
safe_system(command);
|
||||
|
||||
@@ -158,7 +158,7 @@ void turn_connection_off (char *name) {
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
struct keyvalue *kv = NULL;
|
||||
|
||||
|
||||
if (argc < 2) {
|
||||
usage();
|
||||
exit(1);
|
||||
|
||||
@@ -254,7 +254,7 @@ void ovpnInit(void) {
|
||||
fprintf(stderr, "Cannot read ethernet settings\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (strcmp(enableblue, "on") == 0) {
|
||||
if (!findkey(kv, "BLUE_DEV", blueif)) {
|
||||
exit(1);
|
||||
@@ -394,7 +394,7 @@ void setFirewallRules(void) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* we got one device, so lets proceed further */
|
||||
/* we got one device, so lets proceed further */
|
||||
if (!findkey(kv, "DDEST_PORT", dport)){
|
||||
fprintf(stderr, "Cannot read DDEST_PORT\n");
|
||||
exit(1);
|
||||
@@ -474,7 +474,7 @@ void stopDaemon(void) {
|
||||
|
||||
void startDaemon(void) {
|
||||
char command[STRING_SIZE];
|
||||
|
||||
|
||||
if (!((strcmp(enablered, "on") == 0) || (strcmp(enableblue, "on") == 0) || (strcmp(enableorange, "on") == 0))) {
|
||||
fprintf(stderr, "OpenVPN is not enabled on any interface\n");
|
||||
exit(1);
|
||||
@@ -712,7 +712,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
else {
|
||||
ovpnInit();
|
||||
|
||||
|
||||
if( (strcmp(argv[1], "-s") == 0) || (strcmp(argv[1], "--start") == 0) ) {
|
||||
setFirewallRules();
|
||||
startDaemon();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* (c) Alan Hourihane, 2003
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Id: rebuildhosts.c,v 1.3.2.6 2005/07/11 10:56:47 franck78 Exp $
|
||||
*
|
||||
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "Couldn't read main settings\n");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(hostname, SNAME );
|
||||
strcpy(hostname, SNAME );
|
||||
findkey(kv, "HOSTNAME", hostname);
|
||||
findkey(kv, "DOMAINNAME", domainname);
|
||||
freekeyvalues(kv);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
char command[BUFFER_SIZE];
|
||||
char command[BUFFER_SIZE];
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (!(initsetuid()))
|
||||
|
||||
@@ -87,9 +87,9 @@ int main(void)
|
||||
fprintf(stderr, "Cannot read RED_TYPE\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
/* Make sure it's the right type */
|
||||
if (!(strcmp(s, "STATIC")==0))
|
||||
if (!(strcmp(s, "STATIC")==0))
|
||||
exit(0);
|
||||
|
||||
/* Get the RED interface details */
|
||||
@@ -99,7 +99,7 @@ int main(void)
|
||||
fprintf(stderr, "Cannot read RED settings\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
if (!VALID_DEVICE(red_dev))
|
||||
{
|
||||
fprintf(stderr, "Bad red_dev: %s\n", red_dev);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* This program is distributed under the terms of the GNU General Public
|
||||
* Licence. See the file COPYING for details.
|
||||
* Simple header file for all setuid progs.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SETUID_H
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
*
|
||||
* (c) Mark Wormgoor, 2001
|
||||
* Simple program intended to be installed setuid(0) that can be used for
|
||||
* restarting SSHd.
|
||||
*
|
||||
* restarting SSHd.
|
||||
*
|
||||
* $Id: sshctrl.c,v 1.3 2003/12/11 10:57:34 riddles Exp $
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
char command[BUFFER_SIZE];
|
||||
char command[BUFFER_SIZE];
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Edited by the IPFire Team to change var log messages
|
||||
* Edited by the IPFire Team to change var log messages
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -141,7 +141,7 @@ int main(void)
|
||||
exit(ERR_CONFIG);
|
||||
}
|
||||
close(config_fd);
|
||||
|
||||
|
||||
if (rename("/etc/syslog.conf.new", "/etc/syslog.conf") == -1)
|
||||
{
|
||||
perror("Unable to replace old config file");
|
||||
|
||||
@@ -17,7 +17,7 @@ int main(int argc, char *argv[]){
|
||||
|
||||
if (strcmp(argv[1], "cron") == 0){
|
||||
safe_system("rm /etc/fcron.*/updxlrator 2&>/dev/null");
|
||||
|
||||
|
||||
if (strcmp(argv[2], "daily") == 0){
|
||||
safe_system("ln -s /var/ipfire/updatexlrator/bin/checkup /etc/fcron.daily/updxlrator");
|
||||
} else if (strcmp(argv[2], "weekly") == 0){
|
||||
|
||||
@@ -17,7 +17,7 @@ int main(int argc, char *argv[]){
|
||||
|
||||
if (strcmp(argv[1], "cron") == 0){
|
||||
safe_system("rm /etc/fcron.*/urlfilter 2&>/dev/null");
|
||||
|
||||
|
||||
if (strcmp(argv[2], "daily") == 0){
|
||||
safe_system("ln -s /var/ipfire/urlfilter/bin/autoupdate.pl /etc/fcron.daily/urlfilter");
|
||||
} else if (strcmp(argv[2], "weekly") == 0){
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Licence. See the file COPYING for details.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
*
|
||||
* IPFire.org - A linux based firewall
|
||||
* Copyright (C) 2017-2018 Stephan Feddersen <sfeddersen@ipfire.org>
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user