mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b61013aa0c |
No files matched your search
@@ -0,0 +1,108 @@
|
||||
#
|
||||
# Network services, Internet style
|
||||
#
|
||||
# Stripped-down version.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# WELL KNOWN PORT NUMBERS
|
||||
#
|
||||
echo 7/tcp
|
||||
echo 7/udp
|
||||
discard 9/tcp sink null
|
||||
discard 9/udp sink null
|
||||
systat 11/tcp users #Active Users
|
||||
systat 11/udp users #Active Users
|
||||
daytime 13/tcp
|
||||
daytime 13/udp
|
||||
chargen 19/tcp ttytst source #Character Generator
|
||||
chargen 19/udp ttytst source #Character Generator
|
||||
ftp-data 20/tcp #File Transfer [Default Data]
|
||||
ftp-data 20/udp #File Transfer [Default Data]
|
||||
ftp 21/tcp #File Transfer [Control]
|
||||
ftp 21/udp #File Transfer [Control]
|
||||
ssh 22/tcp #Secure Shell Login
|
||||
ssh 22/udp #Secure Shell Login
|
||||
telnet 23/tcp
|
||||
telnet 23/udp
|
||||
# 24/tcp any private mail system
|
||||
# 24/udp any private mail system
|
||||
smtp 25/tcp mail #Simple Mail Transfer
|
||||
smtp 25/udp mail #Simple Mail Transfer
|
||||
time 37/tcp timserver
|
||||
time 37/udp timserver
|
||||
domain 53/tcp #Domain Name Server
|
||||
domain 53/udp #Domain Name Server
|
||||
bootps 67/tcp dhcps #Bootstrap Protocol Server
|
||||
bootps 67/udp dhcps #Bootstrap Protocol Server
|
||||
bootpc 68/tcp dhcpc #Bootstrap Protocol Client
|
||||
bootpc 68/udp dhcpc #Bootstrap Protocol Client
|
||||
tftp 69/tcp #Trivial File Transfer
|
||||
tftp 69/udp #Trivial File Transfer
|
||||
gopher 70/tcp
|
||||
gopher 70/udp
|
||||
finger 79/tcp
|
||||
finger 79/udp
|
||||
http 80/tcp www www-http #World Wide Web HTTP
|
||||
http 80/udp www www-http #World Wide Web HTTP
|
||||
sunrpc 111/tcp rpcbind #SUN Remote Procedure Call
|
||||
sunrpc 111/udp rpcbind #SUN Remote Procedure Call
|
||||
auth 113/tcp ident tap #Authentication Service
|
||||
auth 113/udp ident tap #Authentication Service
|
||||
nntp 119/tcp usenet #Network News Transfer Protocol
|
||||
nntp 119/udp usenet #Network News Transfer Protocol
|
||||
rmt 411/tcp #Remote MT Protocol
|
||||
rmt 411/udp #Remote MT Protocol
|
||||
https 443/tcp
|
||||
https 443/udp
|
||||
#
|
||||
# Berkeley-specific services
|
||||
#
|
||||
exec 512/tcp #remote process execution;
|
||||
# authentication performed using
|
||||
# passwords and UNIX loppgin names
|
||||
biff 512/udp comsat #used by mail system to notify users
|
||||
# of new mail received; currently
|
||||
# receives messages only from
|
||||
# processes on the same machine
|
||||
login 513/tcp #remote login a la telnet;
|
||||
# automatic authentication performed
|
||||
# based on priviledged port numbers
|
||||
# and distributed data bases which
|
||||
# identify "authentication domains"
|
||||
who 513/udp whod #maintains data bases showing who's
|
||||
# logged in to machines on a local
|
||||
# net and the load average of the
|
||||
# machine
|
||||
cmd 514/tcp shell #like exec, but automatic
|
||||
# authentication is performed as for
|
||||
# login server
|
||||
syslog 514/udp
|
||||
printer 515/tcp spooler
|
||||
printer 515/udp spooler
|
||||
talk 517/tcp #like tenex link, but across
|
||||
# machine - unfortunately, doesn't
|
||||
# use link protocol (this is actually
|
||||
# just a rendezvous port from which a
|
||||
# tcp connection is established)
|
||||
talk 517/udp #like tenex link, but across
|
||||
# machine - unfortunately, doesn't
|
||||
# use link protocol (this is actually
|
||||
# just a rendezvous port from which a
|
||||
# tcp connection is established)
|
||||
ntalk 518/tcp
|
||||
ntalk 518/udp
|
||||
utime 519/tcp unixtime
|
||||
utime 519/udp unixtime
|
||||
efs 520/tcp #extended file name server
|
||||
router 520/udp route routed #local routing process (on site);
|
||||
# uses variant of Xerox NS routing
|
||||
# information protocol
|
||||
uucp 540/tcp uucpd
|
||||
uucp 540/udp uucpd
|
||||
uucp-rlogin 541/tcp
|
||||
uucp-rlogin 541/udp
|
||||
klogin 543/tcp # Kerberos (v4/v5)
|
||||
klogin 543/udp # Kerberos (v4/v5)
|
||||
kshell 544/tcp krcmd # Kerberos (v4/v5)
|
||||
kshell 544/udp krcmd # Kerberos (v4/v5)
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
if [ "`id -u`" != "0" ]; then
|
||||
echo "Sorry, this must be done as root."
|
||||
exit 1
|
||||
fi
|
||||
tar --unlink -xpzf compat21.tgz -C /
|
||||
exit 0
|
||||
@@ -0,0 +1,452 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: anonFTP.c,v 1.16 1996/09/01 08:17:12 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Coranth Gryphon. All rights reserved.
|
||||
* Copyright (c) 1996
|
||||
* Jordan K. Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR THEIR PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <dialog.h>
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include "ui_objects.h"
|
||||
#include "dir.h"
|
||||
#include "dialog.priv.h"
|
||||
#include "colors.h"
|
||||
#include "sysinstall.h"
|
||||
|
||||
/* This doesn't change until FTP itself changes */
|
||||
|
||||
#define FTP_NAME "ftp"
|
||||
#define MOTD_FILE "ftpmotd"
|
||||
|
||||
/* These change if we want to use different defaults */
|
||||
|
||||
#define FTP_UID 14
|
||||
#define FTP_GID 5
|
||||
#define FTP_GROUP "operator"
|
||||
#define FTP_UPLOAD "incoming"
|
||||
#define FTP_COMMENT "Anonymous FTP Admin"
|
||||
#define FTP_HOMEDIR "/var/ftp"
|
||||
|
||||
#define ANONFTP_HELPFILE "anonftp"
|
||||
|
||||
/* Set up the structure to hold configuration information */
|
||||
/* Note that this is only what we could fit onto the one screen */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char homedir[64]; /* Home Dir for Anon FTP */
|
||||
char group[32]; /* Group */
|
||||
char uid[8]; /* UID */
|
||||
char comment[64]; /* PWD Comment */
|
||||
char upload[32]; /* Upload Dir */
|
||||
} FTPConf;
|
||||
|
||||
static FTPConf tconf;
|
||||
|
||||
#define ANONFTP_HOMEDIR_LEN 64
|
||||
#define ANONFTP_COMMENT_LEN 64
|
||||
#define ANONFTP_UPLOAD_LEN 32
|
||||
#define ANONFTP_GROUP_LEN 32
|
||||
#define ANONFTP_UID_LEN 8
|
||||
|
||||
static int okbutton, cancelbutton;
|
||||
|
||||
/* What the screen size is meant to be */
|
||||
#define ANONFTP_DIALOG_Y 0
|
||||
#define ANONFTP_DIALOG_X 8
|
||||
#define ANONFTP_DIALOG_WIDTH COLS - 16
|
||||
#define ANONFTP_DIALOG_HEIGHT LINES - 2
|
||||
|
||||
/* The screen layout structure */
|
||||
typedef struct _layout {
|
||||
int y; /* x & Y co-ordinates */
|
||||
int x;
|
||||
int len; /* The size of the dialog on the screen */
|
||||
int maxlen; /* How much the user can type in ... */
|
||||
char *prompt; /* The string for the prompt */
|
||||
char *help; /* The display for the help line */
|
||||
void *var; /* The var to set when this changes */
|
||||
int type; /* The type of the dialog to create */
|
||||
void *obj; /* The obj pointer returned by libdialog */
|
||||
} Layout;
|
||||
|
||||
static Layout layout[] = {
|
||||
{ 2, 3, 8, ANONFTP_UID_LEN - 1,
|
||||
"UID:", "What user ID to assign to FTP Admin",
|
||||
tconf.uid, STRINGOBJ, NULL },
|
||||
#define LAYOUT_UID 1
|
||||
|
||||
{ 2, 15, 15, ANONFTP_GROUP_LEN - 1,
|
||||
"Group:", "Group name that ftp process belongs to",
|
||||
tconf.group, STRINGOBJ, NULL },
|
||||
#define LAYOUT_GROUP 2
|
||||
|
||||
{ 2, 35, 24, ANONFTP_COMMENT_LEN - 1,
|
||||
"Comment:", "Password file comment for FTP Admin",
|
||||
tconf.comment, STRINGOBJ, NULL },
|
||||
#define LAYOUT_COMMENT 3
|
||||
|
||||
{ 9, 10, 43, ANONFTP_HOMEDIR_LEN - 1,
|
||||
"FTP Root Directory:",
|
||||
"The top directory to chroot to when doing anonymous ftp",
|
||||
tconf.homedir, STRINGOBJ, NULL },
|
||||
#define LAYOUT_HOMEDIR 4
|
||||
|
||||
{ 14, 20, 22, ANONFTP_UPLOAD_LEN - 1,
|
||||
"Upload Subdirectory:", "Designated sub-directory that holds uploads",
|
||||
tconf.upload, STRINGOBJ, NULL },
|
||||
#define LAYOUT_UPLOAD 5
|
||||
|
||||
{ 19, 15, 0, 0,
|
||||
"OK", "Select this if you are happy with these settings",
|
||||
&okbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_OKBUTTON 6
|
||||
|
||||
{ 19, 35, 0, 0,
|
||||
"CANCEL", "Select this if you wish to cancel this screen",
|
||||
&cancelbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_CANCELBUTTON 7
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
int
|
||||
createFtpUser(void)
|
||||
{
|
||||
struct passwd *tpw;
|
||||
struct group *tgrp;
|
||||
char pwline[256];
|
||||
char *tptr;
|
||||
int gid;
|
||||
FILE *fptr;
|
||||
|
||||
if ((gid = atoi(tconf.group)) <= 0) {
|
||||
if (!(tgrp = getgrnam(tconf.group))) {
|
||||
/* group does not exist, create it by name */
|
||||
|
||||
tptr = msgGetInput("14", "What group ID to use for group %s ?", tconf.group);
|
||||
if (tptr && *tptr && ((gid = atoi(tptr)) > 0)) {
|
||||
if ((fptr = fopen(_PATH_GROUP,"a"))) {
|
||||
fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME);
|
||||
fclose(fptr);
|
||||
}
|
||||
}
|
||||
else
|
||||
gid = FTP_GID;
|
||||
}
|
||||
else
|
||||
gid = tgrp->gr_gid;
|
||||
}
|
||||
else if (!getgrgid(gid)) {
|
||||
/* group does not exist, create it by number */
|
||||
|
||||
tptr = msgGetInput("14", "What group name to use for gid %d ?", gid);
|
||||
if (tptr && *tptr) {
|
||||
strcpy(tconf.group, tptr);
|
||||
if ((tgrp = getgrnam(tconf.group))) {
|
||||
gid = tgrp->gr_gid;
|
||||
}
|
||||
else if ((fptr = fopen(_PATH_GROUP,"a"))) {
|
||||
fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME);
|
||||
fclose(fptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((tpw = getpwnam(FTP_NAME))) {
|
||||
if (tpw->pw_uid != FTP_UID)
|
||||
msgConfirm("FTP user already exists with a different uid.");
|
||||
|
||||
return (DITEM_SUCCESS); /* succeeds if already exists */
|
||||
}
|
||||
|
||||
sprintf(pwline, "%s::%s:%d::0:0:%s:%s:/bin/date\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir);
|
||||
|
||||
fptr = fopen(_PATH_MASTERPASSWD,"a");
|
||||
if (! fptr) {
|
||||
msgConfirm("Could not open master password file.");
|
||||
return (DITEM_FAILURE);
|
||||
}
|
||||
fprintf(fptr, pwline);
|
||||
fclose(fptr);
|
||||
msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD);
|
||||
vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD);
|
||||
return (DITEM_SUCCESS);
|
||||
}
|
||||
|
||||
/* This is it - how to get the setup values */
|
||||
static int
|
||||
anonftpOpenDialog(void)
|
||||
{
|
||||
WINDOW *ds_win;
|
||||
ComposeObj *obj = NULL;
|
||||
ComposeObj *first, *last;
|
||||
int n=0, quit=FALSE, cancel=FALSE, ret;
|
||||
int max;
|
||||
char help[FILENAME_MAX];
|
||||
char title[80];
|
||||
|
||||
/* We need a curses window */
|
||||
ds_win = newwin(LINES, COLS, 0, 0);
|
||||
if (ds_win == 0) {
|
||||
beep();
|
||||
msgConfirm("Cannot open anonymous ftp dialog window!!");
|
||||
return(DITEM_FAILURE);
|
||||
}
|
||||
|
||||
/* Say where our help comes from */
|
||||
systemHelpFile(ANONFTP_HELPFILE, help);
|
||||
use_helpfile(help);
|
||||
|
||||
/* Setup a nice screen for us to splat stuff onto */
|
||||
draw_box(ds_win, ANONFTP_DIALOG_Y, ANONFTP_DIALOG_X, ANONFTP_DIALOG_HEIGHT, ANONFTP_DIALOG_WIDTH, dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
mvwaddstr(ds_win, ANONFTP_DIALOG_Y, ANONFTP_DIALOG_X + 20, " Anonymous FTP Configuration ");
|
||||
|
||||
draw_box(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 8, ANONFTP_DIALOG_HEIGHT - 11, ANONFTP_DIALOG_WIDTH - 17,
|
||||
dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
sprintf(title, " Path Configuration ");
|
||||
mvwaddstr(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 22, title);
|
||||
|
||||
/** Initialize the config Data Structure **/
|
||||
|
||||
bzero(&tconf, sizeof(tconf));
|
||||
|
||||
strcpy(tconf.group, FTP_GROUP);
|
||||
strcpy(tconf.upload, FTP_UPLOAD);
|
||||
strcpy(tconf.comment, FTP_COMMENT);
|
||||
strcpy(tconf.homedir, FTP_HOMEDIR);
|
||||
sprintf(tconf.uid, "%d", FTP_UID);
|
||||
|
||||
/* Loop over the layout list, create the objects, and add them
|
||||
onto the chain of objects that dialog uses for traversal*/
|
||||
|
||||
n = 0;
|
||||
#define lt layout[n]
|
||||
|
||||
while (lt.help != NULL) {
|
||||
switch (lt.type) {
|
||||
case STRINGOBJ:
|
||||
lt.obj = NewStringObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X,
|
||||
lt.len, lt.maxlen);
|
||||
break;
|
||||
|
||||
case BUTTONOBJ:
|
||||
lt.obj = NewButtonObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + ANONFTP_DIALOG_Y, lt.x + ANONFTP_DIALOG_X);
|
||||
break;
|
||||
|
||||
default:
|
||||
msgFatal("Don't support this object yet!");
|
||||
}
|
||||
AddObj(&obj, lt.type, (void *) lt.obj);
|
||||
n++;
|
||||
}
|
||||
max = n - 1;
|
||||
|
||||
/* Find the last object we can traverse to */
|
||||
last = obj;
|
||||
while (last->next)
|
||||
last = last->next;
|
||||
|
||||
/* Find the first object in the list */
|
||||
first = obj;
|
||||
while (first->prev)
|
||||
first = first->prev;
|
||||
|
||||
/* Some more initialisation before we go into the main input loop */
|
||||
n = 0;
|
||||
cancelbutton = 0;
|
||||
cancel = FALSE;
|
||||
okbutton = 0;
|
||||
|
||||
/* Incoming user data - DUCK! */
|
||||
while (!quit) {
|
||||
char help_line[80];
|
||||
int i, len = strlen(lt.help);
|
||||
|
||||
/* Display the help line at the bottom of the screen */
|
||||
for (i = 0; i < 79; i++)
|
||||
help_line[i] = (i < len) ? lt.help[i] : ' ';
|
||||
help_line[i] = '\0';
|
||||
use_helpline(help_line);
|
||||
display_helpline(ds_win, LINES - 1, COLS - 1);
|
||||
|
||||
/* Ask for libdialog to do its stuff */
|
||||
ret = PollObj(&obj);
|
||||
|
||||
/* Handle special case stuff that libdialog misses. Sigh */
|
||||
switch (ret) {
|
||||
/* Bail out */
|
||||
case SEL_ESC:
|
||||
quit = TRUE, cancel=TRUE;
|
||||
break;
|
||||
|
||||
/* This doesn't work for list dialogs. Oh well. Perhaps
|
||||
should special case the move from the OK button ``up''
|
||||
to make it go to the interface list, but then it gets
|
||||
awkward for the user to go back and correct screw up's
|
||||
in the per-interface section */
|
||||
|
||||
case KEY_DOWN:
|
||||
case SEL_CR:
|
||||
case SEL_TAB:
|
||||
if (n < max)
|
||||
++n;
|
||||
else
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
/* The user has pressed enter over a button object */
|
||||
case SEL_BUTTON:
|
||||
quit = TRUE;
|
||||
if (cancelbutton)
|
||||
cancel = TRUE;
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
case SEL_BACKTAB:
|
||||
if (n)
|
||||
--n;
|
||||
else
|
||||
n = max;
|
||||
break;
|
||||
|
||||
case KEY_F(1):
|
||||
display_helpfile();
|
||||
|
||||
/* They tried some key combination we don't support - tell them! */
|
||||
default:
|
||||
beep();
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear this crap off the screen */
|
||||
dialog_clear_norefresh();
|
||||
use_helpfile(NULL);
|
||||
|
||||
if (cancel)
|
||||
return DITEM_FAILURE;
|
||||
return DITEM_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
configAnonFTP(dialogMenuItem *self)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Be optimistic */
|
||||
i = DITEM_SUCCESS;
|
||||
|
||||
dialog_clear_norefresh();
|
||||
i = anonftpOpenDialog();
|
||||
if (DITEM_STATUS(i) != DITEM_SUCCESS) {
|
||||
msgConfirm("Configuration of Anonymous FTP cancelled per user request.");
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
/*** Use defaults for any invalid values ***/
|
||||
if (atoi(tconf.uid) <= 0)
|
||||
sprintf(tconf.uid, "%d", FTP_UID);
|
||||
|
||||
if (!tconf.group[0])
|
||||
strcpy(tconf.group, FTP_GROUP);
|
||||
|
||||
if (!tconf.upload[0])
|
||||
strcpy(tconf.upload, FTP_UPLOAD);
|
||||
|
||||
/*** If the user did not specify a directory, use default ***/
|
||||
|
||||
if (tconf.homedir[strlen(tconf.homedir) - 1] == '/')
|
||||
tconf.homedir[strlen(tconf.homedir) - 1] = '\0';
|
||||
|
||||
if (!tconf.homedir[0])
|
||||
strcpy(tconf.homedir, FTP_HOMEDIR);
|
||||
|
||||
/*** If HomeDir does not exist, create it ***/
|
||||
|
||||
if (!directory_exists(tconf.homedir))
|
||||
vsystem("mkdir -p %s", tconf.homedir);
|
||||
|
||||
if (directory_exists(tconf.homedir)) {
|
||||
msgNotify("Configuring %s for use by anon FTP.", tconf.homedir);
|
||||
vsystem("chmod 555 %s && chown root.%s %s", tconf.homedir, tconf.group, tconf.homedir);
|
||||
vsystem("mkdir %s/bin && chmod 555 %s/bin", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /bin/ls %s/bin && chmod 111 %s/bin/ls", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /bin/date %s/bin && chmod 111 %s/bin/date", tconf.homedir, tconf.homedir);
|
||||
vsystem("mkdir %s/etc && chmod 555 %s/etc", tconf.homedir, tconf.homedir);
|
||||
vsystem("mkdir -p %s/pub", tconf.homedir);
|
||||
vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload);
|
||||
vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload);
|
||||
|
||||
if (DITEM_STATUS(createFtpUser()) == DITEM_SUCCESS) {
|
||||
msgNotify("Copying password information for anon FTP.");
|
||||
vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd", tconf.homedir, tconf.homedir);
|
||||
vsystem("cp /etc/group %s/etc && chmod 444 %s/etc/group", tconf.homedir, tconf.homedir);
|
||||
vsystem("chown -R root.%s %s/pub", tconf.group, tconf.homedir);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to create FTP user! Anonymous FTP setup failed.");
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) {
|
||||
char cmd[256];
|
||||
dialog_clear();
|
||||
vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE);
|
||||
sprintf(cmd, "%s %s/etc/%s", variable_get(VAR_EDITOR), tconf.homedir, MOTD_FILE);
|
||||
if (!systemExecute(cmd))
|
||||
i = DITEM_SUCCESS;
|
||||
else
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
msgConfirm("Invalid Directory: %s\n"
|
||||
"Anonymous FTP will not be set up.", tconf.homedir);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
if (DITEM_STATUS(i) == DITEM_SUCCESS)
|
||||
variable_set2("anon_ftp", "YES");
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
@@ -0,0 +1,586 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: apache.c,v 1.27 1996/09/01 08:17:13 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Coranth Gryphon. All rights reserved.
|
||||
* Copyright (c) 1996
|
||||
* Jordan K. Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR THEIR PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/param.h>
|
||||
#include <string.h>
|
||||
#include <dialog.h>
|
||||
#include "ui_objects.h"
|
||||
#include "dir.h"
|
||||
#include "dialog.priv.h"
|
||||
#include "colors.h"
|
||||
#include "sysinstall.h"
|
||||
|
||||
|
||||
#define APACHE_HELPFILE "apache"
|
||||
#define FREEBSD_GIF "http://www.freebsd.org/gifs/powerlogo.gif"
|
||||
|
||||
/* These change if the package uses different defaults */
|
||||
|
||||
#define DEFAULT_USER "bin"
|
||||
#define DEFAULT_GROUP "bin"
|
||||
#define WELCOME_FILE "index.html"
|
||||
#define USER_HOMEDIR "public_html"
|
||||
|
||||
#define APACHE_BASE "/usr/local/www"
|
||||
#define DATA_SUBDIR "data"
|
||||
#define CONFIG_SUBDIR "server/conf"
|
||||
|
||||
#define LOGS_SUBDIR "/var/log"
|
||||
#define ACCESS_LOGNAME "httpd.access"
|
||||
#define ERROR_LOGNAME "httpd.error"
|
||||
|
||||
/* Set up the structure to hold configuration information */
|
||||
/* Note that this is only what we could fit onto the one screen */
|
||||
|
||||
typedef struct {
|
||||
char docroot[128]; /* DocumentRoot */
|
||||
char userdir[128]; /* UserDir */
|
||||
char welcome[32]; /* Welcome Doc */
|
||||
char email[64]; /* ServerAdmin */
|
||||
char hostname[64]; /* ServerName */
|
||||
char logdir[64]; /* Where to put Logs */
|
||||
char accesslog[32]; /* access_log */
|
||||
char errorlog[32]; /* error_log */
|
||||
char defuser[16]; /* default user id */
|
||||
char defgroup[16]; /* default group id */
|
||||
} ApacheConf;
|
||||
|
||||
static ApacheConf tconf;
|
||||
|
||||
#define APACHE_DOCROOT_LEN 128
|
||||
#define APACHE_USERDIR_LEN 128
|
||||
#define APACHE_WELCOME_LEN 32
|
||||
#define APACHE_EMAIL_LEN 64
|
||||
#define APACHE_HOSTNAME_LEN 64
|
||||
#define APACHE_LOGDIR_LEN 64
|
||||
#define APACHE_ACCESSLOG_LEN 32
|
||||
#define APACHE_ERRORLOG_LEN 32
|
||||
#define APACHE_DEFUSER_LEN 16
|
||||
#define APACHE_DEFGROUP_LEN 16
|
||||
|
||||
static int okbutton, cancelbutton;
|
||||
|
||||
/* What the screen size is meant to be */
|
||||
#define APACHE_DIALOG_Y 0
|
||||
#define APACHE_DIALOG_X 0
|
||||
#define APACHE_DIALOG_WIDTH COLS
|
||||
#define APACHE_DIALOG_HEIGHT LINES - 2
|
||||
|
||||
/* The screen layout structure */
|
||||
typedef struct _layout {
|
||||
int y; /* x & Y co-ordinates */
|
||||
int x;
|
||||
int len; /* The size of the dialog on the screen */
|
||||
int maxlen; /* How much the user can type in ... */
|
||||
char *prompt; /* The string for the prompt */
|
||||
char *help; /* The display for the help line */
|
||||
void *var; /* The var to set when this changes */
|
||||
int type; /* The type of the dialog to create */
|
||||
void *obj; /* The obj pointer returned by libdialog */
|
||||
} Layout;
|
||||
|
||||
static Layout layout[] = {
|
||||
{ 1, 2, 30, HOSTNAME_FIELD_LEN - 1,
|
||||
"Host Name:",
|
||||
"What name to report this host as to client browsers",
|
||||
tconf.hostname, STRINGOBJ, NULL },
|
||||
#define LAYOUT_HOSTNAME 0
|
||||
|
||||
{ 1, 40, 32, APACHE_EMAIL_LEN - 1,
|
||||
"Email Address:",
|
||||
"The email address of the site maintainer, e.g. [email protected]",
|
||||
tconf.email, STRINGOBJ, NULL },
|
||||
#define LAYOUT_EMAIL 1
|
||||
|
||||
{ 5, 5, 20, APACHE_WELCOME_LEN - 1,
|
||||
"Default Document:",
|
||||
"The name of the default document found in each directory",
|
||||
tconf.welcome, STRINGOBJ, NULL },
|
||||
#define LAYOUT_WELCOME 2
|
||||
|
||||
{ 5, 40, 14, APACHE_DEFUSER_LEN - 1,
|
||||
"Default UserID:", "Default UID for access to web pages",
|
||||
tconf.defuser, STRINGOBJ, NULL },
|
||||
#define LAYOUT_DEFUSER 3
|
||||
|
||||
{ 5, 60, 14, APACHE_DEFGROUP_LEN - 1,
|
||||
"Default Group ID:", "Default GID for access to web pages",
|
||||
tconf.defgroup, STRINGOBJ, NULL },
|
||||
#define LAYOUT_DEFGROUP 4
|
||||
|
||||
{ 10, 4, 36, APACHE_DOCROOT_LEN - 1,
|
||||
"Root Document Path:",
|
||||
"The top directory that holds the system web pages",
|
||||
tconf.docroot, STRINGOBJ, NULL },
|
||||
#define LAYOUT_DOCROOT 5
|
||||
|
||||
{ 10, 50, 14, APACHE_USERDIR_LEN - 1,
|
||||
"User Directory:",
|
||||
"Personal sub-directory that holds users' web pages (eg. ~/Web)",
|
||||
tconf.userdir, STRINGOBJ, NULL },
|
||||
#define LAYOUT_USERDIR 6
|
||||
|
||||
{ 14, 4, 28, APACHE_LOGDIR_LEN - 1,
|
||||
"Log Dir:", "Directory to put httpd log files",
|
||||
tconf.logdir, STRINGOBJ, NULL },
|
||||
#define LAYOUT_LOGDIR 7
|
||||
|
||||
{ 14, 38, 16, APACHE_ACCESSLOG_LEN - 1,
|
||||
"Access Log:", "Name of log file to report access",
|
||||
tconf.accesslog, STRINGOBJ, NULL },
|
||||
#define LAYOUT_ACCESSLOG 8
|
||||
|
||||
{ 14, 60, 16, APACHE_ERRORLOG_LEN - 1,
|
||||
"Error Log:", "Name of log file to report errors",
|
||||
tconf.errorlog, STRINGOBJ, NULL },
|
||||
#define LAYOUT_ERRORLOG 9
|
||||
|
||||
{ 19, 15, 0, 0,
|
||||
"OK", "Select this if you are happy with these settings",
|
||||
&okbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_OKBUTTON 10
|
||||
|
||||
{ 19, 45, 0, 0,
|
||||
"CANCEL", "Select this if you wish to cancel this screen",
|
||||
&cancelbutton, BUTTONOBJ, NULL },
|
||||
#define LAYOUT_CANCELBUTTON 11
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
/* This is it - how to get Apache setup values */
|
||||
static int
|
||||
apacheOpenDialog(void)
|
||||
{
|
||||
WINDOW *ds_win;
|
||||
ComposeObj *obj = NULL;
|
||||
ComposeObj *first, *last;
|
||||
int n=0, quit=FALSE, cancel=FALSE, ret;
|
||||
int max;
|
||||
char *tmp;
|
||||
char help[FILENAME_MAX];
|
||||
char title[80];
|
||||
|
||||
/* We need a curses window */
|
||||
ds_win = newwin(LINES, COLS, 0, 0);
|
||||
if (ds_win == 0)
|
||||
{
|
||||
beep();
|
||||
msgConfirm("Cannot open apache dialog window!!");
|
||||
return(DITEM_SUCCESS);
|
||||
}
|
||||
|
||||
/* Say where our help comes from */
|
||||
systemHelpFile(APACHE_HELPFILE, help);
|
||||
use_helpfile(help);
|
||||
|
||||
/* Setup a nice screen for us to splat stuff onto */
|
||||
draw_box(ds_win, APACHE_DIALOG_Y, APACHE_DIALOG_X, APACHE_DIALOG_HEIGHT, APACHE_DIALOG_WIDTH, dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
mvwaddstr(ds_win, APACHE_DIALOG_Y, APACHE_DIALOG_X + 20, " Apache HTTPD Configuration ");
|
||||
|
||||
draw_box(ds_win, APACHE_DIALOG_Y + 9, APACHE_DIALOG_X + 1, APACHE_DIALOG_HEIGHT - 13, APACHE_DIALOG_WIDTH - 2,
|
||||
dialog_attr, border_attr);
|
||||
wattrset(ds_win, dialog_attr);
|
||||
sprintf(title, " Path Configuration ");
|
||||
mvwaddstr(ds_win, APACHE_DIALOG_Y + 9, APACHE_DIALOG_X + 22, title);
|
||||
|
||||
/** Initialize the config Data Structure **/
|
||||
|
||||
bzero(&tconf, sizeof(tconf));
|
||||
|
||||
tmp = variable_get(VAR_DOMAINNAME);
|
||||
if (tmp) {
|
||||
sprintf(tconf.email, "webmaster@%s", tmp);
|
||||
sprintf(tconf.hostname, "www.%s", tmp);
|
||||
}
|
||||
|
||||
strcpy(tconf.defuser, DEFAULT_USER);
|
||||
strcpy(tconf.defgroup, DEFAULT_GROUP);
|
||||
|
||||
strcpy(tconf.userdir, USER_HOMEDIR);
|
||||
strcpy(tconf.welcome, WELCOME_FILE);
|
||||
|
||||
strcpy(tconf.logdir, LOGS_SUBDIR);
|
||||
strcpy(tconf.accesslog, ACCESS_LOGNAME);
|
||||
strcpy(tconf.errorlog, ERROR_LOGNAME);
|
||||
|
||||
sprintf(tconf.docroot, "%s/%s", APACHE_BASE,DATA_SUBDIR);
|
||||
|
||||
/* Loop over the layout list, create the objects, and add them
|
||||
onto the chain of objects that dialog uses for traversal*/
|
||||
|
||||
n = 0;
|
||||
|
||||
#define lt layout[n]
|
||||
|
||||
while (lt.help != NULL) {
|
||||
switch (lt.type) {
|
||||
case STRINGOBJ:
|
||||
lt.obj = NewStringObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + APACHE_DIALOG_Y, lt.x + APACHE_DIALOG_X,
|
||||
lt.len, lt.maxlen);
|
||||
break;
|
||||
|
||||
case BUTTONOBJ:
|
||||
lt.obj = NewButtonObj(ds_win, lt.prompt, lt.var,
|
||||
lt.y + APACHE_DIALOG_Y, lt.x + APACHE_DIALOG_X);
|
||||
break;
|
||||
|
||||
default:
|
||||
msgFatal("Don't support this object yet!");
|
||||
}
|
||||
AddObj(&obj, lt.type, (void *) lt.obj);
|
||||
n++;
|
||||
}
|
||||
max = n - 1;
|
||||
|
||||
/* Find the last object we can traverse to */
|
||||
last = obj;
|
||||
while (last->next)
|
||||
last = last->next;
|
||||
|
||||
/* Find the first object in the list */
|
||||
first = obj;
|
||||
while (first->prev)
|
||||
first = first->prev;
|
||||
|
||||
/* Some more initialisation before we go into the main input loop */
|
||||
n = 0;
|
||||
cancelbutton = 0;
|
||||
cancel = FALSE;
|
||||
okbutton = 0;
|
||||
|
||||
/* Incoming user data - DUCK! */
|
||||
while (!quit) {
|
||||
char help_line[80];
|
||||
int i, len = strlen(lt.help);
|
||||
|
||||
/* Display the help line at the bottom of the screen */
|
||||
for (i = 0; i < 79; i++)
|
||||
help_line[i] = (i < len) ? lt.help[i] : ' ';
|
||||
help_line[i] = '\0';
|
||||
use_helpline(help_line);
|
||||
display_helpline(ds_win, LINES - 1, COLS - 1);
|
||||
|
||||
/* Ask for libdialog to do its stuff */
|
||||
ret = PollObj(&obj);
|
||||
|
||||
/* We are in the Hostname field - calculate the e-mail addr */
|
||||
if (n == LAYOUT_HOSTNAME) {
|
||||
if ((tmp = index(tconf.hostname, '.')) != NULL) {
|
||||
sprintf(tconf.email,"webmaster@%s",tmp+1);
|
||||
RefreshStringObj(layout[LAYOUT_EMAIL].obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle special case stuff that libdialog misses. Sigh */
|
||||
switch (ret) {
|
||||
/* Bail out */
|
||||
case SEL_ESC:
|
||||
quit = TRUE, cancel=TRUE;
|
||||
break;
|
||||
|
||||
/* This doesn't work for list dialogs. Oh well. Perhaps
|
||||
should special case the move from the OK button ``up''
|
||||
to make it go to the interface list, but then it gets
|
||||
awkward for the user to go back and correct screw up's
|
||||
in the per-interface section */
|
||||
|
||||
case KEY_DOWN:
|
||||
case SEL_TAB:
|
||||
case SEL_CR:
|
||||
if (n < max)
|
||||
++n;
|
||||
else
|
||||
n = 0;
|
||||
break;
|
||||
|
||||
/* The user has pressed enter over a button object */
|
||||
case SEL_BUTTON:
|
||||
quit = TRUE;
|
||||
if (cancelbutton)
|
||||
cancel = TRUE;
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
case SEL_BACKTAB:
|
||||
if (n)
|
||||
--n;
|
||||
else
|
||||
n = max;
|
||||
break;
|
||||
|
||||
case KEY_F(1):
|
||||
display_helpfile();
|
||||
|
||||
/* They tried some key combination we don't support - tell them! */
|
||||
default:
|
||||
beep();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Clear this crap off the screen */
|
||||
dialog_clear_norefresh();
|
||||
use_helpfile(NULL);
|
||||
|
||||
if (cancel)
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
int
|
||||
configApache(dialogMenuItem *self)
|
||||
{
|
||||
int i;
|
||||
char company[64], file[128];
|
||||
char *tptr;
|
||||
FILE *fptr;
|
||||
|
||||
/* Be optimistic */
|
||||
i = DITEM_SUCCESS;
|
||||
|
||||
dialog_clear_norefresh();
|
||||
msgConfirm("Since you elected to install the WEB server, we'll now add the\n"
|
||||
"Apache HTTPD package and set up a few configuration files.");
|
||||
i = package_add(PACKAGE_APACHE);
|
||||
if (DITEM_STATUS(i) != DITEM_SUCCESS) {
|
||||
msgConfirm("Hmmmmm. Looks like we weren't able to fetch the Apache WEB server\n"
|
||||
"package. You may wish to fetch and configure it by hand by looking\n"
|
||||
"in /usr/ports/net/apache (in the ports collection) or looking for the\n"
|
||||
"precompiled apache package in packages/networking/%s.", PACKAGE_APACHE);
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
dialog_clear_norefresh();
|
||||
i = apacheOpenDialog();
|
||||
if (DITEM_STATUS(i) != DITEM_SUCCESS) {
|
||||
msgConfirm("Configuration of the Apache WEB server was cancelled per\n"
|
||||
"user request.");
|
||||
return i;
|
||||
}
|
||||
/*** Fix defaults for invalid value ***/
|
||||
if (!tconf.logdir[0])
|
||||
strcpy(tconf.logdir, LOGS_SUBDIR);
|
||||
if (!tconf.accesslog[0])
|
||||
strcpy(tconf.accesslog, ACCESS_LOGNAME);
|
||||
if (!tconf.errorlog[0])
|
||||
strcpy(tconf.errorlog, ERROR_LOGNAME);
|
||||
|
||||
if (!tconf.welcome[0])
|
||||
strcpy(tconf.welcome, WELCOME_FILE);
|
||||
if (!tconf.userdir[0])
|
||||
strcpy(tconf.userdir, USER_HOMEDIR);
|
||||
|
||||
if (!tconf.defuser[0])
|
||||
strcpy(tconf.defuser, DEFAULT_USER);
|
||||
if (!tconf.defgroup[0])
|
||||
strcpy(tconf.defgroup, DEFAULT_GROUP);
|
||||
|
||||
/*** If the user did not specify a directory, use default ***/
|
||||
|
||||
if (tconf.docroot[strlen(tconf.docroot) - 1] == '/')
|
||||
tconf.docroot[strlen(tconf.docroot) - 1] = '\0';
|
||||
|
||||
if (!tconf.docroot[0])
|
||||
sprintf(tconf.docroot, "%s/%s", APACHE_BASE, DATA_SUBDIR);
|
||||
|
||||
/*** If DocRoot does not exist, create it ***/
|
||||
|
||||
if (!directory_exists(tconf.docroot))
|
||||
vsystem("mkdir -p %s", tconf.docroot);
|
||||
|
||||
if (directory_exists(tconf.docroot)) {
|
||||
sprintf(file, "%s/%s", tconf.docroot, tconf.welcome);
|
||||
if (!file_readable(file)) {
|
||||
tptr = msgGetInput(NULL, "What is your company name?");
|
||||
if (tptr && tptr[0])
|
||||
strcpy(company, tptr);
|
||||
else
|
||||
strcpy(company, "our Web Page");
|
||||
|
||||
msgNotify("Creating sample web page...");
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "<CENTER>\n<TITLE>Welcome Page</TITLE>\n");
|
||||
fprintf(fptr, "<H1>Welcome to %s </H1>\n</CENTER>\n",company);
|
||||
fprintf(fptr, "<P><HR SIZE=4>\n<CENTER>\n");
|
||||
fprintf(fptr, "<A HREF=\"http://www.FreeBSD.org/What\">\n");
|
||||
fprintf(fptr, "<IMG SRC=\"%s\" ALIGN=CENTER BORDER=0 ", FREEBSD_GIF);
|
||||
fprintf(fptr, " ALT=\"Powered by FreeBSD\"></A>\n");
|
||||
if (!tconf.email[0]) {
|
||||
if ((tptr = variable_get(VAR_DOMAINNAME)))
|
||||
sprintf(tconf.email, "root@%s", tptr);
|
||||
}
|
||||
if (tconf.email[0]) {
|
||||
fprintf(fptr, "<ADDRESS><H4>\n");
|
||||
fprintf(fptr, " For questions or comments, please send mail to:\n");
|
||||
fprintf(fptr, " <A HREF=\"mailto:%s\">%s</A>\n",
|
||||
tconf.email, tconf.email);
|
||||
fprintf(fptr, "</H4></ADDRESS>\n");
|
||||
}
|
||||
fprintf(fptr, "</CENTER>\n\n");
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to create sample Web Page.");
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to create Document Root Directory.");
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
msgNotify("Writing configuration files....");
|
||||
|
||||
(void)vsystem("mkdir -p %s/%s", APACHE_BASE, CONFIG_SUBDIR);
|
||||
sprintf(file, "%s/%s/access.conf", APACHE_BASE, CONFIG_SUBDIR);
|
||||
if (file_readable(file))
|
||||
vsystem("mv -f %s %s.ORIG", file, file);
|
||||
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "<Directory %s/cgi-bin>\n", APACHE_BASE);
|
||||
fprintf(fptr, "Options Indexes FollowSymLinks\n");
|
||||
fprintf(fptr, "</Directory>\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "<Directory %s>\n", tconf.docroot);
|
||||
fprintf(fptr, "Options Indexes FollowSymLinks\n");
|
||||
fprintf(fptr, "AllowOverride All\n");
|
||||
fprintf(fptr, "</Directory>\n");
|
||||
fprintf(fptr, "\n");
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Could not create %s",file);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
sprintf(file, "%s/%s/httpd.conf", APACHE_BASE, CONFIG_SUBDIR);
|
||||
if (file_readable(file))
|
||||
vsystem("mv -f %s %s.ORIG", file, file);
|
||||
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "ServerType standalone\n");
|
||||
fprintf(fptr, "Port 80\n");
|
||||
fprintf(fptr, "TimeOut 400\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "ErrorLog %s/%s\n", LOGS_SUBDIR, ERROR_LOGNAME);
|
||||
fprintf(fptr, "TransferLog %s/%s\n", LOGS_SUBDIR, ACCESS_LOGNAME);
|
||||
fprintf(fptr, "PidFile /var/run/httpd.pid\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "StartServers 5\n");
|
||||
fprintf(fptr, "MinSpareServers 5\n");
|
||||
fprintf(fptr, "MaxSpareServers 10\n");
|
||||
fprintf(fptr, "MaxRequestsPerChild 30\n");
|
||||
fprintf(fptr, "MaxClients 150\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "User %s\n",tconf.defuser);
|
||||
fprintf(fptr, "Group %s\n",tconf.defgroup);
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
if (tconf.email[0])
|
||||
fprintf(fptr, "ServerAdmin %s\n", tconf.email);
|
||||
if (tconf.hostname[0])
|
||||
fprintf(fptr, "ServerName %s\n", tconf.hostname);
|
||||
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Could not create %s",file);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
|
||||
sprintf(file, "%s/%s/srm.conf", APACHE_BASE, CONFIG_SUBDIR);
|
||||
if (file_readable(file))
|
||||
vsystem("mv -f %s %s.ORIG", file, file);
|
||||
fptr = fopen(file,"w");
|
||||
if (fptr) {
|
||||
fprintf(fptr, "FancyIndexing on\n");
|
||||
fprintf(fptr, "DefaultType text/plain\n");
|
||||
fprintf(fptr, "IndexIgnore */.??* *~ *# */HEADER* */README* */RCS\n");
|
||||
fprintf(fptr, "HeaderName HEADER\n");
|
||||
fprintf(fptr, "ReadmeName README\n");
|
||||
fprintf(fptr, "AccessFileName .htaccess\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "AddEncoding x-compress Z\n");
|
||||
fprintf(fptr, "AddEncoding x-gzip gz\n");
|
||||
fprintf(fptr, "DefaultIcon /icons/unknown.gif\n");
|
||||
fprintf(fptr, "\n");
|
||||
fprintf(fptr, "AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip\n");
|
||||
fprintf(fptr, "AddIconByType (TXT,/icons/text.gif) text/*\n");
|
||||
fprintf(fptr, "AddIconByType (IMG,/icons/image2.gif) image/*\n");
|
||||
fprintf(fptr, "AddIconByType (SND,/icons/sound2.gif) audio/*\n");
|
||||
fprintf(fptr, "AddIconByType (VID,/icons/movie.gif) video/*\n");
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
fprintf(fptr, "AddIcon /icons/text.gif .ps .shtml\n");
|
||||
fprintf(fptr, "AddIcon /icons/movie.gif .mpg .qt\n");
|
||||
fprintf(fptr, "AddIcon /icons/binary.gif .bin\n");
|
||||
fprintf(fptr, "AddIcon /icons/burst.gif .wrl\n");
|
||||
fprintf(fptr, "AddIcon /icons/binhex.gif .hqx .sit\n");
|
||||
fprintf(fptr, "AddIcon /icons/uu.gif .uu\n");
|
||||
fprintf(fptr, "AddIcon /icons/tar.gif .tar\n");
|
||||
fprintf(fptr, "AddIcon /icons/back.gif ..\n");
|
||||
fprintf(fptr, "AddIcon /icons/dir.gif ^^DIRECTORY^^\n");
|
||||
fprintf(fptr, "AddIcon /icons/blank.gif ^^BLANKICON^^\n");
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
fprintf(fptr, "ScriptAlias /cgi_bin/ %s/cgi_bin/\n",APACHE_BASE);
|
||||
fprintf(fptr, "Alias /icons/ %s/icons/\n",APACHE_BASE);
|
||||
fprintf(fptr, "DocumentRoot %s\n",tconf.docroot);
|
||||
fprintf(fptr, "UserDir %s\n", tconf.userdir);
|
||||
fprintf(fptr, "DirectoryIndex %s\n", tconf.welcome);
|
||||
fprintf(fptr, "\n");
|
||||
|
||||
fclose(fptr);
|
||||
}
|
||||
else {
|
||||
msgConfirm("Could not create %s",file);
|
||||
i = DITEM_FAILURE;
|
||||
}
|
||||
if (DITEM_STATUS(i) == DITEM_SUCCESS)
|
||||
variable_set2("apache_httpd", "YES");
|
||||
return i | DITEM_RESTORE;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated for what's essentially a complete rewrite.
|
||||
*
|
||||
* $Id: doc.c,v 1.18 1996/07/05 08:35:53 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
|
||||
/*
|
||||
* This is called from the main menu. Try to find a copy of Lynx from somewhere
|
||||
* and fire it up on the first copy of the handbook we can find.
|
||||
*/
|
||||
int
|
||||
docBrowser(dialogMenuItem *self)
|
||||
{
|
||||
int ret;
|
||||
char *browser = variable_get(VAR_BROWSER_PACKAGE);
|
||||
|
||||
if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) {
|
||||
msgConfirm("This option may only be used after the system is installed, sorry!");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* First, make sure we have whatever browser we've chosen is here */
|
||||
if (!package_exists(browser)) {
|
||||
ret = package_add(browser);
|
||||
if (DITEM_STATUS(ret) != DITEM_SUCCESS) {
|
||||
msgConfirm("Unable to install the %s HTML browser package. You may\n"
|
||||
"wish to verify that your media is configured correctly and\n"
|
||||
"try again.", browser);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_executable(variable_get(VAR_BROWSER_BINARY))) {
|
||||
if (!msgYesNo("Hmmm. The %s package claims to have installed, but I can't\n"
|
||||
"find its binary in %s! You may wish to try a different\n"
|
||||
"location to load the package from (go to Media menu) and see if that\n"
|
||||
"makes a difference.\n\n"
|
||||
"I suggest that we remove the version that was extracted since it does\n"
|
||||
"not appear to be correct. Would you like me to do that now?"))
|
||||
vsystem("pkg_delete %s %s", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v" : "", browser);
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
/* Run browser on the appropriate doc */
|
||||
if (dmenuOpenSimple(&MenuHTMLDoc, FALSE))
|
||||
return DITEM_SUCCESS | DITEM_RECREATE;
|
||||
else
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
/* Try to show one of the documents requested from the HTML doc menu */
|
||||
int
|
||||
docShowDocument(dialogMenuItem *self)
|
||||
{
|
||||
char tmp[512], target[512];
|
||||
char *where = NULL;
|
||||
char *browser = variable_get(VAR_BROWSER_BINARY);
|
||||
char *str = self->prompt;
|
||||
|
||||
if (!file_executable(browser)) {
|
||||
msgConfirm("Can't find the browser in %s! Please ensure that it's\n"
|
||||
"properly set in the Options editor.", browser);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (!strcmp(str, "Home"))
|
||||
where = "http://www.freebsd.org";
|
||||
else if (!strcmp(str, "Other"))
|
||||
where = msgGetInput("http://www.freebsd.org", "Please enter the URL of the location you wish to visit.");
|
||||
else if (!strcmp(str, "FAQ")) {
|
||||
strcpy(target, "/usr/share/doc/FAQ/FAQ.html");
|
||||
if (!file_readable(target))
|
||||
strcpy(target, "http://www.freebsd.org/FAQ");
|
||||
where = target;
|
||||
}
|
||||
else if (!strcmp(str, "Handbook")) {
|
||||
strcpy(target, "/usr/share/doc/handbook/handbook.html");
|
||||
if (!file_readable(target))
|
||||
strcpy(target, "http://www.freebsd.org/handbook");
|
||||
where = target;
|
||||
}
|
||||
if (where) {
|
||||
sprintf(tmp, "%s %s", browser, where);
|
||||
dialog_clear();
|
||||
systemExecute(tmp);
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
}
|
||||
else {
|
||||
msgConfirm("Hmmmmm! I can't seem to access the documentation you selected!\n"
|
||||
"Have you loaded the bin distribution? Is your network connected?");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
This screen allows you to configure the anonymous FTP user.
|
||||
|
||||
The following configuration values are editable:
|
||||
|
||||
UID: The user ID you wish to assign to the anonymous FTP user.
|
||||
All files uploaded will be owned by this ID.
|
||||
|
||||
Group: Which group you wish the anonymous FTP user to be in.
|
||||
|
||||
Comment: String describing this user in /etc/passwd
|
||||
|
||||
|
||||
FTP Root Directory:
|
||||
|
||||
Where files available for anonymous FTP will be kept.
|
||||
|
||||
Upload subdirectory:
|
||||
|
||||
Where files uploaded by anonymous FTP users will go.
|
||||
@@ -0,0 +1,51 @@
|
||||
There are two sets of options that the Apache HTTP Server needs.
|
||||
|
||||
The first set covers how it operates. These are as follows:
|
||||
|
||||
The "HostName" field is the name of this host, as it is
|
||||
reported to each client connection. Normally, the fully
|
||||
qualified domain name of the host running the server is
|
||||
returned. If you want this set to something else, however,
|
||||
(usually "www.my.domain") then this can be entered here.
|
||||
|
||||
Additionally, the server needs to know how many connections
|
||||
are allowed at one time - this is the "Max Connections"
|
||||
field. If more than this number of clients attempt to connect
|
||||
at once, the additional connections will be refused. This is
|
||||
used to limit how much system load will be imposed by the HTTP
|
||||
server.
|
||||
|
||||
The "Email Address" field is the address of the person (or
|
||||
system alias) who is the administrator for this web site. In
|
||||
addition to being used by the Apache Server itself, it is also
|
||||
put at the bottom of the sample web page that is created.
|
||||
|
||||
Finally, the "Default User" and "Default Group" fields specify
|
||||
what user id and group id should be used by the server for
|
||||
remote connections. Local connections are kept as the UID and
|
||||
GID of the local process.
|
||||
|
||||
The second set of options determine what information is made available
|
||||
to each client:
|
||||
|
||||
The "Document Root Path" is the top of the tree of documents
|
||||
that are made avaliable. For example, if the value is
|
||||
"/usr/web", then the URL "http://www.foo.com/doc.html" would
|
||||
translate as "/usr/web/doc.html".
|
||||
|
||||
Similarly, the "User Directory" is the location in each user's
|
||||
home directory where their public web documents are
|
||||
stored. Thus if the value if this is "Public", then the URL
|
||||
"http://www.foo.com/~joe/doc" would translate to the path
|
||||
"~joe/Public/doc".
|
||||
|
||||
Finally, if the URL points to a directory, there is always a
|
||||
"Default Document" that Apache will use. This field holds the
|
||||
name (not the path) of this document. By default, Apache uses
|
||||
the file "index.html". However, some sites may be more used to
|
||||
using the file "welcome.html".
|
||||
|
||||
There are a number of other options that can be configured with
|
||||
Apache, such as path aliases, masquerading as multiple hosts, server
|
||||
child process parameters, and so forth. For more information on these,
|
||||
consult the Apache man pages at http://www.apache.org.
|
||||
@@ -0,0 +1,38 @@
|
||||
Welcome to the 2.1.5 (or 2.0.5) -> 2.1.6 upgrade procedure!
|
||||
|
||||
It must first be said that this upgrade DOES NOT take a particularly
|
||||
sophisticated approach to the upgrade problem, it being more a
|
||||
question of providing what seemed "good enough" at the time. A truly
|
||||
polished upgrade that deals properly with the broad spectrum of
|
||||
installed 2.0.5 / 2.1 systems would be nice to have, but until that
|
||||
gets written what you get is this - the brute-force approach!
|
||||
|
||||
What this upgrade will attempt to do is best summarized thusly:
|
||||
|
||||
1. fsck and mount all file systems chosen in the label editor.
|
||||
2. Ask for a location to preserve your /etc directory into and do so.
|
||||
3. Extract all selected distributions on top of your existing system.
|
||||
4. Copy certain obvious files back from the preserved /etc, leaving the
|
||||
rest of the /etc file merge up to the user.
|
||||
5. Drop user in a shell so that they may perform that merge before
|
||||
rebooting into the new system.
|
||||
|
||||
And that's it! This "upgrade" is not going to hold your hand in all
|
||||
major respects, it's simply provided to make one PART of the upgrade
|
||||
easier.
|
||||
|
||||
IMPORTANT NOTE: What this upgrade procedure may also do, in fact, is
|
||||
completely destroy your system (though much more quickly than you
|
||||
would have been able to destroy it yourself). It is simply impossible
|
||||
to guarantee that this procedure's crude form of upgrade automation
|
||||
will work in all cases and if you do this upgrade without proper
|
||||
BACKUPS for any important data then you really must like living life
|
||||
close to the edge, that's all we can say!
|
||||
|
||||
NOTE to 2.0 users: We're sorry, but the "slice" changes that were
|
||||
added in FreeBSD 2.0.5 made automated upgrades pretty difficult due to
|
||||
the fact that a complete reinstall is pretty much called for. Things
|
||||
may still *work* after a 2.1 upgrade, but you will also no doubt
|
||||
receive many warnings at boot time about non-aligned slices and such;
|
||||
we really do recommend a fresh installation for 2.0 systems! (But
|
||||
back up your user data first :-).
|
||||
@@ -0,0 +1,582 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: index.c,v 1.37 1996/08/01 12:02:24 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ncurses.h>
|
||||
#include <dialog.h>
|
||||
#include "sysinstall.h"
|
||||
|
||||
/* Macros and magic values */
|
||||
#define MAX_MENU 12
|
||||
#define _MAX_DESC 55
|
||||
|
||||
static int index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended);
|
||||
|
||||
/* Smarter strdup */
|
||||
inline char *
|
||||
_strdup(char *ptr)
|
||||
{
|
||||
return ptr ? strdup(ptr) : NULL;
|
||||
}
|
||||
|
||||
static char *descrs[] = {
|
||||
"Package Selection", "To mark a package or select a category, move to it and press SPACE.\n"
|
||||
"To unmark a package, press SPACE again. To go to a previous menu,\n"
|
||||
"select the Cancel button. To search for a package by name, press ESC.\n"
|
||||
"To finally extract packages, you should Cancel all the way out of any\n"
|
||||
"submenus and then this top menu. NOTE: The All category selection\n"
|
||||
"creates a very large submenu. If you select it, please be patient.",
|
||||
"Package Targets", "These are the packages you've selected for extraction.\n\n"
|
||||
"If you're sure of these choices, select OK.\n"
|
||||
"If not, select Cancel to go back to the package selection menu.\n",
|
||||
"All", "All available packages in all categories.",
|
||||
"applications", "User application software.",
|
||||
"archivers", "Utilities for archiving and unarchiving data.",
|
||||
"audio", "Audio utilities - most require a supported sound card.",
|
||||
"benchmarks", "Utilities for measuring system performance.",
|
||||
"benchmarking", "Utilities for measuring system performance.",
|
||||
"cad", "Computer Aided Design utilities.",
|
||||
"comms", "Communications utilities.",
|
||||
"databases", "Database software.",
|
||||
"devel", "Software development utilities and libraries.",
|
||||
"development", "Software development utilities and libraries.",
|
||||
"documentation", "Document preparation utilities.",
|
||||
"editors", "Common text editors.",
|
||||
"emulation", "Utilities for emulating other OS types.",
|
||||
"emulators", "Utilities for emulating other OS types.",
|
||||
"games", "Various and sundry amusements.",
|
||||
"graphics", "Graphics libraries and utilities.",
|
||||
"japanese", "Ported software for the Japanese market.",
|
||||
"lang", "Computer languages.",
|
||||
"languages", "Computer languages.",
|
||||
"libraries", "Software development libraries.",
|
||||
"mail", "Electronic mail packages and utilities.",
|
||||
"math", "Mathematical computation software.",
|
||||
"misc", "Miscellaneous utilities.",
|
||||
"net", "Networking utilities.",
|
||||
"networking", "Networking utilities.",
|
||||
"news", "USENET News support software.",
|
||||
"numeric", "Mathematical computation software.",
|
||||
"orphans", "Packages without a home elsewhere.",
|
||||
"plan9", "Software from the plan9 Operating System.",
|
||||
"print", "Utilities for dealing with printing.",
|
||||
"printing", "Utilities for dealing with printing.",
|
||||
"programming", "Software development utilities and libraries.",
|
||||
"russian", "Ported software for the Russian market.",
|
||||
"security", "System security software.",
|
||||
"shells", "Various shells (tcsh, bash, etc).",
|
||||
"sysutils", "Various system utilities.",
|
||||
"www", "WEB utilities (browers, HTTP servers, etc).",
|
||||
"troff", "TROFF Text formatting utilities.",
|
||||
"utils", "Various user utilities.",
|
||||
"utilities", "Various user utilities.",
|
||||
"x11", "X Window System based utilities.",
|
||||
NULL, NULL,
|
||||
};
|
||||
|
||||
static char *
|
||||
fetch_desc(char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; descrs[i]; i += 2) {
|
||||
if (!strcmp(descrs[i], name))
|
||||
return descrs[i + 1];
|
||||
}
|
||||
return "No description provided";
|
||||
}
|
||||
|
||||
static PkgNodePtr
|
||||
new_pkg_node(char *name, node_type type)
|
||||
{
|
||||
PkgNodePtr tmp = safe_malloc(sizeof(PkgNode));
|
||||
|
||||
tmp->name = _strdup(name);
|
||||
tmp->type = type;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static char *
|
||||
strip(char *buf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; buf[i]; i++)
|
||||
if (buf[i] == '\t' || buf[i] == '\n')
|
||||
buf[i] = ' ';
|
||||
return buf;
|
||||
}
|
||||
|
||||
static IndexEntryPtr
|
||||
new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *deps)
|
||||
{
|
||||
IndexEntryPtr tmp = safe_malloc(sizeof(IndexEntry));
|
||||
|
||||
tmp->name = _strdup(name);
|
||||
tmp->path = _strdup(pathto);
|
||||
tmp->prefix = _strdup(prefix);
|
||||
tmp->comment = _strdup(comment);
|
||||
tmp->descrfile = strip(_strdup(descr));
|
||||
tmp->maintainer = _strdup(maint);
|
||||
tmp->deps = _strdup(deps);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static void
|
||||
index_register(PkgNodePtr top, char *where, IndexEntryPtr ptr)
|
||||
{
|
||||
PkgNodePtr p, q;
|
||||
|
||||
for (q = NULL, p = top->kids; p; p = p->next) {
|
||||
if (!strcmp(p->name, where)) {
|
||||
q = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!p) {
|
||||
/* Add new category */
|
||||
q = new_pkg_node(where, PLACE);
|
||||
q->desc = fetch_desc(where);
|
||||
q->next = top->kids;
|
||||
top->kids = q;
|
||||
}
|
||||
p = new_pkg_node(ptr->name, PACKAGE);
|
||||
p->desc = ptr->comment;
|
||||
p->data = ptr;
|
||||
p->next = q->kids;
|
||||
q->kids = p;
|
||||
}
|
||||
|
||||
static int
|
||||
copy_to_sep(char *to, char *from, int sep)
|
||||
{
|
||||
char *tok;
|
||||
|
||||
tok = strchr(from, sep);
|
||||
if (!tok) {
|
||||
*to = '\0';
|
||||
return 0;
|
||||
}
|
||||
*tok = '\0';
|
||||
strcpy(to, from);
|
||||
return tok + 1 - from;
|
||||
}
|
||||
|
||||
static int
|
||||
readline(int fd, char *buf, int max)
|
||||
{
|
||||
int rv, i = 0;
|
||||
char ch;
|
||||
|
||||
while ((rv = read(fd, &ch, 1)) == 1 && ch != '\n' && i < max)
|
||||
buf[i++] = ch;
|
||||
if (i < max)
|
||||
buf[i] = '\0';
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
index_parse(int fd, char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *cats, char *deps)
|
||||
{
|
||||
char line[1024];
|
||||
char *cp;
|
||||
int i;
|
||||
|
||||
i = readline(fd, line, 1024);
|
||||
if (i <= 0)
|
||||
return EOF;
|
||||
cp = line;
|
||||
cp += copy_to_sep(name, cp, '|');
|
||||
cp += copy_to_sep(pathto, cp, '|');
|
||||
cp += copy_to_sep(prefix, cp, '|');
|
||||
cp += copy_to_sep(comment, cp, '|');
|
||||
cp += copy_to_sep(descr, cp, '|');
|
||||
cp += copy_to_sep(maint, cp, '|');
|
||||
cp += copy_to_sep(cats, cp, '|');
|
||||
(void)copy_to_sep(deps, cp, '|');
|
||||
/* We're not actually interested in any of the other fields */
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
index_get(char *fname, PkgNodePtr papa)
|
||||
{
|
||||
int i, fd;
|
||||
|
||||
fd = open(fname, O_RDONLY);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "Unable to open index file `%s' for reading.\n", fname);
|
||||
i = -1;
|
||||
}
|
||||
else
|
||||
i = index_read(fd, papa);
|
||||
close(fd);
|
||||
return i;
|
||||
}
|
||||
|
||||
int
|
||||
index_read(int fd, PkgNodePtr papa)
|
||||
{
|
||||
char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[511];
|
||||
|
||||
while (index_parse(fd, name, pathto, prefix, comment, descr, maint, cats, deps) != EOF) {
|
||||
char *cp, *cp2, tmp[511];
|
||||
IndexEntryPtr idx;
|
||||
|
||||
idx = new_index(name, pathto, prefix, comment, descr, maint, deps);
|
||||
/* For now, we only add things to menus if they're in categories. Keywords are ignored */
|
||||
for (cp = strcpy(tmp, cats); (cp2 = strchr(cp, ' ')) != NULL; cp = cp2 + 1) {
|
||||
*cp2 = '\0';
|
||||
index_register(papa, cp, idx);
|
||||
}
|
||||
index_register(papa, cp, idx);
|
||||
|
||||
/* Add to special "All" category */
|
||||
index_register(papa, "All", idx);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
index_init(PkgNodePtr top, PkgNodePtr plist)
|
||||
{
|
||||
if (top) {
|
||||
top->next = top->kids = NULL;
|
||||
top->name = "Package Selection";
|
||||
top->type = PLACE;
|
||||
top->desc = fetch_desc(top->name);
|
||||
top->data = NULL;
|
||||
}
|
||||
if (plist) {
|
||||
plist->next = plist->kids = NULL;
|
||||
plist->name = "Package Targets";
|
||||
plist->type = PLACE;
|
||||
plist->desc = fetch_desc(plist->name);
|
||||
plist->data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
index_print(PkgNodePtr top, int level)
|
||||
{
|
||||
int i;
|
||||
|
||||
while (top) {
|
||||
for (i = 0; i < level; i++) putchar('\t');
|
||||
printf("name [%s]: %s\n", top->type == PLACE ? "place" : "package", top->name);
|
||||
for (i = 0; i < level; i++) putchar('\t');
|
||||
printf("desc: %s\n", top->desc);
|
||||
if (top->kids)
|
||||
index_print(top->kids, level + 1);
|
||||
top = top->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Swap one node for another */
|
||||
static void
|
||||
swap_nodes(PkgNodePtr a, PkgNodePtr b)
|
||||
{
|
||||
PkgNode tmp;
|
||||
|
||||
tmp = *a;
|
||||
*a = *b;
|
||||
a->next = tmp.next;
|
||||
tmp.next = b->next;
|
||||
*b = tmp;
|
||||
}
|
||||
|
||||
/* Use a disgustingly simplistic bubble sort to put our lists in order */
|
||||
void
|
||||
index_sort(PkgNodePtr top)
|
||||
{
|
||||
PkgNodePtr p, q;
|
||||
|
||||
/* Sort everything at the top level */
|
||||
for (p = top->kids; p; p = p->next) {
|
||||
for (q = top->kids; q; q = q->next) {
|
||||
if (q->next && strcmp(q->name, q->next->name) > 0)
|
||||
swap_nodes(q, q->next);
|
||||
}
|
||||
}
|
||||
|
||||
/* Now sub-sort everything n levels down */
|
||||
|
||||
for (p = top->kids; p; p = p->next) {
|
||||
if (p->kids)
|
||||
index_sort(p);
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete an entry out of the list it's in (only the plist, at present) */
|
||||
void
|
||||
index_delete(PkgNodePtr n)
|
||||
{
|
||||
if (n->next) {
|
||||
PkgNodePtr p = n->next;
|
||||
|
||||
*n = *(n->next);
|
||||
safe_free(p);
|
||||
}
|
||||
else /* Kludgy end sentinal */
|
||||
n->name = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search for a given node by name, returning the category in if
|
||||
* tp is non-NULL.
|
||||
*/
|
||||
PkgNodePtr
|
||||
index_search(PkgNodePtr top, char *str, PkgNodePtr *tp)
|
||||
{
|
||||
PkgNodePtr p, sp;
|
||||
|
||||
for (p = top->kids; p && p->name; p = p->next) {
|
||||
/* Subtract out the All category from searches */
|
||||
if (!strcmp(p->name, "All"))
|
||||
continue;
|
||||
|
||||
/* If tp == NULL, we're looking for an exact package match */
|
||||
if (!tp && !strncmp(p->name, str, strlen(str)))
|
||||
return p;
|
||||
|
||||
/* If tp, we're looking for both a package and a pointer to the place it's in */
|
||||
if (tp && !strncmp(p->name, str, strlen(str))) {
|
||||
*tp = top;
|
||||
return p;
|
||||
}
|
||||
|
||||
/* The usual recursion-out-of-laziness ploy */
|
||||
if (p->kids)
|
||||
if ((sp = index_search(p, str, tp)) != NULL)
|
||||
return sp;
|
||||
}
|
||||
if (p && !p->name)
|
||||
p = NULL;
|
||||
return p;
|
||||
}
|
||||
|
||||
int
|
||||
pkg_checked(dialogMenuItem *self)
|
||||
{
|
||||
PkgNodePtr kp = self->data, plist = (PkgNodePtr)self->aux;
|
||||
int i;
|
||||
|
||||
i = index_search(plist, kp->name, NULL) ? TRUE : FALSE;
|
||||
if (kp->type == PACKAGE && plist)
|
||||
return i || package_exists(kp->name);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int
|
||||
pkg_fire(dialogMenuItem *self)
|
||||
{
|
||||
int ret;
|
||||
PkgNodePtr sp, kp = self->data, plist = (PkgNodePtr)self->aux;
|
||||
|
||||
if (!plist)
|
||||
ret = DITEM_FAILURE;
|
||||
else if (kp->type == PACKAGE) {
|
||||
sp = index_search(plist, kp->name, NULL);
|
||||
/* Not already selected? */
|
||||
if (!sp) {
|
||||
if (!package_exists(kp->name)) {
|
||||
PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode));
|
||||
|
||||
*np = *kp;
|
||||
np->next = plist->kids;
|
||||
plist->kids = np;
|
||||
msgInfo("Added %s to selection list", kp->name);
|
||||
}
|
||||
}
|
||||
else if (sp) {
|
||||
msgInfo("Removed %s from selection list", kp->name);
|
||||
index_delete(sp);
|
||||
}
|
||||
ret = DITEM_SUCCESS;
|
||||
}
|
||||
else { /* Not a package, must be a directory */
|
||||
int p, s;
|
||||
|
||||
p = s = 0;
|
||||
index_menu(kp, plist, &p, &s);
|
||||
ret = DITEM_SUCCESS | DITEM_CONTINUE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
pkg_selected(dialogMenuItem *self, int is_selected)
|
||||
{
|
||||
PkgNodePtr kp = self->data;
|
||||
|
||||
if (!is_selected || kp->type != PACKAGE)
|
||||
return;
|
||||
msgInfo(kp->desc);
|
||||
}
|
||||
|
||||
int
|
||||
index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll)
|
||||
{
|
||||
int n, rval, maxname;
|
||||
int curr, max;
|
||||
PkgNodePtr kp;
|
||||
dialogMenuItem *nitems;
|
||||
Boolean hasPackages;
|
||||
WINDOW *w;
|
||||
|
||||
hasPackages = FALSE;
|
||||
nitems = NULL;
|
||||
|
||||
w = savescr();
|
||||
n = maxname = 0;
|
||||
/* Figure out if this menu is full of "leaves" or "branches" */
|
||||
for (kp = top->kids; kp && kp->name; kp = kp->next) {
|
||||
int len;
|
||||
|
||||
++n;
|
||||
if (kp->type == PACKAGE && plist) {
|
||||
hasPackages = TRUE;
|
||||
if ((len = strlen(kp->name)) > maxname)
|
||||
maxname = len;
|
||||
}
|
||||
}
|
||||
if (!n && plist) {
|
||||
msgConfirm("The %s menu is empty.", top->name);
|
||||
restorescr(w);
|
||||
return DITEM_LEAVE_MENU;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
n = 0;
|
||||
curr = max = 0;
|
||||
kp = top->kids;
|
||||
while (kp && kp->name) {
|
||||
char buf[256];
|
||||
|
||||
/* Brutally adjust description to fit in menu */
|
||||
strcpy(buf, kp->desc);
|
||||
if (strlen(buf) > (_MAX_DESC - maxname))
|
||||
buf[_MAX_DESC - maxname] = '\0';
|
||||
nitems = item_add(nitems, kp->name, buf, pkg_checked, pkg_fire, pkg_selected, kp, (int)plist, &curr, &max);
|
||||
++n;
|
||||
kp = kp->next;
|
||||
}
|
||||
/* NULL delimiter so item_free() knows when to stop later */
|
||||
nitems = item_add(nitems, NULL, NULL, NULL, NULL, NULL, NULL, 0, &curr, &max);
|
||||
|
||||
recycle:
|
||||
dialog_clear_norefresh();
|
||||
if (hasPackages)
|
||||
rval = dialog_checklist(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n, nitems, NULL);
|
||||
else /* It's a categories menu */
|
||||
rval = dialog_menu(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n,
|
||||
nitems, NULL, pos, scroll);
|
||||
if (rval == -1 && plist) {
|
||||
static char *cp;
|
||||
PkgNodePtr menu;
|
||||
|
||||
/* Search */
|
||||
if ((cp = msgGetInput(cp, "Search by package name. Please enter search string:")) != NULL) {
|
||||
PkgNodePtr p = index_search(top, cp, &menu);
|
||||
|
||||
if (p) {
|
||||
int pos, scroll;
|
||||
|
||||
/* These need to be set to point at the found item, actually. Hmmm! */
|
||||
pos = scroll = 0;
|
||||
index_menu(menu, plist, &pos, &scroll);
|
||||
}
|
||||
else
|
||||
msgConfirm("Search string: %s yielded no hits.", cp);
|
||||
}
|
||||
goto recycle;
|
||||
}
|
||||
items_free(nitems, &curr, &max);
|
||||
restorescr(w);
|
||||
return rval ? DITEM_FAILURE : DITEM_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist)
|
||||
{
|
||||
PkgNodePtr tmp;
|
||||
int status = DITEM_SUCCESS;
|
||||
|
||||
for (tmp = plist->kids; tmp && tmp->name; tmp = tmp->next)
|
||||
status = index_extract_one(dev, top, tmp, FALSE);
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
|
||||
{
|
||||
int status = DITEM_SUCCESS;
|
||||
PkgNodePtr tmp2;
|
||||
IndexEntryPtr id = who->data;
|
||||
|
||||
if (id && id->deps && strlen(id->deps)) {
|
||||
char t[1024], *cp, *cp2;
|
||||
|
||||
strcpy(t, id->deps);
|
||||
cp = t;
|
||||
while (cp && DITEM_STATUS(status) == DITEM_SUCCESS) {
|
||||
if ((cp2 = index(cp, ' ')) != NULL)
|
||||
*cp2 = '\0';
|
||||
if ((tmp2 = index_search(top, cp, NULL)) != NULL) {
|
||||
status = index_extract_one(dev, top, tmp2, TRUE);
|
||||
if (DITEM_STATUS(status) != DITEM_SUCCESS) {
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Loading of dependant package %s failed", cp);
|
||||
else
|
||||
msgConfirm("Loading of dependant package %s failed", cp);
|
||||
}
|
||||
if (cp2)
|
||||
cp = cp2 + 1;
|
||||
else
|
||||
cp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Done with the deps? Load the real m'coy */
|
||||
if (DITEM_STATUS(status) == DITEM_SUCCESS)
|
||||
status = package_extract(dev, who->name, depended);
|
||||
return status;
|
||||
}
|
||||
@@ -0,0 +1,380 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: installUpgrade.c,v 1.32 1996/09/18 18:40:37 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mount.h>
|
||||
|
||||
typedef struct _hitList {
|
||||
enum { JUST_COPY, CALL_HANDLER } action ;
|
||||
char *name;
|
||||
Boolean optional;
|
||||
void (*handler)(struct _hitList *self);
|
||||
} HitList;
|
||||
|
||||
/* cop-out function for files we can't handle */
|
||||
static void
|
||||
doByHand(HitList *h)
|
||||
{
|
||||
msgConfirm("/etc/%s is one of those files that this upgrade procedure just isn't\n"
|
||||
"smart enough to deal with right now. You'll need to merge the old and\n"
|
||||
"new versions by hand when the option to do so manually is later\n"
|
||||
"presented (in the meantime, you might want to write the name of\n"
|
||||
"this file down! - the holographic shell on VTY4 is a good place for\n"
|
||||
"this).", h->name);
|
||||
}
|
||||
|
||||
static void
|
||||
yellSysconfig(HitList *h)
|
||||
{
|
||||
msgConfirm("/etc/sysconfig is one of those files that this upgrade procedure just isn't\n"
|
||||
"smart enough to deal with right now. Unfortunately, your system\n"
|
||||
"will also come up with a very different \"personality\" than it had\n"
|
||||
"before if you do not merge at LEAST the hostname and ifconfig lines\n"
|
||||
"from the old one! This is very important, so please do this merge\n"
|
||||
"even if you do no others before the system is allowed to reboot.");
|
||||
}
|
||||
|
||||
/* These are the only meaningful files I know about */
|
||||
static HitList etc_files [] = {
|
||||
{ JUST_COPY, "Xaccel.ini", TRUE, NULL },
|
||||
{ JUST_COPY, "adduser.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "aliases", TRUE, NULL },
|
||||
{ JUST_COPY, "aliases.db", TRUE, NULL },
|
||||
{ JUST_COPY, "amd.map", TRUE, NULL },
|
||||
{ JUST_COPY, "crontab", TRUE, NULL },
|
||||
{ JUST_COPY, "csh.cshrc", TRUE, NULL },
|
||||
{ JUST_COPY, "csh.login", TRUE, NULL },
|
||||
{ JUST_COPY, "csh.logout", TRUE, NULL },
|
||||
{ JUST_COPY, "daily", TRUE, NULL },
|
||||
{ JUST_COPY, "disktab", TRUE, NULL },
|
||||
{ JUST_COPY, "dm.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "exports", TRUE, NULL },
|
||||
{ JUST_COPY, "fbtab", TRUE, NULL },
|
||||
{ CALL_HANDLER, "fstab", FALSE, doByHand },
|
||||
{ JUST_COPY, "ftpusers", TRUE, NULL },
|
||||
{ JUST_COPY, "gnats", TRUE, NULL },
|
||||
{ JUST_COPY, "group", FALSE, NULL },
|
||||
{ JUST_COPY, "host.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "hosts", TRUE, NULL },
|
||||
{ JUST_COPY, "hosts.equiv", TRUE, NULL },
|
||||
{ JUST_COPY, "hosts.lpd", TRUE, NULL },
|
||||
{ CALL_HANDLER, "inetd.conf", FALSE, doByHand },
|
||||
{ CALL_HANDLER, "kerberosIV", TRUE, doByHand },
|
||||
{ JUST_COPY, "localtime", TRUE, NULL },
|
||||
{ JUST_COPY, "login.access", TRUE, NULL },
|
||||
{ JUST_COPY, "mail.rc", TRUE, NULL },
|
||||
{ JUST_COPY, "make.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "manpath.config", TRUE, NULL },
|
||||
{ JUST_COPY, "master.passwd", TRUE, NULL },
|
||||
{ JUST_COPY, "mib.txt", TRUE, NULL },
|
||||
{ JUST_COPY, "modems", TRUE, NULL },
|
||||
{ JUST_COPY, "monthly", TRUE, NULL },
|
||||
{ JUST_COPY, "motd", TRUE, NULL },
|
||||
{ JUST_COPY, "namedb", TRUE, NULL },
|
||||
{ CALL_HANDLER, "netstart", FALSE, doByHand },
|
||||
{ JUST_COPY, "networks", TRUE, NULL },
|
||||
{ JUST_COPY, "passwd", FALSE, NULL },
|
||||
{ JUST_COPY, "phones", TRUE, NULL },
|
||||
{ JUST_COPY, "ppp", TRUE, NULL },
|
||||
{ JUST_COPY, "printcap", TRUE, NULL },
|
||||
{ JUST_COPY, "profile", TRUE, NULL },
|
||||
{ JUST_COPY, "protocols", TRUE, NULL },
|
||||
{ JUST_COPY, "pwd.db", TRUE, NULL },
|
||||
{ CALL_HANDLER, "rc", FALSE, doByHand },
|
||||
{ CALL_HANDLER, "rc.i386", TRUE, doByHand },
|
||||
{ JUST_COPY, "rc.local", TRUE, NULL },
|
||||
{ CALL_HANDLER, "rc.serial", TRUE, doByHand },
|
||||
{ JUST_COPY, "remote", TRUE, NULL },
|
||||
{ JUST_COPY, "resolv.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "rmt", TRUE, NULL },
|
||||
{ JUST_COPY, "security", TRUE, NULL },
|
||||
{ JUST_COPY, "sendmail.cf", TRUE, NULL },
|
||||
{ CALL_HANDLER, "services", TRUE, doByHand },
|
||||
{ JUST_COPY, "shells", TRUE, NULL },
|
||||
{ JUST_COPY, "skeykeys", TRUE, NULL },
|
||||
{ JUST_COPY, "spwd.db", TRUE, NULL },
|
||||
{ JUST_COPY, "supfile", TRUE, NULL },
|
||||
{ CALL_HANDLER, "sysconfig", FALSE, yellSysconfig },
|
||||
{ JUST_COPY, "syslog.conf", TRUE, NULL },
|
||||
{ JUST_COPY, "termcap", TRUE, NULL },
|
||||
{ JUST_COPY, "ttys", TRUE, NULL },
|
||||
{ JUST_COPY, "uucp", TRUE, NULL },
|
||||
{ JUST_COPY, "weekly", TRUE, NULL },
|
||||
{ 0 },
|
||||
};
|
||||
|
||||
void
|
||||
traverseHitlist(HitList *h)
|
||||
{
|
||||
while (h->name) {
|
||||
if (!file_readable(h->name)) {
|
||||
if (!h->optional)
|
||||
msgConfirm("Unable to find an old /etc/%s file! That is decidedly non-standard and\n"
|
||||
"your upgraded system may function a little strangely as a result.");
|
||||
}
|
||||
else {
|
||||
if (h->action == JUST_COPY) {
|
||||
/* Nuke the just-loaded copy thoroughly */
|
||||
vsystem("rm -rf /etc/%s", h->name);
|
||||
|
||||
/* Copy the old one into its place */
|
||||
msgNotify("Resurrecting %s..", h->name);
|
||||
/* Do this with tar so that symlinks and such are preserved */
|
||||
if (vsystem("tar cf - %s | tar xpf - -C /etc", h->name))
|
||||
msgConfirm("Unable to resurrect your old /etc/%s! Hmmmm.", h->name);
|
||||
}
|
||||
else /* call handler */
|
||||
h->handler(h);
|
||||
}
|
||||
++h;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
installUpgrade(dialogMenuItem *self)
|
||||
{
|
||||
char *saved_etc;
|
||||
Boolean extractingBin = TRUE;
|
||||
struct termios foo;
|
||||
|
||||
variable_set2(SYSTEM_STATE, "upgrade");
|
||||
systemDisplayHelp("upgrade");
|
||||
|
||||
dialog_clear_norefresh();
|
||||
if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n"
|
||||
"risk it all and proceed with this upgrade?") != 0)
|
||||
return DITEM_FAILURE | DITEM_RESTORE;
|
||||
|
||||
if (!Dists) {
|
||||
msgConfirm("You haven't specified any distributions yet. The upgrade procedure will\n"
|
||||
"only upgrade those portions of the system for which a distribution has\n"
|
||||
"been selected. In the next screen, we'll go to the Distributions menu\n"
|
||||
"to select those portions of 2.1 you wish to install on top of your 2.0.5\n"
|
||||
"system.");
|
||||
if (!dmenuOpenSimple(&MenuDistributions, FALSE))
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
dialog_clear_norefresh();
|
||||
}
|
||||
|
||||
/* No bin selected? Not much of an upgrade.. */
|
||||
if (!(Dists & DIST_BIN)) {
|
||||
if (msgYesNo("You didn't select the bin distribution as one of the distributons to load.\n"
|
||||
"This one is pretty vital to a successful 2.1 upgrade. Are you SURE you don't\n"
|
||||
"want to select the bin distribution? Chose _No_ to bring up the Distributions\n"
|
||||
"menu.") != 0) {
|
||||
if (!dmenuOpenSimple(&MenuDistributions, FALSE))
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
dialog_clear_norefresh();
|
||||
}
|
||||
}
|
||||
|
||||
/* Still?! OK! They must know what they're doing.. */
|
||||
if (!(Dists & DIST_BIN))
|
||||
extractingBin = FALSE;
|
||||
|
||||
if (!mediaDevice) {
|
||||
msgConfirm("Now you must specify an installation medium for the upgrade.");
|
||||
if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
if (RunningAsInit) {
|
||||
Device **devs;
|
||||
int i, cnt;
|
||||
char *cp;
|
||||
|
||||
cp = variable_get(VAR_DISK);
|
||||
devs = deviceFind(cp, DEVICE_TYPE_DISK);
|
||||
cnt = deviceCount(devs);
|
||||
if (!cnt) {
|
||||
msgConfirm("No disks found! Please verify that your disk controller is being\n"
|
||||
"properly probed at boot time. See the Hardware Guide on the\n"
|
||||
"Documentation menu for clues on diagnosing this type of problem.");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
else {
|
||||
/* Enable all the drives befor we start */
|
||||
for (i = 0; i < cnt; i++)
|
||||
devs[i]->enabled = TRUE;
|
||||
}
|
||||
|
||||
msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n"
|
||||
"you will be expected to *Mount* any partitions you're interested in\n"
|
||||
"upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n"
|
||||
"unless you're absolutely sure you know what you're doing! In this\n"
|
||||
"instance, you'll be using the label editor as little more than a fancy\n"
|
||||
"screen-oriented way of labeling existing partitions.\n\n"
|
||||
"Once you're done in the label editor, press Q to return here for the next\n"
|
||||
"step.");
|
||||
|
||||
if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) {
|
||||
msgConfirm("The disk label editor failed to work properly! Upgrade operation\n"
|
||||
"aborted.");
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
/* Don't write out MBR info */
|
||||
variable_set2(DISK_PARTITIONED, "written");
|
||||
if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) {
|
||||
msgConfirm("Not all file systems were properly mounted. Upgrade operation\n"
|
||||
"aborted.");
|
||||
variable_unset(DISK_PARTITIONED);
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
}
|
||||
|
||||
if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) {
|
||||
msgConfirm("Unable to chroot to /mnt - something is wrong with the\n"
|
||||
"root partition or the way it's mounted if this doesn't work.");
|
||||
variable_unset(DISK_PARTITIONED);
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
|
||||
chdir("/");
|
||||
systemCreateHoloshell();
|
||||
|
||||
saved_etc = NULL;
|
||||
if (extractingBin) {
|
||||
while (!saved_etc) {
|
||||
saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?");
|
||||
if (!saved_etc || !*saved_etc || Mkdir(saved_etc)) {
|
||||
saved_etc = NULL;
|
||||
if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n"
|
||||
"Doing an upgrade without first backing up your /etc directory is a very\n"
|
||||
"bad idea! Do you want to go back and specify the save directory again?") != 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (saved_etc) {
|
||||
msgNotify("Preserving /etc directory..");
|
||||
if (vsystem("tar -cf - -C /etc . | tar -xpf - -C %s", saved_etc))
|
||||
if (msgYesNo("Unable to backup your /etc into %s.\n"
|
||||
"Do you want to continue anyway?") != 0)
|
||||
return DITEM_FAILURE | DITEM_RECREATE;
|
||||
}
|
||||
if (file_readable("/kernel")) {
|
||||
msgNotify("Moving old kernel to /kernel.prev");
|
||||
if (system("chflags noschg /kernel && mv /kernel /kernel.prev")) {
|
||||
if (!msgYesNo("Hmmm! I couldn't move the old kernel over! Do you want to\n"
|
||||
"treat this as a big problem and abort the upgrade? Due to the\n"
|
||||
"way that this upgrade process works, you will have to reboot\n"
|
||||
"and start over from the beginning. Select Yes to reboot now"))
|
||||
systemShutdown(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
msgNotify("Beginning extraction of distributions..");
|
||||
if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) {
|
||||
if (extractingBin && (Dists & DIST_BIN)) {
|
||||
msgConfirm("Hmmmm. We couldn't even extract the bin distribution. This upgrade\n"
|
||||
"should be considered a failure and started from the beginning, sorry!\n"
|
||||
"The system will reboot now.");
|
||||
dialog_clear();
|
||||
systemShutdown(1);
|
||||
}
|
||||
msgConfirm("The extraction process seems to have had some problems, but we got most\n"
|
||||
"of the essentials. We'll treat this as a warning since it may have been\n"
|
||||
"only non-essential distributions which failed to load.");
|
||||
}
|
||||
|
||||
if (extractingBin) {
|
||||
msgNotify("OK, now it's time to go pound on your root a little bit to create all the\n"
|
||||
"/dev entries and such that a 2.1 system expects to see. I'll also perform a\n"
|
||||
"few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
|
||||
"on top of an existing system..");
|
||||
if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE) {
|
||||
msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
|
||||
"You may wish to examine the system a little more closely when\n"
|
||||
"it comes time to merge your /etc customizations back.");
|
||||
}
|
||||
}
|
||||
|
||||
msgConfirm("First stage of upgrade completed successfully!\n\n"
|
||||
"Next comes stage 2, where we attempt to resurrect your /etc\n"
|
||||
"directory!");
|
||||
|
||||
if (saved_etc && chdir(saved_etc)) {
|
||||
msgConfirm("Unable to go to your saved /etc directory in %s?! Argh!\n"
|
||||
"Something went seriously wrong! It's quite possible that\n"
|
||||
"your former /etc is toast. I hope you didn't have any\n"
|
||||
"important customizations you wanted to keep in there.. :(");
|
||||
}
|
||||
else {
|
||||
/* Now try to resurrect the /etc files */
|
||||
traverseHitlist(etc_files);
|
||||
}
|
||||
|
||||
msgConfirm("OK! At this stage, we've resurrected all the /etc files we could\n"
|
||||
"(and you may have been warned about some that you'll have to merge\n"
|
||||
"yourself by hand) and we're going to drop you into a shell to do\n"
|
||||
"the rest yourself (sorry about this!). Once the system looks good\n"
|
||||
"to you, exit the shell to reboot the system.");
|
||||
|
||||
chdir("/");
|
||||
dialog_clear();
|
||||
end_dialog();
|
||||
DialogActive = FALSE;
|
||||
endwin();
|
||||
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
if (tcgetattr(0, &foo) != -1) {
|
||||
foo.c_cc[VERASE] = '\010';
|
||||
if (tcsetattr(0, TCSANOW, &foo) == -1)
|
||||
msgDebug("Unable to set the erase character.\n");
|
||||
}
|
||||
else
|
||||
msgDebug("Unable to get the terminal attributes!\n");
|
||||
printf("Well, good luck! When you're done, please type \"reboot\" or exit\n"
|
||||
"the shell to reboot the new system.\n");
|
||||
if (!Fake)
|
||||
system("/bin/sh");
|
||||
else
|
||||
exit(0);
|
||||
if (RunningAsInit)
|
||||
reboot(0);
|
||||
/* NOTREACHED */
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 1996 Joerg Wunsch
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <machine/console.h>
|
||||
|
||||
struct keymapInfo {
|
||||
const char *name;
|
||||
const struct keymap *map;
|
||||
};
|
||||
|
||||
#include "keymap.h"
|
||||
#include "sysinstall.h"
|
||||
|
||||
/*
|
||||
* keymap.h is being automatically generated by the Makefile. It
|
||||
* contains definitions for all desired keymaps. Note that since we
|
||||
* don't support font loading nor screen mapping during installation,
|
||||
* we simply don't care for any other keys than the ASCII subset.
|
||||
*
|
||||
* Therefore, if no keymap with the exact name has been found in the
|
||||
* first pass, we make a second pass over the table looking just for
|
||||
* the language name only.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return values:
|
||||
*
|
||||
* 0: OK
|
||||
* -1: no appropriate keymap found
|
||||
* -2: error installing map (other than ENXIO which means we're not on syscons)
|
||||
*/
|
||||
|
||||
int
|
||||
loadKeymap(const char *lang)
|
||||
{
|
||||
int passno, err;
|
||||
char *llang;
|
||||
size_t l;
|
||||
struct keymapInfo *kip;
|
||||
|
||||
llang = strdup(lang);
|
||||
if (llang == NULL)
|
||||
abort();
|
||||
|
||||
for (passno = 0; passno < 2; passno++)
|
||||
{
|
||||
if (passno > 0)
|
||||
{
|
||||
/* make the match more fuzzy */
|
||||
l = strspn(llang, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
||||
llang[l] = '\0';
|
||||
}
|
||||
|
||||
l = strlen(llang);
|
||||
|
||||
for (kip = keymapInfos; kip->name; kip++)
|
||||
if (strncmp(kip->name, llang, l) == 0)
|
||||
{
|
||||
/* Yep, got it! */
|
||||
err = ioctl(0, PIO_KEYMAP, kip->map);
|
||||
free(llang);
|
||||
return (err == -1 && errno != ENOTTY)? -2: 0;
|
||||
}
|
||||
}
|
||||
free(llang);
|
||||
return -1;
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
/* $XConsortium: lndir.c,v 1.14 95/01/09 20:08:20 kaleb Exp $ */
|
||||
/* $XFree86: xc/config/util/lndir.c,v 3.3 1995/01/28 15:41:09 dawes Exp $ */
|
||||
/* Create shadow link tree (after X11R4 script of the same name)
|
||||
Mark Reinhold ([email protected])/3 January 1990 */
|
||||
|
||||
/* Hacked somewhat by Jordan Hubbard, The FreeBSD Project, to make it */
|
||||
/* an invokable function from sysinstall rather than a stand-alone binary */
|
||||
|
||||
/*
|
||||
Copyright (c) 1990, X Consortium
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of the X Consortium shall not be
|
||||
used in advertising or otherwise to promote the sale, use or other dealings
|
||||
in this Software without prior written authorization from the X Consortium.
|
||||
|
||||
*/
|
||||
|
||||
/* From the original /bin/sh script:
|
||||
|
||||
Used to create a copy of the a directory tree that has links for all
|
||||
non-directories (except those named RCS, SCCS or CVS.adm). If you are
|
||||
building the distribution on more than one machine, you should use
|
||||
this technique.
|
||||
|
||||
If your master sources are located in /usr/local/src/X and you would like
|
||||
your link tree to be in /usr/local/src/new-X, do the following:
|
||||
|
||||
% mkdir /usr/local/src/new-X
|
||||
% cd /usr/local/src/new-X
|
||||
% lndir ../X
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "sysinstall.h"
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN 2048
|
||||
#endif
|
||||
|
||||
static char *rcurdir;
|
||||
static char *curdir;
|
||||
|
||||
static int
|
||||
equivalent(char *lname, char *rname)
|
||||
{
|
||||
char *s;
|
||||
|
||||
if (!strcmp(lname, rname))
|
||||
return 1;
|
||||
for (s = lname; *s && (s = strchr(s, '/')); s++) {
|
||||
while (s[1] == '/')
|
||||
strcpy(s+1, s+2);
|
||||
}
|
||||
return !strcmp(lname, rname);
|
||||
}
|
||||
|
||||
|
||||
/* Recursively create symbolic links from the current directory to the "from"
|
||||
directory. Assumes that files described by fs and ts are directories. */
|
||||
|
||||
static int
|
||||
dodir(char *fn, struct stat *fs, struct stat *ts, int rel)
|
||||
{
|
||||
DIR *df;
|
||||
struct dirent *dp;
|
||||
char buf[MAXPATHLEN + 1], *p;
|
||||
char symbuf[MAXPATHLEN + 1];
|
||||
struct stat sb, sc;
|
||||
int n_dirs;
|
||||
int symlen;
|
||||
char *ocurdir;
|
||||
|
||||
if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino))
|
||||
return 1;
|
||||
|
||||
if (rel)
|
||||
strcpy (buf, "../");
|
||||
else
|
||||
buf[0] = '\0';
|
||||
strcat (buf, fn);
|
||||
|
||||
if (!(df = opendir (buf))) {
|
||||
msgDebug("%s: Cannot opendir\n", buf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
p = buf + strlen (buf);
|
||||
*p++ = '/';
|
||||
n_dirs = fs->st_nlink;
|
||||
while ((dp = readdir (df)) != NULL) {
|
||||
if (dp->d_name[strlen(dp->d_name) - 1] == '~')
|
||||
continue;
|
||||
strcpy (p, dp->d_name);
|
||||
|
||||
if (n_dirs > 0) {
|
||||
if (stat (buf, &sb) < 0) {
|
||||
msgDebug("Can't stat: %s\n", buf);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
/* directory */
|
||||
n_dirs--;
|
||||
if (dp->d_name[0] == '.' &&
|
||||
(dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "RCS"))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "SCCS"))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "CVS"))
|
||||
continue;
|
||||
if (!strcmp (dp->d_name, "CVS.adm"))
|
||||
continue;
|
||||
ocurdir = rcurdir;
|
||||
rcurdir = buf;
|
||||
curdir = isDebug() ? buf : (char *)0;
|
||||
if (isDebug())
|
||||
msgDebug("%s:\n", buf);
|
||||
if ((stat(dp->d_name, &sc) < 0) && (errno == ENOENT)) {
|
||||
if (mkdir(dp->d_name, 0777) < 0 ||
|
||||
stat (dp->d_name, &sc) < 0) {
|
||||
msgDebug("Unable to make or stat: %s\n", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
|
||||
msgDebug("%s: is a link instead of a directory\n", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
if (chdir (dp->d_name) < 0) {
|
||||
msgDebug("Unable to chdir to: %s\n", dp->d_name);
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
(void)dodir(buf, &sb, &sc, (buf[0] != '/'));
|
||||
if (chdir ("..") < 0) {
|
||||
msgDebug("Unable to get back to ..\n");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
curdir = rcurdir = ocurdir;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* non-directory */
|
||||
symlen = readlink (dp->d_name, symbuf, sizeof(symbuf) - 1);
|
||||
if (symlen >= 0) {
|
||||
symbuf[symlen] = '\0';
|
||||
if (!equivalent (symbuf, buf))
|
||||
msgDebug("%s: %s\n", dp->d_name, symbuf);
|
||||
} else if (symlink (buf, dp->d_name) < 0)
|
||||
msgDebug("Unable to create symlink: %s\n", dp->d_name);
|
||||
}
|
||||
|
||||
closedir (df);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
lndir(char *from, char *to)
|
||||
{
|
||||
struct stat fs, ts;
|
||||
|
||||
if (!to)
|
||||
to = ".";
|
||||
|
||||
/* to directory */
|
||||
if (stat(to, &ts) < 0) {
|
||||
msgDebug("Destination directory doesn't exist: %s\n", to);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (!(S_ISDIR(ts.st_mode))) {
|
||||
msgDebug ("%s: Not a directory\n", to);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (chdir(to) < 0) {
|
||||
msgDebug("Unable to chdir to %s\n", to);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
/* from directory */
|
||||
if (stat(from, &fs) < 0) {
|
||||
msgDebug("From directory doesn't exist: %s\n", from);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
if (!(S_ISDIR(fs.st_mode))) {
|
||||
msgDebug ("%s: Not a directory\n", from);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
return dodir(from, &fs, &ts, 0);
|
||||
}
|
||||
@@ -0,0 +1,290 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated for what's essentially a complete rewrite.
|
||||
*
|
||||
* $Id: options.c,v 1.45 1996/11/07 08:03:27 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static char *
|
||||
varCheck(Option opt)
|
||||
{
|
||||
char *cp = NULL;
|
||||
|
||||
if (opt.aux)
|
||||
cp = variable_get((char *)opt.aux);
|
||||
if (!cp)
|
||||
return "NO";
|
||||
return cp;
|
||||
}
|
||||
|
||||
/* Show our little logo */
|
||||
static char *
|
||||
resetLogo(char *str)
|
||||
{
|
||||
return "[RESET!]";
|
||||
}
|
||||
|
||||
static char *
|
||||
mediaCheck(Option opt)
|
||||
{
|
||||
if (mediaDevice) {
|
||||
switch(mediaDevice->type) {
|
||||
case DEVICE_TYPE_UFS:
|
||||
case DEVICE_TYPE_DISK:
|
||||
return "File system";
|
||||
|
||||
case DEVICE_TYPE_FLOPPY:
|
||||
return "Floppy";
|
||||
|
||||
case DEVICE_TYPE_FTP:
|
||||
return "FTP";
|
||||
|
||||
case DEVICE_TYPE_CDROM:
|
||||
return "CDROM";
|
||||
|
||||
case DEVICE_TYPE_TAPE:
|
||||
return "Tape";
|
||||
|
||||
case DEVICE_TYPE_DOS:
|
||||
return "DOS";
|
||||
|
||||
case DEVICE_TYPE_NFS:
|
||||
return "NFS";
|
||||
|
||||
case DEVICE_TYPE_NONE:
|
||||
case DEVICE_TYPE_NETWORK:
|
||||
case DEVICE_TYPE_ANY:
|
||||
default:
|
||||
return "<unknown>";
|
||||
}
|
||||
}
|
||||
return "<not yet set>";
|
||||
}
|
||||
|
||||
#define TAPE_PROMPT "Please enter the tape block size in 512 byte blocks:"
|
||||
#define RELNAME_PROMPT "Please specify the release you wish to load or\n\"none\" for a generic release install:"
|
||||
#define BPKG_PROMPT "Please specify the name of the HTML browser package:"
|
||||
#define BBIN_PROMPT "Please specify a full pathname to the HTML browser binary:"
|
||||
#define EDITOR_PROMPT "Please specify the name of the text editor you wish to use:"
|
||||
#define PKG_PROMPT "Please specify a temporary directory with lots of free space:"
|
||||
#define INSTROOT_PROMPT "Please specify a root directory if installing somewhere other than /"
|
||||
|
||||
static Option Options[] = {
|
||||
{ "NFS Secure", "NFS server talks only on a secure port",
|
||||
OPT_IS_VAR, NULL, VAR_NFS_SECURE, varCheck },
|
||||
{ "NFS Slow", "User is using a slow PC or ethernet card",
|
||||
OPT_IS_VAR, NULL, VAR_SLOW_ETHER, varCheck },
|
||||
{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
|
||||
OPT_IS_VAR, NULL, VAR_DEBUG, varCheck },
|
||||
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
|
||||
OPT_IS_VAR, NULL, VAR_NO_CONFIRM, varCheck },
|
||||
{ "FTP username", "Username and password to use instead of anonymous",
|
||||
OPT_IS_FUNC, mediaSetFTPUserPass, VAR_FTP_USER, varCheck },
|
||||
{ "Editor", "Which text editor to use during installation",
|
||||
OPT_IS_VAR, EDITOR_PROMPT, VAR_EDITOR, varCheck },
|
||||
{ "Tape Blocksize", "Tape media block size in 512 byte blocks",
|
||||
OPT_IS_VAR, TAPE_PROMPT, VAR_TAPE_BLOCKSIZE, varCheck },
|
||||
{ "Extract Detail", "How verbosely to display file name information during extractions",
|
||||
OPT_IS_FUNC, mediaSetCPIOVerbosity, VAR_CPIO_VERBOSITY, varCheck },
|
||||
{ "Release Name", "Which release to attempt to load from installation media",
|
||||
OPT_IS_VAR, RELNAME_PROMPT, VAR_RELNAME, varCheck },
|
||||
{ "Install Root", "Which directory to unpack distributions or packages relative to",
|
||||
OPT_IS_VAR, INSTROOT_PROMPT, VAR_INSTALL_ROOT, varCheck },
|
||||
{ "Browser Pkg", "This is the browser package that will be used for viewing HTML docs",
|
||||
OPT_IS_VAR, BPKG_PROMPT, VAR_BROWSER_PACKAGE, varCheck },
|
||||
{ "Browser Exec", "This is the path to the main binary of the browser package",
|
||||
OPT_IS_VAR, BBIN_PROMPT, VAR_BROWSER_BINARY, varCheck },
|
||||
{ "Media Type", "The current installation media type.",
|
||||
OPT_IS_FUNC, mediaGetType, VAR_MEDIA_TYPE, mediaCheck },
|
||||
{ "Package Temp", "The directory where package temporary files should go",
|
||||
OPT_IS_VAR, PKG_PROMPT, VAR_PKG_TMPDIR, varCheck },
|
||||
{ "Use Defaults", "Reset all values to startup defaults",
|
||||
OPT_IS_FUNC, installVarDefaults, 0, resetLogo },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
#define OPT_START_ROW 4
|
||||
#define OPT_END_ROW 19
|
||||
#define OPT_NAME_COL 0
|
||||
#define OPT_VALUE_COL 16
|
||||
#define GROUP_OFFSET 40
|
||||
|
||||
static char *
|
||||
value_of(Option opt)
|
||||
{
|
||||
static char ival[40];
|
||||
|
||||
switch (opt.type) {
|
||||
case OPT_IS_STRING:
|
||||
return (char *)opt.data;
|
||||
|
||||
case OPT_IS_INT:
|
||||
sprintf(ival, "%d", (int)opt.data);
|
||||
return ival;
|
||||
|
||||
case OPT_IS_FUNC:
|
||||
case OPT_IS_VAR:
|
||||
if (opt.check)
|
||||
return opt.check(opt);
|
||||
else
|
||||
return "<*>";
|
||||
}
|
||||
return "<unknown>";
|
||||
}
|
||||
|
||||
static int
|
||||
fire(Option opt)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (opt.type == OPT_IS_FUNC) {
|
||||
int (*cp)(char *) = opt.data, rcode;
|
||||
|
||||
rcode = cp(NULL);
|
||||
if (rcode & (DITEM_RECREATE | DITEM_RESTORE))
|
||||
status = 1;
|
||||
}
|
||||
else if (opt.type == OPT_IS_VAR) {
|
||||
if (opt.data) {
|
||||
(void)variable_get_value(opt.aux, opt.data);
|
||||
status = 1;
|
||||
}
|
||||
else if (variable_get(opt.aux))
|
||||
variable_unset(opt.aux);
|
||||
else
|
||||
variable_set2(opt.aux, "YES");
|
||||
}
|
||||
if (opt.check)
|
||||
opt.check(opt);
|
||||
refresh();
|
||||
return status;
|
||||
}
|
||||
|
||||
int
|
||||
optionsEditor(dialogMenuItem *self)
|
||||
{
|
||||
int i, optcol, optrow, key;
|
||||
static int currOpt = 0;
|
||||
|
||||
dialog_clear_norefresh();
|
||||
clear();
|
||||
|
||||
while (1) {
|
||||
/* Whap up the header */
|
||||
attrset(A_REVERSE); mvaddstr(0, 0, "Options Editor"); attrset(A_NORMAL);
|
||||
for (i = 0; i < 2; i++) {
|
||||
mvaddstr(OPT_START_ROW - 2, OPT_NAME_COL + (i * GROUP_OFFSET), "Name");
|
||||
mvaddstr(OPT_START_ROW - 1, OPT_NAME_COL + (i * GROUP_OFFSET), "----");
|
||||
|
||||
mvaddstr(OPT_START_ROW - 2, OPT_VALUE_COL + (i * GROUP_OFFSET), "Value");
|
||||
mvaddstr(OPT_START_ROW - 1, OPT_VALUE_COL + (i * GROUP_OFFSET), "-----");
|
||||
}
|
||||
/* And the footer */
|
||||
mvprintw(OPT_END_ROW + 1, 0, "Use SPACE to select/toggle an option, arrow keys to move,");
|
||||
mvprintw(OPT_END_ROW + 2, 0, "? or F1 for more help. When you're done, type Q to Quit.");
|
||||
|
||||
optrow = OPT_START_ROW;
|
||||
optcol = OPT_NAME_COL;
|
||||
for (i = 0; Options[i].name; i++) {
|
||||
/* Names are painted somewhat gratuitously each time, but it's easier this way */
|
||||
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
|
||||
if (currOpt == i)
|
||||
attrset(ATTR_SELECTED);
|
||||
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
|
||||
if (currOpt == i)
|
||||
attrset(A_NORMAL);
|
||||
if (optrow == OPT_END_ROW) {
|
||||
optrow = OPT_START_ROW;
|
||||
optcol += GROUP_OFFSET;
|
||||
}
|
||||
clrtoeol();
|
||||
}
|
||||
attrset(ATTR_TITLE);
|
||||
mvaddstr(OPT_END_ROW + 4, 0, Options[currOpt].desc);
|
||||
attrset(A_NORMAL);
|
||||
clrtoeol();
|
||||
move(0, 14);
|
||||
refresh();
|
||||
|
||||
/* Start the edit loop */
|
||||
key = toupper(getch());
|
||||
switch (key) {
|
||||
case KEY_F(1):
|
||||
case '?':
|
||||
systemDisplayHelp("options");
|
||||
clear();
|
||||
break;
|
||||
|
||||
case KEY_UP:
|
||||
if (currOpt)
|
||||
--currOpt;
|
||||
else
|
||||
for (currOpt = 0; Options[currOpt + 1].name; currOpt++);
|
||||
continue;
|
||||
|
||||
case KEY_DOWN:
|
||||
if (Options[currOpt + 1].name)
|
||||
++currOpt;
|
||||
else
|
||||
currOpt = 0;
|
||||
continue;
|
||||
|
||||
case KEY_HOME:
|
||||
currOpt = 0;
|
||||
continue;
|
||||
|
||||
case KEY_END:
|
||||
while (Options[currOpt + 1].name)
|
||||
++currOpt;
|
||||
continue;
|
||||
|
||||
case ' ':
|
||||
if (fire(Options[currOpt]))
|
||||
clear();
|
||||
continue;
|
||||
|
||||
case 'Q':
|
||||
clear();
|
||||
dialog_clear();
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
|
||||
default:
|
||||
beep();
|
||||
}
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return DITEM_SUCCESS | DITEM_RESTORE;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* The new sysinstall program.
|
||||
*
|
||||
* This is probably the last program in the `sysinstall' line - the next
|
||||
* generation being essentially a complete rewrite.
|
||||
*
|
||||
* $Id: package.c,v 1.48 1996/10/12 19:30:26 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer,
|
||||
* verbatim and that no modifications are made prior to this
|
||||
* point in the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/stat.h>
|
||||
#include "sysinstall.h"
|
||||
|
||||
/* Like package_extract, but assumes current media device */
|
||||
int
|
||||
package_add(char *name)
|
||||
{
|
||||
if (!mediaVerify())
|
||||
return DITEM_FAILURE;
|
||||
return package_extract(mediaDevice, name, FALSE);
|
||||
}
|
||||
|
||||
Boolean
|
||||
package_exists(char *name)
|
||||
{
|
||||
char fname[FILENAME_MAX];
|
||||
int status /* = vsystem("pkg_info -e %s", name) */;
|
||||
|
||||
/* XXX KLUDGE ALERT! This makes evil assumptions about how XXX
|
||||
* packages register themselves and should *really be done with
|
||||
* `pkg_info -e <name>' except that this it's too slow for an
|
||||
* item check routine.. :-(
|
||||
*/
|
||||
snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name);
|
||||
status = access(fname, R_OK);
|
||||
msgDebug("package check for %s returns %s.\n", name,
|
||||
status ? "failure" : "success");
|
||||
return !status;
|
||||
}
|
||||
|
||||
/* SIGPIPE handler */
|
||||
static Boolean sigpipe_caught = FALSE;
|
||||
|
||||
static void
|
||||
catch_pipe(int sig)
|
||||
{
|
||||
sigpipe_caught = TRUE;
|
||||
}
|
||||
|
||||
/* Extract a package based on a namespec and a media device */
|
||||
int
|
||||
package_extract(Device *dev, char *name, Boolean depended)
|
||||
{
|
||||
char path[511];
|
||||
int fd, ret;
|
||||
|
||||
/* Check to make sure it's not already there */
|
||||
if (package_exists(name))
|
||||
return DITEM_SUCCESS;
|
||||
|
||||
/* If necessary, initialize the ldconfig hints */
|
||||
if (!file_readable("/var/run/ld.so.hints"))
|
||||
vsystem("ldconfig /usr/lib /usr/local/lib /usr/X11R6/lib");
|
||||
|
||||
if (!dev->init(dev)) {
|
||||
msgConfirm("Unable to initialize media type for package extract.");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* Be initially optimistic */
|
||||
ret = DITEM_SUCCESS | DITEM_RESTORE;
|
||||
/* Make a couple of paranoid locations for temp files to live if user specified none */
|
||||
if (!variable_get("PKG_TMPDIR")) {
|
||||
/* Set it to a location with as much space as possible */
|
||||
variable_set2("PKG_TMPDIR", "/usr/tmp");
|
||||
}
|
||||
Mkdir(variable_get("PKG_TMPDIR"));
|
||||
|
||||
if (!index(name, '/'))
|
||||
sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
|
||||
else
|
||||
sprintf(path, "%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
|
||||
fd = dev->get(dev, path, TRUE);
|
||||
if (fd >= 0) {
|
||||
int i, tot, pfd[2];
|
||||
pid_t pid;
|
||||
|
||||
signal(SIGPIPE, catch_pipe);
|
||||
msgNotify("Adding %s%s\nfrom %s", path, depended ? " (as a dependency)" : "", dev->name);
|
||||
pipe(pfd);
|
||||
pid = fork();
|
||||
if (!pid) {
|
||||
dup2(pfd[0], 0); close(pfd[0]);
|
||||
dup2(DebugFD, 1);
|
||||
close(2);
|
||||
close(pfd[1]);
|
||||
chroot(variable_get(VAR_INSTALL_ROOT));
|
||||
i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-", 0);
|
||||
if (isDebug())
|
||||
msgDebug("pkg_add returns %d status\n", i);
|
||||
}
|
||||
else {
|
||||
char buf[BUFSIZ];
|
||||
WINDOW *w = savescr();
|
||||
struct timeval start, stop;
|
||||
|
||||
close(pfd[0]);
|
||||
tot = 0;
|
||||
(void)gettimeofday(&start, (struct timezone *)0);
|
||||
|
||||
while (!sigpipe_caught && (i = read(fd, buf, BUFSIZ)) > 0) {
|
||||
int seconds;
|
||||
|
||||
tot += i;
|
||||
/* Print statistics about how we're doing */
|
||||
(void) gettimeofday(&stop, (struct timezone *)0);
|
||||
stop.tv_sec = stop.tv_sec - start.tv_sec;
|
||||
stop.tv_usec = stop.tv_usec - start.tv_usec;
|
||||
if (stop.tv_usec < 0)
|
||||
stop.tv_sec--, stop.tv_usec += 1000000;
|
||||
seconds = stop.tv_sec + (stop.tv_usec / 1000000.0);
|
||||
if (!seconds)
|
||||
seconds = 1;
|
||||
msgInfo("%10d bytes read from package %s @ %4.1f KBytes/second", tot, name, (tot / seconds) / 1024.0);
|
||||
/* Write it out */
|
||||
if (write(pfd[1], buf, i) != i) {
|
||||
msgInfo("Write failure to pkg_add! Package may be corrupt.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
close(pfd[1]);
|
||||
dev->close(dev, fd);
|
||||
if (sigpipe_caught)
|
||||
msgDebug("Caught SIGPIPE while trying to install the %s package.\n", name);
|
||||
else
|
||||
msgInfo("Package %s read successfully - waiting for pkg_add", name);
|
||||
refresh();
|
||||
i = waitpid(pid, &tot, 0);
|
||||
if (sigpipe_caught || i < 0 || WEXITSTATUS(tot)) {
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Add of package %s aborted due to some error -\n"
|
||||
"Please check the debug screen for more info.", name);
|
||||
else
|
||||
msgConfirm("Add of package %s aborted due to some error -\n"
|
||||
"Please check the debug screen for more info.", name);
|
||||
}
|
||||
else
|
||||
msgNotify("Package %s was added successfully", name);
|
||||
|
||||
/* Now catch any stragglers */
|
||||
while (wait3(&tot, WNOHANG, NULL) > 0);
|
||||
|
||||
sleep(1);
|
||||
restorescr(w);
|
||||
sigpipe_caught = FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
msgDebug("pkg_extract: get operation returned %d\n", fd);
|
||||
dialog_clear_norefresh();
|
||||
if (variable_get(VAR_NO_CONFIRM))
|
||||
msgNotify("Unable to fetch package %s from selected media.\n"
|
||||
"No package add will be done.", name);
|
||||
else {
|
||||
msgConfirm("Unable to fetch package %s from selected media.\n"
|
||||
"No package add will be done.", name);
|
||||
}
|
||||
ret = DITEM_FAILURE | DITEM_RESTORE;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
#define RELEASE_NAME "__RELEASE"
|
||||
@@ -0,0 +1,112 @@
|
||||
# alt
|
||||
# scan cntrl alt alt cntrl lock
|
||||
# code base shift cntrl shift alt shift cntrl shift state
|
||||
# ------------------------------------------------------------------
|
||||
000 nop nop nop nop nop nop nop nop O
|
||||
001 esc esc nop nop esc esc nop nop O
|
||||
002 '&' '1' nop nop '|' '|' nop nop O
|
||||
003 233 '2' nul nul '@' '@' nul nul O
|
||||
004 '"' '3' nop nop '#' '#' nop nop O
|
||||
005 ''' '4' nop nop ''' '4' nop nop O
|
||||
006 '(' '5' nop nop '(' '5' nop nop O
|
||||
007 167 '6' rs rs '^' '^' rs rs O
|
||||
008 232 '7' nop nop 232 '7' nop nop O
|
||||
009 '|' '8' nop nop '|' '8' nop nop O
|
||||
010 231 '9' nop nop '{' '{' nop nop O
|
||||
011 225 '0' nop nop '}' '}' nop nop O
|
||||
012 ')' 176 ns ns ')' 176 ns ns O
|
||||
013 '-' '_' nop nop '-' '_' nop nop O
|
||||
014 bs bs del del bs bs del del O
|
||||
015 ht btab nop nop ht btab nop nop O
|
||||
016 'a' 'A' dc1 dc1 'a' 'A' dc1 dc1 C
|
||||
017 'z' 'Z' etb etb 'z' 'Z' etb etb C
|
||||
018 'e' 'E' enq enq 'e' 'E' enq enq C
|
||||
019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C
|
||||
020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C
|
||||
021 'y' 'Y' em em 'y' 'Y' em em C
|
||||
022 'u' 'U' nak nak 'u' 'U' nak nak C
|
||||
023 'i' 'I' ht ht 'i' 'I' ht ht C
|
||||
024 'o' 'O' si si 'o' 'O' si si C
|
||||
025 'p' 'P' dle dle 'p' 'P' dle dle C
|
||||
026 '^' 168 esc esc '[' '[' esc esc O
|
||||
027 '$' '*' gs gs ']' ']' gs gs O
|
||||
028 cr cr nl nl cr cr nl nl O
|
||||
029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
|
||||
030 'q' 'Q' soh soh 'q' 'Q' soh soh C
|
||||
031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C
|
||||
032 'd' 'D' eot eot 'd' 'D' eot eot C
|
||||
033 'f' 'F' ack ack 'f' 'F' ack ack C
|
||||
034 'g' 'G' bel bel 'g' 'G' bel bel C
|
||||
035 'h' 'H' bs bs 'h' 'H' bs bs C
|
||||
036 'j' 'J' nl nl 'j' 'J' nl nl C
|
||||
037 'k' 'K' vt vt 'k' 'K' vt vt C
|
||||
038 'l' 'L' ff ff 'l' 'L' ff ff C
|
||||
039 'm' 'M' nop nop 'm' 'M' nop nop O
|
||||
040 249 '%' nop nop ''' '"' nop nop O
|
||||
041 178 nop nop nop '|' '|' nop nop O
|
||||
042 lshift lshift lshift lshift lshift lshift lshift lshift O
|
||||
043 181 163 fs fs 96 96 fs fs O
|
||||
044 'w' 'W' sub sub 'w' 'W' sub sub C
|
||||
045 'x' 'X' can can 'x' 'X' can can C
|
||||
046 'c' 'C' etx etx 'c' 'C' etx etx C
|
||||
047 'v' 'V' syn syn 'v' 'V' syn syn C
|
||||
048 'b' 'B' stx stx 'b' 'B' stx stx C
|
||||
049 'n' 'N' so so 'n' 'N' so so C
|
||||
050 ',' '?' cr cr ',' '?' cr cr C
|
||||
051 ';' '.' nop nop ';' '.' nop nop O
|
||||
052 ':' '/' nop nop ':' '/' nop nop O
|
||||
053 '=' '+' nop nop '~' '~' nop nop O
|
||||
054 rshift rshift rshift rshift rshift rshift rshift rshift O
|
||||
055 '*' '*' nscr nscr '*' '*' nscr nscr O
|
||||
056 lalt lalt lalt lalt lalt lalt lalt lalt O
|
||||
057 ' ' ' ' nul ' ' ' ' ' ' ' ' ' ' O
|
||||
058 clock clock clock clock clock clock clock clock O
|
||||
059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
|
||||
060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
|
||||
061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
|
||||
062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
|
||||
063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
|
||||
064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
|
||||
065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
|
||||
066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
|
||||
067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
|
||||
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
|
||||
069 nlock nlock nlock nlock nlock nlock nlock nlock O
|
||||
070 slock slock slock slock slock slock slock slock O
|
||||
071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
|
||||
072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
|
||||
073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
|
||||
074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
|
||||
075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
|
||||
076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
|
||||
077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
|
||||
078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
|
||||
079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
|
||||
080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
|
||||
081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
|
||||
082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
|
||||
083 del '.' '.' '.' '.' '.' boot boot N
|
||||
084 ns ns ns ns ns ns ns ns O
|
||||
085 nop nop nop nop nop nop nop nop O
|
||||
086 '>' '<' nop nop '\' '\' nop nop O
|
||||
087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
|
||||
088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
|
||||
089 cr cr nl nl cr cr nl nl O
|
||||
090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
|
||||
091 '/' '/' '/' '/' '/' '/' '/' '/' N
|
||||
092 nscr nop debug nop nop nop nop nop O
|
||||
093 ralt ralt ralt ralt ralt ralt ralt ralt O
|
||||
094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
|
||||
095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
|
||||
096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
|
||||
097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
|
||||
098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
|
||||
099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
|
||||
100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
|
||||
101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
|
||||
102 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
|
||||
103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
|
||||
104 slock slock slock slock slock slock slock slock O
|
||||
105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
|
||||
106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
|
||||
107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
|
||||
@@ -1,685 +0,0 @@
|
||||
/*+M*************************************************************************
|
||||
* Adaptec AIC7770/AIC7870 sequencer code assembler.
|
||||
*
|
||||
* Copyright (c) 1994 John Aycock
|
||||
* The University of Calgary Department of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of Calgary
|
||||
* Department of Computer Science and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Comments are started by `#' and continue to the end of the line; lines
|
||||
* may be of the form:
|
||||
* <label>*
|
||||
* <label>* <undef-sym> = <value>
|
||||
* <label>* <opcode> <operand>*
|
||||
*
|
||||
* A <label> is an <undef-sym> ending in a colon. Spaces, tabs, and commas
|
||||
* are token separators.
|
||||
*
|
||||
*-M*************************************************************************/
|
||||
static char id[] = "$Id: aic7xxx_asm.c,v 1.12 1996/03/31 03:02:35 gibbs Exp $";
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define MEMORY 448
|
||||
#define MAXLINE 1024
|
||||
#define MAXTOKEN 32
|
||||
#define ADOTOUT "a.out"
|
||||
#define NOVALUE -1
|
||||
|
||||
/*
|
||||
* AIC-7770/AIC-7870 register definitions
|
||||
*/
|
||||
#define R_SINDEX 0x65
|
||||
#define R_ALLONES 0x69
|
||||
#define R_ALLZEROS 0x6a
|
||||
#define R_NONE 0x6a
|
||||
|
||||
int debug;
|
||||
int lineno, LC;
|
||||
char *filename;
|
||||
unsigned char M[MEMORY][4];
|
||||
|
||||
void
|
||||
error(char *s)
|
||||
{
|
||||
fprintf(stderr, "%s: %s at line %d\n", filename, s, lineno);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void *
|
||||
Malloc(size_t size)
|
||||
{
|
||||
void *p = malloc(size);
|
||||
if (!p)
|
||||
error("out of memory");
|
||||
return(p);
|
||||
}
|
||||
|
||||
void *
|
||||
Realloc(void *ptr, size_t size)
|
||||
{
|
||||
void *p = realloc(ptr, size);
|
||||
if (!p)
|
||||
error("out of memory");
|
||||
return(p);
|
||||
}
|
||||
|
||||
char *
|
||||
Strdup(char *s)
|
||||
{
|
||||
char *p = (char *)Malloc(strlen(s) + 1);
|
||||
strcpy(p, s);
|
||||
return(p);
|
||||
}
|
||||
|
||||
typedef struct sym_t {
|
||||
struct sym_t *next; /* MUST BE FIRST */
|
||||
char *name;
|
||||
int value;
|
||||
int npatch;
|
||||
int *patch;
|
||||
} sym_t;
|
||||
|
||||
sym_t *head;
|
||||
|
||||
void
|
||||
define(char *name, int value)
|
||||
{
|
||||
sym_t *p, *q;
|
||||
|
||||
for (p = head, q = (sym_t *)&head; p; p = p->next) {
|
||||
if (!strcmp(p->name, name))
|
||||
error("redefined symbol");
|
||||
q = p;
|
||||
}
|
||||
|
||||
p = q->next = (sym_t *)Malloc(sizeof(sym_t));
|
||||
p->next = NULL;
|
||||
p->name = Strdup(name);
|
||||
p->value = value;
|
||||
p->npatch = 0;
|
||||
p->patch = NULL;
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr, "\"%s\" ", p->name);
|
||||
if (p->value != NOVALUE)
|
||||
fprintf(stderr, "defined as 0x%x\n", p->value);
|
||||
else
|
||||
fprintf(stderr, "undefined\n");
|
||||
}
|
||||
}
|
||||
|
||||
sym_t *
|
||||
lookup(char *name)
|
||||
{
|
||||
sym_t *p;
|
||||
|
||||
for (p = head; p; p = p->next)
|
||||
if (!strcmp(p->name, name))
|
||||
return(p);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void
|
||||
patch(sym_t *p, int location)
|
||||
{
|
||||
p->npatch += 1;
|
||||
p->patch = (int *)Realloc(p->patch, p->npatch * sizeof(int *));
|
||||
|
||||
p->patch[p->npatch - 1] = location;
|
||||
}
|
||||
|
||||
void backpatch(void)
|
||||
{
|
||||
int i;
|
||||
sym_t *p;
|
||||
|
||||
for (p = head; p; p = p->next) {
|
||||
|
||||
if (p->value == NOVALUE) {
|
||||
fprintf(stderr,
|
||||
"%s: undefined symbol \"%s\"\n",
|
||||
filename, p->name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (p->npatch) {
|
||||
if (debug)
|
||||
fprintf(stderr,
|
||||
"\"%s\" (0x%x) patched at",
|
||||
p->name, p->value);
|
||||
|
||||
for (i = 0; i < p->npatch; i++) {
|
||||
M[p->patch[i]][0] &= ~1;
|
||||
M[p->patch[i]][0] |= ((p->value >> 8) & 1);
|
||||
M[p->patch[i]][1] = p->value & 0xff;
|
||||
|
||||
if (debug)
|
||||
fprintf(stderr, " 0x%x", p->patch[i]);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
fputc('\n', stderr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Output words in byte-reversed order (least significant first)
|
||||
* since the sequencer RAM is loaded that way.
|
||||
*/
|
||||
void
|
||||
output(FILE *fp)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < LC; i++)
|
||||
fprintf(fp, "\t0x%02x, 0x%02x, 0x%02x, 0x%02x,\n",
|
||||
M[i][3],
|
||||
M[i][2],
|
||||
M[i][1],
|
||||
M[i][0]);
|
||||
printf("%d out of %d instructions used.\n", LC, MEMORY);
|
||||
}
|
||||
|
||||
char **
|
||||
getl(int *n)
|
||||
{
|
||||
int i;
|
||||
char *p, *quote;
|
||||
static char buf[MAXLINE];
|
||||
static char *a[MAXTOKEN];
|
||||
|
||||
i = 0;
|
||||
|
||||
while (fgets(buf, sizeof(buf), stdin)) {
|
||||
|
||||
lineno += 1;
|
||||
|
||||
if (buf[strlen(buf)-1] != '\n')
|
||||
error("line too long");
|
||||
|
||||
p = strchr(buf, '#');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
p = buf;
|
||||
rescan:
|
||||
quote = strchr(p, '\"');
|
||||
if (quote)
|
||||
*quote = '\0';
|
||||
for (p = strtok(p, ", \t\n"); p; p = strtok(NULL, ", \t\n"))
|
||||
if (i < MAXTOKEN-1)
|
||||
a[i++] = p;
|
||||
else
|
||||
error("too many tokens");
|
||||
if (quote) {
|
||||
quote++;
|
||||
p = strchr(quote, '\"');
|
||||
if (!p)
|
||||
error("unterminated string constant");
|
||||
else if (i < MAXTOKEN-1) {
|
||||
a[i++] = quote;
|
||||
*p = '\0';
|
||||
p++;
|
||||
}
|
||||
else
|
||||
error("too many tokens");
|
||||
goto rescan;
|
||||
}
|
||||
if (i) {
|
||||
*n = i;
|
||||
return(a);
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
#define A 0x8000 /* `A'ccumulator ok */
|
||||
#define I 0x4000 /* use as immediate value */
|
||||
#define SL 0x2000 /* shift left */
|
||||
#define SR 0x1000 /* shift right */
|
||||
#define RL 0x0800 /* rotate left */
|
||||
#define RR 0x0400 /* rotate right */
|
||||
#define LO 0x8000 /* lookup: ori-{jmp,jc,jnc,call} */
|
||||
#define LA 0x4000 /* lookup: and-{jz,jnz} */
|
||||
#define LX 0x2000 /* lookup: xor-{je,jne} */
|
||||
#define NA -1 /* not applicable */
|
||||
|
||||
struct {
|
||||
char *name;
|
||||
int n; /* number of operands, including opcode */
|
||||
unsigned int op; /* immediate or L?|pos_from_0 */
|
||||
unsigned int dest; /* NA, pos_from_0, or I|immediate */
|
||||
unsigned int src; /* NA, pos_from_0, or I|immediate */
|
||||
unsigned int imm; /* pos_from_0, A|pos_from_0, or I|immediate */
|
||||
unsigned int addr; /* NA or pos_from_0 */
|
||||
int fmt; /* instruction format - 1, 2, or 3 */
|
||||
} instr[] = {
|
||||
/*
|
||||
* N OP DEST SRC IMM ADDR FMT
|
||||
*/
|
||||
{ "mov", 3, 1, 1, 2, I|0xff, NA, 1 },
|
||||
{ "mov", 4, LO|2, NA, 1, I|0, 3, 3 },
|
||||
{ "mvi", 3, 0, 1, I|R_ALLZEROS, A|2, NA, 1 },
|
||||
{ "mvi", 4, LO|2, NA, I|R_ALLZEROS, 1, 3, 3 },
|
||||
{ "not", 2, 2, 1, 1, I|0xff, NA, 1 },
|
||||
{ "and", 3, 1, 1, 1, A|2, NA, 1 },
|
||||
{ "and", 4, 1, 1, 3, A|2, NA, 1 },
|
||||
{ "or", 3, 0, 1, 1, A|2, NA, 1 },
|
||||
{ "or", 4, 0, 1, 3, A|2, NA, 1 },
|
||||
{ "or", 5, LO|3, NA, 1, 2, 4, 3 },
|
||||
{ "xor", 3, 2, 1, 1, A|2, NA, 1 },
|
||||
{ "xor", 4, 2, 1, 3, A|2, NA, 1 },
|
||||
{ "nop", 1, 1, I|R_NONE, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ "inc", 2, 3, 1, 1, I|1, NA, 1 },
|
||||
{ "inc", 3, 3, 1, 2, I|1, NA, 1 },
|
||||
{ "dec", 2, 3, 1, 1, I|0xff, NA, 1 },
|
||||
{ "dec", 3, 3, 1, 2, I|0xff, NA, 1 },
|
||||
{ "jmp", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "jc", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "jnc", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "call", 2, LO|0, NA, I|R_SINDEX, I|0, 1, 3 },
|
||||
{ "test", 5, LA|3, NA, 1, A|2, 4, 3 },
|
||||
{ "cmp", 5, LX|3, NA, 1, A|2, 4, 3 },
|
||||
{ "ret", 1, 1, I|R_NONE, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ "ret", 1, 1, I|R_NONE, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ "clc", 1, 3, I|R_NONE, I|R_ALLZEROS, I|1, NA, 1 },
|
||||
{ "clc", 4, 3, 2, I|R_ALLZEROS, A|3, NA, 1 },
|
||||
{ "stc", 2, 3, 1, I|R_ALLONES, I|1, NA, 1 },
|
||||
{ "add", 3, 3, 1, 1, A|2, NA, 1 },
|
||||
{ "add", 4, 3, 1, 3, A|2, NA, 1 },
|
||||
{ "adc", 3, 4, 1, 1, A|2, NA, 1 },
|
||||
{ "adc", 4, 4, 1, 3, A|2, NA, 1 },
|
||||
{ "shl", 3, 5, 1, 1, SL|2, NA, 2 },
|
||||
{ "shl", 4, 5, 1, 2, SL|3, NA, 2 },
|
||||
{ "shr", 3, 5, 1, 1, SR|2, NA, 2 },
|
||||
{ "shr", 4, 5, 1, 2, SR|3, NA, 2 },
|
||||
{ "rol", 3, 5, 1, 1, RL|2, NA, 2 },
|
||||
{ "rol", 4, 5, 1, 2, RL|3, NA, 2 },
|
||||
{ "ror", 3, 5, 1, 1, RR|2, NA, 2 },
|
||||
{ "ror", 4, 5, 1, 2, RR|3, NA, 2 },
|
||||
/*
|
||||
* Extensions (note also that mvi allows A)
|
||||
*/
|
||||
{ "clr", 2, 1, 1, I|R_ALLZEROS, I|0xff, NA, 1 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
int
|
||||
eval_operand(char **a, int spec)
|
||||
{
|
||||
int i;
|
||||
unsigned int want = spec & (LO|LA|LX);
|
||||
|
||||
static struct {
|
||||
unsigned int what;
|
||||
char *name;
|
||||
int value;
|
||||
} jmptab[] = {
|
||||
{ LO, "jmp", 8 },
|
||||
{ LO, "jc", 9 },
|
||||
{ LO, "jnc", 10 },
|
||||
{ LO, "call", 11 },
|
||||
{ LA, "jz", 15 },
|
||||
{ LA, "jnz", 13 },
|
||||
{ LX, "je", 14 },
|
||||
{ LX, "jne", 12 },
|
||||
};
|
||||
|
||||
spec &= ~(LO|LA|LX);
|
||||
|
||||
for (i = 0; i < sizeof(jmptab)/sizeof(jmptab[0]); i++)
|
||||
if (jmptab[i].what == want &&
|
||||
!strcmp(jmptab[i].name, a[spec]))
|
||||
{
|
||||
return(jmptab[i].value);
|
||||
}
|
||||
|
||||
if (want)
|
||||
error("invalid jump");
|
||||
|
||||
return(spec); /* "case 0" - no flags set */
|
||||
}
|
||||
|
||||
int
|
||||
eval_sdi(char **a, int spec)
|
||||
{
|
||||
sym_t *p;
|
||||
unsigned val;
|
||||
|
||||
if (spec == NA)
|
||||
return(NA);
|
||||
|
||||
switch (spec & (A|I|SL|SR|RL|RR)) {
|
||||
case SL:
|
||||
case SR:
|
||||
case RL:
|
||||
case RR:
|
||||
if (isdigit(*a[spec &~ (SL|SR|RL|RR)]))
|
||||
val = strtol(a[spec &~ (SL|SR|RL|RR)], NULL, 0);
|
||||
else {
|
||||
p = lookup(a[spec &~ (SL|SR|RL|RR)]);
|
||||
if (!p)
|
||||
error("undefined symbol used");
|
||||
val = p->value;
|
||||
}
|
||||
|
||||
switch (spec & (SL|SR|RL|RR)) { /* blech */
|
||||
case SL:
|
||||
if (val > 7)
|
||||
return(0xf0);
|
||||
return(((val % 8) << 4) |
|
||||
(val % 8));
|
||||
case SR:
|
||||
if (val > 7)
|
||||
return(0xf0);
|
||||
return(((val % 8) << 4) |
|
||||
(1 << 3) |
|
||||
((8 - (val % 8)) % 8));
|
||||
case RL:
|
||||
return(val % 8);
|
||||
case RR:
|
||||
return((8 - (val % 8)) % 8);
|
||||
}
|
||||
case I:
|
||||
return(spec &~ I);
|
||||
case A:
|
||||
/*
|
||||
* An immediate field of zero selects
|
||||
* the accumulator. Vigorously object
|
||||
* if zero is given otherwise - it's
|
||||
* most likely an error.
|
||||
*/
|
||||
spec &= ~A;
|
||||
if (!strcmp("A", a[spec]))
|
||||
return(0);
|
||||
if (isdigit(*a[spec]) &&
|
||||
strtol(a[spec], NULL, 0) == 0)
|
||||
{
|
||||
error("immediate value of zero selects accumulator");
|
||||
}
|
||||
/* falls through */
|
||||
case 0:
|
||||
if (isdigit(*a[spec]))
|
||||
return(strtol(a[spec], NULL, 0));
|
||||
p = lookup(a[spec]);
|
||||
if (p)
|
||||
return(p->value);
|
||||
error("undefined symbol used");
|
||||
}
|
||||
|
||||
return(NA); /* shut the compiler up */
|
||||
}
|
||||
|
||||
int
|
||||
eval_addr(char **a, int spec)
|
||||
{
|
||||
sym_t *p;
|
||||
|
||||
if (spec == NA)
|
||||
return(NA);
|
||||
if (isdigit(*a[spec]))
|
||||
return(strtol(a[spec], NULL, 0));
|
||||
|
||||
p = lookup(a[spec]);
|
||||
|
||||
if (p) {
|
||||
if (p->value != NOVALUE)
|
||||
return(p->value);
|
||||
patch(p, LC);
|
||||
} else {
|
||||
define(a[spec], NOVALUE);
|
||||
p = lookup(a[spec]);
|
||||
patch(p, LC);
|
||||
}
|
||||
|
||||
return(NA); /* will be patched in later */
|
||||
}
|
||||
|
||||
int
|
||||
crack(char **a, int n)
|
||||
{
|
||||
int i;
|
||||
int I_imm, I_addr;
|
||||
int I_op, I_dest, I_src, I_ret;
|
||||
|
||||
/*
|
||||
* Check for "ret" at the end of the line; remove
|
||||
* it unless it's "ret" alone - we still want to
|
||||
* look it up in the table.
|
||||
*/
|
||||
I_ret = (strcmp(a[n-1], "ret") ? 0 : !0);
|
||||
if (I_ret && n > 1)
|
||||
n -= 1;
|
||||
|
||||
for (i = 0; instr[i].name; i++) {
|
||||
/*
|
||||
* Look for match in table given constraints,
|
||||
* currently just the name and the number of
|
||||
* operands.
|
||||
*/
|
||||
if (!strcmp(instr[i].name, *a) && instr[i].n == n)
|
||||
break;
|
||||
}
|
||||
if (!instr[i].name)
|
||||
error("unknown opcode or wrong number of operands");
|
||||
|
||||
I_op = eval_operand(a, instr[i].op);
|
||||
I_src = eval_sdi(a, instr[i].src);
|
||||
I_imm = eval_sdi(a, instr[i].imm);
|
||||
I_dest = eval_sdi(a, instr[i].dest);
|
||||
I_addr = eval_addr(a, instr[i].addr);
|
||||
|
||||
if( LC >= MEMORY )
|
||||
error("Memory exhausted!\n");
|
||||
|
||||
switch (instr[i].fmt) {
|
||||
case 1:
|
||||
case 2:
|
||||
M[LC][0] = (I_op << 1) | I_ret;
|
||||
M[LC][1] = I_dest;
|
||||
M[LC][2] = I_src;
|
||||
M[LC][3] = I_imm;
|
||||
break;
|
||||
case 3:
|
||||
if (I_ret)
|
||||
error("illegal use of \"ret\"");
|
||||
M[LC][0] = (I_op << 1) | ((I_addr >> 8) & 1);
|
||||
M[LC][1] = I_addr & 0xff;
|
||||
M[LC][2] = I_src;
|
||||
M[LC][3] = I_imm;
|
||||
break;
|
||||
}
|
||||
|
||||
return (1); /* no two-byte instructions yet */
|
||||
}
|
||||
|
||||
#undef SL
|
||||
#undef SR
|
||||
#undef RL
|
||||
#undef RR
|
||||
#undef LX
|
||||
#undef LA
|
||||
#undef LO
|
||||
#undef I
|
||||
#undef A
|
||||
|
||||
void
|
||||
assemble(FILE *ofile)
|
||||
{
|
||||
int n;
|
||||
char **a;
|
||||
sym_t *p;
|
||||
|
||||
while ((a = getl(&n))) {
|
||||
|
||||
while (a[0][strlen(*a)-1] == ':') {
|
||||
a[0][strlen(*a)-1] = '\0';
|
||||
p = lookup(*a);
|
||||
if (p)
|
||||
p->value = LC;
|
||||
else
|
||||
define(*a, LC);
|
||||
a += 1;
|
||||
n -= 1;
|
||||
}
|
||||
|
||||
if (!n) /* line was all labels */
|
||||
continue;
|
||||
|
||||
if (n == 3 && !strcmp("VERSION", *a))
|
||||
fprintf(ofile, "#define %s \"%s\"\n", a[1], a[2]);
|
||||
else {
|
||||
if (n == 3 && !strcmp("=", a[1]))
|
||||
define(*a, strtol(a[2], NULL, 0));
|
||||
else
|
||||
LC += crack(a, n);
|
||||
}
|
||||
}
|
||||
|
||||
backpatch();
|
||||
output(ofile);
|
||||
|
||||
if (debug)
|
||||
output(stderr);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
int pid;
|
||||
int ifile;
|
||||
FILE *ofile;
|
||||
int fd[2];
|
||||
|
||||
ofile = NULL;
|
||||
while ((c = getopt(argc, argv, "dho:vD:")) != EOF) {
|
||||
switch (c) {
|
||||
case 'd':
|
||||
debug = !0;
|
||||
break;
|
||||
case 'D':
|
||||
{
|
||||
char *p;
|
||||
if ((p = strchr(optarg, '=')) != NULL) {
|
||||
*p = '\0';
|
||||
define(optarg, strtol(p + 1, NULL, 0));
|
||||
}
|
||||
else
|
||||
define(optarg, 1);
|
||||
break;
|
||||
}
|
||||
case 'o':
|
||||
|
||||
if ((ofile = fopen(optarg, "w")) == NULL) {
|
||||
perror(optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'h':
|
||||
printf("usage: %s [-d] [-Dname] [-ooutput] input\n",
|
||||
*argv);
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
case 'v':
|
||||
printf("%s\n", id);
|
||||
exit(EXIT_SUCCESS);
|
||||
break;
|
||||
default:
|
||||
exit(EXIT_FAILURE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc - optind != 1) {
|
||||
fprintf(stderr, "%s: must have one input file\n", *argv);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
filename = argv[optind];
|
||||
|
||||
|
||||
if ((ifile = open(filename, O_RDONLY)) < 0) {
|
||||
perror(filename);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!ofile) {
|
||||
if ((ofile = fopen(ADOTOUT, "w")) == NULL) {
|
||||
perror(ADOTOUT);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
if (pipe(fd) < 0) {
|
||||
perror("pipe failed");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((pid = fork()) < 0 ) {
|
||||
perror("fork failed");
|
||||
exit(1);
|
||||
}
|
||||
else if (pid > 0) { /* Parent */
|
||||
close(fd[1]); /* Close write end */
|
||||
if (fd[0] != STDIN_FILENO) {
|
||||
if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) {
|
||||
perror("dup2 error on stdin");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
close(fd[0]);
|
||||
}
|
||||
assemble(ofile);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
else { /* Child */
|
||||
close(fd[0]); /* Close Read end */
|
||||
if (fd[1] != STDOUT_FILENO) {
|
||||
if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) {
|
||||
perror("dup2 error on stdout");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
close(fd[1]);
|
||||
}
|
||||
if (ifile != STDIN_FILENO) {
|
||||
if (dup2(ifile, STDIN_FILENO) != STDIN_FILENO) {
|
||||
perror("dup2 error on stdin");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
close(ifile);
|
||||
}
|
||||
execl("/usr/bin/cpp", "/usr/bin/cpp", "-P", "-", "-", NULL);
|
||||
}
|
||||
return(EXIT_SUCCESS);
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
* deutsche Geschichte
|
||||
*
|
||||
*
|
||||
* Die Angaben wurden überwiegend entnommen aus dem Buch:
|
||||
*
|
||||
* Fragen an die deutsch Geschichte, Ideen, Kräfte, Entscheidungen von
|
||||
* 1800 bis zur Gegenwart; historische Ausstellung im Reichstagsgebäude
|
||||
* in Berlin; Katalog, 16. Auflage, Sonderausgabe - Bonn: Deutscher
|
||||
* Bundestag, Referat Öffentlichkeitsarbeit, 1990
|
||||
*
|
||||
* English Title: Question on German history
|
||||
*
|
||||
* ISBN 3-924521-59-X
|
||||
*
|
||||
* $Id: calendar.geschichte,v 1.2 1996/02/02 06:05:15 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef _de_DE_ISO_8859_1_geschichte_
|
||||
#define _de_DE_ISO_8859_1_geschichte_
|
||||
|
||||
LANG=de_DE.ISO_8859-1
|
||||
|
||||
/* 1800-1933 */
|
||||
07/11 Gründung der Rheinbundes, 1806
|
||||
10/14 Doppelschlacht bei Jena und Auerstedt, 1806
|
||||
10/16 Völkerschlacht bei Leipzig, 1813
|
||||
06/18 Niederlage Napoleons bei Waterloo, 1815
|
||||
10/18 Wartburgfest der Deutschen Burschenschaften, 1817
|
||||
01/01 Inkrafttreten des Vertrages über den deutschen. Zollverein, 1834
|
||||
12/07 erste deutsche Eisenbahn zwischen Nürnberg und Fürth, 1835
|
||||
06 Aufstand der schlesischen Weber, 1844
|
||||
12/21 Verabschiedung des Gesetzes über die Grundrechte des deutschen
|
||||
Volkes durch die Frankfurter Nationalversammlung, 1848
|
||||
03/27 Annahme der deutschen Reichsverfassung in der Frankfurter
|
||||
Paulskirche, Wahl von Friedrich Wilhelm IV von Preußen zum
|
||||
deutschen Kaiser, 1849
|
||||
04/28 Ablehnung der deutschen Kaiserkrone durch den preußichen König, 1849
|
||||
07/03 Schlacht von Königgrätz
|
||||
07/13 Emser Depesche, 1870
|
||||
07/18 Verkündung des Dogmas von der päpstlichen Unfehlbarkeit
|
||||
durch das I. Vatikanische Konzil
|
||||
01/18 Proklamation des deutschen Kaiserreiches in Versailles, 1871
|
||||
10/18 Verabschiedung des Sozialistengesetzes durch den Reichstag, 1878
|
||||
03/20 Entlassung von Bismarck als Reichskanzler und
|
||||
preußischer Ministerpräsident, 1890
|
||||
06/21 Eröffnung des Nord-Ostsee-Kanals, 1895
|
||||
01/07 Billigung des Bürgerlichen Gesetzbuches (BGB) durch den Reichstag, 1896
|
||||
01/01 Bürgerliches Gesetzbuches tritt in Kraft, 1900
|
||||
06/28 Ermordung des österreichischen Thronfolgers Erzherzog Franz
|
||||
Ferdinand durch serbische Nationalisten in Sarajewo, 1914
|
||||
07/28 Kriegserklärung Österreich-Ungarns an Serbien, 1914
|
||||
08/01 Deutsche Mobilmachung und Kriegserklärung an Rußland, 1914
|
||||
08/03 Deutsche Kriegserklärung an Frankreich, 1914
|
||||
08/04 Kriegserklärung Großbritaniens an Deutschland, 1914
|
||||
08/04 Bewilligung der Kriegskredite im Reichstag, 1914
|
||||
08/26 Schlacht bei Tannenberg, 1914
|
||||
02/21 Schlacht um Verdun, 1916
|
||||
03/08 Ausbruch der Revolution in Rußland, Abdankung von Zar Nikolaus II, 1917
|
||||
04/06 Kriegserklärung der USA an Deutschland
|
||||
12/15 Waffenstillstand zwisch Rußland und Deutschland, 1917
|
||||
03/03 Frieden von Brest-Litowsk, 1918
|
||||
11/03 Matrosenaufstand in Kiel, 1918
|
||||
11/09 Ausrufung der Republik durch Scheidemann (SPD), 1918
|
||||
02/11 Friedrich Ebert wird Reichspräsident, Weimar 1919
|
||||
06/28 Unterzeichnung des Versailler Vertrages, 1919
|
||||
03/21 Volksabstimmung in Oberschlesien, 1921
|
||||
04/16 Vertrag von Rapallo, 1922
|
||||
06/24 Ermordung von Reichsaußenminister Rathenau, 1922
|
||||
01/11 Besetzung des Ruhrgebietes durch Frankreich+Belgien, 1923
|
||||
09/10 Eintritt Deutschlands in den Völkerbund, 1926
|
||||
10/25 Schwarzer Freitag in New York, Beginn der Weltwirtschaftskrise, 1929
|
||||
|
||||
|
||||
/* II. Weltkrieg */
|
||||
10/14 Austritt auf dem Völkerbund, 1933
|
||||
03/16 Wiedereinführung der allgemeinen Wehrpflicht, 1935
|
||||
10/25 Deutsch-italienischer Vertrag, Achse Berlin-Rom, 1936
|
||||
11/25 Antikominternpakt zwischen Deutschland und Japan, 1936
|
||||
01/13 Volksabstimmung im Saargebiet über die Rückführung ins Reich, 1935
|
||||
03/12 Einmarsch deutscher Truppen in Österreich, 1938
|
||||
09/29 Münchner Abkommen, 1938
|
||||
03/15 Einmarsch deutscher Truppen in die Tschechoslowakei, 1939
|
||||
03/23 Rückgabe des Memelgebietes an Deutschland, 1939
|
||||
08/23 Abschluß des Hitler-Stalin-Paktes, 1939
|
||||
09/03 Kriegserklärung Großbritaniens und Frankreichs an Deutschland, 1939
|
||||
04/09 Besetzung Dänemarks, Invasion in Norwegen, 1940
|
||||
05/10 Deutscher Angriff auf Belgien, die Niederlande, Luxemburg
|
||||
und Frankreich, 1940
|
||||
06/22 Angriff gegen die Sowjetunion, 1941
|
||||
12/11 Kriegserklärung Deutschlands an die USA, 1941
|
||||
01/14 Konferenz von Casablanca, 1943
|
||||
01/31 Kapitulation der 6. deutschen Armee in Stalingrad, 1943
|
||||
06/06 Alliierte Landung in Nordwestfrankreich, 1944
|
||||
02/04 Konferenz von Jalta, 4.-11.2. 1945
|
||||
04/25 Zusammentreffen von amerikanischen und sowjetischer Truppen
|
||||
bei Torgau an der Elbe, 1945
|
||||
05/08 Bedingungslose Kapitulation von Deutschland, 1945
|
||||
07/01 Rückzug der britischen und amerikanischen Truppen aus
|
||||
Sachsen, Thüringen und Mecklenburg, Einmarsch westlicher
|
||||
Truppen in Berlin, 1945
|
||||
07/17 Potsdammer Konferenz, 1945
|
||||
09/01 Überfall auf Polen, Beginn des 2. Weltkrieges, 1939
|
||||
10/01 Verkündigung der Urteile im Nürnberger
|
||||
Hauptkriegsverbrecherprozeß, 1946
|
||||
02/25 Auflösung der Landes Preußen durch den Kontrollrat, 1947
|
||||
08/06 erster Atombombenabwurf auf Hiroshima, 1945
|
||||
08/08 Atombombenabwurf auf Nagasaki, 1945
|
||||
04/19 Warschauer Ghetto Aufstand, 1943
|
||||
12/07 Japan bombardiert Pearl Harbor, 1941
|
||||
|
||||
/* Deutschland nach dem 2. Weltkrieg */
|
||||
04/11 Attentat auf Dutschke, Studentenunruhen, 1958
|
||||
04/26 GAU in Tschernobyl
|
||||
05/05 Natobeitritt, Wiederbewaffnung, Souveränität der Bundesrepublik, 1955
|
||||
05/06 Rücktritt von Brandt, 1974
|
||||
05/16 Wahl von Schmidt (SPD) zum Bundeskanzler, 1974
|
||||
05/23 Verkündung des Grundgesetzes
|
||||
05/23 Wahl von Richard von Weizäcker zum Bundespräsidenten, 1984
|
||||
06/05 Marshallplan, 1947
|
||||
06/20 Währungsreform in den Westzonen, 1948
|
||||
06/24 Beginn der Berliner Blockade, 1948
|
||||
07/01 Wahl von Heinrich Lübke zum Bundespräsidenten, 1959
|
||||
07/01 Währungs- und Währungsunion, 1990
|
||||
08/12 deutsch-sowjetischer Gewaltverzichtsvertrag, Moskau 1970
|
||||
08/14 Wahl zum ersten deutschen Bundestag, 1949
|
||||
09/03 Vier-Mächte-Abkommen über Berlin, 1971
|
||||
09/05 Entführung und Ermordung von Arbeitgeberpräsident Schleyer, Entführung einer Lufthansa-Maschine nach Mogadischu, 1977
|
||||
09/07 DDR-Staatsratsvorsitzender Honecker in der Bundesrepublik, 1987
|
||||
09/12 Wahl von Theodor Heuss (FDP) zum Bundespräsidenten, 1949
|
||||
09/15 Wahl von Konrad Adenauer (CDU) zum Bundeskanzler, 1949
|
||||
09/17 Bruch der Sozialliberalen Koalition, 1982
|
||||
09/18 Aufnahme von Bundesrepublik und DDR in die UNO, 1993
|
||||
10/01 Ablösung von Bundeskanzler Schmidt durch Kohl, 1982
|
||||
10/23 Volksabstimmung im Saargebiet, 1955
|
||||
12/02 Washingtoner Abkommen über Bi-Zone, 1946
|
||||
12/07 deutsch-polnischer Vertrag, Warschau 1970
|
||||
12/10 Friedensnobelpreis für Brandt, 1971
|
||||
12/12 Nachrüstungsbeschluß des NATO-Ministerates, 1979
|
||||
12/21 Grundlagenvertrag zwischen DDR und Bundesrepublik, 1972
|
||||
|
||||
|
||||
/* Nationalsozialismus */
|
||||
11/09 Hitler-Putsch in München/Marsch auf die Feldherrenhalle, 1923
|
||||
11/09 Reichskristallnacht, 1938
|
||||
09/14 Reichstagswahl: Erdrutsch zugunsten der NSDAP, 1930
|
||||
07/31 Reichstagswahl: NSDAP wird stärkste Fraktion, 1932
|
||||
11/06 Reichstagswahl: Rückgang der NSDAP, 1932
|
||||
01/30 Ernennung von Hitler zum Reichskanzler, 1933
|
||||
02/27 Reichstagsbrand, 1933
|
||||
03/05 Reichstagswahl: Mehrheit für NSDAP+DNVP, 1933
|
||||
03/23 Annahme des Ermächtigungsgesetzes, 1933
|
||||
03/31 Erstes Gesetz zur Gleichschaltung der Länder, 1933
|
||||
04/01 Organisierter Boykott jüdischer Geschäfte, 1933
|
||||
04/07 Zweites Gesetz zur Gleichschaltung der Länder, 1933
|
||||
05/02 Auflösung der Gewerkschaften, 1933
|
||||
06 Auflösung aller Parteien außer NSDAP, 1933
|
||||
07/20 Konkordat zwischen Deutschland und dem Vatikan, 1933
|
||||
06/30 Röhm-Putsch, Ausschaltung der SA-Führung, 1934
|
||||
09/15 Nürnberger Gesetze, 1935
|
||||
01/08 Eröffnung der olympischen Spiele in Berlin, 1936
|
||||
01/20 Wannseekonferenz, 1942
|
||||
04/30 Selbstmord Hitlers, 1945
|
||||
07/29 Mussolini geboren, 1883
|
||||
|
||||
/* Sozialismus */
|
||||
01/21 Lenin gestorben, 1924
|
||||
06 Gründung des Bundes der Kommunisten in London durch Marx+Engels, 1847
|
||||
05/23 Gründung des Allgemeinen Deutschen Arbeitervereins in Leipzig
|
||||
unter Führung von Ferdinand Lassalles, 1863
|
||||
08/07 Gründung der Sozialdemokratischen Arbeiterpartei in Eisenach
|
||||
unter der Führung von August Begel und Wilhelm Liebknecht, 1869
|
||||
04/06 Gründung der Unabhängigen Sozialdemokratischen Partei, Gotha 1917
|
||||
11/07 Oktoberrevolution in Rußland, Putsch der Bolschewisten, 1917
|
||||
12/31 Gründung der KPD, 1918
|
||||
01/15 Ermordung von Rosa Luxemburg und Karl Liebknecht, 1919
|
||||
03/05 Tod Stalins, 1953
|
||||
03/18 Erste demokratische Volkskammerwahl, 1990
|
||||
04/21 Zwangsvereinigung von KPD und SPD zur SED, 1946
|
||||
05/14 Gründung der Warschauer Paktes, 1955
|
||||
06/17 Arbeiteraufstand am 17. Juni 1953
|
||||
06/25 Begin der Korea-Krieges, 1950
|
||||
08/13 Bau der Berliner Mauer, 1961
|
||||
08/21 Einmarsch des Warschauer Pakts in die Tschechoslowakei, 1968
|
||||
10/03 Offizielles Ende der DDR :-)
|
||||
10/07 Gründung der DDR 1949
|
||||
10/09 Massendemonstration in Leipzig, 1989
|
||||
10/14 Kuba-Krise, 1962
|
||||
10/18 Ablösung von Erich Honecker als SED-Generalsekretär, 1989
|
||||
11/09 Fall der Berliner Mauer, 1989
|
||||
09/09 Mao Tse-Tung gestorben im Alter von 82 Jahren, 1976
|
||||
11/10 Sowjetischer Präsident Leonid Breschnew gestorben, Alter 75, 1982
|
||||
03/27 Chruschtschow wird sowjetischer Präsident, 1958
|
||||
10/12 Chruschtschow schlägt während einer Rede in der UNO mit den
|
||||
Schuhen auf den Tisch, 1960
|
||||
|
||||
#endif /* _de_DE_ISO_8859_1_geschichte_ */
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Kirche in Deutschland
|
||||
*
|
||||
* $Id: calendar.kirche,v 1.2 1996/02/02 06:05:16 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef _de_DE_ISO_8859_1_kirche_
|
||||
#define _de_DE_ISO_8859_1_kirche_
|
||||
|
||||
LANG=de_DE.ISO_8859-1
|
||||
|
||||
Easter-46 Aschermittwoch
|
||||
Easter-48 Rosenmontag
|
||||
Easter-7 Palmsonntag
|
||||
|
||||
11/Sun-3 Volkstrauertag (maybe)
|
||||
11/Sun-2 Volkstrauertag oder Totensonntag
|
||||
11/Sun-1 1. Advent oder Totensonntag
|
||||
12/Sun+1 1. oder 2. Advent
|
||||
12/Sun+2 2. oder 3. Advent
|
||||
12/Sun+3 3. oder 4. Advent
|
||||
12/Sun+4 4. Advent (maybe)
|
||||
|
||||
12/06 Nikolaus
|
||||
12/25 1. Weihnachtstag
|
||||
12/26 2. Weihnachtstag
|
||||
|
||||
/* Evangelische Kirche */
|
||||
11/10 Martin Luther geboren in Eisleben, 1483
|
||||
10/31 95 Thesen von Luther, Wittenberg, 1517
|
||||
|
||||
#endif /* !_de_DE_ISO_8859_1_kirche_ */
|
||||
@@ -1,48 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
#
|
||||
# This is a generic configuration file for NEXTSTEP 3.3 systems.
|
||||
# It has support for local and SMTP mail only. If you want to
|
||||
# customize it, copy it to a name appropriate for your environment
|
||||
# and do the modifications there.
|
||||
#
|
||||
|
||||
divert(0)dnl
|
||||
VERSIONID(`@(#)generic-nextstep3.3.mc 8.2 (Berkeley) 3/23/96')
|
||||
OSTYPE(nextstep)dnl
|
||||
DOMAIN(generic)dnl
|
||||
MAILER(local)dnl
|
||||
MAILER(smtp)dnl
|
||||
@@ -1,40 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)genericstable.m4 8.1 (Berkeley) 2/11/96')
|
||||
divert(-1)
|
||||
|
||||
define(`GENERICS_TABLE', ifelse(_ARG_, `', `hash -o /etc/genericstable', `_ARG_'))dnl
|
||||
@@ -1,40 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)limited_masquerade.m4 8.1 (Berkeley) 2/11/96')
|
||||
divert(-1)
|
||||
|
||||
define(`_LIMITED_MASQUERADE_', 1)
|
||||
@@ -1,40 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)masquerade_entire_domain.m4 8.1 (Berkeley) 2/11/96')
|
||||
divert(-1)
|
||||
|
||||
define(`_MASQUERADE_ENTIRE_DOMAIN_', 1)
|
||||
@@ -1,40 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)virtusertable.m4 8.1 (Berkeley) 2/11/96')
|
||||
divert(-1)
|
||||
|
||||
define(`VIRTUSER_TABLE', ifelse(_ARG_, `', `hash -o /etc/virtusertable', `_ARG_'))dnl
|
||||
@@ -1,41 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1995 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)aix2.m4 8.2 (Berkeley) 9/19/96')
|
||||
define(`LOCAL_MAILER_PATH', /bin/bellmail)dnl
|
||||
define(`LOCAL_MAILER_ARGS', mail $u)dnl
|
||||
define(`LOCAL_MAILER_FLAGS', `mn9')dnl
|
||||
define(`confTIME_ZONE', `USE_TZ')dnl
|
||||
@@ -1,49 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1996 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# Contributed by Tim Rice <[email protected]>.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)altos.m4 8.3 (Berkeley) 9/25/96')
|
||||
|
||||
define(`ALIAS_FILE', /usr/lib/mail/aliases)dnl
|
||||
ifdef(`QUEUE_DIR',, `define(`QUEUE_DIR', /usr/spool/mqueue)')dnl
|
||||
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /usr/lib/sendmail.st)')dnl
|
||||
ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')dnl
|
||||
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', /usr/bin/lmail)')dnl
|
||||
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', mPuhCE9)')dnl
|
||||
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `lmail $u')')dnl
|
||||
ifdef(`LOCAL_SHELL_FLAGS',, `define(`LOCAL_SHELL_FLAGS', Peu)')dnl
|
||||
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')dnl
|
||||
@@ -1,50 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1996 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# Concurrent Computer Corporation Maxion system support contributed
|
||||
# by Donald R. Laster Jr. <[email protected]>.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)maxion.m4 8.3 (Berkeley) 9/25/96')
|
||||
|
||||
define(`ALIAS_FILE', `/etc/ucbmail/aliases')dnl
|
||||
define(`HELP_FILE', `/etc/ucbmail/sendmail.hf')dnl
|
||||
define(`QUEUE_DIR', `/var/spool/mqueue')dnl
|
||||
define(`STATUS_FILE', `/var/adm/log/sendmail.st')dnl
|
||||
define(`LOCAL_MAILER_PATH', `/usr/bin/mail')dnl
|
||||
define(`LOCAL_MAILER_FLAGS',`rmn9')dnl
|
||||
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
|
||||
define(`LOCAL_MAILER_ARGS', `mail $u')dnl
|
||||
define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gmedium $h!rmail ($u)')dnl
|
||||
divert(-1)
|
||||
@@ -1,51 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# This ostype file is suitable for use on Solaris 2.x systems that
|
||||
# have mail.local installed. It is my understanding that this is
|
||||
# standard as of Solaris 2.5.
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)solaris2.ml.m4 8.2 (Berkeley) 9/25/96')
|
||||
divert(-1)
|
||||
|
||||
define(`ALIAS_FILE', /etc/mail/aliases)
|
||||
ifdef(`HELP_FILE',, `define(`HELP_FILE', /etc/mail/sendmail.hf)')
|
||||
ifdef(`STATUS_FILE',, `define(`STATUS_FILE', /etc/mail/sendmail.st)')
|
||||
ifdef(`LOCAL_MAILER_PATH',, `define(`LOCAL_MAILER_PATH', `/usr/lib/mail.local')')
|
||||
ifdef(`LOCAL_MAILER_FLAGS',, `define(`LOCAL_MAILER_FLAGS', `fSmn9')')
|
||||
ifdef(`LOCAL_MAILER_ARGS',, `define(`LOCAL_MAILER_ARGS', `mail.local -d $u')')
|
||||
ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g $h!rmail ($u)')')
|
||||
define(`confCW_FILE', /etc/mail/sendmail.cw)
|
||||
@@ -1,49 +0,0 @@
|
||||
divert(-1)
|
||||
#
|
||||
# Copyright (c) 1983 Eric P. Allman
|
||||
# Copyright (c) 1988, 1993
|
||||
# The Regents of the University of California. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# 3. All advertising materials mentioning features or use of this software
|
||||
# must display the following acknowledgement:
|
||||
# This product includes software developed by the University of
|
||||
# California, Berkeley and its contributors.
|
||||
# 4. Neither the name of the University nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# Definitions for UXP/DS (Fujitsu/ICL DS/90 series)
|
||||
# Diego R. Lopez, CICA (Seville). 1995
|
||||
#
|
||||
|
||||
divert(0)
|
||||
VERSIONID(`@(#)uxpds.m4 8.3 (Berkeley) 9/25/96')
|
||||
|
||||
define(`confDEF_GROUP_ID', `6')
|
||||
define(`ALIAS_FILE', /usr/ucblib/aliases)dnl
|
||||
ifdef(`HELP_FILE',,`define(`HELP_FILE', /usr/ucblib/sendmail.hf)')dnl
|
||||
ifdef(`STATUS_FILE',,`define(`STATUS_FILE', /usr/ucblib/sendmail.st)')dnl
|
||||
define(`LOCAL_MAILER_PATH', `/usr/ucblib/binmail')dnl
|
||||
define(`LOCAL_MAILER_FLAGS', `rmn9')dnl
|
||||
define(`LOCAL_SHELL_FLAGS', `ehuP')dnl
|
||||
define(`UUCP_MAILER_ARGS', `uux - -r -a$f -gmedium $h!rmail ($u)')dnl
|
||||
@@ -1,77 +0,0 @@
|
||||
.\"/*
|
||||
.\" * Copyright (c) 1996 John M. Vinopal
|
||||
.\" * All rights reserved.
|
||||
.\" *
|
||||
.\" * Redistribution and use in source and binary forms, with or without
|
||||
.\" * modification, are permitted provided that the following conditions
|
||||
.\" * are met:
|
||||
.\" * 1. Redistributions of source code must retain the above copyright
|
||||
.\" * notice, this list of conditions and the following disclaimer.
|
||||
.\" * 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" * notice, this list of conditions and the following disclaimer in the
|
||||
.\" * documentation and/or other materials provided with the distribution.
|
||||
.\" * 3. All advertising materials mentioning features or use of this software
|
||||
.\" * must display the following acknowledgement:
|
||||
.\" * This product includes software developed for the NetBSD Project
|
||||
.\" * by John M. Vinopal.
|
||||
.\" * 4. The name of the author may not be used to endorse or promote products
|
||||
.\" * derived from this software without specific prior written permission.
|
||||
.\" *
|
||||
.\" * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
.\" * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
.\" * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
.\" * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
.\" * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" * SUCH DAMAGE.
|
||||
.\" */
|
||||
.\" $Id$
|
||||
.Dd August 13, 1996
|
||||
.Dt MAILSTATS 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm mailstats
|
||||
.Nd display mail protocol statistics
|
||||
.Sh SYNOPSIS
|
||||
.Nm mailstats
|
||||
.Op Fl o
|
||||
.Op Fl C Ar sendmail.cf
|
||||
.Op Fl f Ar sendmail.st
|
||||
.Sh DESCRIPTION
|
||||
.Nm Mailstats
|
||||
displays mail statistics on a per mailer basis.
|
||||
Each line of output contains
|
||||
the mailer number, the count and byte-count of incoming messages,
|
||||
the count and byte-count of outgoing messages, and the name of the
|
||||
mailer unless the
|
||||
.Fl o
|
||||
flag is specified. Common mailers include smtp and local (eg:
|
||||
.Nm mail.local,
|
||||
the program which handles local delivery of mail).
|
||||
.Pp
|
||||
Statistics are read from the
|
||||
.Nm sendmail
|
||||
statistics file
|
||||
.Ar sendmail.st,
|
||||
the location of which is defined in
|
||||
.Ar sendmail.cf,
|
||||
or specified with the
|
||||
.Fl f
|
||||
flag. Mailers are likewise defined in the
|
||||
.Ar sendmail.cf
|
||||
file. Statistics are cumulative; zero the statistics file
|
||||
to reset the counters.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/log/sendmail.st -compact
|
||||
.It Pa /etc/sendmail.cf
|
||||
sendmail configuration file
|
||||
.It Pa /var/log/sendmail.st
|
||||
sendmail statistics file
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr sendmail 8 ,
|
||||
.Xr mail.local 8
|
||||
@@ -1,41 +0,0 @@
|
||||
.\" @(#)praliases.8 8.1 (Berkeley) 9/21/96
|
||||
.Dd April 25, 1996
|
||||
.Dt PRALIASES 1
|
||||
.Os BSD 3
|
||||
.Sh NAME
|
||||
.Nm praliases
|
||||
.Nd display system mail aliases
|
||||
.Sh SYNOPSIS
|
||||
.Nm praliases
|
||||
.Op Fl f Ar file
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm praliases
|
||||
utility displays the current system aliases,
|
||||
one per line, in no particular order.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl f
|
||||
Read the specified file instead of the default
|
||||
.Nm sendmail
|
||||
system aliases file.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm praliases
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /var/log/sendmail.stXX -compact
|
||||
.It Pa /etc/aliases
|
||||
The default
|
||||
.Nm sendmail
|
||||
system aliases file.
|
||||
.It Pa /etc/aliases.db
|
||||
The database version of the
|
||||
.Pa /etc/aliases
|
||||
file.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr mailq 1 ,
|
||||
.Xr sendmail 8
|
||||
Reference in new issue
Block a user