usr/local/bin/rebuildhosts
usr/local/bin/redctrl
usr/local/bin/restartssh
-usr/local/bin/restartsyslogd
usr/local/bin/restartwireless
#usr/local/bin/sambactrl
usr/local/bin/setaliases
* Net-Server-0.93
* Net_SSLeay.pm-1.25
* Python-2.4.3
-* SnortSnarf-050314.1
* Text-Tabs+Wrap-2005.0824
* URI-1.35
* Unix-Syslog-0.100
* bwm-ng-0.6
* bzip2-1.0.3
* calamaris-2.59
-* capi4k-utils-2005-07-18
* ccache-2.4
* cdrtools-2.01
* cftp-0.12
* ethtool-3
* expat-2.0.0
* ez-ipupdate-3.0.11b8
-* fcdsl-suse93-3.11-07
-* fcdsl2-suse93-3.11-07
-* fcdslsl-suse93-3.11-07
-* fcdslslusb-suse93-3.11-05
-* fcdslusb-suse93-3.11-07
* fcron-3.0.1
* fetchmail-6.3.4
* file-4.17
######
-OBJS=main.o ide.o nic.o net.o config.o ../libsmooth/libsmooth.o usb.o scsi.o unattended.o
+OBJS=main.o nic.o net.o config.o ../libsmooth/libsmooth.o unattended.o
install: $(OBJS)
$(LINK) $(OBJS) -o $@ $(LIBS)
+++ /dev/null
-/* SmoothWall install program.
- *
- * This program is distributed under the terms of the GNU General Public
- * Licence. See the file COPYING for details.
- *
- * (c) Lawrence Manning, 2001
- * Contains some functs for scanning /proc for ide info on CDROMS and
- * harddisks.
- *
- */
-
-#include "install.h"
-
-int initialize_ide() {
- mysystem("/sbin/modprobe ide-generic");
- mysystem("/sbin/modprobe generic");
- mysystem("/sbin/modprobe ide-cd");
- mysystem("/sbin/modprobe ide-disk");
-
- return 0;
-}
-
-/* checkide(). Scans the named drive letter and returns the IDE_??? type. */
-int checkide(char letter)
-{
- FILE *f = NULL;
- char filename[STRING_SIZE];
- char buffer[STRING_SIZE];
-
- sprintf(filename, "/proc/ide/hd%c/media", letter);
-
- if (!(f = fopen(filename, "r")))
- return IDE_EMPTY;
-
- if (!(fgets(buffer, STRING_SIZE, f)))
- {
- printf("Couldn't read from %s\n", filename);
- fclose(f);
- return IDE_EMPTY;
- }
-
- fclose(f);
-
- stripnl(buffer);
-
- if (strcmp(buffer, "cdrom") == 0)
- return IDE_CDROM;
- else if (strcmp(buffer, "disk") == 0)
- return IDE_HD;
- else
- return IDE_UNKNOWN;
-}
-
-/* findidetype(). Finds the first ide deveice of the given IDE_?? type. */
-char findidetype(int type)
-{
- char letter;
-
- for (letter = 'a'; letter <= 'z'; letter++)
- {
- if ((checkide(letter)) == type)
- {
- return letter;
- }
- }
- return '\0';
-}
-
char options[STRING_SIZE];
};
-/* ide.c */
-int initialize_ide();
-int checkide(char letter);
-char findidetype(int type);
-
-/* cdrom.c */
-int ejectcdrom(char *dev);
-
/* nic.c */
int networkmenu(struct keyvalue *ethernetkv);
int write_lang_configs( char *lang);
int write_ethernet_configs(struct keyvalue *ethernetkv);
-/* usb.c */
-int initialize_usb();
-int write_usb_modules_conf();
-int checkusb (char *partition);
-
-/* scsi.c */
-int try_scsi(char *dev);
-int get_boot(char *dev);
-
/* unattended.c */
int unattended_setup(struct keyvalue *unattendedkv);
{
fprintf(flog, "Couldn't open commandline: /proc/cmdline\n");
} else {
+ mysystem("/sbin/modprobe ide-generic");
+ mysystem("/sbin/modprobe generic");
+ mysystem("/sbin/modprobe ide-cd");
+ mysystem("/sbin/modprobe ide-disk");
+ mysystem("/sbin/modprobe sd_mod");
+ mysystem("/sbin/modprobe sr_mod");
+ mysystem("/sbin/modprobe usb-storage");
+
fgets(line, STRING_SIZE, cmdfile);
- if (strstr (line, "noide") == NULL) {
- fprintf(flog, "Initializing IDE controllers.\n");
- initialize_ide();
- } else {
- fprintf(flog, "Skipping IDE detection.\n");
- }
- if (strstr (line, "nousb") == NULL) {
- fprintf(flog, "Initializing USB controllers.\n");
- initialize_usb();
- } else {
- fprintf(flog, "Skipping USB detection.\n");
- }
+
// check if we have to make an unattended install
if (strstr (line, "unattended") != NULL) {
unattended = 1;
}
- // Loading the cdrom-filesystem and ext2
- mysystem("/sbin/modprobe iso9660");
- mysystem("/sbin/modprobe ext2");
-
- // Loading the via_rhine driver because it isn't detected correctly (sometimes)
- mysystem("/sbin/modprobe via-rhine");
+ mysystem("/sbin/modprobe iso9660"); // CDROM
+ mysystem("/sbin/modprobe ext2"); // Boot patition
+ mysystem("/sbin/modprobe vfat"); // USB key
}
if (unattended) {
errorbox(ctr[TR_UNABLE_TO_INSTALL_FILES]);
goto EXIT;
}
-
- /* Save USB controller type to modules.conf */
- write_usb_modules_conf();
/* Save language und local settings */
write_lang_configs(shortlangname);
+++ /dev/null
-/* IPCop install program.
- *
- * This program is distributed under the terms of the GNU General Public
- * Licence. See the file COPYING for details.
- *
- * (c) Alan Hourihane, 2003 <alanh@fairlite.demon.co.uk>
- *
- * $Id: scsi.c
- *
- */
-
-#include "install.h"
-
-int
-try_scsi(char *disk_device)
-{
- int fd;
- char dev[10];
-
- sprintf(dev, "/dev/%s", disk_device);
-
- if ((fd = open(dev, O_RDONLY)) < 0)
- return 0;
-
- close(fd);
- // remove usb scsi
- return (checkusb(disk_device) ? 0:1);
- //return 1;
-}
+++ /dev/null
-/*
- * This file is part of the IPCop Firewall.
- *
- * IPCop is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * IPCop is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with IPCop; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Copyright 2002: Mark Wormgoor <mark@wormgoor.com>
- *
- */
-
-#include "install.h"
-
-int usbuhci = 0;
-int usbohci = 0;
-int ehcihcd = 0;
-
-int initialize_usb() {
- mysystem("/sbin/modprobe sd_mod");
- mysystem("/sbin/modprobe sr_mod");
- mysystem("/sbin/modprobe usb-storage");
- mysystem("/sbin/modprobe vfat");
-
- if (ehcihcd) {
- mysystem("/sbin/rmmod ehci-hcd");
- ehcihcd = 0;
- }
- if (usbohci) {
- mysystem("/sbin/rmmod ohci-hcd");
- usbohci = 0;
- }
- if (usbuhci) {
- mysystem("/sbin/rmmod uhci-hcd");
- usbuhci = 0;
- }
-
- if (mysystem("/sbin/modprobe ehci-hcd") == 0)
- ehcihcd = 1;
- if (mysystem("/sbin/modprobe ohci-hcd") == 0)
- usbohci = 1;
- if (mysystem("/sbin/modprobe uhci-hcd") == 0)
- usbuhci = 1;
-
- mysystem("/sbin/modprobe usbhid");
- return 0;
-}
-
-int write_usb_modules_conf() {
- int index;
- FILE *handle;
-
- if (!(handle = fopen("/harddisk/etc/modules.conf", "a")))
- return 0;
-
- index = 0;
-
-#if 0 /* we don't do this yet, because one of the drivers has a problem
- * with it */
- if (ehcihcd) {
- if (index)
- fprintf(handle,"alias usb-controller%d ehci-hcd\n",index);
- else
- fprintf(handle,"alias usb-controller ehci-hcd\n");
- index++;
- }
-#endif
-
- if (usbohci) {
- if (index)
- fprintf(handle,"alias usb-controller%d ohci-hcd\n",index);
- else
- fprintf(handle,"alias usb-controller ohci-hcd\n");
- index++;
- }
-
- if (usbuhci) {
- if (index)
- fprintf(handle,"alias usb-controller%d uhci-hcd\n",index);
- else
- fprintf(handle,"alias usb-controller uhci-hcd\n");
- index++;
- }
- fclose(handle);
-
- return 0;
-}
-
-/* Scans the named partitions and returns true if USB-removable. */
-int checkusb(char *device)
-{
- FILE *f = NULL;
- char filename[STRING_SIZE];
- char command[STRING_SIZE];
- char buffer[STRING_SIZE];
- int found = 0;
-
- sprintf(command, "udevinfo -a -p /sys/block/%s | grep BUS | sort| uniq >/tmp/usbscan 2>/dev/null", device);
- system(command);
-
- f = fopen("/tmp/usbscan", "r");
- while (fgets(buffer, STRING_SIZE, f)) {
- if (strstr(buffer,"usb")) found=1;
- }
- fclose(f);
-
- if (found) return 0;
- else return 1;
-}
/* domainname.c */
int handledomainname(void);
-/* isdn.c */
-int handleisdn(void);
-
/* networking.c */
int handlenetworking(void);
squidctrl restartssh ipfirereboot setaliases \
ipsecctrl timectrl dhcpctrl snortctrl \
applejuicectrl rebuildhosts backupctrl \
- restartsyslogd logwatch openvpnctrl outgoingfwctrl \
+ logwatch openvpnctrl outgoingfwctrl \
restartwireless getipstat qosctrl launch-ether-wake \
redctrl extrahdctrl sambactrl upnpctrl tripwirectrl \
smartctrl clamavctrl pakfire mpfirectrl
snortctrl: snortctrl.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ snortctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
-restartsyslogd: restartsyslogd.c setuid.o ../install+setup/libsmooth/varval.o
- $(COMPILE) -I../install+setup/libsmooth/ restartsyslogd.c setuid.o ../install+setup/libsmooth/varval.o -o $@
-
restartwireless: restartwireless.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ restartwireless.c setuid.o ../install+setup/libsmooth/varval.o -o $@
+++ /dev/null
-/* This file is part of the IPCop Firewall.\r
- *\r
- * This program is distributed under the terms of the GNU General Public\r
- * Licence. See the file COPYING for details.\r
- *\r
- * Copyright (C) 2003-07-12 Robert Kerr <rkerr@go.to>\r
- *\r
- * $Id: restartsyslogd.c,v 1.2.2.3 2004/12/14 17:56:37 gespinasse Exp $\r
- *\r
- */\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <unistd.h>\r
-#include <string.h>\r
-#include <sys/stat.h>\r
-#include <sys/types.h>\r
-#include <fcntl.h>\r
-#include <signal.h>\r
-#include <errno.h>\r
-#include "libsmooth.h"\r
-#include "setuid.h"\r
-\r
-#define ERR_ANY 1\r
-#define ERR_SETTINGS 2 /* error in settings file */\r
-#define ERR_ETC 3 /* error with /etc permissions */\r
-#define ERR_CONFIG 4 /* error updated sshd_config */\r
-#define ERR_SYSLOG 5 /* error restarting syslogd */\r
-\r
-int main(void)\r
-{\r
- char buffer[STRING_SIZE], hostname[STRING_SIZE];\r
- int config_fd,rc,fd,pid;\r
- struct stat st;\r
- struct keyvalue *kv = NULL;\r
- memset(buffer, 0, STRING_SIZE);\r
- memset(hostname, 0, STRING_SIZE);\r
-\r
- if (!(initsetuid()))\r
- exit(1);\r
-\r
-\r
- /* Read in and verify config */\r
- kv=initkeyvalues();\r
-\r
- if (!readkeyvalues(kv, CONFIG_ROOT "/logging/settings"))\r
- {\r
- fprintf(stderr, "Cannot read syslog settings\n");\r
- exit(ERR_SETTINGS);\r
- }\r
-\r
- if (!findkey(kv, "ENABLE_REMOTELOG", buffer))\r
- {\r
- fprintf(stderr, "Cannot read ENABLE_REMOTELOG\n");\r
- exit(ERR_SETTINGS);\r
- }\r
-\r
- if (!findkey(kv, "REMOTELOG_ADDR", hostname))\r
- {\r
- fprintf(stderr, "Cannot read REMOTELOG_ADDR\n");\r
- exit(ERR_SETTINGS);\r
- }\r
-\r
- if (strspn(hostname, VALID_FQDN) != strlen(hostname))\r
- {\r
- fprintf(stderr, "Bad REMOTELOG_ADDR: %s\n", hostname);\r
- exit(ERR_SETTINGS);\r
- }\r
-\r
- freekeyvalues(kv);\r
-\r
-\r
- /* If anyone other than root can write to /etc this would be totally\r
- * insecure - same if anyone other than root owns /etc, as they could\r
- * change the file mode to give themselves or anyone else write access. */\r
- if(lstat("/etc",&st))\r
- {\r
- perror("Unable to stat /etc");\r
- exit(ERR_ETC);\r
- }\r
- if(!S_ISDIR(st.st_mode))\r
- {\r
- fprintf(stderr,"/etc is not a directory?!\n");\r
- exit(ERR_ETC);\r
- }\r
- if ( st.st_uid != 0 || st.st_mode & S_IWOTH ||\r
- ((st.st_gid != 0) && (st.st_mode & S_IWGRP)) )\r
- {\r
- fprintf(stderr,"/etc is owned/writable by non-root users\n");\r
- exit(ERR_ETC);\r
- }\r
-\r
- /* O_CREAT with O_EXCL will make open() fail if the file already exists -\r
- * mostly to prevent 2 copies running at once */\r
- if ((config_fd = open( "/etc/syslog.conf.new", O_WRONLY|O_CREAT|O_EXCL, 0644 )) == -1 )\r
- {\r
- perror("Unable to open new config file");\r
- exit(ERR_CONFIG);\r
- }\r
-\r
- if (!strcmp(buffer,"on"))\r
- snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@\\).\\+$/\\1%s/' /etc/syslog.conf >&%d", hostname, config_fd );\r
- else\r
- snprintf(buffer, STRING_SIZE - 1, "/bin/sed -e 's/^#\\?\\(\\*\\.\\*[[:blank:]]\\+@.\\+\\)$/#\\1/' /etc/syslog.conf >&%d", config_fd );\r
-\r
- /* if the return code isn't 0 failsafe */\r
- if ((rc = unpriv_system(buffer,99,99)) != 0)\r
- {\r
- fprintf(stderr, "sed returned bad exit code: %d\n", rc);\r
- close(config_fd);\r
- unlink("/etc/syslog.conf.new");\r
- exit(ERR_CONFIG);\r
- }\r
- close(config_fd);\r
- if (rename("/etc/syslog.conf.new","/etc/syslog.conf") == -1)\r
- {\r
- perror("Unable to replace old config file");\r
- unlink("/etc/syslog.conf.new");\r
- exit(ERR_CONFIG);\r
- }\r
-\r
-\r
- /* Get syslogd to read the new config file */\r
- if ((fd = open("/var/run/syslogd.pid", O_RDONLY)) == -1)\r
- {\r
- if(errno == ENOENT)\r
- {\r
- /* pid file doesn't exists.. restart syslog */\r
- if((rc = safe_system("/usr/sbin/syslogd -m 0")) == 0 )\r
- return 0;\r
- else\r
- {\r
- fprintf(stderr,\r
- "Unable to restart syslogd - returned exit code %d\n", rc);\r
- exit(ERR_SYSLOG);\r
- }\r
- } else {\r
- /* Something odd is going on, failsafe */\r
- perror("Unable to open pid file");\r
- exit(ERR_SYSLOG);\r
- }\r
- }\r
-\r
- memset(buffer, 0, STRING_SIZE);\r
- if (read(fd, buffer, STRING_SIZE - 1) == -1)\r
- {\r
- close(fd);\r
- perror("Couldn't read from pid file");\r
- exit(ERR_SYSLOG);\r
- }\r
- close(fd);\r
- /* strtol does sanity checks that atoi doesn't do */\r
- errno = 0;\r
- pid = (int)strtol(buffer, (char **)NULL, 10);\r
- if (errno || pid <= 1)\r
- {\r
- fprintf(stderr, "Bad pid value\n");\r
- exit(ERR_SYSLOG);\r
- }\r
- if (kill(pid, SIGHUP) == -1)\r
- {\r
- fprintf(stderr, "Unable to send SIGHUP\n");\r
- exit(ERR_SYSLOG);\r
- }\r
-\r
- return 0;\r
-}\r
#!/bin/sh
#
-# $Id: httpscert,v 1.1.2.2 2005/12/15 21:59:57 eoberlander Exp $
# new : generate new certificate
# read: read issuer in certificate and verify if it is the same as hostname