Remove trailing whitespace.
This commit is contained in:
parent
6c06b4e2aa
commit
5ebc7e6281
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8871
@ -40,7 +40,7 @@
|
|||||||
* to require a specific license from the United States Government.
|
* to require a specific license from the United States Government.
|
||||||
* It is the responsibility of any person or organization contemplating
|
* It is the responsibility of any person or organization contemplating
|
||||||
* export to obtain such a license before exporting.
|
* export to obtain such a license before exporting.
|
||||||
*
|
*
|
||||||
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
|
||||||
* distribute this software and its documentation for any purpose and
|
* distribute this software and its documentation for any purpose and
|
||||||
* without fee is hereby granted, provided that the above copyright
|
* without fee is hereby granted, provided that the above copyright
|
||||||
|
@ -467,7 +467,7 @@ auth_send(data, cnt)
|
|||||||
* We requested strong authentication, however no mechanisms worked.
|
* We requested strong authentication, however no mechanisms worked.
|
||||||
* Therefore, exit on client end.
|
* Therefore, exit on client end.
|
||||||
*/
|
*/
|
||||||
printf("Unable to securely authenticate user ... exit\n");
|
printf("Unable to securely authenticate user ... exit\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
#endif /* KANNAN */
|
#endif /* KANNAN */
|
||||||
}
|
}
|
||||||
|
@ -580,7 +580,7 @@ fb64_stream_key(key, stp)
|
|||||||
* INPUT --(--------->(+)+---> DATA
|
* INPUT --(--------->(+)+---> DATA
|
||||||
* | |
|
* | |
|
||||||
* +-------------+
|
* +-------------+
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Given:
|
* Given:
|
||||||
* iV: Initial vector, 64 bits (8 bytes) long.
|
* iV: Initial vector, 64 bits (8 bytes) long.
|
||||||
@ -641,7 +641,7 @@ cfb64_decrypt(data)
|
|||||||
des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1);
|
des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1);
|
||||||
bcopy((void *)b, (void *)stp->str_feed, sizeof(Block));
|
bcopy((void *)b, (void *)stp->str_feed, sizeof(Block));
|
||||||
stp->str_index = 1; /* Next time will be 1 */
|
stp->str_index = 1; /* Next time will be 1 */
|
||||||
index = 0; /* But now use 0 */
|
index = 0; /* But now use 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* On decryption we store (data) which is cypher. */
|
/* On decryption we store (data) which is cypher. */
|
||||||
@ -714,7 +714,7 @@ ofb64_decrypt(data)
|
|||||||
des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1);
|
des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1);
|
||||||
bcopy((void *)b, (void *)stp->str_feed, sizeof(Block));
|
bcopy((void *)b, (void *)stp->str_feed, sizeof(Block));
|
||||||
stp->str_index = 1; /* Next time will be 1 */
|
stp->str_index = 1; /* Next time will be 1 */
|
||||||
index = 0; /* But now use 0 */
|
index = 0; /* But now use 0 */
|
||||||
}
|
}
|
||||||
|
|
||||||
return(data ^ stp->str_feed[index]);
|
return(data ^ stp->str_feed[index]);
|
||||||
|
@ -106,7 +106,7 @@ static long remote_supports_decrypt = 0;
|
|||||||
static Encryptions encryptions[] = {
|
static Encryptions encryptions[] = {
|
||||||
#ifdef DES_ENCRYPTION
|
#ifdef DES_ENCRYPTION
|
||||||
{ "DES_CFB64", ENCTYPE_DES_CFB64,
|
{ "DES_CFB64", ENCTYPE_DES_CFB64,
|
||||||
cfb64_encrypt,
|
cfb64_encrypt,
|
||||||
cfb64_decrypt,
|
cfb64_decrypt,
|
||||||
cfb64_init,
|
cfb64_init,
|
||||||
cfb64_start,
|
cfb64_start,
|
||||||
@ -116,7 +116,7 @@ static Encryptions encryptions[] = {
|
|||||||
cfb64_keyid,
|
cfb64_keyid,
|
||||||
cfb64_printsub },
|
cfb64_printsub },
|
||||||
{ "DES_OFB64", ENCTYPE_DES_OFB64,
|
{ "DES_OFB64", ENCTYPE_DES_OFB64,
|
||||||
ofb64_encrypt,
|
ofb64_encrypt,
|
||||||
ofb64_decrypt,
|
ofb64_decrypt,
|
||||||
ofb64_init,
|
ofb64_init,
|
||||||
ofb64_start,
|
ofb64_start,
|
||||||
@ -708,7 +708,7 @@ encrypt_request_end()
|
|||||||
* Called when ENCRYPT REQUEST-START is received. If we receive
|
* Called when ENCRYPT REQUEST-START is received. If we receive
|
||||||
* this before a type is picked, then that indicates that the
|
* this before a type is picked, then that indicates that the
|
||||||
* other side wants us to start encrypting data as soon as we
|
* other side wants us to start encrypting data as soon as we
|
||||||
* can.
|
* can.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
encrypt_request_start(data, cnt)
|
encrypt_request_start(data, cnt)
|
||||||
@ -851,7 +851,7 @@ encrypt_start_output(type)
|
|||||||
i = (*ep->start)(DIR_ENCRYPT, Server);
|
i = (*ep->start)(DIR_ENCRYPT, Server);
|
||||||
if (encrypt_debug_mode) {
|
if (encrypt_debug_mode) {
|
||||||
printf(">>>%s: Encrypt start: %s (%d) %s\r\n",
|
printf(">>>%s: Encrypt start: %s (%d) %s\r\n",
|
||||||
Name,
|
Name,
|
||||||
(i < 0) ? "failed" :
|
(i < 0) ? "failed" :
|
||||||
"initial negotiation in progress",
|
"initial negotiation in progress",
|
||||||
i, ENCTYPE_NAME(type));
|
i, ENCTYPE_NAME(type));
|
||||||
|
@ -177,7 +177,7 @@ kerberos4_send(ap)
|
|||||||
CREDENTIALS cred;
|
CREDENTIALS cred;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
printf("[ Trying KERBEROS4 ... ]\n");
|
printf("[ Trying KERBEROS4 ... ]\n");
|
||||||
if (!UserNameRequested) {
|
if (!UserNameRequested) {
|
||||||
if (auth_debug_mode) {
|
if (auth_debug_mode) {
|
||||||
printf("Kerberos V4: no user name supplied\r\n");
|
printf("Kerberos V4: no user name supplied\r\n");
|
||||||
@ -245,7 +245,7 @@ kerberos4_send(ap)
|
|||||||
des_ecb_encrypt(challenge, challenge, sched, 1);
|
des_ecb_encrypt(challenge, challenge, sched, 1);
|
||||||
}
|
}
|
||||||
#endif /* ENCRYPTION */
|
#endif /* ENCRYPTION */
|
||||||
|
|
||||||
if (auth_debug_mode) {
|
if (auth_debug_mode) {
|
||||||
printf("CK: %d:", kerberos4_cksum(auth.dat, auth.length));
|
printf("CK: %d:", kerberos4_cksum(auth.dat, auth.length));
|
||||||
printd(auth.dat, auth.length);
|
printd(auth.dat, auth.length);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* $Source: /home/ncvs/src/lib/libtelnet/kerberos5.c,v $
|
* $Source: /home/ncvs/src/secure/lib/libtelnet/kerberos5.c,v $
|
||||||
* $Author: rgrimes $
|
* $Author: csgr $
|
||||||
* $Id: kerberos5.c,v 1.1.1.1 1994/05/27 05:00:20 rgrimes Exp $
|
* $Id: kerberos5.c,v 1.1.1.1 1994/08/12 22:02:59 csgr Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(lint) && !defined(SABER)
|
#if !defined(lint) && !defined(SABER)
|
||||||
@ -9,7 +9,7 @@ static
|
|||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
const
|
const
|
||||||
#endif
|
#endif
|
||||||
char rcsid_kerberos5_c[] = "$Id: kerberos5.c,v 1.1.1.1 1994/05/27 05:00:20 rgrimes Exp $";
|
char rcsid_kerberos5_c[] = "$Id: kerberos5.c,v 1.1.1.1 1994/08/12 22:02:59 csgr Exp $";
|
||||||
#endif /* lint */
|
#endif /* lint */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
@ -84,7 +84,7 @@ static char sccsid[] = "@(#)kerberos5.c 8.2 (Berkeley) 12/15/93";
|
|||||||
|
|
||||||
/* kerberos 5 include files (ext-proto.h) will get an appropriate stdlib.h
|
/* kerberos 5 include files (ext-proto.h) will get an appropriate stdlib.h
|
||||||
and string.h/strings.h */
|
and string.h/strings.h */
|
||||||
|
|
||||||
#include "encrypt.h"
|
#include "encrypt.h"
|
||||||
#include "auth.h"
|
#include "auth.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
@ -204,7 +204,7 @@ kerberos5_send(ap)
|
|||||||
ksum.contents = sum;
|
ksum.contents = sum;
|
||||||
ksum.length = sizeof(sum);
|
ksum.length = sizeof(sum);
|
||||||
bzero((Voidptr )sum, sizeof(sum));
|
bzero((Voidptr )sum, sizeof(sum));
|
||||||
|
|
||||||
if (!UserNameRequested) {
|
if (!UserNameRequested) {
|
||||||
if (auth_debug_mode) {
|
if (auth_debug_mode) {
|
||||||
printf("Kerberos V5: no user name supplied\r\n");
|
printf("Kerberos V5: no user name supplied\r\n");
|
||||||
@ -254,7 +254,7 @@ kerberos5_send(ap)
|
|||||||
krb5_free_host_realm(realms);
|
krb5_free_host_realm(realms);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bzero((char *)&creds, sizeof(creds));
|
bzero((char *)&creds, sizeof(creds));
|
||||||
creds.server = server;
|
creds.server = server;
|
||||||
@ -284,7 +284,7 @@ kerberos5_send(ap)
|
|||||||
ap_opts = AP_OPTS_MUTUAL_REQUIRED;
|
ap_opts = AP_OPTS_MUTUAL_REQUIRED;
|
||||||
else
|
else
|
||||||
ap_opts = 0;
|
ap_opts = 0;
|
||||||
|
|
||||||
r = krb5_mk_req_extended(ap_opts, &ksum, krb5_kdc_default_options, 0,
|
r = krb5_mk_req_extended(ap_opts, &ksum, krb5_kdc_default_options, 0,
|
||||||
#ifdef ENCRYPTION
|
#ifdef ENCRYPTION
|
||||||
&newkey,
|
&newkey,
|
||||||
@ -441,7 +441,7 @@ kerberos5_is(ap, data, cnt)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
Data(ap, KRB_RESPONSE, outbuf.data, outbuf.length);
|
Data(ap, KRB_RESPONSE, outbuf.data, outbuf.length);
|
||||||
}
|
}
|
||||||
if (krb5_unparse_name(authdat->ticket->enc_part2 ->client,
|
if (krb5_unparse_name(authdat->ticket->enc_part2 ->client,
|
||||||
&name))
|
&name))
|
||||||
name = 0;
|
name = 0;
|
||||||
@ -451,7 +451,7 @@ kerberos5_is(ap, data, cnt)
|
|||||||
name ? name : "");
|
name ? name : "");
|
||||||
}
|
}
|
||||||
auth_finished(ap, AUTH_USER);
|
auth_finished(ap, AUTH_USER);
|
||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
if (authdat->authenticator->subkey &&
|
if (authdat->authenticator->subkey &&
|
||||||
authdat->authenticator->subkey->keytype == KEYTYPE_DES) {
|
authdat->authenticator->subkey->keytype == KEYTYPE_DES) {
|
||||||
@ -463,7 +463,7 @@ kerberos5_is(ap, data, cnt)
|
|||||||
(Voidptr )session_key, sizeof(Block));
|
(Voidptr )session_key, sizeof(Block));
|
||||||
} else
|
} else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef ENCRYPTION
|
#ifdef ENCRYPTION
|
||||||
skey.type = SK_DES;
|
skey.type = SK_DES;
|
||||||
skey.length = 8;
|
skey.length = 8;
|
||||||
@ -475,17 +475,17 @@ kerberos5_is(ap, data, cnt)
|
|||||||
case KRB_FORWARD:
|
case KRB_FORWARD:
|
||||||
inbuf.data = (char *)data;
|
inbuf.data = (char *)data;
|
||||||
inbuf.length = cnt;
|
inbuf.length = cnt;
|
||||||
if (r = rd_and_store_for_creds(&inbuf, authdat->ticket,
|
if (r = rd_and_store_for_creds(&inbuf, authdat->ticket,
|
||||||
UserNameRequested)) {
|
UserNameRequested)) {
|
||||||
char errbuf[128];
|
char errbuf[128];
|
||||||
|
|
||||||
(void) strcpy(errbuf, "Read forwarded creds failed: ");
|
(void) strcpy(errbuf, "Read forwarded creds failed: ");
|
||||||
(void) strcat(errbuf, error_message(r));
|
(void) strcat(errbuf, error_message(r));
|
||||||
Data(ap, KRB_FORWARD_REJECT, errbuf, -1);
|
Data(ap, KRB_FORWARD_REJECT, errbuf, -1);
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Could not read forwarded credentials\r\n");
|
printf("Could not read forwarded credentials\r\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Data(ap, KRB_FORWARD_ACCEPT, 0, 0);
|
Data(ap, KRB_FORWARD_ACCEPT, 0, 0);
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Forwarded credentials obtained\r\n");
|
printf("Forwarded credentials obtained\r\n");
|
||||||
@ -690,16 +690,16 @@ kerberos5_forward(ap)
|
|||||||
krb5_ccache ccache;
|
krb5_ccache ccache;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!(local_creds = (krb5_creds *)
|
if (!(local_creds = (krb5_creds *)
|
||||||
calloc(1, sizeof(*local_creds)))) {
|
calloc(1, sizeof(*local_creds)))) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Kerberos V5: could not allocate memory for credentials\r\n");
|
printf("Kerberos V5: could not allocate memory for credentials\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r = krb5_sname_to_principal(RemoteHostName, "host", 1,
|
if (r = krb5_sname_to_principal(RemoteHostName, "host", 1,
|
||||||
&local_creds->server)) {
|
&local_creds->server)) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Kerberos V5: could not build server name - %s\r\n",
|
printf("Kerberos V5: could not build server name - %s\r\n",
|
||||||
error_message(r));
|
error_message(r));
|
||||||
krb5_free_creds(local_creds);
|
krb5_free_creds(local_creds);
|
||||||
@ -707,7 +707,7 @@ kerberos5_forward(ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (r = krb5_cc_default(&ccache)) {
|
if (r = krb5_cc_default(&ccache)) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Kerberos V5: could not get default ccache - %s\r\n",
|
printf("Kerberos V5: could not get default ccache - %s\r\n",
|
||||||
error_message(r));
|
error_message(r));
|
||||||
krb5_free_creds(local_creds);
|
krb5_free_creds(local_creds);
|
||||||
@ -715,7 +715,7 @@ kerberos5_forward(ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (r = krb5_cc_get_principal(ccache, &local_creds->client)) {
|
if (r = krb5_cc_get_principal(ccache, &local_creds->client)) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Kerberos V5: could not get default principal - %s\r\n",
|
printf("Kerberos V5: could not get default principal - %s\r\n",
|
||||||
error_message(r));
|
error_message(r));
|
||||||
krb5_free_creds(local_creds);
|
krb5_free_creds(local_creds);
|
||||||
@ -724,7 +724,7 @@ kerberos5_forward(ap)
|
|||||||
|
|
||||||
/* Get ticket from credentials cache */
|
/* Get ticket from credentials cache */
|
||||||
if (r = krb5_get_credentials(KRB5_GC_CACHED, ccache, local_creds)) {
|
if (r = krb5_get_credentials(KRB5_GC_CACHED, ccache, local_creds)) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Kerberos V5: could not obtain credentials - %s\r\n",
|
printf("Kerberos V5: could not obtain credentials - %s\r\n",
|
||||||
error_message(r));
|
error_message(r));
|
||||||
krb5_free_creds(local_creds);
|
krb5_free_creds(local_creds);
|
||||||
@ -738,13 +738,13 @@ kerberos5_forward(ap)
|
|||||||
&local_creds->keyblock,
|
&local_creds->keyblock,
|
||||||
forward_flags & OPTS_FORWARDABLE_CREDS,
|
forward_flags & OPTS_FORWARDABLE_CREDS,
|
||||||
&forw_creds)) {
|
&forw_creds)) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
printf("Kerberos V5: error getting forwarded creds - %s\r\n",
|
printf("Kerberos V5: error getting forwarded creds - %s\r\n",
|
||||||
error_message(r));
|
error_message(r));
|
||||||
krb5_free_creds(local_creds);
|
krb5_free_creds(local_creds);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send forwarded credentials */
|
/* Send forwarded credentials */
|
||||||
if (!Data(ap, KRB_FORWARD, forw_creds.data, forw_creds.length)) {
|
if (!Data(ap, KRB_FORWARD, forw_creds.data, forw_creds.length)) {
|
||||||
if (auth_debug_mode)
|
if (auth_debug_mode)
|
||||||
|
@ -266,7 +266,7 @@ krb4encpwd_is(ap, data, cnt)
|
|||||||
Data(ap, KRB4_ENCPWD_CHALLENGE, (void *)challenge, strlen(challenge));
|
Data(ap, KRB4_ENCPWD_CHALLENGE, (void *)challenge, strlen(challenge));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Data(ap, KRB4_ENCPWD_REJECT, 0, 0);
|
Data(ap, KRB4_ENCPWD_REJECT, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -36,8 +36,8 @@ static char sccsid[] = "@(#)read_password.c 8.2 (Berkeley) 12/15/93";
|
|||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Source: /home/ncvs/src/lib/libtelnet/read_password.c,v $
|
* $Source: /home/ncvs/src/secure/lib/libtelnet/read_password.c,v $
|
||||||
* $Author: rgrimes $
|
* $Author: csgr $
|
||||||
*
|
*
|
||||||
* Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
|
* Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
|
||||||
* of Technology.
|
* of Technology.
|
||||||
@ -76,7 +76,7 @@ local_des_read_pw_string(s,max,prompt,verify)
|
|||||||
{
|
{
|
||||||
int ok = 0;
|
int ok = 0;
|
||||||
char *ptr;
|
char *ptr;
|
||||||
|
|
||||||
jmp_buf old_env;
|
jmp_buf old_env;
|
||||||
struct sgttyb tty_state;
|
struct sgttyb tty_state;
|
||||||
char key_string[BUFSIZ];
|
char key_string[BUFSIZ];
|
||||||
@ -91,7 +91,7 @@ local_des_read_pw_string(s,max,prompt,verify)
|
|||||||
goto lose;
|
goto lose;
|
||||||
|
|
||||||
/* save terminal state*/
|
/* save terminal state*/
|
||||||
if (ioctl(0,TIOCGETP,(char *)&tty_state) == -1)
|
if (ioctl(0,TIOCGETP,(char *)&tty_state) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
/*
|
/*
|
||||||
push_signals();
|
push_signals();
|
||||||
|
@ -304,7 +304,7 @@ rsaencpwd_is(ap, data, cnt)
|
|||||||
Data(ap, RSA_ENCPWD_CHALLENGEKEY, (void *)chalkey, chalkey_len);
|
Data(ap, RSA_ENCPWD_CHALLENGEKEY, (void *)chalkey, chalkey_len);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Data(ap, RSA_ENCPWD_REJECT, 0, 0);
|
Data(ap, RSA_ENCPWD_REJECT, 0, 0);
|
||||||
break;
|
break;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
# define _PATH_TTY "/dev/tty"
|
# define _PATH_TTY "/dev/tty"
|
||||||
# ifndef _PATH_LOGIN
|
# ifndef _PATH_LOGIN
|
||||||
# define _PATH_LOGIN "/bin/login"
|
# define _PATH_LOGIN "/bin/login"
|
||||||
|
@ -109,10 +109,10 @@ get_slc_defaults()
|
|||||||
init_termbuf();
|
init_termbuf();
|
||||||
|
|
||||||
for (i = 1; i <= NSLC; i++) {
|
for (i = 1; i <= NSLC; i++) {
|
||||||
slctab[i].defset.flag =
|
slctab[i].defset.flag =
|
||||||
spcset(i, &slctab[i].defset.val, &slctab[i].sptr);
|
spcset(i, &slctab[i].defset.val, &slctab[i].sptr);
|
||||||
slctab[i].current.flag = SLC_NOSUPPORT;
|
slctab[i].current.flag = SLC_NOSUPPORT;
|
||||||
slctab[i].current.val = 0;
|
slctab[i].current.val = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* end of get_slc_defaults */
|
} /* end of get_slc_defaults */
|
||||||
@ -286,7 +286,7 @@ change_slc(func, flag, val)
|
|||||||
register cc_t val;
|
register cc_t val;
|
||||||
{
|
{
|
||||||
register int hislevel, mylevel;
|
register int hislevel, mylevel;
|
||||||
|
|
||||||
hislevel = flag & SLC_LEVELBITS;
|
hislevel = flag & SLC_LEVELBITS;
|
||||||
mylevel = slctab[func].defset.flag & SLC_LEVELBITS;
|
mylevel = slctab[func].defset.flag & SLC_LEVELBITS;
|
||||||
/*
|
/*
|
||||||
@ -345,7 +345,7 @@ change_slc(func, flag, val)
|
|||||||
* request as he asks.
|
* request as he asks.
|
||||||
*
|
*
|
||||||
* If our level is DEFAULT, then just ack whatever was
|
* If our level is DEFAULT, then just ack whatever was
|
||||||
* sent.
|
* sent.
|
||||||
*
|
*
|
||||||
* If he can't change and we can't change,
|
* If he can't change and we can't change,
|
||||||
* then degenerate to NOSUPPORT.
|
* then degenerate to NOSUPPORT.
|
||||||
@ -372,7 +372,7 @@ change_slc(func, flag, val)
|
|||||||
slctab[func].defset.val;
|
slctab[func].defset.val;
|
||||||
val = slctab[func].current.val;
|
val = slctab[func].current.val;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
add_slc(func, flag, val);
|
add_slc(func, flag, val);
|
||||||
}
|
}
|
||||||
@ -423,7 +423,7 @@ check_slc()
|
|||||||
slctab[i].current.val);
|
slctab[i].current.val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* check_slc */
|
} /* check_slc */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -388,7 +388,7 @@ gotiac: switch (c) {
|
|||||||
* All state defaults are negative, and resp defaults to 0.
|
* All state defaults are negative, and resp defaults to 0.
|
||||||
*
|
*
|
||||||
* When initiating a request to change state to new_state:
|
* When initiating a request to change state to new_state:
|
||||||
*
|
*
|
||||||
* if ((want_resp == 0 && new_state == my_state) || want_state == new_state) {
|
* if ((want_resp == 0 && new_state == my_state) || want_state == new_state) {
|
||||||
* do nothing;
|
* do nothing;
|
||||||
* } else {
|
* } else {
|
||||||
|
@ -1076,7 +1076,7 @@ getptyslave()
|
|||||||
#ifdef USE_TERMIO
|
#ifdef USE_TERMIO
|
||||||
ttyfd = t;
|
ttyfd = t;
|
||||||
#endif
|
#endif
|
||||||
if (ioctl(t, I_PUSH, "ptem") < 0)
|
if (ioctl(t, I_PUSH, "ptem") < 0)
|
||||||
fatal(net, "I_PUSH ptem");
|
fatal(net, "I_PUSH ptem");
|
||||||
if (ioctl(t, I_PUSH, "ldterm") < 0)
|
if (ioctl(t, I_PUSH, "ldterm") < 0)
|
||||||
fatal(net, "I_PUSH ldterm");
|
fatal(net, "I_PUSH ldterm");
|
||||||
@ -1576,7 +1576,7 @@ start_login(host, autologin, name)
|
|||||||
if (bftpd) {
|
if (bftpd) {
|
||||||
argv = addarg(argv, "-e");
|
argv = addarg(argv, "-e");
|
||||||
argv = addarg(argv, BFTPPATH);
|
argv = addarg(argv, BFTPPATH);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if defined (SecurID)
|
#if defined (SecurID)
|
||||||
/*
|
/*
|
||||||
@ -2061,7 +2061,7 @@ rmut()
|
|||||||
if (statbf.st_size && utmp) {
|
if (statbf.st_size && utmp) {
|
||||||
nutmp = read(f, (char *)utmp, (int)statbf.st_size);
|
nutmp = read(f, (char *)utmp, (int)statbf.st_size);
|
||||||
nutmp /= sizeof(struct utmp);
|
nutmp /= sizeof(struct utmp);
|
||||||
|
|
||||||
for (u = utmp ; u < &utmp[nutmp] ; u++) {
|
for (u = utmp ; u < &utmp[nutmp] ; u++) {
|
||||||
if (SCMPN(u->ut_line, line+5) ||
|
if (SCMPN(u->ut_line, line+5) ||
|
||||||
u->ut_name[0]==0)
|
u->ut_name[0]==0)
|
||||||
|
@ -816,7 +816,7 @@ doit(who)
|
|||||||
|
|
||||||
#if defined(_SC_CRAY_SECURE_SYS)
|
#if defined(_SC_CRAY_SECURE_SYS)
|
||||||
/*
|
/*
|
||||||
* set ttyp line security label
|
* set ttyp line security label
|
||||||
*/
|
*/
|
||||||
if (secflag) {
|
if (secflag) {
|
||||||
char slave_dev[16];
|
char slave_dev[16];
|
||||||
@ -1400,7 +1400,7 @@ telnet(f, p, host)
|
|||||||
}
|
}
|
||||||
cleanup(0);
|
cleanup(0);
|
||||||
} /* end of telnet */
|
} /* end of telnet */
|
||||||
|
|
||||||
#ifndef TCSIG
|
#ifndef TCSIG
|
||||||
# ifdef TIOCSIG
|
# ifdef TIOCSIG
|
||||||
# define TCSIG TIOCSIG
|
# define TCSIG TIOCSIG
|
||||||
@ -1476,7 +1476,7 @@ int readstream(p, ibuf, bufsize)
|
|||||||
tp = (struct termio *) (ibuf+1 + sizeof(struct iocblk));
|
tp = (struct termio *) (ibuf+1 + sizeof(struct iocblk));
|
||||||
vstop = tp->c_cc[VSTOP];
|
vstop = tp->c_cc[VSTOP];
|
||||||
vstart = tp->c_cc[VSTART];
|
vstart = tp->c_cc[VSTART];
|
||||||
ixon = tp->c_iflag & IXON;
|
ixon = tp->c_iflag & IXON;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errno = EAGAIN;
|
errno = EAGAIN;
|
||||||
|
@ -320,7 +320,7 @@ localstat()
|
|||||||
nfrontp += 7;
|
nfrontp += 7;
|
||||||
editmode = useeditmode;
|
editmode = useeditmode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for changes to special characters in use.
|
* Check for changes to special characters in use.
|
||||||
@ -422,7 +422,7 @@ clientstat(code, parm1, parm2)
|
|||||||
uselinemode = 1;
|
uselinemode = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Quit now if we can't do it.
|
* Quit now if we can't do it.
|
||||||
*/
|
*/
|
||||||
@ -463,7 +463,7 @@ clientstat(code, parm1, parm2)
|
|||||||
send_will(TELOPT_ECHO, 1);
|
send_will(TELOPT_ECHO, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_MODE:
|
case LM_MODE:
|
||||||
{
|
{
|
||||||
register int ack, changed;
|
register int ack, changed;
|
||||||
@ -512,7 +512,7 @@ clientstat(code, parm1, parm2)
|
|||||||
IAC, SE);
|
IAC, SE);
|
||||||
nfrontp += 7;
|
nfrontp += 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
editmode = useeditmode;
|
editmode = useeditmode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -546,9 +546,9 @@ clientstat(code, parm1, parm2)
|
|||||||
(void) ioctl(pty, TIOCSWINSZ, (char *)&ws);
|
(void) ioctl(pty, TIOCSWINSZ, (char *)&ws);
|
||||||
}
|
}
|
||||||
#endif /* TIOCSWINSZ */
|
#endif /* TIOCSWINSZ */
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TELOPT_TSPEED:
|
case TELOPT_TSPEED:
|
||||||
{
|
{
|
||||||
def_tspeed = parm1;
|
def_tspeed = parm1;
|
||||||
@ -613,7 +613,7 @@ _termstat()
|
|||||||
*
|
*
|
||||||
* Some things should not be done until after the login process has started
|
* Some things should not be done until after the login process has started
|
||||||
* and all the pty modes are set to what they are supposed to be. This
|
* and all the pty modes are set to what they are supposed to be. This
|
||||||
* function is called when the pty state has been processed for the first time.
|
* function is called when the pty state has been processed for the first time.
|
||||||
* It calls other functions that do things that were deferred in each module.
|
* It calls other functions that do things that were deferred in each module.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
@ -713,7 +713,7 @@ printsub(direction, pointer, length)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_SLC:
|
case LM_SLC:
|
||||||
sprintf(nfrontp, "SLC");
|
sprintf(nfrontp, "SLC");
|
||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
@ -863,7 +863,7 @@ printsub(direction, pointer, length)
|
|||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sprintf(nfrontp, " %d", pointer[i]);
|
sprintf(nfrontp, " %d", pointer[i]);
|
||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
@ -966,7 +966,7 @@ printsub(direction, pointer, length)
|
|||||||
case TELOPT_AUTHENTICATION:
|
case TELOPT_AUTHENTICATION:
|
||||||
sprintf(nfrontp, "AUTHENTICATION");
|
sprintf(nfrontp, "AUTHENTICATION");
|
||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
|
|
||||||
if (length < 2) {
|
if (length < 2) {
|
||||||
sprintf(nfrontp, " (empty suboption??\?)");
|
sprintf(nfrontp, " (empty suboption??\?)");
|
||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
@ -1171,13 +1171,13 @@ printdata(tag, ptr, cnt)
|
|||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
for (i = 0; i < 20 && cnt; i++) {
|
for (i = 0; i < 20 && cnt; i++) {
|
||||||
sprintf(nfrontp, "%02x", *ptr);
|
sprintf(nfrontp, "%02x", *ptr);
|
||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
if (isprint(*ptr)) {
|
if (isprint(*ptr)) {
|
||||||
xbuf[i] = *ptr;
|
xbuf[i] = *ptr;
|
||||||
} else {
|
} else {
|
||||||
xbuf[i] = '.';
|
xbuf[i] = '.';
|
||||||
}
|
}
|
||||||
if (i % 2) {
|
if (i % 2) {
|
||||||
*nfrontp = ' ';
|
*nfrontp = ' ';
|
||||||
nfrontp++;
|
nfrontp++;
|
||||||
}
|
}
|
||||||
@ -1187,6 +1187,6 @@ printdata(tag, ptr, cnt)
|
|||||||
xbuf[i] = '\0';
|
xbuf[i] = '\0';
|
||||||
sprintf(nfrontp, " %s\r\n", xbuf );
|
sprintf(nfrontp, " %s\r\n", xbuf );
|
||||||
nfrontp += strlen(nfrontp);
|
nfrontp += strlen(nfrontp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* DIAGNOSTICS */
|
#endif /* DIAGNOSTICS */
|
||||||
|
@ -234,7 +234,7 @@ control(c)
|
|||||||
* the "send" command.
|
* the "send" command.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct sendlist {
|
struct sendlist {
|
||||||
char *name; /* How user refers to it (case independent) */
|
char *name; /* How user refers to it (case independent) */
|
||||||
char *help; /* Help information (0 ==> no help) */
|
char *help; /* Help information (0 ==> no help) */
|
||||||
@ -2417,7 +2417,7 @@ tn(argc, argv)
|
|||||||
errno = oerrno;
|
errno = oerrno;
|
||||||
perror((char *)0);
|
perror((char *)0);
|
||||||
host->h_addr_list++;
|
host->h_addr_list++;
|
||||||
memcpy((caddr_t)&sin.sin_addr,
|
memcpy((caddr_t)&sin.sin_addr,
|
||||||
host->h_addr_list[0], host->h_length);
|
host->h_addr_list[0], host->h_length);
|
||||||
(void) NetClose(net);
|
(void) NetClose(net);
|
||||||
continue;
|
continue;
|
||||||
@ -2804,10 +2804,10 @@ cmdrc(m1, m2)
|
|||||||
* *cpp: If *cpp was equal to NULL, it will be filled
|
* *cpp: If *cpp was equal to NULL, it will be filled
|
||||||
* in with a pointer to our static area that has
|
* in with a pointer to our static area that has
|
||||||
* the option filled in. This will be 32bit aligned.
|
* the option filled in. This will be 32bit aligned.
|
||||||
*
|
*
|
||||||
* *lenp: This will be filled in with how long the option
|
* *lenp: This will be filled in with how long the option
|
||||||
* pointed to by *cpp is.
|
* pointed to by *cpp is.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
unsigned long
|
unsigned long
|
||||||
sourceroute(arg, cpp, lenp)
|
sourceroute(arg, cpp, lenp)
|
||||||
|
@ -65,7 +65,7 @@ tninit()
|
|||||||
init_terminal();
|
init_terminal();
|
||||||
|
|
||||||
init_network();
|
init_network();
|
||||||
|
|
||||||
init_telnet();
|
init_telnet();
|
||||||
|
|
||||||
init_sys();
|
init_sys();
|
||||||
@ -192,7 +192,7 @@ main(argc, argv)
|
|||||||
case 'f':
|
case 'f':
|
||||||
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
|
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
|
||||||
if (forward_flags & OPTS_FORWARD_CREDS) {
|
if (forward_flags & OPTS_FORWARD_CREDS) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Only one of -f and -F allowed.\n",
|
"%s: Only one of -f and -F allowed.\n",
|
||||||
prompt);
|
prompt);
|
||||||
usage();
|
usage();
|
||||||
@ -200,14 +200,14 @@ main(argc, argv)
|
|||||||
forward_flags |= OPTS_FORWARD_CREDS;
|
forward_flags |= OPTS_FORWARD_CREDS;
|
||||||
#else
|
#else
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Warning: -f ignored, no Kerberos V5 support.\n",
|
"%s: Warning: -f ignored, no Kerberos V5 support.\n",
|
||||||
prompt);
|
prompt);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
|
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
|
||||||
if (forward_flags & OPTS_FORWARD_CREDS) {
|
if (forward_flags & OPTS_FORWARD_CREDS) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Only one of -f and -F allowed.\n",
|
"%s: Only one of -f and -F allowed.\n",
|
||||||
prompt);
|
prompt);
|
||||||
usage();
|
usage();
|
||||||
@ -216,7 +216,7 @@ main(argc, argv)
|
|||||||
forward_flags |= OPTS_FORWARDABLE_CREDS;
|
forward_flags |= OPTS_FORWARDABLE_CREDS;
|
||||||
#else
|
#else
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Warning: -F ignored, no Kerberos V5 support.\n",
|
"%s: Warning: -F ignored, no Kerberos V5 support.\n",
|
||||||
prompt);
|
prompt);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -223,7 +223,7 @@ TerminalSpecialChars(c)
|
|||||||
/*
|
/*
|
||||||
* Flush output to the terminal
|
* Flush output to the terminal
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
TerminalFlushOutput()
|
TerminalFlushOutput()
|
||||||
{
|
{
|
||||||
@ -946,7 +946,7 @@ process_rings(netin, netout, netex, ttyin, ttyout, poll)
|
|||||||
|
|
||||||
if (netout) {
|
if (netout) {
|
||||||
FD_SET(net, &obits);
|
FD_SET(net, &obits);
|
||||||
}
|
}
|
||||||
if (ttyout) {
|
if (ttyout) {
|
||||||
FD_SET(tout, &obits);
|
FD_SET(tout, &obits);
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ init_telnet()
|
|||||||
ClearArray(options);
|
ClearArray(options);
|
||||||
|
|
||||||
connected = In3270 = ISend = localflow = donebinarytoggle = 0;
|
connected = In3270 = ISend = localflow = donebinarytoggle = 0;
|
||||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||||
auth_encrypt_connect(connected);
|
auth_encrypt_connect(connected);
|
||||||
#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */
|
#endif /* defined(AUTHENTICATION) || defined(ENCRYPTION) */
|
||||||
restartany = -1;
|
restartany = -1;
|
||||||
@ -689,7 +689,7 @@ mklist(buf, name)
|
|||||||
else if (islower(c))
|
else if (islower(c))
|
||||||
*cp = toupper(c);
|
*cp = toupper(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for an old V6 2 character name. If the second
|
* Check for an old V6 2 character name. If the second
|
||||||
* name points to the beginning of the buffer, and is
|
* name points to the beginning of the buffer, and is
|
||||||
@ -1834,7 +1834,7 @@ telrcv()
|
|||||||
case TS_IAC:
|
case TS_IAC:
|
||||||
process_iac:
|
process_iac:
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|
||||||
case WILL:
|
case WILL:
|
||||||
telrcv_state = TS_WILL;
|
telrcv_state = TS_WILL;
|
||||||
continue;
|
continue;
|
||||||
@ -2249,7 +2249,7 @@ telnet(user)
|
|||||||
{
|
{
|
||||||
sys_telnet_init();
|
sys_telnet_init();
|
||||||
|
|
||||||
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
#if defined(AUTHENTICATION) || defined(ENCRYPTION)
|
||||||
{
|
{
|
||||||
static char local_host[256] = { 0 };
|
static char local_host[256] = { 0 };
|
||||||
|
|
||||||
|
@ -593,7 +593,7 @@ printsub(direction, pointer, length)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LM_SLC:
|
case LM_SLC:
|
||||||
fprintf(NetTrace, "SLC");
|
fprintf(NetTrace, "SLC");
|
||||||
for (i = 2; i < length - 2; i += 3) {
|
for (i = 2; i < length - 2; i += 3) {
|
||||||
@ -725,7 +725,7 @@ printsub(direction, pointer, length)
|
|||||||
fprintf(NetTrace, "\n");
|
fprintf(NetTrace, "\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(NetTrace, " %d", pointer[i]);
|
fprintf(NetTrace, " %d", pointer[i]);
|
||||||
break;
|
break;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: coff.c,v 1.1 1994/10/14 08:46:12 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: ibcs2.c,v 1.2 1994/10/14 08:45:16 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# $Id: Makefile,v 1.1 1995/01/12 13:03:01 ugen Exp $
|
# $Id: Makefile,v 1.2 1995/01/12 13:57:51 ugen Exp $
|
||||||
|
|
||||||
.PATH: ${.CURDIR}/../../sys/netinet
|
.PATH: ${.CURDIR}/../../sys/netinet
|
||||||
KMOD= ipfw_mod
|
KMOD= ipfw_mod
|
||||||
SRCS= ipfw_lkm.c ip_fw.c
|
SRCS= ipfw_lkm.c ip_fw.c
|
||||||
NOMAN=
|
NOMAN=
|
||||||
CFLAGS+= -DIPFIREWALL -DIPACCT
|
CFLAGS+= -DIPFIREWALL -DIPACCT
|
||||||
#
|
#
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include <sys/protosw.h>
|
#include <sys/protosw.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#include <sys/conf.h>
|
#include <sys/conf.h>
|
||||||
#include <sys/exec.h>
|
#include <sys/exec.h>
|
||||||
@ -73,7 +73,7 @@ ipfw_unload(struct lkm_table *lkmtp, int cmd)
|
|||||||
int s=splnet();
|
int s=splnet();
|
||||||
#ifdef IPFIREWALL
|
#ifdef IPFIREWALL
|
||||||
ip_fw_ctl_ptr=NULL;
|
ip_fw_ctl_ptr=NULL;
|
||||||
ip_fw_chk_ptr=NULL;
|
ip_fw_chk_ptr=NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef IPACCT
|
#ifdef IPACCT
|
||||||
ip_acct_ctl_ptr=NULL;
|
ip_acct_ctl_ptr=NULL;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: socksys.c,v 1.1 1994/10/16 20:38:50 sos Exp $
|
* $Id: socksys.c,v 1.2 1995/01/24 04:22:19 bde Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -40,12 +40,12 @@ int sockopen();
|
|||||||
int sockclose();
|
int sockclose();
|
||||||
int sockioctl();
|
int sockioctl();
|
||||||
|
|
||||||
struct cdevsw dev_socksys = {
|
struct cdevsw dev_socksys = {
|
||||||
(d_open_t *)sockopen, (d_close_t *)sockclose,
|
(d_open_t *)sockopen, (d_close_t *)sockclose,
|
||||||
(d_rdwr_t *)enodev, (d_rdwr_t *)enodev,
|
(d_rdwr_t *)enodev, (d_rdwr_t *)enodev,
|
||||||
(d_ioctl_t *)sockioctl, (d_stop_t *)enodev,
|
(d_ioctl_t *)sockioctl, (d_stop_t *)enodev,
|
||||||
(d_reset_t *)nullop, NULL,
|
(d_reset_t *)nullop, NULL,
|
||||||
(d_select_t *)seltrue, (d_mmap_t *)enodev,
|
(d_select_t *)seltrue, (d_mmap_t *)enodev,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: blank_saver.c,v 1.1 1995/02/22 13:45:30 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -42,17 +42,17 @@ MOD_MISC("blank_saver")
|
|||||||
void (*current_saver)();
|
void (*current_saver)();
|
||||||
void (*old_saver)();
|
void (*old_saver)();
|
||||||
|
|
||||||
static void
|
static void
|
||||||
blank_saver(int blank)
|
blank_saver(int blank)
|
||||||
{
|
{
|
||||||
u_char val;
|
u_char val;
|
||||||
if (blank) {
|
if (blank) {
|
||||||
scrn_blanked = 1;
|
scrn_blanked = 1;
|
||||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||||
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
|
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||||
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
|
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
|
||||||
scrn_blanked = 0;
|
scrn_blanked = 0;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: fade_saver.c,v 1.1 1995/02/22 13:46:32 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -42,7 +42,7 @@ MOD_MISC("fade_saver")
|
|||||||
void (*current_saver)();
|
void (*current_saver)();
|
||||||
void (*old_saver)();
|
void (*old_saver)();
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fade_saver(int blank)
|
fade_saver(int blank)
|
||||||
{
|
{
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: green_saver.c,v 1.1 1995/02/22 13:47:14 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -42,19 +42,19 @@ MOD_MISC("green_saver")
|
|||||||
void (*current_saver)();
|
void (*current_saver)();
|
||||||
void (*old_saver)();
|
void (*old_saver)();
|
||||||
|
|
||||||
static void
|
static void
|
||||||
green_saver(int blank)
|
green_saver(int blank)
|
||||||
{
|
{
|
||||||
u_char val;
|
u_char val;
|
||||||
if (blank) {
|
if (blank) {
|
||||||
scrn_blanked = 1;
|
scrn_blanked = 1;
|
||||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||||
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
|
outb(TSIDX, 0x01); outb(TSREG, val | 0x20);
|
||||||
outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
|
outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
|
||||||
outb(crtc_addr + 1, val & ~0x80);
|
outb(crtc_addr + 1, val & ~0x80);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
outb(TSIDX, 0x01); val = inb(TSREG);
|
outb(TSIDX, 0x01); val = inb(TSREG);
|
||||||
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
|
outb(TSIDX, 0x01); outb(TSREG, val & 0xDF);
|
||||||
outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
|
outb(crtc_addr, 0x17); val = inb(crtc_addr + 1);
|
||||||
outb(crtc_addr + 1, val | 0x80);
|
outb(crtc_addr + 1, val | 0x80);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: snake_saver.c,v 1.2 1995/03/30 15:10:20 sos Exp $
|
* $Id: snake_saver.c,v 1.3 1995/05/16 19:10:11 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -42,7 +42,7 @@ MOD_MISC("snake_saver")
|
|||||||
void (*current_saver)();
|
void (*current_saver)();
|
||||||
void (*old_saver)();
|
void (*old_saver)();
|
||||||
|
|
||||||
static void
|
static void
|
||||||
snake_saver(int blank)
|
snake_saver(int blank)
|
||||||
{
|
{
|
||||||
const char saves[] = {"FreeBSD-2.0.5"};
|
const char saves[] = {"FreeBSD-2.0.5"};
|
||||||
@ -70,7 +70,7 @@ snake_saver(int blank)
|
|||||||
outb(crtc_addr+1, f & 0xff);
|
outb(crtc_addr+1, f & 0xff);
|
||||||
scrn_blanked = 1;
|
scrn_blanked = 1;
|
||||||
}
|
}
|
||||||
if (scrn_blanked++ < 4)
|
if (scrn_blanked++ < 4)
|
||||||
return;
|
return;
|
||||||
scrn_blanked = 1;
|
scrn_blanked = 1;
|
||||||
*(savs[sizeof(saves)-2]) = scr_map[0x20];
|
*(savs[sizeof(saves)-2]) = scr_map[0x20];
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer
|
* notice, this list of conditions and the following disclaimer
|
||||||
* in this position and unchanged.
|
* in this position and unchanged.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
@ -25,7 +25,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (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 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: star_saver.c,v 1.1 1995/02/22 13:47:36 sos Exp $
|
* $Id: star_saver.c,v 1.2 1995/03/30 15:10:03 sos Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -48,31 +48,31 @@ void (*old_saver)();
|
|||||||
* Alternate saver that got its inspiration from a well known utility
|
* Alternate saver that got its inspiration from a well known utility
|
||||||
* package for an inferior^H^H^H^H^H^Hfamous OS.
|
* package for an inferior^H^H^H^H^H^Hfamous OS.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
star_saver(int blank)
|
star_saver(int blank)
|
||||||
{
|
{
|
||||||
scr_stat *scp = cur_console;
|
scr_stat *scp = cur_console;
|
||||||
int cell, i;
|
int cell, i;
|
||||||
char pattern[] = {"...........++++*** "};
|
char pattern[] = {"...........++++*** "};
|
||||||
char colors[] = {FG_DARKGREY, FG_LIGHTGREY,
|
char colors[] = {FG_DARKGREY, FG_LIGHTGREY,
|
||||||
FG_WHITE, FG_LIGHTCYAN};
|
FG_WHITE, FG_LIGHTCYAN};
|
||||||
static u_short stars[NUM_STARS][2];
|
static u_short stars[NUM_STARS][2];
|
||||||
|
|
||||||
if (blank) {
|
if (blank) {
|
||||||
if (!scrn_blanked) {
|
if (!scrn_blanked) {
|
||||||
scrn_blanked = 1;
|
scrn_blanked = 1;
|
||||||
fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
|
fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
|
||||||
scp->xsize * scp->ysize);
|
scp->xsize * scp->ysize);
|
||||||
set_border(0);
|
set_border(0);
|
||||||
for(i=0; i<NUM_STARS; i++) {
|
for(i=0; i<NUM_STARS; i++) {
|
||||||
stars[i][0] =
|
stars[i][0] =
|
||||||
random() % (scp->xsize*scp->ysize);
|
random() % (scp->xsize*scp->ysize);
|
||||||
stars[i][1] = 0;
|
stars[i][1] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cell = random() % NUM_STARS;
|
cell = random() % NUM_STARS;
|
||||||
*((u_short*)(Crtat + stars[cell][0])) =
|
*((u_short*)(Crtat + stars[cell][0])) =
|
||||||
scr_map[pattern[stars[cell][1]]] |
|
scr_map[pattern[stars[cell][1]]] |
|
||||||
colors[random()%sizeof(colors)] << 8;
|
colors[random()%sizeof(colors)] << 8;
|
||||||
if ((stars[cell][1]+=(random()%4)) >= sizeof(pattern)-1) {
|
if ((stars[cell][1]+=(random()%4)) >= sizeof(pattern)-1) {
|
||||||
stars[cell][0] = random() % (scp->xsize*scp->ysize);
|
stars[cell][0] = random() % (scp->xsize*scp->ysize);
|
||||||
|
@ -97,7 +97,7 @@ int main(argc, argv)
|
|||||||
}
|
}
|
||||||
if (init == -1)
|
if (init == -1)
|
||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
if (access(_PATH_CLOCK, F_OK))
|
if (access(_PATH_CLOCK, F_OK))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -705,7 +705,7 @@ display(f, lp)
|
|||||||
|
|
||||||
case FS_BSDLFS:
|
case FS_BSDLFS:
|
||||||
fprintf(f, " %5d %5d %5d",
|
fprintf(f, " %5d %5d %5d",
|
||||||
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
||||||
pp->p_cpg);
|
pp->p_cpg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ display(f, lp)
|
|||||||
else
|
else
|
||||||
putc(' ', f);
|
putc(' ', f);
|
||||||
fprintf(f, "- %d",
|
fprintf(f, "- %d",
|
||||||
(pp->p_offset +
|
(pp->p_offset +
|
||||||
pp->p_size + lp->d_secpercyl - 1) /
|
pp->p_size + lp->d_secpercyl - 1) /
|
||||||
lp->d_secpercyl - 1);
|
lp->d_secpercyl - 1);
|
||||||
if (pp->p_size % lp->d_secpercyl)
|
if (pp->p_size % lp->d_secpercyl)
|
||||||
|
@ -705,7 +705,7 @@ display(f, lp)
|
|||||||
|
|
||||||
case FS_BSDLFS:
|
case FS_BSDLFS:
|
||||||
fprintf(f, " %5d %5d %5d",
|
fprintf(f, " %5d %5d %5d",
|
||||||
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
pp->p_fsize, pp->p_fsize * pp->p_frag,
|
||||||
pp->p_cpg);
|
pp->p_cpg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -720,7 +720,7 @@ display(f, lp)
|
|||||||
else
|
else
|
||||||
putc(' ', f);
|
putc(' ', f);
|
||||||
fprintf(f, "- %d",
|
fprintf(f, "- %d",
|
||||||
(pp->p_offset +
|
(pp->p_offset +
|
||||||
pp->p_size + lp->d_secpercyl - 1) /
|
pp->p_size + lp->d_secpercyl - 1) /
|
||||||
lp->d_secpercyl - 1);
|
lp->d_secpercyl - 1);
|
||||||
if (pp->p_size % lp->d_secpercyl)
|
if (pp->p_size % lp->d_secpercyl)
|
||||||
|
@ -55,7 +55,7 @@ struct nlist nlk[] = {
|
|||||||
|
|
||||||
int quiet = FALSE;
|
int quiet = FALSE;
|
||||||
|
|
||||||
void
|
void
|
||||||
fatal(name, str)
|
fatal(name, str)
|
||||||
char *name, *str;
|
char *name, *str;
|
||||||
{
|
{
|
||||||
@ -68,7 +68,7 @@ fatal(name, str)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
error(name, str)
|
error(name, str)
|
||||||
char *name, *str;
|
char *name, *str;
|
||||||
{
|
{
|
||||||
@ -186,7 +186,7 @@ main(ac, av)
|
|||||||
fatal("kvmread", NULL);
|
fatal("kvmread", NULL);
|
||||||
dev_found = 0;
|
dev_found = 0;
|
||||||
|
|
||||||
while(pos_t!=NULL) {
|
while(pos_t!=NULL) {
|
||||||
if (kvm_read(kd, pos_t, &buf1, sizeof(struct isa_device)) < 0)
|
if (kvm_read(kd, pos_t, &buf1, sizeof(struct isa_device)) < 0)
|
||||||
fatal("kvmread", NULL);
|
fatal("kvmread", NULL);
|
||||||
|
|
||||||
@ -222,7 +222,7 @@ main(ac, av)
|
|||||||
if (buf1.id_id != 0)
|
if (buf1.id_id != 0)
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf(
|
printf(
|
||||||
"kernel: id=%u io=%X irq=%d drq=%d maddr=%X msize=%d flags=%X enabled=%X \n",
|
"kernel: id=%u io=%X irq=%d drq=%d maddr=%X msize=%d flags=%X enabled=%X \n",
|
||||||
buf1.id_id, buf1.id_iobase, buf1.id_irq, buf1.id_drq,
|
buf1.id_id, buf1.id_iobase, buf1.id_irq, buf1.id_drq,
|
||||||
buf1.id_maddr, buf1.id_msize, buf1.id_flags, buf1.id_enabled);
|
buf1.id_maddr, buf1.id_msize, buf1.id_flags, buf1.id_enabled);
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ int mapdirs __P((ino_t maxino, long *tapesize));
|
|||||||
|
|
||||||
/* file dumping routines */
|
/* file dumping routines */
|
||||||
void blksout __P((daddr_t *blkp, int frags, ino_t ino));
|
void blksout __P((daddr_t *blkp, int frags, ino_t ino));
|
||||||
void bread __P((daddr_t blkno, char *buf, int size));
|
void bread __P((daddr_t blkno, char *buf, int size));
|
||||||
void dumpino __P((struct dinode *dp, ino_t ino));
|
void dumpino __P((struct dinode *dp, ino_t ino));
|
||||||
void dumpmap __P((char *map, int type, ino_t ino));
|
void dumpmap __P((char *map, int type, ino_t ino));
|
||||||
void writeheader __P((ino_t ino));
|
void writeheader __P((ino_t ino));
|
||||||
|
@ -93,7 +93,7 @@ main(argc, argv)
|
|||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
register ino_t ino;
|
register ino_t ino;
|
||||||
register int dirty;
|
register int dirty;
|
||||||
register struct dinode *dp;
|
register struct dinode *dp;
|
||||||
register struct fstab *dt;
|
register struct fstab *dt;
|
||||||
register char *map;
|
register char *map;
|
||||||
@ -359,7 +359,7 @@ main(argc, argv)
|
|||||||
the end of each block written, and not in mid-block.
|
the end of each block written, and not in mid-block.
|
||||||
Assume no erroneous blocks; this can be compensated
|
Assume no erroneous blocks; this can be compensated
|
||||||
for with an artificially low tape size. */
|
for with an artificially low tape size. */
|
||||||
fetapes =
|
fetapes =
|
||||||
( tapesize /* blocks */
|
( tapesize /* blocks */
|
||||||
* TP_BSIZE /* bytes/block */
|
* TP_BSIZE /* bytes/block */
|
||||||
* (1.0/density) /* 0.1" / byte */
|
* (1.0/density) /* 0.1" / byte */
|
||||||
|
@ -171,7 +171,7 @@ struct group *gp;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the names from the group entry "operator" to notify.
|
* Get the names from the group entry "operator" to notify.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
set_operators()
|
set_operators()
|
||||||
{
|
{
|
||||||
@ -300,7 +300,7 @@ timeest()
|
|||||||
if (tnow >= tschedule) {
|
if (tnow >= tschedule) {
|
||||||
tschedule = tnow + 300;
|
tschedule = tnow + 300;
|
||||||
if (blockswritten < 500)
|
if (blockswritten < 500)
|
||||||
return;
|
return;
|
||||||
deltat = tstart_writing - tnow +
|
deltat = tstart_writing - tnow +
|
||||||
(1.0 * (tnow - tstart_writing))
|
(1.0 * (tnow - tstart_writing))
|
||||||
/ blockswritten * tapesize;
|
/ blockswritten * tapesize;
|
||||||
|
@ -318,12 +318,12 @@ trewind()
|
|||||||
|
|
||||||
for (f = 0; f < SLAVES; f++) {
|
for (f = 0; f < SLAVES; f++) {
|
||||||
/*
|
/*
|
||||||
* Drain the results, but unlike EOT we DO (or should) care
|
* Drain the results, but unlike EOT we DO (or should) care
|
||||||
* what the return values were, since if we detect EOT after
|
* what the return values were, since if we detect EOT after
|
||||||
* we think we've written the last blocks to the tape anyway,
|
* we think we've written the last blocks to the tape anyway,
|
||||||
* we have to replay those blocks with rollforward.
|
* we have to replay those blocks with rollforward.
|
||||||
*
|
*
|
||||||
* fixme: punt for now.
|
* fixme: punt for now.
|
||||||
*/
|
*/
|
||||||
if (slaves[f].sent) {
|
if (slaves[f].sent) {
|
||||||
if (atomic(read, slaves[f].fd, (char *)&got, sizeof got)
|
if (atomic(read, slaves[f].fd, (char *)&got, sizeof got)
|
||||||
@ -391,9 +391,9 @@ rollforward()
|
|||||||
ntb = (union u_spcl *)tslp->tblock[1];
|
ntb = (union u_spcl *)tslp->tblock[1];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Each of the N slaves should have requests that need to
|
* Each of the N slaves should have requests that need to
|
||||||
* be replayed on the next tape. Use the extra slave buffers
|
* be replayed on the next tape. Use the extra slave buffers
|
||||||
* (slaves[SLAVES]) to construct request lists to be sent to
|
* (slaves[SLAVES]) to construct request lists to be sent to
|
||||||
* each slave in turn.
|
* each slave in turn.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < SLAVES; i++) {
|
for (i = 0; i < SLAVES; i++) {
|
||||||
@ -401,7 +401,7 @@ rollforward()
|
|||||||
otb = (union u_spcl *)slp->tblock;
|
otb = (union u_spcl *)slp->tblock;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For each request in the current slave, copy it to tslp.
|
* For each request in the current slave, copy it to tslp.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
prev = NULL;
|
prev = NULL;
|
||||||
@ -445,8 +445,8 @@ rollforward()
|
|||||||
|
|
||||||
if (prev->dblk != 0) {
|
if (prev->dblk != 0) {
|
||||||
/*
|
/*
|
||||||
* If the last one was a disk block, make the
|
* If the last one was a disk block, make the
|
||||||
* first of this one be the last bit of that disk
|
* first of this one be the last bit of that disk
|
||||||
* block...
|
* block...
|
||||||
*/
|
*/
|
||||||
q->dblk = prev->dblk +
|
q->dblk = prev->dblk +
|
||||||
@ -454,7 +454,7 @@ rollforward()
|
|||||||
ntb = (union u_spcl *)tslp->tblock;
|
ntb = (union u_spcl *)tslp->tblock;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* It wasn't a disk block. Copy the data to its
|
* It wasn't a disk block. Copy the data to its
|
||||||
* new location in the buffer.
|
* new location in the buffer.
|
||||||
*/
|
*/
|
||||||
q->dblk = 0;
|
q->dblk = 0;
|
||||||
@ -548,7 +548,7 @@ startnewtape(top)
|
|||||||
case X_FINOK:
|
case X_FINOK:
|
||||||
msg("Child %d finishes X_FINOK\n", childpid);
|
msg("Child %d finishes X_FINOK\n", childpid);
|
||||||
break;
|
break;
|
||||||
case X_ABORT:
|
case X_ABORT:
|
||||||
msg("Child %d finishes X_ABORT\n", childpid);
|
msg("Child %d finishes X_ABORT\n", childpid);
|
||||||
break;
|
break;
|
||||||
case X_REWRITE:
|
case X_REWRITE:
|
||||||
@ -598,7 +598,7 @@ startnewtape(top)
|
|||||||
while ((tapefd = (host ? rmtopen(tape, 2) :
|
while ((tapefd = (host ? rmtopen(tape, 2) :
|
||||||
pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
|
pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
|
||||||
#else
|
#else
|
||||||
while ((tapefd = (pipeout ? 1 :
|
while ((tapefd = (pipeout ? 1 :
|
||||||
open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
|
open(tape, O_WRONLY|O_CREAT, 0666))) < 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
@ -613,7 +613,7 @@ startnewtape(top)
|
|||||||
blocksthisvol = 0;
|
blocksthisvol = 0;
|
||||||
if (top)
|
if (top)
|
||||||
newtape++; /* new tape signal */
|
newtape++; /* new tape signal */
|
||||||
spcl.c_count = slp->count;
|
spcl.c_count = slp->count;
|
||||||
/*
|
/*
|
||||||
* measure firstrec in TP_BSIZE units since restore doesn't
|
* measure firstrec in TP_BSIZE units since restore doesn't
|
||||||
* know the correct ntrec value...
|
* know the correct ntrec value...
|
||||||
@ -707,13 +707,13 @@ enslave()
|
|||||||
Exit(X_FINOK);
|
Exit(X_FINOK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < SLAVES; i++)
|
for (i = 0; i < SLAVES; i++)
|
||||||
(void) atomic(write, slaves[i].fd,
|
(void) atomic(write, slaves[i].fd,
|
||||||
(char *) &slaves[(i + 1) % SLAVES].pid,
|
(char *) &slaves[(i + 1) % SLAVES].pid,
|
||||||
sizeof slaves[0].pid);
|
sizeof slaves[0].pid);
|
||||||
|
|
||||||
master = 0;
|
master = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -769,7 +769,7 @@ doslave(cmd, slave_number)
|
|||||||
p->count * TP_BSIZE);
|
p->count * TP_BSIZE);
|
||||||
} else {
|
} else {
|
||||||
if (p->count != 1 || atomic(read, cmd,
|
if (p->count != 1 || atomic(read, cmd,
|
||||||
(char *)slp->tblock[trecno],
|
(char *)slp->tblock[trecno],
|
||||||
TP_BSIZE) != TP_BSIZE)
|
TP_BSIZE) != TP_BSIZE)
|
||||||
quit("master/slave protocol botched.\n");
|
quit("master/slave protocol botched.\n");
|
||||||
}
|
}
|
||||||
@ -798,7 +798,7 @@ doslave(cmd, slave_number)
|
|||||||
#ifdef WRITEDEBUG
|
#ifdef WRITEDEBUG
|
||||||
printf("slave %d wrote %d\n", slave_number, wrote);
|
printf("slave %d wrote %d\n", slave_number, wrote);
|
||||||
#endif
|
#endif
|
||||||
if (wrote < 0)
|
if (wrote < 0)
|
||||||
break;
|
break;
|
||||||
if (wrote == 0)
|
if (wrote == 0)
|
||||||
eot_count++;
|
eot_count++;
|
||||||
@ -806,7 +806,7 @@ doslave(cmd, slave_number)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WRITEDEBUG
|
#ifdef WRITEDEBUG
|
||||||
if (size != writesize)
|
if (size != writesize)
|
||||||
printf("slave %d only wrote %d out of %d bytes and gave up.\n",
|
printf("slave %d only wrote %d out of %d bytes and gave up.\n",
|
||||||
slave_number, size, writesize);
|
slave_number, size, writesize);
|
||||||
#endif
|
#endif
|
||||||
@ -828,7 +828,7 @@ doslave(cmd, slave_number)
|
|||||||
* (for EOT handling)
|
* (for EOT handling)
|
||||||
*/
|
*/
|
||||||
(void) atomic(write, cmd, (char *)&size, sizeof size);
|
(void) atomic(write, cmd, (char *)&size, sizeof size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If partial write, don't want next slave to go.
|
* If partial write, don't want next slave to go.
|
||||||
|
@ -545,14 +545,14 @@ getino(inum)
|
|||||||
* Error recovery is attempted at most BREADEMAX times before seeking
|
* Error recovery is attempted at most BREADEMAX times before seeking
|
||||||
* consent from the operator to continue.
|
* consent from the operator to continue.
|
||||||
*/
|
*/
|
||||||
int breaderrors = 0;
|
int breaderrors = 0;
|
||||||
#define BREADEMAX 32
|
#define BREADEMAX 32
|
||||||
|
|
||||||
void
|
void
|
||||||
bread(blkno, buf, size)
|
bread(blkno, buf, size)
|
||||||
daddr_t blkno;
|
daddr_t blkno;
|
||||||
char *buf;
|
char *buf;
|
||||||
int size;
|
int size;
|
||||||
{
|
{
|
||||||
int cnt, i;
|
int cnt, i;
|
||||||
extern int errno;
|
extern int errno;
|
||||||
|
@ -221,10 +221,10 @@ dump_ifile(fd, lfsp, do_ientries)
|
|||||||
dump_cleaner_info(lfsp, ipage);
|
dump_cleaner_info(lfsp, ipage);
|
||||||
print_suheader;
|
print_suheader;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < (lfsp->lfs_segtabsz + lfsp->lfs_cleansz)) {
|
if (i < (lfsp->lfs_segtabsz + lfsp->lfs_cleansz)) {
|
||||||
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
||||||
lfsp->lfs_sepb);
|
lfsp->lfs_sepb);
|
||||||
if (!inum)
|
if (!inum)
|
||||||
if(!do_ientries)
|
if(!do_ientries)
|
||||||
@ -251,11 +251,11 @@ dump_ifile(fd, lfsp, do_ientries)
|
|||||||
if (i < lfsp->lfs_cleansz) {
|
if (i < lfsp->lfs_cleansz) {
|
||||||
dump_cleaner_info(lfsp, ipage);
|
dump_cleaner_info(lfsp, ipage);
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
i -= lfsp->lfs_cleansz;
|
i -= lfsp->lfs_cleansz;
|
||||||
|
|
||||||
if (i < lfsp->lfs_segtabsz) {
|
if (i < lfsp->lfs_segtabsz) {
|
||||||
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
inum = dump_ipage_segusage(lfsp, inum, ipage,
|
||||||
lfsp->lfs_sepb);
|
lfsp->lfs_sepb);
|
||||||
if (!inum)
|
if (!inum)
|
||||||
if(!do_ientries)
|
if(!do_ientries)
|
||||||
@ -285,7 +285,7 @@ dump_ifile(fd, lfsp, do_ientries)
|
|||||||
if (i < lfsp->lfs_cleansz) {
|
if (i < lfsp->lfs_cleansz) {
|
||||||
dump_cleaner_info(lfsp, ipage);
|
dump_cleaner_info(lfsp, ipage);
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
i -= lfsp->lfs_cleansz;
|
i -= lfsp->lfs_cleansz;
|
||||||
|
|
||||||
if (i < lfsp->lfs_segtabsz) {
|
if (i < lfsp->lfs_segtabsz) {
|
||||||
@ -385,7 +385,7 @@ dump_sum(fd, lfsp, sp, segnum, addr)
|
|||||||
int numblocks;
|
int numblocks;
|
||||||
struct dinode *inop;
|
struct dinode *inop;
|
||||||
|
|
||||||
if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum,
|
if (sp->ss_sumsum != (ck = cksum(&sp->ss_datasum,
|
||||||
LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum)))) {
|
LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum)))) {
|
||||||
(void)printf("dumplfs: %s %d address 0x%lx\n",
|
(void)printf("dumplfs: %s %d address 0x%lx\n",
|
||||||
"corrupt summary block; segment", segnum, addr);
|
"corrupt summary block; segment", segnum, addr);
|
||||||
@ -410,10 +410,10 @@ dump_sum(fd, lfsp, sp, segnum, addr)
|
|||||||
printf(" Inode addresses:");
|
printf(" Inode addresses:");
|
||||||
for (dp--, i = 0; i < sp->ss_ninos; dp--) {
|
for (dp--, i = 0; i < sp->ss_ninos; dp--) {
|
||||||
printf("\t0x%X {", *dp);
|
printf("\t0x%X {", *dp);
|
||||||
get(fd, *dp << (lfsp->lfs_bshift - lfsp->lfs_fsbtodb), inop,
|
get(fd, *dp << (lfsp->lfs_bshift - lfsp->lfs_fsbtodb), inop,
|
||||||
(1 << lfsp->lfs_bshift));
|
(1 << lfsp->lfs_bshift));
|
||||||
for (j = 0; i < sp->ss_ninos && j < INOPB(lfsp); j++, i++) {
|
for (j = 0; i < sp->ss_ninos && j < INOPB(lfsp); j++, i++) {
|
||||||
if (j > 0)
|
if (j > 0)
|
||||||
(void)printf(", ");
|
(void)printf(", ");
|
||||||
(void)printf("%d", inop[j].di_inumber);
|
(void)printf("%d", inop[j].di_inumber);
|
||||||
}
|
}
|
||||||
@ -463,7 +463,7 @@ dump_segment(fd, segnum, addr, lfsp, dump_sb)
|
|||||||
do {
|
do {
|
||||||
get(fd, sum_offset, sumblock, LFS_SUMMARY_SIZE);
|
get(fd, sum_offset, sumblock, LFS_SUMMARY_SIZE);
|
||||||
sump = (SEGSUM *)sumblock;
|
sump = (SEGSUM *)sumblock;
|
||||||
if (sump->ss_sumsum != cksum (&sump->ss_datasum,
|
if (sump->ss_sumsum != cksum (&sump->ss_datasum,
|
||||||
LFS_SUMMARY_SIZE - sizeof(sump->ss_sumsum))) {
|
LFS_SUMMARY_SIZE - sizeof(sump->ss_sumsum))) {
|
||||||
sbp = (struct lfs *)sump;
|
sbp = (struct lfs *)sump;
|
||||||
if (sb = (sbp->lfs_magic == LFS_MAGIC)) {
|
if (sb = (sbp->lfs_magic == LFS_MAGIC)) {
|
||||||
@ -479,7 +479,7 @@ dump_segment(fd, segnum, addr, lfsp, dump_sb)
|
|||||||
nblocks = dump_sum(fd, lfsp, sump, segnum, sum_offset >>
|
nblocks = dump_sum(fd, lfsp, sump, segnum, sum_offset >>
|
||||||
(lfsp->lfs_bshift - lfsp->lfs_fsbtodb));
|
(lfsp->lfs_bshift - lfsp->lfs_fsbtodb));
|
||||||
if (nblocks)
|
if (nblocks)
|
||||||
sum_offset += LFS_SUMMARY_SIZE +
|
sum_offset += LFS_SUMMARY_SIZE +
|
||||||
(nblocks << lfsp->lfs_bshift);
|
(nblocks << lfsp->lfs_bshift);
|
||||||
else
|
else
|
||||||
sum_offset = 0;
|
sum_offset = 0;
|
||||||
|
@ -40,7 +40,7 @@ static char copyright[] =
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
/*static char sccsid[] = "From: @(#)swapon.c 8.1 (Berkeley) 6/5/93";*/
|
/*static char sccsid[] = "From: @(#)swapon.c 8.1 (Berkeley) 6/5/93";*/
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id$";
|
"$Id: dumpon.c,v 1.1 1995/05/12 19:10:09 wollman Exp $";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
@ -99,7 +99,7 @@ main(int argc, char **argv)
|
|||||||
mib[0] = CTL_KERN;
|
mib[0] = CTL_KERN;
|
||||||
mib[1] = KERN_DUMPDEV;
|
mib[1] = KERN_DUMPDEV;
|
||||||
|
|
||||||
rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev,
|
rv = sysctl(mib, 2, (void *)0, (size_t *)0, &stab.st_rdev,
|
||||||
sizeof stab.st_rdev);
|
sizeof stab.st_rdev);
|
||||||
if (rv) {
|
if (rv) {
|
||||||
err(EX_OSERR, "sysctl: kern.dumpdev");
|
err(EX_OSERR, "sysctl: kern.dumpdev");
|
||||||
@ -110,7 +110,7 @@ main(int argc, char **argv)
|
|||||||
printf("%s: crash dumps disabled\n", whoami);
|
printf("%s: crash dumps disabled\n", whoami);
|
||||||
} else {
|
} else {
|
||||||
printf("%s: crash dumps to %s (%lu, %lu)\n",
|
printf("%s: crash dumps to %s (%lu, %lu)\n",
|
||||||
whoami, argv[0],
|
whoami, argv[0],
|
||||||
(unsigned long)major(stab.st_rdev),
|
(unsigned long)major(stab.st_rdev),
|
||||||
(unsigned long)minor(stab.st_rdev));
|
(unsigned long)minor(stab.st_rdev));
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
PROG= fdisk
|
PROG= fdisk
|
||||||
SRCS= fdisk.c
|
SRCS= fdisk.c
|
||||||
MAN8= fdisk.8
|
MAN8= fdisk.8
|
||||||
|
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
/*
|
/*
|
||||||
* Mach Operating System
|
* Mach Operating System
|
||||||
* Copyright (c) 1992 Carnegie Mellon University
|
* Copyright (c) 1992 Carnegie Mellon University
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify and distribute this software and its
|
* Permission to use, copy, modify and distribute this software and its
|
||||||
* documentation is hereby granted, provided that both the copyright
|
* documentation is hereby granted, provided that both the copyright
|
||||||
* notice and this permission notice appear in all copies of the
|
* notice and this permission notice appear in all copies of the
|
||||||
* software, derivative works or modified versions, and any portions
|
* software, derivative works or modified versions, and any portions
|
||||||
* thereof, and that both notices appear in supporting documentation.
|
* thereof, and that both notices appear in supporting documentation.
|
||||||
*
|
*
|
||||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* Carnegie Mellon requests users of this software to return to
|
* Carnegie Mellon requests users of this software to return to
|
||||||
*
|
*
|
||||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||||
* School of Computer Science
|
* School of Computer Science
|
||||||
* Carnegie Mellon University
|
* Carnegie Mellon University
|
||||||
* Pittsburgh PA 15213-3890
|
* Pittsburgh PA 15213-3890
|
||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||||
* the rights to redistribute these changes.
|
* the rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
@ -89,37 +89,37 @@ static int i_flag = 0; /* replace partition data */
|
|||||||
static int u_flag = 0; /* update partition data */
|
static int u_flag = 0; /* update partition data */
|
||||||
|
|
||||||
static unsigned char bootcode[] = {
|
static unsigned char bootcode[] = {
|
||||||
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
||||||
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
||||||
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
||||||
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
||||||
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
||||||
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
||||||
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
||||||
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
||||||
0xeb, 0xf4, 0xfb, 0xeb, 0xfe,
|
0xeb, 0xf4, 0xfb, 0xeb, 0xfe,
|
||||||
'M', 'i', 's', 's', 'i', 'n', 'g', ' ',
|
'M', 'i', 's', 's', 'i', 'n', 'g', ' ',
|
||||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||||
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
||||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||||
'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ',
|
'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ',
|
||||||
'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0,
|
'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0,
|
||||||
'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ',
|
'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ',
|
||||||
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
||||||
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
struct part_type
|
struct part_type
|
||||||
@ -128,46 +128,46 @@ struct part_type
|
|||||||
char *name;
|
char *name;
|
||||||
}part_types[] =
|
}part_types[] =
|
||||||
{
|
{
|
||||||
{0x00, "unused"}
|
{0x00, "unused"}
|
||||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||||
,{0x02, "XENIX / filesystem"}
|
,{0x02, "XENIX / filesystem"}
|
||||||
,{0x03, "XENIX /usr filesystem"}
|
,{0x03, "XENIX /usr filesystem"}
|
||||||
,{0x04, "Primary DOS with 16 bit FAT"}
|
,{0x04, "Primary DOS with 16 bit FAT"}
|
||||||
,{0x05, "Extended DOS"}
|
,{0x05, "Extended DOS"}
|
||||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||||
,{0x08, "AIX filesystem"}
|
,{0x08, "AIX filesystem"}
|
||||||
,{0x09, "AIX boot partition or Coherent"}
|
,{0x09, "AIX boot partition or Coherent"}
|
||||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||||
,{0x10, "OPUS"}
|
,{0x10, "OPUS"}
|
||||||
,{0x40, "VENIX 286"}
|
,{0x40, "VENIX 286"}
|
||||||
,{0x50, "DM"}
|
,{0x50, "DM"}
|
||||||
,{0x51, "DM"}
|
,{0x51, "DM"}
|
||||||
,{0x52, "CP/M or Microport SysV/AT"}
|
,{0x52, "CP/M or Microport SysV/AT"}
|
||||||
,{0x56, "GB"}
|
,{0x56, "GB"}
|
||||||
,{0x61, "Speed"}
|
,{0x61, "Speed"}
|
||||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||||
,{0x64, "Novell Netware 2.xx"}
|
,{0x64, "Novell Netware 2.xx"}
|
||||||
,{0x65, "Novell Netware 3.xx"}
|
,{0x65, "Novell Netware 3.xx"}
|
||||||
,{0x75, "PCIX"}
|
,{0x75, "PCIX"}
|
||||||
,{0x80, "Minix 1.1 ... 1.4a"}
|
,{0x80, "Minix 1.1 ... 1.4a"}
|
||||||
,{0x81, "Minix 1.4b ... 1.5.10"}
|
,{0x81, "Minix 1.4b ... 1.5.10"}
|
||||||
,{0x82, "Linux swap"}
|
,{0x82, "Linux swap"}
|
||||||
,{0x83, "Linux filesystem"}
|
,{0x83, "Linux filesystem"}
|
||||||
,{0x93, "Amoeba filesystem"}
|
,{0x93, "Amoeba filesystem"}
|
||||||
,{0x94, "Amoeba bad block table"}
|
,{0x94, "Amoeba bad block table"}
|
||||||
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
||||||
,{0xA7, "NEXTSTEP"}
|
,{0xA7, "NEXTSTEP"}
|
||||||
,{0xB7, "BSDI BSD/386 filesystem"}
|
,{0xB7, "BSDI BSD/386 filesystem"}
|
||||||
,{0xB8, "BSDI BSD/386 swap"}
|
,{0xB8, "BSDI BSD/386 swap"}
|
||||||
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
||||||
,{0xE1, "Speed"}
|
,{0xE1, "Speed"}
|
||||||
,{0xE3, "Speed"}
|
,{0xE3, "Speed"}
|
||||||
,{0xE4, "Speed"}
|
,{0xE4, "Speed"}
|
||||||
,{0xF1, "Speed"}
|
,{0xF1, "Speed"}
|
||||||
,{0xF2, "DOS 3.3+ Secondary"}
|
,{0xF2, "DOS 3.3+ Secondary"}
|
||||||
,{0xF4, "Speed"}
|
,{0xF4, "Speed"}
|
||||||
,{0xFF, "BBT (Bad Blocks Table)"}
|
,{0xFF, "BBT (Bad Blocks Table)"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ int i;
|
|||||||
|
|
||||||
if (argc > 0)
|
if (argc > 0)
|
||||||
disk = argv[0];
|
disk = argv[0];
|
||||||
|
|
||||||
if (open_disk(u_flag) < 0)
|
if (open_disk(u_flag) < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[3]);
|
|||||||
int size = disksecs - start;
|
int size = disksecs - start;
|
||||||
int rest;
|
int rest;
|
||||||
|
|
||||||
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
||||||
mboot.signature = BOOT_MAGIC;
|
mboot.signature = BOOT_MAGIC;
|
||||||
|
|
||||||
partp->dp_typ = DOSPTYP_386BSD;
|
partp->dp_typ = DOSPTYP_386BSD;
|
||||||
@ -366,7 +366,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i;
|
|||||||
dos(partp->dp_start+partp->dp_size - 1,
|
dos(partp->dp_start+partp->dp_size - 1,
|
||||||
&partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd);
|
&partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_part(i);
|
print_part(i);
|
||||||
} while (!ok("Are we happy with this entry?"));
|
} while (!ok("Are we happy with this entry?"));
|
||||||
}
|
}
|
||||||
@ -456,7 +456,7 @@ open_disk(u_flag)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (stat(disk, &st) == -1) {
|
if (stat(disk, &st) == -1) {
|
||||||
fprintf(stderr, "%s: Can't get file status of %s\n",
|
fprintf(stderr, "%s: Can't get file status of %s\n",
|
||||||
name, disk);
|
name, disk);
|
||||||
return -1;
|
return -1;
|
||||||
@ -516,7 +516,7 @@ get_params(verbose)
|
|||||||
|
|
||||||
read_s0()
|
read_s0()
|
||||||
{
|
{
|
||||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||||
fprintf(stderr, "%s: Can't read fdisk partition table\n", name);
|
fprintf(stderr, "%s: Can't read fdisk partition table\n", name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ write_s0()
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
if (ioctl(fd, DIOCWLABEL, &flag) < 0)
|
if (ioctl(fd, DIOCWLABEL, &flag) < 0)
|
||||||
perror("ioctl DIOCWLABEL");
|
perror("ioctl DIOCWLABEL");
|
||||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||||
fprintf(stderr, "%s: Can't write fdisk partition table\n",
|
fprintf(stderr, "%s: Can't write fdisk partition table\n",
|
||||||
name);
|
name);
|
||||||
return -1;
|
return -1;
|
||||||
@ -687,7 +687,7 @@ int type;
|
|||||||
int counter = 0;
|
int counter = 0;
|
||||||
struct part_type *ptr = part_types;
|
struct part_type *ptr = part_types;
|
||||||
|
|
||||||
|
|
||||||
while(counter < numentries)
|
while(counter < numentries)
|
||||||
{
|
{
|
||||||
if(ptr->type == type)
|
if(ptr->type == type)
|
||||||
|
@ -149,7 +149,7 @@ dirscan(idesc)
|
|||||||
dirty(bp);
|
dirty(bp);
|
||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
if (n & STOP)
|
if (n & STOP)
|
||||||
return (n);
|
return (n);
|
||||||
}
|
}
|
||||||
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
||||||
@ -512,7 +512,7 @@ makeentry(parent, ino, name)
|
|||||||
struct dinode *dp;
|
struct dinode *dp;
|
||||||
struct inodesc idesc;
|
struct inodesc idesc;
|
||||||
char pathbuf[MAXPATHLEN + 1];
|
char pathbuf[MAXPATHLEN + 1];
|
||||||
|
|
||||||
if (parent < ROOTINO || parent >= maxino ||
|
if (parent < ROOTINO || parent >= maxino ||
|
||||||
ino < ROOTINO || ino >= maxino)
|
ino < ROOTINO || ino >= maxino)
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -112,14 +112,14 @@ struct inodesc {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Linked list of duplicate blocks.
|
* Linked list of duplicate blocks.
|
||||||
*
|
*
|
||||||
* The list is composed of two parts. The first part of the
|
* The list is composed of two parts. The first part of the
|
||||||
* list (from duplist through the node pointed to by muldup)
|
* list (from duplist through the node pointed to by muldup)
|
||||||
* contains a single copy of each duplicate block that has been
|
* contains a single copy of each duplicate block that has been
|
||||||
* found. The second part of the list (from muldup to the end)
|
* found. The second part of the list (from muldup to the end)
|
||||||
* contains duplicate blocks that have been found more than once.
|
* contains duplicate blocks that have been found more than once.
|
||||||
* To check if a block has been found as a duplicate it is only
|
* To check if a block has been found as a duplicate it is only
|
||||||
* necessary to search from duplist through muldup. To find the
|
* necessary to search from duplist through muldup. To find the
|
||||||
* total number of times that a block has been found as a duplicate
|
* total number of times that a block has been found as a duplicate
|
||||||
* the entire list must be searched for occurences of the block
|
* the entire list must be searched for occurences of the block
|
||||||
* in question. The following diagram shows a sample list where
|
* in question. The following diagram shows a sample list where
|
||||||
|
@ -374,7 +374,7 @@ inocleanup()
|
|||||||
free((char *)inpsort);
|
free((char *)inpsort);
|
||||||
inphead = inpsort = NULL;
|
inphead = inpsort = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
inodirty()
|
inodirty()
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@ main(argc, argv)
|
|||||||
case 'c':
|
case 'c':
|
||||||
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
debug++;
|
debug++;
|
||||||
break;
|
break;
|
||||||
@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
|||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
if (cvtlevel && sblk.b_dirty) {
|
if (cvtlevel && sblk.b_dirty) {
|
||||||
/*
|
/*
|
||||||
* Write out the duplicate super blocks
|
* Write out the duplicate super blocks
|
||||||
*/
|
*/
|
||||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1980, 1986, 1993
|
* Copyright (c) 1980, 1986, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -211,7 +211,7 @@ pass2check(idesc)
|
|||||||
dirp->d_type = typemap[dirp->d_ino];
|
dirp->d_type = typemap[dirp->d_ino];
|
||||||
ret |= ALTERED;
|
ret |= ALTERED;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* check for "."
|
* check for "."
|
||||||
*/
|
*/
|
||||||
if (idesc->id_entryno != 0)
|
if (idesc->id_entryno != 0)
|
||||||
|
@ -117,7 +117,7 @@ pass5()
|
|||||||
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
||||||
newcg->cg_boff =
|
newcg->cg_boff =
|
||||||
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
||||||
newcg->cg_iusedoff = newcg->cg_boff +
|
newcg->cg_iusedoff = newcg->cg_boff +
|
||||||
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
||||||
newcg->cg_freeoff =
|
newcg->cg_freeoff =
|
||||||
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
||||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||||
nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -157,7 +157,7 @@ setup(dev)
|
|||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sblock.fs_interleave < 1 ||
|
if (sblock.fs_interleave < 1 ||
|
||||||
sblock.fs_interleave > sblock.fs_nsect) {
|
sblock.fs_interleave > sblock.fs_nsect) {
|
||||||
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
||||||
sblock.fs_interleave);
|
sblock.fs_interleave);
|
||||||
@ -169,7 +169,7 @@ setup(dev)
|
|||||||
dirty(&asblk);
|
dirty(&asblk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||||
sblock.fs_npsect > sblock.fs_nsect*2) {
|
sblock.fs_npsect > sblock.fs_nsect*2) {
|
||||||
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
||||||
sblock.fs_npsect);
|
sblock.fs_npsect);
|
||||||
@ -277,7 +277,7 @@ setup(dev)
|
|||||||
}
|
}
|
||||||
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
||||||
if (lncntp == NULL) {
|
if (lncntp == NULL) {
|
||||||
printf("cannot alloc %u bytes for lncntp\n",
|
printf("cannot alloc %u bytes for lncntp\n",
|
||||||
(unsigned)(maxino + 1) * sizeof(short));
|
(unsigned)(maxino + 1) * sizeof(short));
|
||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ setup(dev)
|
|||||||
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
||||||
sizeof(struct inoinfo *));
|
sizeof(struct inoinfo *));
|
||||||
if (inpsort == NULL || inphead == NULL) {
|
if (inpsort == NULL || inphead == NULL) {
|
||||||
printf("cannot alloc %u bytes for inphead\n",
|
printf("cannot alloc %u bytes for inphead\n",
|
||||||
(unsigned)numdirs * sizeof(struct inoinfo *));
|
(unsigned)numdirs * sizeof(struct inoinfo *));
|
||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ dirscan(idesc)
|
|||||||
dirty(bp);
|
dirty(bp);
|
||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
if (n & STOP)
|
if (n & STOP)
|
||||||
return (n);
|
return (n);
|
||||||
}
|
}
|
||||||
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
||||||
@ -512,7 +512,7 @@ makeentry(parent, ino, name)
|
|||||||
struct dinode *dp;
|
struct dinode *dp;
|
||||||
struct inodesc idesc;
|
struct inodesc idesc;
|
||||||
char pathbuf[MAXPATHLEN + 1];
|
char pathbuf[MAXPATHLEN + 1];
|
||||||
|
|
||||||
if (parent < ROOTINO || parent >= maxino ||
|
if (parent < ROOTINO || parent >= maxino ||
|
||||||
ino < ROOTINO || ino >= maxino)
|
ino < ROOTINO || ino >= maxino)
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -112,14 +112,14 @@ struct inodesc {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Linked list of duplicate blocks.
|
* Linked list of duplicate blocks.
|
||||||
*
|
*
|
||||||
* The list is composed of two parts. The first part of the
|
* The list is composed of two parts. The first part of the
|
||||||
* list (from duplist through the node pointed to by muldup)
|
* list (from duplist through the node pointed to by muldup)
|
||||||
* contains a single copy of each duplicate block that has been
|
* contains a single copy of each duplicate block that has been
|
||||||
* found. The second part of the list (from muldup to the end)
|
* found. The second part of the list (from muldup to the end)
|
||||||
* contains duplicate blocks that have been found more than once.
|
* contains duplicate blocks that have been found more than once.
|
||||||
* To check if a block has been found as a duplicate it is only
|
* To check if a block has been found as a duplicate it is only
|
||||||
* necessary to search from duplist through muldup. To find the
|
* necessary to search from duplist through muldup. To find the
|
||||||
* total number of times that a block has been found as a duplicate
|
* total number of times that a block has been found as a duplicate
|
||||||
* the entire list must be searched for occurences of the block
|
* the entire list must be searched for occurences of the block
|
||||||
* in question. The following diagram shows a sample list where
|
* in question. The following diagram shows a sample list where
|
||||||
|
@ -374,7 +374,7 @@ inocleanup()
|
|||||||
free((char *)inpsort);
|
free((char *)inpsort);
|
||||||
inphead = inpsort = NULL;
|
inphead = inpsort = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
inodirty()
|
inodirty()
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@ main(argc, argv)
|
|||||||
case 'c':
|
case 'c':
|
||||||
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
debug++;
|
debug++;
|
||||||
break;
|
break;
|
||||||
@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
|||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
if (cvtlevel && sblk.b_dirty) {
|
if (cvtlevel && sblk.b_dirty) {
|
||||||
/*
|
/*
|
||||||
* Write out the duplicate super blocks
|
* Write out the duplicate super blocks
|
||||||
*/
|
*/
|
||||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1980, 1986, 1993
|
* Copyright (c) 1980, 1986, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -211,7 +211,7 @@ pass2check(idesc)
|
|||||||
dirp->d_type = typemap[dirp->d_ino];
|
dirp->d_type = typemap[dirp->d_ino];
|
||||||
ret |= ALTERED;
|
ret |= ALTERED;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* check for "."
|
* check for "."
|
||||||
*/
|
*/
|
||||||
if (idesc->id_entryno != 0)
|
if (idesc->id_entryno != 0)
|
||||||
|
@ -117,7 +117,7 @@ pass5()
|
|||||||
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
||||||
newcg->cg_boff =
|
newcg->cg_boff =
|
||||||
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
||||||
newcg->cg_iusedoff = newcg->cg_boff +
|
newcg->cg_iusedoff = newcg->cg_boff +
|
||||||
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
||||||
newcg->cg_freeoff =
|
newcg->cg_freeoff =
|
||||||
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
||||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||||
nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -157,7 +157,7 @@ setup(dev)
|
|||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sblock.fs_interleave < 1 ||
|
if (sblock.fs_interleave < 1 ||
|
||||||
sblock.fs_interleave > sblock.fs_nsect) {
|
sblock.fs_interleave > sblock.fs_nsect) {
|
||||||
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
||||||
sblock.fs_interleave);
|
sblock.fs_interleave);
|
||||||
@ -169,7 +169,7 @@ setup(dev)
|
|||||||
dirty(&asblk);
|
dirty(&asblk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||||
sblock.fs_npsect > sblock.fs_nsect*2) {
|
sblock.fs_npsect > sblock.fs_nsect*2) {
|
||||||
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
||||||
sblock.fs_npsect);
|
sblock.fs_npsect);
|
||||||
@ -277,7 +277,7 @@ setup(dev)
|
|||||||
}
|
}
|
||||||
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
||||||
if (lncntp == NULL) {
|
if (lncntp == NULL) {
|
||||||
printf("cannot alloc %u bytes for lncntp\n",
|
printf("cannot alloc %u bytes for lncntp\n",
|
||||||
(unsigned)(maxino + 1) * sizeof(short));
|
(unsigned)(maxino + 1) * sizeof(short));
|
||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ setup(dev)
|
|||||||
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
||||||
sizeof(struct inoinfo *));
|
sizeof(struct inoinfo *));
|
||||||
if (inpsort == NULL || inphead == NULL) {
|
if (inpsort == NULL || inphead == NULL) {
|
||||||
printf("cannot alloc %u bytes for inphead\n",
|
printf("cannot alloc %u bytes for inphead\n",
|
||||||
(unsigned)numdirs * sizeof(struct inoinfo *));
|
(unsigned)numdirs * sizeof(struct inoinfo *));
|
||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ dirscan(idesc)
|
|||||||
dirty(bp);
|
dirty(bp);
|
||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
if (n & STOP)
|
if (n & STOP)
|
||||||
return (n);
|
return (n);
|
||||||
}
|
}
|
||||||
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
return (idesc->id_filesize > 0 ? KEEPON : STOP);
|
||||||
@ -512,7 +512,7 @@ makeentry(parent, ino, name)
|
|||||||
struct dinode *dp;
|
struct dinode *dp;
|
||||||
struct inodesc idesc;
|
struct inodesc idesc;
|
||||||
char pathbuf[MAXPATHLEN + 1];
|
char pathbuf[MAXPATHLEN + 1];
|
||||||
|
|
||||||
if (parent < ROOTINO || parent >= maxino ||
|
if (parent < ROOTINO || parent >= maxino ||
|
||||||
ino < ROOTINO || ino >= maxino)
|
ino < ROOTINO || ino >= maxino)
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -112,14 +112,14 @@ struct inodesc {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Linked list of duplicate blocks.
|
* Linked list of duplicate blocks.
|
||||||
*
|
*
|
||||||
* The list is composed of two parts. The first part of the
|
* The list is composed of two parts. The first part of the
|
||||||
* list (from duplist through the node pointed to by muldup)
|
* list (from duplist through the node pointed to by muldup)
|
||||||
* contains a single copy of each duplicate block that has been
|
* contains a single copy of each duplicate block that has been
|
||||||
* found. The second part of the list (from muldup to the end)
|
* found. The second part of the list (from muldup to the end)
|
||||||
* contains duplicate blocks that have been found more than once.
|
* contains duplicate blocks that have been found more than once.
|
||||||
* To check if a block has been found as a duplicate it is only
|
* To check if a block has been found as a duplicate it is only
|
||||||
* necessary to search from duplist through muldup. To find the
|
* necessary to search from duplist through muldup. To find the
|
||||||
* total number of times that a block has been found as a duplicate
|
* total number of times that a block has been found as a duplicate
|
||||||
* the entire list must be searched for occurences of the block
|
* the entire list must be searched for occurences of the block
|
||||||
* in question. The following diagram shows a sample list where
|
* in question. The following diagram shows a sample list where
|
||||||
|
@ -374,7 +374,7 @@ inocleanup()
|
|||||||
free((char *)inpsort);
|
free((char *)inpsort);
|
||||||
inphead = inpsort = NULL;
|
inphead = inpsort = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
inodirty()
|
inodirty()
|
||||||
{
|
{
|
||||||
|
@ -84,7 +84,7 @@ main(argc, argv)
|
|||||||
case 'c':
|
case 'c':
|
||||||
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
cvtlevel = argtoi('c', "conversion level", optarg, 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
debug++;
|
debug++;
|
||||||
break;
|
break;
|
||||||
@ -296,7 +296,7 @@ checkfilesys(filesys, mntpt, auxdata, child)
|
|||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
if (cvtlevel && sblk.b_dirty) {
|
if (cvtlevel && sblk.b_dirty) {
|
||||||
/*
|
/*
|
||||||
* Write out the duplicate super blocks
|
* Write out the duplicate super blocks
|
||||||
*/
|
*/
|
||||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1980, 1986, 1993
|
* Copyright (c) 1980, 1986, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -211,7 +211,7 @@ pass2check(idesc)
|
|||||||
dirp->d_type = typemap[dirp->d_ino];
|
dirp->d_type = typemap[dirp->d_ino];
|
||||||
ret |= ALTERED;
|
ret |= ALTERED;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* check for "."
|
* check for "."
|
||||||
*/
|
*/
|
||||||
if (idesc->id_entryno != 0)
|
if (idesc->id_entryno != 0)
|
||||||
|
@ -117,7 +117,7 @@ pass5()
|
|||||||
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
&newcg->cg_space[0] - (u_char *)(&newcg->cg_link);
|
||||||
newcg->cg_boff =
|
newcg->cg_boff =
|
||||||
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
newcg->cg_btotoff + fs->fs_cpg * sizeof(long);
|
||||||
newcg->cg_iusedoff = newcg->cg_boff +
|
newcg->cg_iusedoff = newcg->cg_boff +
|
||||||
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
fs->fs_cpg * fs->fs_nrpos * sizeof(short);
|
||||||
newcg->cg_freeoff =
|
newcg->cg_freeoff =
|
||||||
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
newcg->cg_iusedoff + howmany(fs->fs_ipg, NBBY);
|
||||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||||
nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -157,7 +157,7 @@ setup(dev)
|
|||||||
sbdirty();
|
sbdirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sblock.fs_interleave < 1 ||
|
if (sblock.fs_interleave < 1 ||
|
||||||
sblock.fs_interleave > sblock.fs_nsect) {
|
sblock.fs_interleave > sblock.fs_nsect) {
|
||||||
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
pwarn("IMPOSSIBLE INTERLEAVE=%d IN SUPERBLOCK",
|
||||||
sblock.fs_interleave);
|
sblock.fs_interleave);
|
||||||
@ -169,7 +169,7 @@ setup(dev)
|
|||||||
dirty(&asblk);
|
dirty(&asblk);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sblock.fs_npsect < sblock.fs_nsect ||
|
if (sblock.fs_npsect < sblock.fs_nsect ||
|
||||||
sblock.fs_npsect > sblock.fs_nsect*2) {
|
sblock.fs_npsect > sblock.fs_nsect*2) {
|
||||||
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
pwarn("IMPOSSIBLE NPSECT=%d IN SUPERBLOCK",
|
||||||
sblock.fs_npsect);
|
sblock.fs_npsect);
|
||||||
@ -277,7 +277,7 @@ setup(dev)
|
|||||||
}
|
}
|
||||||
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
lncntp = (short *)calloc((unsigned)(maxino + 1), sizeof(short));
|
||||||
if (lncntp == NULL) {
|
if (lncntp == NULL) {
|
||||||
printf("cannot alloc %u bytes for lncntp\n",
|
printf("cannot alloc %u bytes for lncntp\n",
|
||||||
(unsigned)(maxino + 1) * sizeof(short));
|
(unsigned)(maxino + 1) * sizeof(short));
|
||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
@ -289,7 +289,7 @@ setup(dev)
|
|||||||
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
inphead = (struct inoinfo **)calloc((unsigned)numdirs,
|
||||||
sizeof(struct inoinfo *));
|
sizeof(struct inoinfo *));
|
||||||
if (inpsort == NULL || inphead == NULL) {
|
if (inpsort == NULL || inphead == NULL) {
|
||||||
printf("cannot alloc %u bytes for inphead\n",
|
printf("cannot alloc %u bytes for inphead\n",
|
||||||
(unsigned)numdirs * sizeof(struct inoinfo *));
|
(unsigned)numdirs * sizeof(struct inoinfo *));
|
||||||
goto badsb;
|
goto badsb;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
PROG= fdisk
|
PROG= fdisk
|
||||||
SRCS= fdisk.c
|
SRCS= fdisk.c
|
||||||
MAN8= fdisk.8
|
MAN8= fdisk.8
|
||||||
|
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
/*
|
/*
|
||||||
* Mach Operating System
|
* Mach Operating System
|
||||||
* Copyright (c) 1992 Carnegie Mellon University
|
* Copyright (c) 1992 Carnegie Mellon University
|
||||||
* All Rights Reserved.
|
* All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify and distribute this software and its
|
* Permission to use, copy, modify and distribute this software and its
|
||||||
* documentation is hereby granted, provided that both the copyright
|
* documentation is hereby granted, provided that both the copyright
|
||||||
* notice and this permission notice appear in all copies of the
|
* notice and this permission notice appear in all copies of the
|
||||||
* software, derivative works or modified versions, and any portions
|
* software, derivative works or modified versions, and any portions
|
||||||
* thereof, and that both notices appear in supporting documentation.
|
* thereof, and that both notices appear in supporting documentation.
|
||||||
*
|
*
|
||||||
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
|
||||||
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
|
||||||
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* Carnegie Mellon requests users of this software to return to
|
* Carnegie Mellon requests users of this software to return to
|
||||||
*
|
*
|
||||||
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
|
||||||
* School of Computer Science
|
* School of Computer Science
|
||||||
* Carnegie Mellon University
|
* Carnegie Mellon University
|
||||||
* Pittsburgh PA 15213-3890
|
* Pittsburgh PA 15213-3890
|
||||||
*
|
*
|
||||||
* any improvements or extensions that they make and grant Carnegie Mellon
|
* any improvements or extensions that they make and grant Carnegie Mellon
|
||||||
* the rights to redistribute these changes.
|
* the rights to redistribute these changes.
|
||||||
*/
|
*/
|
||||||
@ -89,37 +89,37 @@ static int i_flag = 0; /* replace partition data */
|
|||||||
static int u_flag = 0; /* update partition data */
|
static int u_flag = 0; /* update partition data */
|
||||||
|
|
||||||
static unsigned char bootcode[] = {
|
static unsigned char bootcode[] = {
|
||||||
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
0x33, 0xc0, 0xfa, 0x8e, 0xd0, 0xbc, 0x00, 0x7c, 0x8e, 0xc0, 0x8e, 0xd8, 0xfb, 0x8b, 0xf4, 0xbf,
|
||||||
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
0x00, 0x06, 0xb9, 0x00, 0x02, 0xfc, 0xf3, 0xa4, 0xea, 0x1d, 0x06, 0x00, 0x00, 0xb0, 0x04, 0xbe,
|
||||||
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
0xbe, 0x07, 0x80, 0x3c, 0x80, 0x74, 0x0c, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x75, 0xf4, 0xbe, 0xbd,
|
||||||
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
0x06, 0xeb, 0x43, 0x8b, 0xfe, 0x8b, 0x14, 0x8b, 0x4c, 0x02, 0x83, 0xc6, 0x10, 0xfe, 0xc8, 0x74,
|
||||||
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
0x0a, 0x80, 0x3c, 0x80, 0x75, 0xf4, 0xbe, 0xbd, 0x06, 0xeb, 0x2b, 0xbd, 0x05, 0x00, 0xbb, 0x00,
|
||||||
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
0x7c, 0xb8, 0x01, 0x02, 0xcd, 0x13, 0x73, 0x0c, 0x33, 0xc0, 0xcd, 0x13, 0x4d, 0x75, 0xef, 0xbe,
|
||||||
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
0x9e, 0x06, 0xeb, 0x12, 0x81, 0x3e, 0xfe, 0x7d, 0x55, 0xaa, 0x75, 0x07, 0x8b, 0xf7, 0xea, 0x00,
|
||||||
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
0x7c, 0x00, 0x00, 0xbe, 0x85, 0x06, 0x2e, 0xac, 0x0a, 0xc0, 0x74, 0x06, 0xb4, 0x0e, 0xcd, 0x10,
|
||||||
0xeb, 0xf4, 0xfb, 0xeb, 0xfe,
|
0xeb, 0xf4, 0xfb, 0xeb, 0xfe,
|
||||||
'M', 'i', 's', 's', 'i', 'n', 'g', ' ',
|
'M', 'i', 's', 's', 'i', 'n', 'g', ' ',
|
||||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||||
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
'E', 'r', 'r', 'o', 'r', ' ', 'l', 'o', 'a', 'd', 'i', 'n', 'g', ' ',
|
||||||
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
'o', 'p', 'e', 'r', 'a', 't', 'i', 'n', 'g', ' ', 's', 'y', 's', 't', 'e', 'm', 0,
|
||||||
'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ',
|
'I', 'n', 'v', 'a', 'l', 'i', 'd', ' ',
|
||||||
'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0,
|
'p', 'a', 'r', 't', 'i', 't', 'i', 'o', 'n', ' ', 't', 'a', 'b', 'l', 'e', 0,
|
||||||
'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ',
|
'A', 'u', 't', 'h', 'o', 'r', ' ', '-', ' ',
|
||||||
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
'S', 'i', 'e', 'g', 'm', 'a', 'r', ' ', 'S', 'c', 'h', 'm', 'i', 'd', 't', 0,0,0,
|
||||||
|
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
struct part_type
|
struct part_type
|
||||||
@ -128,46 +128,46 @@ struct part_type
|
|||||||
char *name;
|
char *name;
|
||||||
}part_types[] =
|
}part_types[] =
|
||||||
{
|
{
|
||||||
{0x00, "unused"}
|
{0x00, "unused"}
|
||||||
,{0x01, "Primary DOS with 12 bit FAT"}
|
,{0x01, "Primary DOS with 12 bit FAT"}
|
||||||
,{0x02, "XENIX / filesystem"}
|
,{0x02, "XENIX / filesystem"}
|
||||||
,{0x03, "XENIX /usr filesystem"}
|
,{0x03, "XENIX /usr filesystem"}
|
||||||
,{0x04, "Primary DOS with 16 bit FAT"}
|
,{0x04, "Primary DOS with 16 bit FAT"}
|
||||||
,{0x05, "Extended DOS"}
|
,{0x05, "Extended DOS"}
|
||||||
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
,{0x06, "Primary 'big' DOS (> 32MB)"}
|
||||||
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
,{0x07, "OS/2 HPFS, QNX or Advanced UNIX"}
|
||||||
,{0x08, "AIX filesystem"}
|
,{0x08, "AIX filesystem"}
|
||||||
,{0x09, "AIX boot partition or Coherent"}
|
,{0x09, "AIX boot partition or Coherent"}
|
||||||
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
,{0x0A, "OS/2 Boot Manager or OPUS"}
|
||||||
,{0x10, "OPUS"}
|
,{0x10, "OPUS"}
|
||||||
,{0x40, "VENIX 286"}
|
,{0x40, "VENIX 286"}
|
||||||
,{0x50, "DM"}
|
,{0x50, "DM"}
|
||||||
,{0x51, "DM"}
|
,{0x51, "DM"}
|
||||||
,{0x52, "CP/M or Microport SysV/AT"}
|
,{0x52, "CP/M or Microport SysV/AT"}
|
||||||
,{0x56, "GB"}
|
,{0x56, "GB"}
|
||||||
,{0x61, "Speed"}
|
,{0x61, "Speed"}
|
||||||
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
,{0x63, "ISC UNIX, other System V/386, GNU HURD or Mach"}
|
||||||
,{0x64, "Novell Netware 2.xx"}
|
,{0x64, "Novell Netware 2.xx"}
|
||||||
,{0x65, "Novell Netware 3.xx"}
|
,{0x65, "Novell Netware 3.xx"}
|
||||||
,{0x75, "PCIX"}
|
,{0x75, "PCIX"}
|
||||||
,{0x80, "Minix 1.1 ... 1.4a"}
|
,{0x80, "Minix 1.1 ... 1.4a"}
|
||||||
,{0x81, "Minix 1.4b ... 1.5.10"}
|
,{0x81, "Minix 1.4b ... 1.5.10"}
|
||||||
,{0x82, "Linux swap"}
|
,{0x82, "Linux swap"}
|
||||||
,{0x83, "Linux filesystem"}
|
,{0x83, "Linux filesystem"}
|
||||||
,{0x93, "Amoeba filesystem"}
|
,{0x93, "Amoeba filesystem"}
|
||||||
,{0x94, "Amoeba bad block table"}
|
,{0x94, "Amoeba bad block table"}
|
||||||
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
,{0xA5, "FreeBSD/NetBSD/386BSD"}
|
||||||
,{0xA7, "NEXTSTEP"}
|
,{0xA7, "NEXTSTEP"}
|
||||||
,{0xB7, "BSDI BSD/386 filesystem"}
|
,{0xB7, "BSDI BSD/386 filesystem"}
|
||||||
,{0xB8, "BSDI BSD/386 swap"}
|
,{0xB8, "BSDI BSD/386 swap"}
|
||||||
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
,{0xDB, "Concurrent CPM or C.DOS or CTOS"}
|
||||||
,{0xE1, "Speed"}
|
,{0xE1, "Speed"}
|
||||||
,{0xE3, "Speed"}
|
,{0xE3, "Speed"}
|
||||||
,{0xE4, "Speed"}
|
,{0xE4, "Speed"}
|
||||||
,{0xF1, "Speed"}
|
,{0xF1, "Speed"}
|
||||||
,{0xF2, "DOS 3.3+ Secondary"}
|
,{0xF2, "DOS 3.3+ Secondary"}
|
||||||
,{0xF4, "Speed"}
|
,{0xF4, "Speed"}
|
||||||
,{0xFF, "BBT (Bad Blocks Table)"}
|
,{0xFF, "BBT (Bad Blocks Table)"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ int i;
|
|||||||
|
|
||||||
if (argc > 0)
|
if (argc > 0)
|
||||||
disk = argv[0];
|
disk = argv[0];
|
||||||
|
|
||||||
if (open_disk(u_flag) < 0)
|
if (open_disk(u_flag) < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ struct dos_partition *partp = (struct dos_partition *) (&mboot.parts[3]);
|
|||||||
int size = disksecs - start;
|
int size = disksecs - start;
|
||||||
int rest;
|
int rest;
|
||||||
|
|
||||||
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
memcpy(mboot.bootinst, bootcode, sizeof(bootcode));
|
||||||
mboot.signature = BOOT_MAGIC;
|
mboot.signature = BOOT_MAGIC;
|
||||||
|
|
||||||
partp->dp_typ = DOSPTYP_386BSD;
|
partp->dp_typ = DOSPTYP_386BSD;
|
||||||
@ -366,7 +366,7 @@ struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i;
|
|||||||
dos(partp->dp_start+partp->dp_size - 1,
|
dos(partp->dp_start+partp->dp_size - 1,
|
||||||
&partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd);
|
&partp->dp_ecyl, &partp->dp_esect, &partp->dp_ehd);
|
||||||
}
|
}
|
||||||
|
|
||||||
print_part(i);
|
print_part(i);
|
||||||
} while (!ok("Are we happy with this entry?"));
|
} while (!ok("Are we happy with this entry?"));
|
||||||
}
|
}
|
||||||
@ -456,7 +456,7 @@ open_disk(u_flag)
|
|||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
||||||
if (stat(disk, &st) == -1) {
|
if (stat(disk, &st) == -1) {
|
||||||
fprintf(stderr, "%s: Can't get file status of %s\n",
|
fprintf(stderr, "%s: Can't get file status of %s\n",
|
||||||
name, disk);
|
name, disk);
|
||||||
return -1;
|
return -1;
|
||||||
@ -516,7 +516,7 @@ get_params(verbose)
|
|||||||
|
|
||||||
read_s0()
|
read_s0()
|
||||||
{
|
{
|
||||||
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
if (read_disk(0, (char *) mboot.bootinst) == -1) {
|
||||||
fprintf(stderr, "%s: Can't read fdisk partition table\n", name);
|
fprintf(stderr, "%s: Can't read fdisk partition table\n", name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -545,7 +545,7 @@ write_s0()
|
|||||||
flag = 1;
|
flag = 1;
|
||||||
if (ioctl(fd, DIOCWLABEL, &flag) < 0)
|
if (ioctl(fd, DIOCWLABEL, &flag) < 0)
|
||||||
perror("ioctl DIOCWLABEL");
|
perror("ioctl DIOCWLABEL");
|
||||||
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
if (write_disk(0, (char *) mboot.bootinst) == -1) {
|
||||||
fprintf(stderr, "%s: Can't write fdisk partition table\n",
|
fprintf(stderr, "%s: Can't write fdisk partition table\n",
|
||||||
name);
|
name);
|
||||||
return -1;
|
return -1;
|
||||||
@ -687,7 +687,7 @@ int type;
|
|||||||
int counter = 0;
|
int counter = 0;
|
||||||
struct part_type *ptr = part_types;
|
struct part_type *ptr = part_types;
|
||||||
|
|
||||||
|
|
||||||
while(counter < numentries)
|
while(counter < numentries)
|
||||||
{
|
{
|
||||||
if(ptr->type == type)
|
if(ptr->type == type)
|
||||||
|
@ -105,7 +105,7 @@ check_stat(int fd, int wr)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((s & QS_FMTOK) == 0) {
|
if ((s & QS_FMTOK) == 0) {
|
||||||
fprintf(stderr, "tape is not formatted\n");
|
fprintf(stderr, "tape is not formatted\n");
|
||||||
return(2);
|
return(2);
|
||||||
|
@ -68,8 +68,8 @@ static char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <nlist.h>
|
#include <nlist.h>
|
||||||
#include <kvm.h>
|
#include <kvm.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
struct ifreq ifr, ridreq;
|
struct ifreq ifr, ridreq;
|
||||||
@ -287,7 +287,7 @@ ifconfig(argc,argv,af,rafp,flag)
|
|||||||
perror("ioctl (SIOCGIFMTU)");
|
perror("ioctl (SIOCGIFMTU)");
|
||||||
else
|
else
|
||||||
mtu = ifr.ifr_mtu;
|
mtu = ifr.ifr_mtu;
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
status();
|
status();
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@ -701,7 +701,7 @@ ether_status()
|
|||||||
m += printf("%02x%c",
|
m += printf("%02x%c",
|
||||||
*cp++ & 0xff,
|
*cp++ & 0xff,
|
||||||
n > 0 ? ':' : ' ');
|
n > 0 ? ':' : ' ');
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -710,7 +710,7 @@ ether_status()
|
|||||||
}
|
}
|
||||||
kvm_close(kvmd);
|
kvm_close(kvmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
Perror(cmd)
|
Perror(cmd)
|
||||||
char *cmd;
|
char *cmd;
|
||||||
{
|
{
|
||||||
|
@ -678,14 +678,14 @@ single_user()
|
|||||||
return (state_func_t) requested_transition;
|
return (state_func_t) requested_transition;
|
||||||
|
|
||||||
if (!WIFEXITED(status)) {
|
if (!WIFEXITED(status)) {
|
||||||
if (WTERMSIG(status) == SIGKILL) {
|
if (WTERMSIG(status) == SIGKILL) {
|
||||||
/*
|
/*
|
||||||
* reboot(8) killed shell?
|
* reboot(8) killed shell?
|
||||||
*/
|
*/
|
||||||
warning("single user shell terminated.");
|
warning("single user shell terminated.");
|
||||||
sleep(STALL_TIMEOUT);
|
sleep(STALL_TIMEOUT);
|
||||||
_exit(0);
|
_exit(0);
|
||||||
} else {
|
} else {
|
||||||
warning("single user shell terminated, restarting");
|
warning("single user shell terminated, restarting");
|
||||||
return (state_func_t) single_user;
|
return (state_func_t) single_user;
|
||||||
}
|
}
|
||||||
@ -797,7 +797,7 @@ start_session_db()
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1215,7 +1215,7 @@ multi_user()
|
|||||||
/*
|
/*
|
||||||
* If the administrator has not set the security level to -1
|
* If the administrator has not set the security level to -1
|
||||||
* to indicate that the kernel should not run multiuser in secure
|
* to indicate that the kernel should not run multiuser in secure
|
||||||
* mode, and the run script has not set a higher level of security
|
* mode, and the run script has not set a higher level of security
|
||||||
* than level 1, then put the kernel into secure mode.
|
* than level 1, then put the kernel into secure mode.
|
||||||
*/
|
*/
|
||||||
if (getsecuritylevel() == 0)
|
if (getsecuritylevel() == 0)
|
||||||
@ -1391,7 +1391,7 @@ strk (char *p)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
c = *t;
|
c = *t;
|
||||||
while (c == ' ' || c == '\t' )
|
while (c == ' ' || c == '\t' )
|
||||||
c = *++t;
|
c = *++t;
|
||||||
if (!c) {
|
if (!c) {
|
||||||
t = 0;
|
t = 0;
|
||||||
@ -1401,7 +1401,7 @@ strk (char *p)
|
|||||||
if (c == '\'') {
|
if (c == '\'') {
|
||||||
c = *++t;
|
c = *++t;
|
||||||
q = t;
|
q = t;
|
||||||
while (c && c != '\'')
|
while (c && c != '\'')
|
||||||
c = *++t;
|
c = *++t;
|
||||||
if (!c) /* unterminated string */
|
if (!c) /* unterminated string */
|
||||||
q = t = 0;
|
q = t = 0;
|
||||||
@ -1411,7 +1411,7 @@ strk (char *p)
|
|||||||
while (c && c != ' ' && c != '\t' )
|
while (c && c != ' ' && c != '\t' )
|
||||||
c = *++t;
|
c = *++t;
|
||||||
*t++ = 0;
|
*t++ = 0;
|
||||||
if (!c)
|
if (!c)
|
||||||
t = 0;
|
t = 0;
|
||||||
}
|
}
|
||||||
return q;
|
return q;
|
||||||
|
@ -77,11 +77,11 @@ char action_tab[][MAXSTR]={
|
|||||||
"f",
|
"f",
|
||||||
#define A_FLUSH 6
|
#define A_FLUSH 6
|
||||||
"z",
|
"z",
|
||||||
#define A_ZERO 7
|
#define A_ZERO 7
|
||||||
"l",
|
"l",
|
||||||
#define A_LIST 8
|
#define A_LIST 8
|
||||||
"po",
|
"po",
|
||||||
#define A_POLICY 9
|
#define A_POLICY 9
|
||||||
"",
|
"",
|
||||||
#define A_NONE 10
|
#define A_NONE 10
|
||||||
};
|
};
|
||||||
@ -158,7 +158,7 @@ u_long mask;
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
mask=mask>>1;
|
mask=mask>>1;
|
||||||
}
|
}
|
||||||
return h_num;
|
return h_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,16 +178,16 @@ int i,mb;
|
|||||||
if (do_short && do_acct) {
|
if (do_short && do_acct) {
|
||||||
printf("%8d:%8d ",chain->fw_bcnt,chain->fw_pcnt);
|
printf("%8d:%8d ",chain->fw_bcnt,chain->fw_pcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (do_short)
|
if (do_short)
|
||||||
if (c_t==FW) {
|
if (c_t==FW) {
|
||||||
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
||||||
if (chain->fw_flg & IP_FW_F_PRN)
|
if (chain->fw_flg & IP_FW_F_PRN)
|
||||||
printf("l");
|
printf("l");
|
||||||
else
|
else
|
||||||
printf("a");
|
printf("a");
|
||||||
else
|
else
|
||||||
if (chain->fw_flg & IP_FW_F_PRN)
|
if (chain->fw_flg & IP_FW_F_PRN)
|
||||||
if (chain->fw_flg & IP_FW_F_ICMPRPL)
|
if (chain->fw_flg & IP_FW_F_ICMPRPL)
|
||||||
printf("R");
|
printf("R");
|
||||||
@ -199,19 +199,19 @@ if (do_short)
|
|||||||
else
|
else
|
||||||
printf("d");
|
printf("d");
|
||||||
} else {
|
} else {
|
||||||
if (chain->fw_flg & IP_FW_F_BIDIR)
|
if (chain->fw_flg & IP_FW_F_BIDIR)
|
||||||
printf("b");
|
printf("b");
|
||||||
else
|
else
|
||||||
printf("s");
|
printf("s");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (c_t==FW) {
|
if (c_t==FW) {
|
||||||
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
if (chain->fw_flg & IP_FW_F_ACCEPT)
|
||||||
if (chain->fw_flg & IP_FW_F_PRN)
|
if (chain->fw_flg & IP_FW_F_PRN)
|
||||||
printf("log ");
|
printf("log ");
|
||||||
else
|
else
|
||||||
printf("accept ");
|
printf("accept ");
|
||||||
else
|
else
|
||||||
if (chain->fw_flg & IP_FW_F_PRN)
|
if (chain->fw_flg & IP_FW_F_PRN)
|
||||||
if (chain->fw_flg & IP_FW_F_ICMPRPL)
|
if (chain->fw_flg & IP_FW_F_ICMPRPL)
|
||||||
printf("lreject ");
|
printf("lreject ");
|
||||||
@ -223,9 +223,9 @@ else
|
|||||||
else
|
else
|
||||||
printf("deny ");
|
printf("deny ");
|
||||||
} else {
|
} else {
|
||||||
if (chain->fw_flg & IP_FW_F_BIDIR)
|
if (chain->fw_flg & IP_FW_F_BIDIR)
|
||||||
printf("bidir ");
|
printf("bidir ");
|
||||||
else
|
else
|
||||||
printf("single ");
|
printf("single ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,9 +299,9 @@ else
|
|||||||
comma = " ";
|
comma = " ";
|
||||||
for (i=0;i<chain->fw_nsp; i++ ) {
|
for (i=0;i<chain->fw_nsp; i++ ) {
|
||||||
printf("%s%d",comma,chain->fw_pts[i]);
|
printf("%s%d",comma,chain->fw_pts[i]);
|
||||||
if (i==0 && (chain->fw_flg & IP_FW_F_SRNG))
|
if (i==0 && (chain->fw_flg & IP_FW_F_SRNG))
|
||||||
comma = ":";
|
comma = ":";
|
||||||
else
|
else
|
||||||
comma = ",";
|
comma = ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ else
|
|||||||
printf("%s",he->h_name);
|
printf("%s",he->h_name);
|
||||||
} else {
|
} else {
|
||||||
printf(inet_ntoa(chain->fw_dst));
|
printf(inet_ntoa(chain->fw_dst));
|
||||||
if (adrt!=ULONG_MAX)
|
if (adrt!=ULONG_MAX)
|
||||||
if ((mb=mask_bits(chain->fw_dmsk))>=0)
|
if ((mb=mask_bits(chain->fw_dmsk))>=0)
|
||||||
printf("/%d",mb);
|
printf("/%d",mb);
|
||||||
else {
|
else {
|
||||||
@ -336,7 +336,7 @@ else
|
|||||||
printf("%s%d",comma,chain->fw_pts[chain->fw_nsp+i]);
|
printf("%s%d",comma,chain->fw_pts[chain->fw_nsp+i]);
|
||||||
if (i==chain->fw_nsp && (chain->fw_flg & IP_FW_F_DRNG))
|
if (i==chain->fw_nsp && (chain->fw_flg & IP_FW_F_DRNG))
|
||||||
comma = ":";
|
comma = ":";
|
||||||
else
|
else
|
||||||
comma = ",";
|
comma = ",";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,7 +501,7 @@ int a_max;
|
|||||||
int *is_range;
|
int *is_range;
|
||||||
{
|
{
|
||||||
char *s_pr2,*s_h,*s_t,*cp;
|
char *s_pr2,*s_h,*s_t,*cp;
|
||||||
u_short p1,p2;
|
u_short p1,p2;
|
||||||
int i=0;
|
int i=0;
|
||||||
|
|
||||||
(void)strtok(str,":");
|
(void)strtok(str,":");
|
||||||
@ -556,7 +556,7 @@ struct hostent *hptr;
|
|||||||
mask->s_addr=0L;
|
mask->s_addr=0L;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (mask) {
|
if (mask) {
|
||||||
(void)strtok(str,"/");
|
(void)strtok(str,"/");
|
||||||
@ -564,7 +564,7 @@ struct hostent *hptr;
|
|||||||
(void)strtok(str,":");
|
(void)strtok(str,":");
|
||||||
sm_oct=strtok(NULL,"");
|
sm_oct=strtok(NULL,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inet_aton(str,addr)) {
|
if (!inet_aton(str,addr)) {
|
||||||
if (do_resolv) {
|
if (do_resolv) {
|
||||||
if (!(hptr=gethostbyname(str))) {
|
if (!(hptr=gethostbyname(str))) {
|
||||||
@ -581,7 +581,7 @@ struct hostent *hptr;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is in case mask we
|
* This is in case mask we
|
||||||
* want to set IP only
|
* want to set IP only
|
||||||
*/
|
*/
|
||||||
if (!mask)
|
if (!mask)
|
||||||
@ -603,7 +603,7 @@ struct hostent *hptr;
|
|||||||
htonl(ULONG_MAX<<(sizeof(u_long)*CHAR_BIT-n_bit));
|
htonl(ULONG_MAX<<(sizeof(u_long)*CHAR_BIT-n_bit));
|
||||||
else
|
else
|
||||||
mask->s_addr=0L;
|
mask->s_addr=0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sm_oct) {
|
if (sm_oct) {
|
||||||
if (!inet_aton(sm_oct,mask)) {
|
if (!inet_aton(sm_oct,mask)) {
|
||||||
@ -620,14 +620,14 @@ struct hostent *hptr;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int set_entry_ifname(str,frwl)
|
int set_entry_ifname(str,frwl)
|
||||||
char *str;
|
char *str;
|
||||||
struct ip_fw * frwl;
|
struct ip_fw * frwl;
|
||||||
{
|
{
|
||||||
char name[IFNAMSIZ],buf[IFNAMSIZ],*sptr;
|
char name[IFNAMSIZ],buf[IFNAMSIZ],*sptr;
|
||||||
short unit;
|
short unit;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i=0; sptr=str;
|
i=0; sptr=str;
|
||||||
while(isalpha(*sptr++)) {
|
while(isalpha(*sptr++)) {
|
||||||
i++;
|
i++;
|
||||||
@ -654,7 +654,7 @@ int i;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void set_entry(av,frwl)
|
void set_entry(av,frwl)
|
||||||
char **av;
|
char **av;
|
||||||
struct ip_fw * frwl;
|
struct ip_fw * frwl;
|
||||||
{
|
{
|
||||||
@ -711,7 +711,7 @@ int token;
|
|||||||
show_usage("Missing 'to' specification.");
|
show_usage("Missing 'to' specification.");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_entry_ip(*av,&(frwl->fw_dst),&(frwl->fw_dmsk));
|
set_entry_ip(*av,&(frwl->fw_dst),&(frwl->fw_dmsk));
|
||||||
got_to = 1;
|
got_to = 1;
|
||||||
}
|
}
|
||||||
@ -729,7 +729,7 @@ int token;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try first to set interface name
|
* Try first to set interface name
|
||||||
* from arguments.set_entry_ip() will exit on
|
* from arguments.set_entry_ip() will exit on
|
||||||
* wrong argument.
|
* wrong argument.
|
||||||
*/
|
*/
|
||||||
@ -838,7 +838,7 @@ if (*av==NULL || strlen(*av)<=0) {
|
|||||||
}
|
}
|
||||||
if (kvm_nlist(kd,nlf) < 0 || nlf[0].n_type == 0) {
|
if (kvm_nlist(kd,nlf) < 0 || nlf[0].n_type == 0) {
|
||||||
fprintf(stderr,"%s: kvm_nlist: no namelist in %s\n",
|
fprintf(stderr,"%s: kvm_nlist: no namelist in %s\n",
|
||||||
progname,getbootfile());
|
progname,getbootfile());
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -900,7 +900,7 @@ struct ip_fw frwl;
|
|||||||
|
|
||||||
s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW );
|
s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW );
|
||||||
if ( s < 0 ) {
|
if ( s < 0 ) {
|
||||||
fprintf(stderr,"%s: Can't open raw socket.Must be root to use this programm. \n",progname);
|
fprintf(stderr,"%s: Can't open raw socket.Must be root to use this programm. \n",progname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if ( ac == 1 ) {
|
if ( ac == 1 ) {
|
||||||
@ -922,7 +922,7 @@ struct ip_fw frwl;
|
|||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
show_usage(NULL);
|
show_usage(NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*(av+=optind)==NULL) {
|
if (*(av+=optind)==NULL) {
|
||||||
@ -956,13 +956,13 @@ struct ip_fw frwl;
|
|||||||
int_t=AC;
|
int_t=AC;
|
||||||
break;
|
break;
|
||||||
case A_FLUSH:
|
case A_FLUSH:
|
||||||
flush(++av);
|
flush(++av);
|
||||||
exit(0); /* successful exit */
|
exit(0); /* successful exit */
|
||||||
case A_LIST:
|
case A_LIST:
|
||||||
list(++av);
|
list(++av);
|
||||||
exit(0); /* successful exit */
|
exit(0); /* successful exit */
|
||||||
case A_ZERO:
|
case A_ZERO:
|
||||||
zero();
|
zero();
|
||||||
exit(0); /* successful exit */
|
exit(0); /* successful exit */
|
||||||
case A_POLICY:
|
case A_POLICY:
|
||||||
policy(++av);
|
policy(++av);
|
||||||
@ -974,7 +974,7 @@ struct ip_fw frwl;
|
|||||||
|
|
||||||
if (is_check)
|
if (is_check)
|
||||||
goto proto_switch;
|
goto proto_switch;
|
||||||
|
|
||||||
if (!int_notdef)
|
if (!int_notdef)
|
||||||
if (*(++av)==NULL) {
|
if (*(++av)==NULL) {
|
||||||
show_usage(NULL);
|
show_usage(NULL);
|
||||||
@ -1078,14 +1078,14 @@ struct ip_fw frwl;
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_entry(av,&frwl);
|
set_entry(av,&frwl);
|
||||||
frwl.fw_flg=flags;
|
frwl.fw_flg=flags;
|
||||||
|
|
||||||
if (is_check) {
|
if (is_check) {
|
||||||
#ifndef disabled
|
#ifndef disabled
|
||||||
fprintf(stderr,"%s: checking disabled.\n",progname);
|
fprintf(stderr,"%s: checking disabled.\n",progname);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
struct ip *pkt;
|
struct ip *pkt;
|
||||||
struct tcphdr *th;
|
struct tcphdr *th;
|
||||||
int p_len=sizeof(struct ip)+sizeof(struct tcphdr);
|
int p_len=sizeof(struct ip)+sizeof(struct tcphdr);
|
||||||
@ -1120,10 +1120,10 @@ struct ip_fw frwl;
|
|||||||
}
|
}
|
||||||
pkt->ip_src.s_addr=frwl.fw_src.s_addr;
|
pkt->ip_src.s_addr=frwl.fw_src.s_addr;
|
||||||
pkt->ip_dst.s_addr=frwl.fw_dst.s_addr;
|
pkt->ip_dst.s_addr=frwl.fw_dst.s_addr;
|
||||||
|
|
||||||
th->th_sport=htons(frwl.fw_pts[0]);
|
th->th_sport=htons(frwl.fw_pts[0]);
|
||||||
th->th_dport=htons(frwl.fw_pts[frwl.fw_nsp]);
|
th->th_dport=htons(frwl.fw_pts[frwl.fw_nsp]);
|
||||||
|
|
||||||
if (setsockopt(s,IPPROTO_IP,ctl,pkt,p_len))
|
if (setsockopt(s,IPPROTO_IP,ctl,pkt,p_len))
|
||||||
printf("Packet DENYED.\n");
|
printf("Packet DENYED.\n");
|
||||||
else
|
else
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Id: md5.c,v 1.3 1995/02/26 01:55:31 phk Exp $
|
* $Id: md5.c,v 1.4 1995/02/26 02:00:35 phk Exp $
|
||||||
*
|
*
|
||||||
* Derived from:
|
* Derived from:
|
||||||
*/
|
*/
|
||||||
@ -67,7 +67,7 @@ main(argc, argv)
|
|||||||
MDTestSuite();
|
MDTestSuite();
|
||||||
else {
|
else {
|
||||||
p = MD5File(argv[i]);
|
p = MD5File(argv[i]);
|
||||||
if (!p)
|
if (!p)
|
||||||
perror(argv[i]);
|
perror(argv[i]);
|
||||||
else
|
else
|
||||||
printf("MD5 (%s) = %s\n", argv[i], p);
|
printf("MD5 (%s) = %s\n", argv[i], p);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: modload.c,v 1.6 1995/01/23 04:07:57 wollman Exp $
|
* $Id: modload.c,v 1.7 1995/03/16 17:11:21 wollman Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -106,7 +106,7 @@ linkcmd(kernel, entry, outfile, address, object)
|
|||||||
waitpid(pid, &status, 0);
|
waitpid(pid, &status, 0);
|
||||||
|
|
||||||
if(WIFSIGNALED(status)) {
|
if(WIFSIGNALED(status)) {
|
||||||
errx(1, "%s got signal: %s", _PATH_LD,
|
errx(1, "%s got signal: %s", _PATH_LD,
|
||||||
sys_siglist[WTERMSIG(status)]);
|
sys_siglist[WTERMSIG(status)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ mount_ufs(argc, argv)
|
|||||||
/*warnx("ufs: filesystem not found");*/
|
/*warnx("ufs: filesystem not found");*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) {
|
if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) {
|
||||||
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
@ -128,7 +128,7 @@ mount_ufs(argc, argv)
|
|||||||
if (mntflags & MNT_UPDATE)
|
if (mntflags & MNT_UPDATE)
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"Specified device does not match mounted device.\n");
|
"Specified device does not match mounted device.\n");
|
||||||
else
|
else
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"Incorrect super block.\n");
|
"Incorrect super block.\n");
|
||||||
break;
|
break;
|
||||||
|
@ -117,7 +117,7 @@ mount_ufs(argc, argv)
|
|||||||
/*warnx("ufs: filesystem not found");*/
|
/*warnx("ufs: filesystem not found");*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) {
|
if (mount(vfc ? vfc->vfc_index : MOUNT_UFS, fs_name, mntflags, &args) < 0) {
|
||||||
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
(void)fprintf(stderr, "%s on %s: ", args.fspec, fs_name);
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
@ -128,7 +128,7 @@ mount_ufs(argc, argv)
|
|||||||
if (mntflags & MNT_UPDATE)
|
if (mntflags & MNT_UPDATE)
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"Specified device does not match mounted device.\n");
|
"Specified device does not match mounted device.\n");
|
||||||
else
|
else
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"Incorrect super block.\n");
|
"Incorrect super block.\n");
|
||||||
break;
|
break;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*
|
*
|
||||||
* @(#)conf.c 8.2 (Berkeley) 3/27/94
|
* @(#)conf.c 8.2 (Berkeley) 3/27/94
|
||||||
*
|
*
|
||||||
* $Id: conf.c,v 1.2 1992/05/27 07:09:27 jsp Exp jsp $
|
* $Id: conf.c,v 1.2 1995/02/21 04:05:20 wollman Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -131,7 +131,7 @@ qelem *q0;
|
|||||||
}
|
}
|
||||||
ins_que(&p0->p_q, q0->q_back);
|
ins_que(&p0->p_q, q0->q_back);
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static path *palloc(cline, lno)
|
static path *palloc(cline, lno)
|
||||||
|
@ -220,7 +220,7 @@ main(argc, argv)
|
|||||||
conf_read(&q, conf);
|
conf_read(&q, conf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Accept a new connection
|
* Accept a new connection
|
||||||
* Will get EINTR if a signal has arrived, so just
|
* Will get EINTR if a signal has arrived, so just
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
*
|
*
|
||||||
* @(#)conf.c 8.2 (Berkeley) 3/27/94
|
* @(#)conf.c 8.2 (Berkeley) 3/27/94
|
||||||
*
|
*
|
||||||
* $Id: conf.c,v 1.2 1992/05/27 07:09:27 jsp Exp jsp $
|
* $Id: conf.c,v 1.2 1995/02/21 04:05:20 wollman Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -131,7 +131,7 @@ qelem *q0;
|
|||||||
}
|
}
|
||||||
ins_que(&p0->p_q, q0->q_back);
|
ins_que(&p0->p_q, q0->q_back);
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static path *palloc(cline, lno)
|
static path *palloc(cline, lno)
|
||||||
|
@ -220,7 +220,7 @@ main(argc, argv)
|
|||||||
conf_read(&q, conf);
|
conf_read(&q, conf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Accept a new connection
|
* Accept a new connection
|
||||||
* Will get EINTR if a signal has arrived, so just
|
* Will get EINTR if a signal has arrived, so just
|
||||||
|
@ -68,12 +68,12 @@ static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94";
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This routine provides the user interface to mounting a umap layer.
|
* This routine provides the user interface to mounting a umap layer.
|
||||||
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
||||||
* where the next lower level is mounted, the place where the umap layer is to
|
* where the next lower level is mounted, the place where the umap layer is to
|
||||||
* be mounted, the name of the user mapfile, and the name of the group
|
* be mounted, the name of the user mapfile, and the name of the group
|
||||||
* mapfile. The routine checks the ownerships and permissions on the
|
* mapfile. The routine checks the ownerships and permissions on the
|
||||||
* mapfiles, then opens and reads them. Then it calls mount(), which
|
* mapfiles, then opens and reads them. Then it calls mount(), which
|
||||||
* will, in turn, call the umap version of mount.
|
* will, in turn, call the umap version of mount.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct mntopt mopts[] = {
|
struct mntopt mopts[] = {
|
||||||
@ -130,7 +130,7 @@ main(argc, argv)
|
|||||||
#ifdef MAPSECURITY
|
#ifdef MAPSECURITY
|
||||||
/*
|
/*
|
||||||
* Check that group and other don't have write permissions on
|
* Check that group and other don't have write permissions on
|
||||||
* this mapfile, and that the mapfile belongs to root.
|
* this mapfile, and that the mapfile belongs to root.
|
||||||
*/
|
*/
|
||||||
if (fstat(fileno(fp), &statbuf))
|
if (fstat(fileno(fp), &statbuf))
|
||||||
err(1, "%s%s", mapfile, not);
|
err(1, "%s%s", mapfile, not);
|
||||||
@ -177,7 +177,7 @@ main(argc, argv)
|
|||||||
#ifdef MAPSECURITY
|
#ifdef MAPSECURITY
|
||||||
/*
|
/*
|
||||||
* Check that group and other don't have write permissions on
|
* Check that group and other don't have write permissions on
|
||||||
* this group mapfile, and that the file belongs to root.
|
* this group mapfile, and that the file belongs to root.
|
||||||
*/
|
*/
|
||||||
if (fstat(fileno(gfp), &statbuf))
|
if (fstat(fileno(gfp), &statbuf))
|
||||||
err(1, "%s%s", gmapfile, not);
|
err(1, "%s%s", gmapfile, not);
|
||||||
|
@ -68,12 +68,12 @@ static char sccsid[] = "@(#)mount_umap.c 8.3 (Berkeley) 3/27/94";
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This routine provides the user interface to mounting a umap layer.
|
* This routine provides the user interface to mounting a umap layer.
|
||||||
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
* It takes 4 mandatory parameters. The mandatory arguments are the place
|
||||||
* where the next lower level is mounted, the place where the umap layer is to
|
* where the next lower level is mounted, the place where the umap layer is to
|
||||||
* be mounted, the name of the user mapfile, and the name of the group
|
* be mounted, the name of the user mapfile, and the name of the group
|
||||||
* mapfile. The routine checks the ownerships and permissions on the
|
* mapfile. The routine checks the ownerships and permissions on the
|
||||||
* mapfiles, then opens and reads them. Then it calls mount(), which
|
* mapfiles, then opens and reads them. Then it calls mount(), which
|
||||||
* will, in turn, call the umap version of mount.
|
* will, in turn, call the umap version of mount.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct mntopt mopts[] = {
|
struct mntopt mopts[] = {
|
||||||
@ -130,7 +130,7 @@ main(argc, argv)
|
|||||||
#ifdef MAPSECURITY
|
#ifdef MAPSECURITY
|
||||||
/*
|
/*
|
||||||
* Check that group and other don't have write permissions on
|
* Check that group and other don't have write permissions on
|
||||||
* this mapfile, and that the mapfile belongs to root.
|
* this mapfile, and that the mapfile belongs to root.
|
||||||
*/
|
*/
|
||||||
if (fstat(fileno(fp), &statbuf))
|
if (fstat(fileno(fp), &statbuf))
|
||||||
err(1, "%s%s", mapfile, not);
|
err(1, "%s%s", mapfile, not);
|
||||||
@ -177,7 +177,7 @@ main(argc, argv)
|
|||||||
#ifdef MAPSECURITY
|
#ifdef MAPSECURITY
|
||||||
/*
|
/*
|
||||||
* Check that group and other don't have write permissions on
|
* Check that group and other don't have write permissions on
|
||||||
* this group mapfile, and that the file belongs to root.
|
* this group mapfile, and that the file belongs to root.
|
||||||
*/
|
*/
|
||||||
if (fstat(fileno(gfp), &statbuf))
|
if (fstat(fileno(gfp), &statbuf))
|
||||||
err(1, "%s%s", gmapfile, not);
|
err(1, "%s%s", gmapfile, not);
|
||||||
|
@ -43,7 +43,7 @@ static char copyright[] =
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
/*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
|
/*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id: mountd.c,v 1.5 1995/03/26 23:36:38 wpaul Exp $";
|
"$Id: mountd.c,v 1.6 1995/05/21 19:31:09 phk Exp $";
|
||||||
#endif /*not lint*/
|
#endif /*not lint*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -580,14 +580,14 @@ put_exlist(dp, xdrsp, adp, putdefp)
|
|||||||
if (!xdr_bool(xdrsp, &true))
|
if (!xdr_bool(xdrsp, &true))
|
||||||
return (1);
|
return (1);
|
||||||
strp = grp->gr_ptr.gt_hostent->h_name;
|
strp = grp->gr_ptr.gt_hostent->h_name;
|
||||||
if (!xdr_string(xdrsp, &strp,
|
if (!xdr_string(xdrsp, &strp,
|
||||||
RPCMNT_NAMELEN))
|
RPCMNT_NAMELEN))
|
||||||
return (1);
|
return (1);
|
||||||
} else if (grp->gr_type == GT_NET) {
|
} else if (grp->gr_type == GT_NET) {
|
||||||
if (!xdr_bool(xdrsp, &true))
|
if (!xdr_bool(xdrsp, &true))
|
||||||
return (1);
|
return (1);
|
||||||
strp = grp->gr_ptr.gt_net.nt_name;
|
strp = grp->gr_ptr.gt_net.nt_name;
|
||||||
if (!xdr_string(xdrsp, &strp,
|
if (!xdr_string(xdrsp, &strp,
|
||||||
RPCMNT_NAMELEN))
|
RPCMNT_NAMELEN))
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ mkfs(pp, fsys, fi, fo)
|
|||||||
fsize, sblock.fs_fsize);
|
fsize, sblock.fs_fsize);
|
||||||
exit(23);
|
exit(23);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Calculate the number of cylinders per group
|
* Calculate the number of cylinders per group
|
||||||
*/
|
*/
|
||||||
sblock.fs_cpg = cpg;
|
sblock.fs_cpg = cpg;
|
||||||
@ -645,7 +645,7 @@ mkfs(pp, fsys, fi, fo)
|
|||||||
sblock.fs_cssize - i < sblock.fs_bsize ?
|
sblock.fs_cssize - i < sblock.fs_bsize ?
|
||||||
sblock.fs_cssize - i : sblock.fs_bsize,
|
sblock.fs_cssize - i : sblock.fs_bsize,
|
||||||
((char *)fscs) + i);
|
((char *)fscs) + i);
|
||||||
/*
|
/*
|
||||||
* Write out the duplicate super blocks
|
* Write out the duplicate super blocks
|
||||||
*/
|
*/
|
||||||
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
|
||||||
@ -712,7 +712,7 @@ initcg(cylno, utime)
|
|||||||
acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag;
|
acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag;
|
||||||
acg.cg_btotoff = &acg.cg_space[0] - (u_char *)(&acg.cg_link);
|
acg.cg_btotoff = &acg.cg_space[0] - (u_char *)(&acg.cg_link);
|
||||||
acg.cg_boff = acg.cg_btotoff + sblock.fs_cpg * sizeof(long);
|
acg.cg_boff = acg.cg_btotoff + sblock.fs_cpg * sizeof(long);
|
||||||
acg.cg_iusedoff = acg.cg_boff +
|
acg.cg_iusedoff = acg.cg_boff +
|
||||||
sblock.fs_cpg * sblock.fs_nrpos * sizeof(short);
|
sblock.fs_cpg * sblock.fs_nrpos * sizeof(short);
|
||||||
acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, NBBY);
|
acg.cg_freeoff = acg.cg_iusedoff + howmany(sblock.fs_ipg, NBBY);
|
||||||
if (sblock.fs_contigsumsize <= 0) {
|
if (sblock.fs_contigsumsize <= 0) {
|
||||||
@ -1110,7 +1110,7 @@ calloc(size, numelm)
|
|||||||
free(ptr)
|
free(ptr)
|
||||||
char *ptr;
|
char *ptr;
|
||||||
{
|
{
|
||||||
|
|
||||||
/* do not worry about it for now */
|
/* do not worry about it for now */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ static struct lfs lfs_default = {
|
|||||||
/* lfs_offset */ 0,
|
/* lfs_offset */ 0,
|
||||||
/* lfs_lastpseg */ 0,
|
/* lfs_lastpseg */ 0,
|
||||||
/* lfs_tstamp */ 0,
|
/* lfs_tstamp */ 0,
|
||||||
/* lfs_maxsymlinklen */ MAXSYMLINKLEN,
|
/* lfs_maxsymlinklen */ MAXSYMLINKLEN,
|
||||||
/* lfs_minfree */ MINFREE,
|
/* lfs_minfree */ MINFREE,
|
||||||
/* lfs_maxfilesize */ 0,
|
/* lfs_maxfilesize */ 0,
|
||||||
/* lfs_dbpseg */ DFL_LFSSEG/DEV_BSIZE,
|
/* lfs_dbpseg */ DFL_LFSSEG/DEV_BSIZE,
|
||||||
@ -144,7 +144,7 @@ static struct lfs lfs_default = {
|
|||||||
/* lfs_flags */ 0,
|
/* lfs_flags */ 0,
|
||||||
/* lfs_fsmnt */ { 0 },
|
/* lfs_fsmnt */ { 0 },
|
||||||
/* lfs_pad */ { 0 },
|
/* lfs_pad */ { 0 },
|
||||||
/* lfs_pad2 */ { 0 },
|
/* lfs_pad2 */ { 0 },
|
||||||
/* lfs_cksum */ 0
|
/* lfs_cksum */ 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ struct direct lfs_lf_dir[] = {
|
|||||||
{ ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
|
{ ROOTINO, sizeof(struct direct), DT_DIR, 2, ".." },
|
||||||
};
|
};
|
||||||
|
|
||||||
static daddr_t make_dinode
|
static daddr_t make_dinode
|
||||||
__P((ino_t, struct dinode *, int, daddr_t, struct lfs *));
|
__P((ino_t, struct dinode *, int, daddr_t, struct lfs *));
|
||||||
static void make_dir __P(( void *, struct direct *, int));
|
static void make_dir __P(( void *, struct direct *, int));
|
||||||
static void put __P((int, off_t, void *, size_t));
|
static void put __P((int, off_t, void *, size_t));
|
||||||
@ -251,7 +251,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
lfsp->lfs_nseg = lfsp->lfs_dsize / lfsp->lfs_ssize;
|
lfsp->lfs_nseg = lfsp->lfs_dsize / lfsp->lfs_ssize;
|
||||||
lfsp->lfs_maxfilesize = maxtable[lfsp->lfs_bshift] << lfsp->lfs_bshift;
|
lfsp->lfs_maxfilesize = maxtable[lfsp->lfs_bshift] << lfsp->lfs_bshift;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The number of free blocks is set from the number of segments times
|
* The number of free blocks is set from the number of segments times
|
||||||
* the segment size - 2 (that we never write because we need to make
|
* the segment size - 2 (that we never write because we need to make
|
||||||
* sure the cleaner can run). Then we'll subtract off the room for the
|
* sure the cleaner can run). Then we'll subtract off the room for the
|
||||||
@ -278,7 +278,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
/* Figure out where the superblocks are going to live */
|
/* Figure out where the superblocks are going to live */
|
||||||
lfsp->lfs_sboffs[0] = LFS_LABELPAD/lp->d_secsize;
|
lfsp->lfs_sboffs[0] = LFS_LABELPAD/lp->d_secsize;
|
||||||
for (i = 1; i < LFS_MAXNUMSB; i++) {
|
for (i = 1; i < LFS_MAXNUMSB; i++) {
|
||||||
sb_addr = ((i * sb_interval) <<
|
sb_addr = ((i * sb_interval) <<
|
||||||
(lfsp->lfs_segshift - lfsp->lfs_bshift + lfsp->lfs_fsbtodb))
|
(lfsp->lfs_segshift - lfsp->lfs_bshift + lfsp->lfs_fsbtodb))
|
||||||
+ lfsp->lfs_sboffs[0];
|
+ lfsp->lfs_sboffs[0];
|
||||||
if (sb_addr > partp->p_size)
|
if (sb_addr > partp->p_size)
|
||||||
@ -287,15 +287,15 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
}
|
}
|
||||||
last_sb_addr = lfsp->lfs_sboffs[i - 1];
|
last_sb_addr = lfsp->lfs_sboffs[i - 1];
|
||||||
lfsp->lfs_lastseg = lfsp->lfs_sboffs[0];
|
lfsp->lfs_lastseg = lfsp->lfs_sboffs[0];
|
||||||
lfsp->lfs_nextseg =
|
lfsp->lfs_nextseg =
|
||||||
lfsp->lfs_sboffs[1] ? lfsp->lfs_sboffs[1] : lfsp->lfs_sboffs[0];
|
lfsp->lfs_sboffs[1] ? lfsp->lfs_sboffs[1] : lfsp->lfs_sboffs[0];
|
||||||
lfsp->lfs_curseg = lfsp->lfs_lastseg;
|
lfsp->lfs_curseg = lfsp->lfs_lastseg;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the segment usage table. The first segment will
|
* Initialize the segment usage table. The first segment will
|
||||||
* contain the superblock, the cleanerinfo (cleansz), the segusage
|
* contain the superblock, the cleanerinfo (cleansz), the segusage
|
||||||
* table * (segtabsz), 1 block's worth of IFILE entries, the root
|
* table * (segtabsz), 1 block's worth of IFILE entries, the root
|
||||||
* directory, the lost+found directory and one block's worth of
|
* directory, the lost+found directory and one block's worth of
|
||||||
* inodes (containing the ifile, root, and l+f inodes).
|
* inodes (containing the ifile, root, and l+f inodes).
|
||||||
*/
|
*/
|
||||||
if (!(cleaninfo = malloc(lfsp->lfs_cleansz << lfsp->lfs_bshift)))
|
if (!(cleaninfo = malloc(lfsp->lfs_cleansz << lfsp->lfs_bshift)))
|
||||||
@ -317,7 +317,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
lfsp->lfs_bfree -=
|
lfsp->lfs_bfree -=
|
||||||
fsbtodb(lfsp, lfsp->lfs_cleansz + lfsp->lfs_segtabsz + 4);
|
fsbtodb(lfsp, lfsp->lfs_cleansz + lfsp->lfs_segtabsz + 4);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now figure out the address of the ifile inode. The inode block
|
* Now figure out the address of the ifile inode. The inode block
|
||||||
* appears immediately after the segment summary.
|
* appears immediately after the segment summary.
|
||||||
*/
|
*/
|
||||||
@ -336,27 +336,27 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
segp->su_nsums = 0;
|
segp->su_nsums = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize dynamic accounting. The blocks available for
|
* Initialize dynamic accounting. The blocks available for
|
||||||
* writing are the bfree blocks minus 1 segment summary for
|
* writing are the bfree blocks minus 1 segment summary for
|
||||||
* each segment since you can't write any new data without
|
* each segment since you can't write any new data without
|
||||||
* creating a segment summary - 2 segments that the cleaner
|
* creating a segment summary - 2 segments that the cleaner
|
||||||
* needs.
|
* needs.
|
||||||
*/
|
*/
|
||||||
lfsp->lfs_avail = lfsp->lfs_bfree - lfsp->lfs_nseg -
|
lfsp->lfs_avail = lfsp->lfs_bfree - lfsp->lfs_nseg -
|
||||||
fsbtodb(lfsp, 2 * lfsp->lfs_ssize);
|
fsbtodb(lfsp, 2 * lfsp->lfs_ssize);
|
||||||
lfsp->lfs_uinodes = 0;
|
lfsp->lfs_uinodes = 0;
|
||||||
/*
|
/*
|
||||||
* Ready to start writing segments. The first segment is different
|
* Ready to start writing segments. The first segment is different
|
||||||
* because it contains the segment usage table and the ifile inode
|
* because it contains the segment usage table and the ifile inode
|
||||||
* as well as a superblock. For the rest of the segments, set the
|
* as well as a superblock. For the rest of the segments, set the
|
||||||
* time stamp to be 0 so that the first segment is the most recent.
|
* time stamp to be 0 so that the first segment is the most recent.
|
||||||
* For each segment that is supposed to contain a copy of the super
|
* For each segment that is supposed to contain a copy of the super
|
||||||
* block, initialize its first few blocks and its segment summary
|
* block, initialize its first few blocks and its segment summary
|
||||||
* to indicate this.
|
* to indicate this.
|
||||||
*/
|
*/
|
||||||
lfsp->lfs_nfiles = LFS_FIRST_INUM - 1;
|
lfsp->lfs_nfiles = LFS_FIRST_INUM - 1;
|
||||||
lfsp->lfs_cksum =
|
lfsp->lfs_cksum =
|
||||||
cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum));
|
cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum));
|
||||||
|
|
||||||
/* Now create a block of disk inodes */
|
/* Now create a block of disk inodes */
|
||||||
@ -370,13 +370,13 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
fatal("%s", strerror(errno));
|
fatal("%s", strerror(errno));
|
||||||
ifile = (IFILE *)ipagep;
|
ifile = (IFILE *)ipagep;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize IFILE. It is the next block following the
|
* Initialize IFILE. It is the next block following the
|
||||||
* block of inodes (whose address has been calculated in
|
* block of inodes (whose address has been calculated in
|
||||||
* lfsp->lfs_idaddr;
|
* lfsp->lfs_idaddr;
|
||||||
*/
|
*/
|
||||||
sb_addr = lfsp->lfs_idaddr + lfsp->lfs_bsize / lp->d_secsize;
|
sb_addr = lfsp->lfs_idaddr + lfsp->lfs_bsize / lp->d_secsize;
|
||||||
sb_addr = make_dinode(LFS_IFILE_INUM, dip,
|
sb_addr = make_dinode(LFS_IFILE_INUM, dip,
|
||||||
lfsp->lfs_cleansz + lfsp->lfs_segtabsz+1, sb_addr, lfsp);
|
lfsp->lfs_cleansz + lfsp->lfs_segtabsz+1, sb_addr, lfsp);
|
||||||
dip->di_mode = IFREG|IREAD|IWRITE;
|
dip->di_mode = IFREG|IREAD|IWRITE;
|
||||||
ip = &ifile[LFS_IFILE_INUM];
|
ip = &ifile[LFS_IFILE_INUM];
|
||||||
@ -404,10 +404,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
/* Make all the other dinodes invalid */
|
/* Make all the other dinodes invalid */
|
||||||
for (i = INOPB(lfsp)-3, dip++; i; i--, dip++)
|
for (i = INOPB(lfsp)-3, dip++; i; i--, dip++)
|
||||||
dip->di_inumber = LFS_UNUSED_INUM;
|
dip->di_inumber = LFS_UNUSED_INUM;
|
||||||
|
|
||||||
|
|
||||||
/* Link remaining IFILE entries in free list */
|
/* Link remaining IFILE entries in free list */
|
||||||
for (ip = &ifile[LFS_FIRST_INUM], i = LFS_FIRST_INUM;
|
for (ip = &ifile[LFS_FIRST_INUM], i = LFS_FIRST_INUM;
|
||||||
i < lfsp->lfs_ifpb; ++ip) {
|
i < lfsp->lfs_ifpb; ++ip) {
|
||||||
ip->if_version = 1;
|
ip->if_version = 1;
|
||||||
ip->if_daddr = LFS_UNUSED_DADDR;
|
ip->if_daddr = LFS_UNUSED_DADDR;
|
||||||
@ -421,10 +421,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
dp = datasump = malloc (blocks_used * sizeof(u_long));
|
dp = datasump = malloc (blocks_used * sizeof(u_long));
|
||||||
*dp++ = ((u_long *)dpagep)[0]; /* inode block */
|
*dp++ = ((u_long *)dpagep)[0]; /* inode block */
|
||||||
for (i = 0; i < lfsp->lfs_cleansz; i++)
|
for (i = 0; i < lfsp->lfs_cleansz; i++)
|
||||||
*dp++ = ((u_long *)cleaninfo)[(i << lfsp->lfs_bshift) /
|
*dp++ = ((u_long *)cleaninfo)[(i << lfsp->lfs_bshift) /
|
||||||
sizeof(u_long)]; /* Cleaner info */
|
sizeof(u_long)]; /* Cleaner info */
|
||||||
for (i = 0; i < lfsp->lfs_segtabsz; i++)
|
for (i = 0; i < lfsp->lfs_segtabsz; i++)
|
||||||
*dp++ = ((u_long *)segtable)[(i << lfsp->lfs_bshift) /
|
*dp++ = ((u_long *)segtable)[(i << lfsp->lfs_bshift) /
|
||||||
sizeof(u_long)]; /* Segusage table */
|
sizeof(u_long)]; /* Segusage table */
|
||||||
*dp++ = ((u_long *)ifile)[0]; /* Ifile */
|
*dp++ = ((u_long *)ifile)[0]; /* Ifile */
|
||||||
|
|
||||||
@ -450,20 +450,20 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
off += lfsp->lfs_bsize;
|
off += lfsp->lfs_bsize;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* use ipagep for space for writing out other stuff. It used to
|
* use ipagep for space for writing out other stuff. It used to
|
||||||
* contain the ifile, but we're done with it.
|
* contain the ifile, but we're done with it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Write out the root and lost and found directories */
|
/* Write out the root and lost and found directories */
|
||||||
bzero(ipagep, lfsp->lfs_bsize);
|
bzero(ipagep, lfsp->lfs_bsize);
|
||||||
make_dir(ipagep, lfs_root_dir,
|
make_dir(ipagep, lfs_root_dir,
|
||||||
sizeof(lfs_root_dir) / sizeof(struct direct));
|
sizeof(lfs_root_dir) / sizeof(struct direct));
|
||||||
*dp++ = ((u_long *)ipagep)[0];
|
*dp++ = ((u_long *)ipagep)[0];
|
||||||
put(fd, off, ipagep, lfsp->lfs_bsize);
|
put(fd, off, ipagep, lfsp->lfs_bsize);
|
||||||
off += lfsp->lfs_bsize;
|
off += lfsp->lfs_bsize;
|
||||||
|
|
||||||
bzero(ipagep, lfsp->lfs_bsize);
|
bzero(ipagep, lfsp->lfs_bsize);
|
||||||
make_dir(ipagep, lfs_lf_dir,
|
make_dir(ipagep, lfs_lf_dir,
|
||||||
sizeof(lfs_lf_dir) / sizeof(struct direct));
|
sizeof(lfs_lf_dir) / sizeof(struct direct));
|
||||||
*dp++ = ((u_long *)ipagep)[0];
|
*dp++ = ((u_long *)ipagep)[0];
|
||||||
put(fd, off, ipagep, lfsp->lfs_bsize);
|
put(fd, off, ipagep, lfsp->lfs_bsize);
|
||||||
@ -472,7 +472,7 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
lfsp->lfs_offset = (off + lfsp->lfs_bsize) / lp->d_secsize;
|
lfsp->lfs_offset = (off + lfsp->lfs_bsize) / lp->d_secsize;
|
||||||
put(fd, LFS_LABELPAD, lfsp, sizeof(struct lfs));
|
put(fd, LFS_LABELPAD, lfsp, sizeof(struct lfs));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finally, calculate all the fields for the summary structure
|
* Finally, calculate all the fields for the summary structure
|
||||||
* and write it.
|
* and write it.
|
||||||
*/
|
*/
|
||||||
@ -536,9 +536,9 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
file_info.fi_ino = LOSTFOUNDINO;
|
file_info.fi_ino = LOSTFOUNDINO;
|
||||||
bcopy(&file_info, sump, sizeof(FINFO));
|
bcopy(&file_info, sump, sizeof(FINFO));
|
||||||
|
|
||||||
((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] =
|
((daddr_t *)ipagep)[LFS_SUMMARY_SIZE / sizeof(daddr_t) - 1] =
|
||||||
lfsp->lfs_idaddr;
|
lfsp->lfs_idaddr;
|
||||||
((SEGSUM *)ipagep)->ss_sumsum = cksum(ipagep+sizeof(summary.ss_sumsum),
|
((SEGSUM *)ipagep)->ss_sumsum = cksum(ipagep+sizeof(summary.ss_sumsum),
|
||||||
LFS_SUMMARY_SIZE - sizeof(summary.ss_sumsum));
|
LFS_SUMMARY_SIZE - sizeof(summary.ss_sumsum));
|
||||||
put(fd, LFS_LABELPAD + LFS_SBPAD, ipagep, LFS_SUMMARY_SIZE);
|
put(fd, LFS_LABELPAD + LFS_SBPAD, ipagep, LFS_SUMMARY_SIZE);
|
||||||
|
|
||||||
@ -556,9 +556,9 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
put(fd, off, sp, LFS_SUMMARY_SIZE);
|
put(fd, off, sp, LFS_SUMMARY_SIZE);
|
||||||
|
|
||||||
/* Now, write rest of segments containing superblocks */
|
/* Now, write rest of segments containing superblocks */
|
||||||
lfsp->lfs_cksum =
|
lfsp->lfs_cksum =
|
||||||
cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum));
|
cksum(lfsp, sizeof(struct lfs) - sizeof(lfsp->lfs_cksum));
|
||||||
for (seg_addr = last_addr = lfsp->lfs_sboffs[0], j = 1, i = 1;
|
for (seg_addr = last_addr = lfsp->lfs_sboffs[0], j = 1, i = 1;
|
||||||
i < lfsp->lfs_nseg; i++) {
|
i < lfsp->lfs_nseg; i++) {
|
||||||
|
|
||||||
seg_addr += lfsp->lfs_ssize << lfsp->lfs_fsbtodb;
|
seg_addr += lfsp->lfs_ssize << lfsp->lfs_fsbtodb;
|
||||||
@ -571,10 +571,10 @@ make_lfs(fd, lp, partp, minfree, bsize, seg_size)
|
|||||||
j++;
|
j++;
|
||||||
put(fd, seg_seek, lfsp, sizeof(struct lfs));
|
put(fd, seg_seek, lfsp, sizeof(struct lfs));
|
||||||
seg_seek += LFS_SBPAD;
|
seg_seek += LFS_SBPAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Summary */
|
/* Summary */
|
||||||
sp->ss_sumsum = cksum(&sp->ss_datasum,
|
sp->ss_sumsum = cksum(&sp->ss_datasum,
|
||||||
LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum));
|
LFS_SUMMARY_SIZE - sizeof(sp->ss_sumsum));
|
||||||
put(fd, seg_seek, sp, LFS_SUMMARY_SIZE);
|
put(fd, seg_seek, sp, LFS_SUMMARY_SIZE);
|
||||||
}
|
}
|
||||||
@ -649,7 +649,7 @@ make_dinode(ino, dip, nblocks, saddr, lfsp)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Construct a set of directory entries in "bufp". We assume that all the
|
* Construct a set of directory entries in "bufp". We assume that all the
|
||||||
* entries in protodir fir in the first DIRBLKSIZ.
|
* entries in protodir fir in the first DIRBLKSIZ.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
make_dir(bufp, protodir, entries)
|
make_dir(bufp, protodir, entries)
|
||||||
|
@ -323,7 +323,7 @@ main(argc, argv)
|
|||||||
if (bsize <= 0)
|
if (bsize <= 0)
|
||||||
bsize = MIN(DFL_LFSBLOCK, 8 * fsize);
|
bsize = MIN(DFL_LFSBLOCK, 8 * fsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (segsize == 0) {
|
if (segsize == 0) {
|
||||||
segsize = pp->p_cpg * bsize;
|
segsize = pp->p_cpg * bsize;
|
||||||
if (segsize <= 0)
|
if (segsize <= 0)
|
||||||
|
@ -706,8 +706,8 @@ status()
|
|||||||
double temp_min = nreceived ? tmin : 0;
|
double temp_min = nreceived ? tmin : 0;
|
||||||
(void)fprintf(stderr, "%ld/%ld packets received (%ld%%) "
|
(void)fprintf(stderr, "%ld/%ld packets received (%ld%%) "
|
||||||
"%.3f min / %.3f avg / %.3f max\n",
|
"%.3f min / %.3f avg / %.3f max\n",
|
||||||
nreceived, ntransmitted,
|
nreceived, ntransmitted,
|
||||||
(ntransmitted ?
|
(ntransmitted ?
|
||||||
100 - (int) (((ntransmitted - nreceived) * 100)
|
100 - (int) (((ntransmitted - nreceived) * 100)
|
||||||
/ ntransmitted)
|
/ ntransmitted)
|
||||||
: 0),
|
: 0),
|
||||||
@ -755,7 +755,7 @@ finish()
|
|||||||
tcsetattr (0, TCSANOW, &ts);
|
tcsetattr (0, TCSANOW, &ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nreceived)
|
if (nreceived)
|
||||||
exit(0);
|
exit(0);
|
||||||
else
|
else
|
||||||
exit(2);
|
exit(2);
|
||||||
|
@ -121,7 +121,7 @@ checkfstab(preen, maxrun, docheck, chkit)
|
|||||||
maxrun = ndisks;
|
maxrun = ndisks;
|
||||||
nextdisk = disks;
|
nextdisk = disks;
|
||||||
for (passno = 0; passno < maxrun; ++passno) {
|
for (passno = 0; passno < maxrun; ++passno) {
|
||||||
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
while ((ret = startdisk(nextdisk, chkit)) != 0 &&
|
||||||
nrun > 0)
|
nrun > 0)
|
||||||
sleep(10);
|
sleep(10);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* Rdisc (this program) was developed by Sun Microsystems, Inc. and is
|
* Rdisc (this program) was developed by Sun Microsystems, Inc. and is
|
||||||
* provided for unrestricted use provided that this legend is included on
|
* provided for unrestricted use provided that this legend is included on
|
||||||
* all tape media and as a part of the software program in whole or part.
|
* all tape media and as a part of the software program in whole or part.
|
||||||
* Users may copy or modify Rdisc without charge, and they may freely
|
* Users may copy or modify Rdisc without charge, and they may freely
|
||||||
* distribute it.
|
* distribute it.
|
||||||
*
|
*
|
||||||
* RDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
* RDISC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||||
@ -57,7 +57,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TBD
|
* TBD
|
||||||
* Use 255.255.255.255 for broadcasts - not the interface broadcast
|
* Use 255.255.255.255 for broadcasts - not the interface broadcast
|
||||||
* address.
|
* address.
|
||||||
@ -162,7 +162,7 @@ int solicit = 0;
|
|||||||
int responder;
|
int responder;
|
||||||
int ntransmitted = 0;
|
int ntransmitted = 0;
|
||||||
int nreceived = 0;
|
int nreceived = 0;
|
||||||
int forever = 0; /* Never give up on host. If 0 defer fork until
|
int forever = 0; /* Never give up on host. If 0 defer fork until
|
||||||
* first response.
|
* first response.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ int preference = 0; /* Setable with -p option */
|
|||||||
/* Host variables */
|
/* Host variables */
|
||||||
int max_solicitations = MAX_SOLICITATIONS;
|
int max_solicitations = MAX_SOLICITATIONS;
|
||||||
unsigned int solicitation_interval = SOLICITATION_INTERVAL;
|
unsigned int solicitation_interval = SOLICITATION_INTERVAL;
|
||||||
int best_preference = 1; /* Set to record only the router(s) with the
|
int best_preference = 1; /* Set to record only the router(s) with the
|
||||||
best preference in the kernel. Not set
|
best preference in the kernel. Not set
|
||||||
puts all routes in the kernel. */
|
puts all routes in the kernel. */
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ do_fork()
|
|||||||
{
|
{
|
||||||
int t;
|
int t;
|
||||||
long pid;
|
long pid;
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -271,7 +271,7 @@ char *argv[];
|
|||||||
if (argc != 0) {
|
if (argc != 0) {
|
||||||
val = strtol(av[0], (char **)NULL, 0);
|
val = strtol(av[0], (char **)NULL, 0);
|
||||||
if (val < 4 || val > 1800) {
|
if (val < 4 || val > 1800) {
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"Bad Max Advertizement Interval\n");
|
"Bad Max Advertizement Interval\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ char *argv[];
|
|||||||
} else {
|
} else {
|
||||||
prusage();
|
prusage();
|
||||||
/* NOTREACHED*/
|
/* NOTREACHED*/
|
||||||
}
|
}
|
||||||
goto next;
|
goto next;
|
||||||
case 'p':
|
case 'p':
|
||||||
argc--, av++;
|
argc--, av++;
|
||||||
@ -403,7 +403,7 @@ char *argv[];
|
|||||||
int fromlen = sizeof (from);
|
int fromlen = sizeof (from);
|
||||||
int cc;
|
int cc;
|
||||||
|
|
||||||
if ( (cc=recvfrom(s, (char *)packet, len, 0,
|
if ( (cc=recvfrom(s, (char *)packet, len, 0,
|
||||||
(struct sockaddr *)&from, &fromlen)) < 0) {
|
(struct sockaddr *)&from, &fromlen)) < 0) {
|
||||||
if( errno == EINTR )
|
if( errno == EINTR )
|
||||||
continue;
|
continue;
|
||||||
@ -444,8 +444,8 @@ void timer()
|
|||||||
if (ntransmitted < initial_advertisements)
|
if (ntransmitted < initial_advertisements)
|
||||||
left_until_advertise = initial_advert_interval;
|
left_until_advertise = initial_advert_interval;
|
||||||
else
|
else
|
||||||
left_until_advertise = min_adv_int +
|
left_until_advertise = min_adv_int +
|
||||||
((max_adv_int - min_adv_int) *
|
((max_adv_int - min_adv_int) *
|
||||||
(random() % 1000)/1000);
|
(random() % 1000)/1000);
|
||||||
} else if (solicit && left_until_solicit <= 0) {
|
} else if (solicit && left_until_solicit <= 0) {
|
||||||
ntransmitted++;
|
ntransmitted++;
|
||||||
@ -464,9 +464,9 @@ void timer()
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* S O L I C I T O R
|
* S O L I C I T O R
|
||||||
*
|
*
|
||||||
* Compose and transmit an ICMP ROUTER SOLICITATION REQUEST packet.
|
* Compose and transmit an ICMP ROUTER SOLICITATION REQUEST packet.
|
||||||
* The IP packet will be added on by the kernel.
|
* The IP packet will be added on by the kernel.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
solicitor(sin)
|
solicitor(sin)
|
||||||
@ -475,7 +475,7 @@ solicitor(sin)
|
|||||||
static u_char outpack[MAXPACKET];
|
static u_char outpack[MAXPACKET];
|
||||||
register struct icmp *icp = (struct icmp *) ALLIGN(outpack);
|
register struct icmp *icp = (struct icmp *) ALLIGN(outpack);
|
||||||
int packetlen, i;
|
int packetlen, i;
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
logtrace("Sending solicitation to %s\n",
|
logtrace("Sending solicitation to %s\n",
|
||||||
pr_name(sin->sin_addr));
|
pr_name(sin->sin_addr));
|
||||||
@ -489,7 +489,7 @@ solicitor(sin)
|
|||||||
/* Compute ICMP checksum here */
|
/* Compute ICMP checksum here */
|
||||||
icp->icmp_cksum = in_cksum( (u_short *)icp, packetlen );
|
icp->icmp_cksum = in_cksum( (u_short *)icp, packetlen );
|
||||||
|
|
||||||
if (isbroadcast(sin))
|
if (isbroadcast(sin))
|
||||||
i = sendbcast(s, (char *)outpack, packetlen);
|
i = sendbcast(s, (char *)outpack, packetlen);
|
||||||
else if (ismulticast(sin))
|
else if (ismulticast(sin))
|
||||||
i = sendmcast( s, (char *)outpack, packetlen, sin);
|
i = sendmcast( s, (char *)outpack, packetlen, sin);
|
||||||
@ -508,9 +508,9 @@ solicitor(sin)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* A V E R T I S E
|
* A V E R T I S E
|
||||||
*
|
*
|
||||||
* Compose and transmit an ICMP ROUTER ADVERTISEMENT packet.
|
* Compose and transmit an ICMP ROUTER ADVERTISEMENT packet.
|
||||||
* The IP packet will be added on by the kernel.
|
* The IP packet will be added on by the kernel.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
advertise(sin)
|
advertise(sin)
|
||||||
@ -520,23 +520,23 @@ advertise(sin)
|
|||||||
register struct icmp_ra *rap = (struct icmp_ra *) ALLIGN(outpack);
|
register struct icmp_ra *rap = (struct icmp_ra *) ALLIGN(outpack);
|
||||||
struct icmp_ra_addr *ap;
|
struct icmp_ra_addr *ap;
|
||||||
int packetlen, i, cc;
|
int packetlen, i, cc;
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
logtrace("Sending advertisement to %s\n",
|
logtrace("Sending advertisement to %s\n",
|
||||||
pr_name(sin->sin_addr));
|
pr_name(sin->sin_addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < num_interfaces; i++) {
|
for (i = 0; i < num_interfaces; i++) {
|
||||||
rap->icmp_type = ICMP_ROUTER_ADVERTISEMENT;
|
rap->icmp_type = ICMP_ROUTER_ADVERTISEMENT;
|
||||||
rap->icmp_code = 0;
|
rap->icmp_code = 0;
|
||||||
rap->icmp_cksum = 0;
|
rap->icmp_cksum = 0;
|
||||||
rap->icmp_num_addrs = 0;
|
rap->icmp_num_addrs = 0;
|
||||||
rap->icmp_wpa = 2;
|
rap->icmp_wpa = 2;
|
||||||
rap->icmp_lifetime = lifetime;
|
rap->icmp_lifetime = lifetime;
|
||||||
packetlen = 8;
|
packetlen = 8;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO handle multiple logical interfaces per
|
* TODO handle multiple logical interfaces per
|
||||||
* physical interface. (increment with rap->icmp_wpa * 4 for
|
* physical interface. (increment with rap->icmp_wpa * 4 for
|
||||||
* each address.)
|
* each address.)
|
||||||
*/
|
*/
|
||||||
@ -550,15 +550,15 @@ advertise(sin)
|
|||||||
/* Compute ICMP checksum here */
|
/* Compute ICMP checksum here */
|
||||||
rap->icmp_cksum = in_cksum( (u_short *)rap, packetlen );
|
rap->icmp_cksum = in_cksum( (u_short *)rap, packetlen );
|
||||||
|
|
||||||
if (isbroadcast(sin))
|
if (isbroadcast(sin))
|
||||||
cc = sendbcastif(s, (char *)outpack, packetlen,
|
cc = sendbcastif(s, (char *)outpack, packetlen,
|
||||||
&interfaces[i]);
|
&interfaces[i]);
|
||||||
else if (ismulticast(sin))
|
else if (ismulticast(sin))
|
||||||
cc = sendmcastif( s, (char *)outpack, packetlen, sin,
|
cc = sendmcastif( s, (char *)outpack, packetlen, sin,
|
||||||
&interfaces[i]);
|
&interfaces[i]);
|
||||||
else {
|
else {
|
||||||
struct interface *ifp = &interfaces[i];
|
struct interface *ifp = &interfaces[i];
|
||||||
/*
|
/*
|
||||||
* Verify that the interface matches the destination
|
* Verify that the interface matches the destination
|
||||||
* address.
|
* address.
|
||||||
*/
|
*/
|
||||||
@ -567,11 +567,11 @@ advertise(sin)
|
|||||||
if (debug) {
|
if (debug) {
|
||||||
logdebug("Unicast to %s ",
|
logdebug("Unicast to %s ",
|
||||||
pr_name(sin->sin_addr));
|
pr_name(sin->sin_addr));
|
||||||
logdebug("on interface %s\n",
|
logdebug("on interface %s\n",
|
||||||
pr_name(ifp->address));
|
pr_name(ifp->address));
|
||||||
}
|
}
|
||||||
cc = sendto( s, (char *)outpack, packetlen, 0,
|
cc = sendto( s, (char *)outpack, packetlen, 0,
|
||||||
(struct sockaddr *)sin,
|
(struct sockaddr *)sin,
|
||||||
sizeof(struct sockaddr));
|
sizeof(struct sockaddr));
|
||||||
} else
|
} else
|
||||||
cc = packetlen;
|
cc = packetlen;
|
||||||
@ -637,7 +637,7 @@ char *pr_name(addr)
|
|||||||
static char buf[256];
|
static char buf[256];
|
||||||
|
|
||||||
phe = gethostbyaddr((char *)&addr.s_addr, 4, AF_INET);
|
phe = gethostbyaddr((char *)&addr.s_addr, 4, AF_INET);
|
||||||
if (phe == NULL)
|
if (phe == NULL)
|
||||||
return( inet_ntoa(addr));
|
return( inet_ntoa(addr));
|
||||||
(void) sprintf(buf, "%s (%s)", phe->h_name, inet_ntoa(addr));
|
(void) sprintf(buf, "%s (%s)", phe->h_name, inet_ntoa(addr));
|
||||||
return(buf);
|
return(buf);
|
||||||
@ -711,7 +711,7 @@ struct sockaddr_in *from;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (rap->icmp_num_addrs < 1) {
|
if (rap->icmp_num_addrs < 1) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
logtrace("ICMP %s from %s: No addresses\n",
|
logtrace("ICMP %s from %s: No addresses\n",
|
||||||
pr_type((int)rap->icmp_type),
|
pr_type((int)rap->icmp_type),
|
||||||
pr_name(from->sin_addr));
|
pr_name(from->sin_addr));
|
||||||
@ -725,14 +725,14 @@ struct sockaddr_in *from;
|
|||||||
rap->icmp_wpa);
|
rap->icmp_wpa);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((unsigned)cc <
|
if ((unsigned)cc <
|
||||||
ICMP_MINLEN + rap->icmp_num_addrs * rap->icmp_wpa * 4) {
|
ICMP_MINLEN + rap->icmp_num_addrs * rap->icmp_wpa * 4) {
|
||||||
if (verbose)
|
if (verbose)
|
||||||
logtrace("ICMP %s from %s: Too short %d, %d\n",
|
logtrace("ICMP %s from %s: Too short %d, %d\n",
|
||||||
pr_type((int)rap->icmp_type),
|
pr_type((int)rap->icmp_type),
|
||||||
pr_name(from->sin_addr),
|
pr_name(from->sin_addr),
|
||||||
cc,
|
cc,
|
||||||
ICMP_MINLEN +
|
ICMP_MINLEN +
|
||||||
rap->icmp_num_addrs * rap->icmp_wpa * 4);
|
rap->icmp_num_addrs * rap->icmp_wpa * 4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -756,16 +756,16 @@ struct sockaddr_in *from;
|
|||||||
for (i = 0; (unsigned)i < rap->icmp_num_addrs; i++) {
|
for (i = 0; (unsigned)i < rap->icmp_num_addrs; i++) {
|
||||||
struct in_addr ina;
|
struct in_addr ina;
|
||||||
ap = (struct icmp_ra_addr *)
|
ap = (struct icmp_ra_addr *)
|
||||||
ALLIGN(buf + hlen + ICMP_MINLEN +
|
ALLIGN(buf + hlen + ICMP_MINLEN +
|
||||||
i * rap->icmp_wpa * 4);
|
i * rap->icmp_wpa * 4);
|
||||||
ina.s_addr = ntohl(ap->addr);
|
ina.s_addr = ntohl(ap->addr);
|
||||||
if (verbose)
|
if (verbose)
|
||||||
logtrace("\taddress %s, preference 0x%x\n",
|
logtrace("\taddress %s, preference 0x%x\n",
|
||||||
pr_name(ina),
|
pr_name(ina),
|
||||||
ntohl(ap->preference));
|
ntohl(ap->preference));
|
||||||
if (!responder) {
|
if (!responder) {
|
||||||
if (is_directly_connected(ina))
|
if (is_directly_connected(ina))
|
||||||
record_router(ina,
|
record_router(ina,
|
||||||
(long)ntohl(ap->preference),
|
(long)ntohl(ap->preference),
|
||||||
rap->icmp_lifetime);
|
rap->icmp_lifetime);
|
||||||
}
|
}
|
||||||
@ -782,7 +782,7 @@ struct sockaddr_in *from;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ICMP_ROUTER_SOLICITATION: {
|
case ICMP_ROUTER_SOLICITATION: {
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
|
|
||||||
@ -818,7 +818,7 @@ struct sockaddr_in *from;
|
|||||||
logtrace("ICMP %s from %s: Too short %d, %d\n",
|
logtrace("ICMP %s from %s: Too short %d, %d\n",
|
||||||
pr_type((int)icp->icmp_type),
|
pr_type((int)icp->icmp_type),
|
||||||
pr_name(from->sin_addr),
|
pr_name(from->sin_addr),
|
||||||
cc,
|
cc,
|
||||||
ICMP_MINLEN);
|
ICMP_MINLEN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -827,8 +827,8 @@ struct sockaddr_in *from;
|
|||||||
logtrace("ICMP %s from %s\n",
|
logtrace("ICMP %s from %s\n",
|
||||||
pr_type((int)icp->icmp_type),
|
pr_type((int)icp->icmp_type),
|
||||||
pr_name(from->sin_addr));
|
pr_name(from->sin_addr));
|
||||||
|
|
||||||
if (!responder)
|
if (!responder)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Check that ip_src is either a neighboor
|
/* Check that ip_src is either a neighboor
|
||||||
@ -844,8 +844,8 @@ struct sockaddr_in *from;
|
|||||||
else
|
else
|
||||||
sin.sin_addr.s_addr = INADDR_BROADCAST;
|
sin.sin_addr.s_addr = INADDR_BROADCAST;
|
||||||
/* Restart the timer when we broadcast */
|
/* Restart the timer when we broadcast */
|
||||||
left_until_advertise = min_adv_int +
|
left_until_advertise = min_adv_int +
|
||||||
((max_adv_int - min_adv_int)
|
((max_adv_int - min_adv_int)
|
||||||
* (random() % 1000)/1000);
|
* (random() % 1000)/1000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -932,7 +932,7 @@ finish()
|
|||||||
interfaces[i].preference = IGNORE_PREFERENCE;
|
interfaces[i].preference = IGNORE_PREFERENCE;
|
||||||
ntransmitted++;
|
ntransmitted++;
|
||||||
advertise(&whereto);
|
advertise(&whereto);
|
||||||
}
|
}
|
||||||
logtrace("\n----%s rdisc Statistics----\n", sendaddress );
|
logtrace("\n----%s rdisc Statistics----\n", sendaddress );
|
||||||
logtrace("%d packets transmitted, ", ntransmitted );
|
logtrace("%d packets transmitted, ", ntransmitted );
|
||||||
logtrace("%d packets received, ", nreceived );
|
logtrace("%d packets received, ", nreceived );
|
||||||
@ -955,25 +955,25 @@ unsigned char *data;
|
|||||||
while (len) {
|
while (len) {
|
||||||
register int i;
|
register int i;
|
||||||
char charstring[17];
|
char charstring[17];
|
||||||
|
|
||||||
(void)strcpy(charstring," "); /* 16 spaces */
|
(void)strcpy(charstring," "); /* 16 spaces */
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
/* output the bytes one at a time,
|
/* output the bytes one at a time,
|
||||||
* not going pas "len" bytes
|
* not going pas "len" bytes
|
||||||
*/
|
*/
|
||||||
if (len) {
|
if (len) {
|
||||||
char ch = *data & 0x7f; /* strip parity */
|
char ch = *data & 0x7f; /* strip parity */
|
||||||
if (!isprint((u_char)ch))
|
if (!isprint((u_char)ch))
|
||||||
ch = ' '; /* ensure printable */
|
ch = ' '; /* ensure printable */
|
||||||
charstring[i] = ch;
|
charstring[i] = ch;
|
||||||
(void) fprintf(out,"%02x ",*data++);
|
(void) fprintf(out,"%02x ",*data++);
|
||||||
len--;
|
len--;
|
||||||
} else
|
} else
|
||||||
(void) fprintf(out," ");
|
(void) fprintf(out," ");
|
||||||
if (i==7)
|
if (i==7)
|
||||||
(void) fprintf(out," ");
|
(void) fprintf(out," ");
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) fprintf(out," *%s*\n",charstring);
|
(void) fprintf(out," *%s*\n",charstring);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1000,7 +1000,7 @@ sendbcast(s, packet, packetlen)
|
|||||||
int packetlen;
|
int packetlen;
|
||||||
{
|
{
|
||||||
int i, cc;
|
int i, cc;
|
||||||
|
|
||||||
for (i = 0; i < num_interfaces; i++) {
|
for (i = 0; i < num_interfaces; i++) {
|
||||||
if ((interfaces[i].flags & IFF_BROADCAST) == 0)
|
if ((interfaces[i].flags & IFF_BROADCAST) == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -1023,7 +1023,7 @@ sendbcastif(s, packet, packetlen, ifp)
|
|||||||
struct sockaddr_in baddr;
|
struct sockaddr_in baddr;
|
||||||
|
|
||||||
baddr.sin_family = AF_INET;
|
baddr.sin_family = AF_INET;
|
||||||
|
|
||||||
if ((ifp->flags & IFF_BROADCAST) == 0)
|
if ((ifp->flags & IFF_BROADCAST) == 0)
|
||||||
return (packetlen);
|
return (packetlen);
|
||||||
|
|
||||||
@ -1049,7 +1049,7 @@ sendmcast(s, packet, packetlen, sin)
|
|||||||
struct sockaddr_in *sin;
|
struct sockaddr_in *sin;
|
||||||
{
|
{
|
||||||
int i, cc;
|
int i, cc;
|
||||||
|
|
||||||
for (i = 0; i < num_interfaces; i++) {
|
for (i = 0; i < num_interfaces; i++) {
|
||||||
if ((interfaces[i].flags & IFF_MULTICAST) == 0)
|
if ((interfaces[i].flags & IFF_MULTICAST) == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -1059,7 +1059,7 @@ sendmcast(s, packet, packetlen, sin)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (packetlen);
|
return (packetlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
sendmcastif(s, packet, packetlen, sin, ifp)
|
sendmcastif(s, packet, packetlen, sin, ifp)
|
||||||
@ -1073,7 +1073,7 @@ sendmcastif(s, packet, packetlen, sin, ifp)
|
|||||||
struct sockaddr_in ifaddr;
|
struct sockaddr_in ifaddr;
|
||||||
|
|
||||||
ifaddr.sin_family = AF_INET;
|
ifaddr.sin_family = AF_INET;
|
||||||
|
|
||||||
if ((ifp->flags & IFF_MULTICAST) == 0)
|
if ((ifp->flags & IFF_MULTICAST) == 0)
|
||||||
return (packetlen);
|
return (packetlen);
|
||||||
|
|
||||||
@ -1081,7 +1081,7 @@ sendmcastif(s, packet, packetlen, sin, ifp)
|
|||||||
if (debug)
|
if (debug)
|
||||||
logdebug("Multicast to interface %s\n",
|
logdebug("Multicast to interface %s\n",
|
||||||
pr_name(ifaddr.sin_addr));
|
pr_name(ifaddr.sin_addr));
|
||||||
if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF,
|
if (setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF,
|
||||||
(char *)&ifaddr.sin_addr,
|
(char *)&ifaddr.sin_addr,
|
||||||
sizeof(ifaddr.sin_addr)) < 0) {
|
sizeof(ifaddr.sin_addr)) < 0) {
|
||||||
logperror("setsockopt (IP_MULTICAST_IF)");
|
logperror("setsockopt (IP_MULTICAST_IF)");
|
||||||
@ -1140,7 +1140,7 @@ initifs()
|
|||||||
(void) close(sock);
|
(void) close(sock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (interfaces)
|
if (interfaces)
|
||||||
interfaces = (struct interface *)ALLIGN(realloc((char *)interfaces,
|
interfaces = (struct interface *)ALLIGN(realloc((char *)interfaces,
|
||||||
numifs * sizeof(struct interface)));
|
numifs * sizeof(struct interface)));
|
||||||
else
|
else
|
||||||
@ -1153,7 +1153,7 @@ initifs()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
interfaces_size = numifs;
|
interfaces_size = numifs;
|
||||||
|
|
||||||
ifc.ifc_len = bufsize;
|
ifc.ifc_len = bufsize;
|
||||||
ifc.ifc_buf = buf;
|
ifc.ifc_buf = buf;
|
||||||
if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
|
if (ioctl(sock, SIOCGIFCONF, (char *)&ifc) < 0) {
|
||||||
@ -1169,7 +1169,7 @@ initifs()
|
|||||||
logperror("initifs: ioctl (get interface flags)");
|
logperror("initifs: ioctl (get interface flags)");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ifr->ifr_addr.sa_family != AF_INET)
|
if (ifr->ifr_addr.sa_family != AF_INET)
|
||||||
continue;
|
continue;
|
||||||
if ((ifreq.ifr_flags & IFF_UP) == 0)
|
if ((ifreq.ifr_flags & IFF_UP) == 0)
|
||||||
continue;
|
continue;
|
||||||
@ -1229,7 +1229,7 @@ initifs()
|
|||||||
(void) free(buf);
|
(void) free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
join(sock, sin)
|
join(sock, sin)
|
||||||
int sock;
|
int sock;
|
||||||
struct sockaddr_in *sin;
|
struct sockaddr_in *sin;
|
||||||
@ -1264,7 +1264,7 @@ int support_multicast()
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL,
|
if (setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL,
|
||||||
(char *)&ttl, sizeof(ttl)) < 0) {
|
(char *)&ttl, sizeof(ttl)) < 0) {
|
||||||
(void) close(sock);
|
(void) close(sock);
|
||||||
return (0);
|
return (0);
|
||||||
@ -1282,7 +1282,7 @@ is_directly_connected(in)
|
|||||||
for (i = 0; i < num_interfaces; i++) {
|
for (i = 0; i < num_interfaces; i++) {
|
||||||
/* Check that the subnetwork numbers match */
|
/* Check that the subnetwork numbers match */
|
||||||
|
|
||||||
if ((in.s_addr & interfaces[i].netmask.s_addr ) ==
|
if ((in.s_addr & interfaces[i].netmask.s_addr ) ==
|
||||||
(interfaces[i].remoteaddr.s_addr & interfaces[i].netmask.s_addr))
|
(interfaces[i].remoteaddr.s_addr & interfaces[i].netmask.s_addr))
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@ -1342,15 +1342,15 @@ age_table(time)
|
|||||||
int recalculate_max = 0;
|
int recalculate_max = 0;
|
||||||
int max = max_preference();
|
int max = max_preference();
|
||||||
|
|
||||||
tpp = &table;
|
tpp = &table;
|
||||||
while (*tpp != NULL) {
|
while (*tpp != NULL) {
|
||||||
tp = *tpp;
|
tp = *tpp;
|
||||||
tp->remaining_time -= time;
|
tp->remaining_time -= time;
|
||||||
if (tp->remaining_time <= 0) {
|
if (tp->remaining_time <= 0) {
|
||||||
*tpp = tp->next;
|
*tpp = tp->next;
|
||||||
if (tp->in_kernel)
|
if (tp->in_kernel)
|
||||||
del_route(tp->router);
|
del_route(tp->router);
|
||||||
if (best_preference &&
|
if (best_preference &&
|
||||||
tp->preference == max)
|
tp->preference == max)
|
||||||
recalculate_max++;
|
recalculate_max++;
|
||||||
free((char *)tp);
|
free((char *)tp);
|
||||||
@ -1384,9 +1384,9 @@ record_router(router, preference, ttl)
|
|||||||
int old_max = max_preference();
|
int old_max = max_preference();
|
||||||
int changed_up = 0; /* max preference could have increased */
|
int changed_up = 0; /* max preference could have increased */
|
||||||
int changed_down = 0; /* max preference could have decreased */
|
int changed_down = 0; /* max preference could have decreased */
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
logdebug("Recording %s, preference 0x%x\n",
|
logdebug("Recording %s, preference 0x%x\n",
|
||||||
pr_name(router),
|
pr_name(router),
|
||||||
preference);
|
preference);
|
||||||
tp = find_router(router);
|
tp = find_router(router);
|
||||||
@ -1413,7 +1413,7 @@ record_router(router, preference, ttl)
|
|||||||
tp->next = table;
|
tp->next = table;
|
||||||
table = tp;
|
table = tp;
|
||||||
}
|
}
|
||||||
if (!tp->in_kernel &&
|
if (!tp->in_kernel &&
|
||||||
(!best_preference || tp->preference == max_preference()) &&
|
(!best_preference || tp->preference == max_preference()) &&
|
||||||
tp->preference != IGNORE_PREFERENCE) {
|
tp->preference != IGNORE_PREFERENCE) {
|
||||||
add_route(tp->router);
|
add_route(tp->router);
|
||||||
@ -1429,7 +1429,7 @@ record_router(router, preference, ttl)
|
|||||||
if (new_max != IGNORE_PREFERENCE) {
|
if (new_max != IGNORE_PREFERENCE) {
|
||||||
tp = table;
|
tp = table;
|
||||||
while (tp) {
|
while (tp) {
|
||||||
if (tp->preference == new_max &&
|
if (tp->preference == new_max &&
|
||||||
!tp->in_kernel) {
|
!tp->in_kernel) {
|
||||||
add_route(tp->router);
|
add_route(tp->router);
|
||||||
tp->in_kernel++;
|
tp->in_kernel++;
|
||||||
@ -1452,7 +1452,7 @@ record_router(router, preference, ttl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -1487,7 +1487,7 @@ rtioctl(addr, op)
|
|||||||
sin = (struct sockaddr_in *)ALLIGN(&rt.rt_gateway);
|
sin = (struct sockaddr_in *)ALLIGN(&rt.rt_gateway);
|
||||||
sin->sin_addr = addr;
|
sin->sin_addr = addr;
|
||||||
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
rt.rt_flags = RTF_UP | RTF_GATEWAY;
|
||||||
|
|
||||||
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||||
if (sock < 0) {
|
if (sock < 0) {
|
||||||
logperror("rtioctl: socket");
|
logperror("rtioctl: socket");
|
||||||
@ -1501,7 +1501,7 @@ rtioctl(addr, op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LOGGER
|
* LOGGER
|
||||||
*/
|
*/
|
||||||
|
@ -16,4 +16,4 @@ struct ip_mreq {
|
|||||||
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
struct in_addr imr_multiaddr; /* IP multicast address of group */
|
||||||
struct in_addr imr_interface; /* local IP address of interface */
|
struct in_addr imr_interface; /* local IP address of interface */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ skipdirs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Recursively find names and inumbers of all files in subtree
|
* Recursively find names and inumbers of all files in subtree
|
||||||
* pname and pass them off to be processed.
|
* pname and pass them off to be processed.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -477,7 +477,7 @@ rst_readdir(dirp)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (dirp->dd_loc == 0) {
|
if (dirp->dd_loc == 0) {
|
||||||
dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
|
dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf,
|
||||||
DIRBLKSIZ);
|
DIRBLKSIZ);
|
||||||
if (dirp->dd_size <= 0) {
|
if (dirp->dd_size <= 0) {
|
||||||
dprintf(stderr, "error reading directory\n");
|
dprintf(stderr, "error reading directory\n");
|
||||||
@ -583,7 +583,7 @@ setdirmodes(flags)
|
|||||||
struct modeinfo node;
|
struct modeinfo node;
|
||||||
struct entry *ep;
|
struct entry *ep;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
vprintf(stdout, "Set directory mode, owner, and times.\n");
|
vprintf(stdout, "Set directory mode, owner, and times.\n");
|
||||||
(void) sprintf(modefile, "%s/rstmode%d", _PATH_TMP, dumpdate);
|
(void) sprintf(modefile, "%s/rstmode%d", _PATH_TMP, dumpdate);
|
||||||
mf = fopen(modefile, "r");
|
mf = fopen(modefile, "r");
|
||||||
|
@ -130,7 +130,7 @@ deletefile(name, ino, type)
|
|||||||
return (descend);
|
return (descend);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following four routines implement the incremental
|
* The following four routines implement the incremental
|
||||||
* restore algorithm. The first removes old entries, the second
|
* restore algorithm. The first removes old entries, the second
|
||||||
* does renames and calculates the extraction list, the third
|
* does renames and calculates the extraction list, the third
|
||||||
@ -139,7 +139,7 @@ deletefile(name, ino, type)
|
|||||||
*
|
*
|
||||||
* Directories cannot be immediately deleted, as they may have
|
* Directories cannot be immediately deleted, as they may have
|
||||||
* other files in them which need to be moved out first. As
|
* other files in them which need to be moved out first. As
|
||||||
* directories to be deleted are found, they are put on the
|
* directories to be deleted are found, they are put on the
|
||||||
* following deletion list. After all deletions and renames
|
* following deletion list. After all deletions and renames
|
||||||
* are done, this list is actually deleted.
|
* are done, this list is actually deleted.
|
||||||
*/
|
*/
|
||||||
@ -203,7 +203,7 @@ nodeupdates(name, ino, type)
|
|||||||
# define MODECHG 0x8 /* mode of inode changed */
|
# define MODECHG 0x8 /* mode of inode changed */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This routine is called once for each element in the
|
* This routine is called once for each element in the
|
||||||
* directory hierarchy, with a full path name.
|
* directory hierarchy, with a full path name.
|
||||||
* The "type" value is incorrectly specified as LEAF for
|
* The "type" value is incorrectly specified as LEAF for
|
||||||
* directories that are not on the dump tape.
|
* directories that are not on the dump tape.
|
||||||
@ -394,7 +394,7 @@ nodeupdates(name, ino, type)
|
|||||||
* that we need to rename, so we delete it from the symbol
|
* that we need to rename, so we delete it from the symbol
|
||||||
* table, and put it on the list to be deleted eventually.
|
* table, and put it on the list to be deleted eventually.
|
||||||
* Conversely if a directory is to be created, it must be
|
* Conversely if a directory is to be created, it must be
|
||||||
* done immediately, rather than waiting until the
|
* done immediately, rather than waiting until the
|
||||||
* extraction phase.
|
* extraction phase.
|
||||||
*/
|
*/
|
||||||
case ONTAPE|INOFND|MODECHG:
|
case ONTAPE|INOFND|MODECHG:
|
||||||
@ -464,7 +464,7 @@ nodeupdates(name, ino, type)
|
|||||||
default:
|
default:
|
||||||
panic("[%s] %s: impossible state\n", keyval(key), name);
|
panic("[%s] %s: impossible state\n", keyval(key), name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return (descend);
|
return (descend);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,7 +606,7 @@ createleaves(symtabfile)
|
|||||||
/*
|
/*
|
||||||
* If we find files on the tape that have no corresponding
|
* If we find files on the tape that have no corresponding
|
||||||
* directory entries, then we must have found a file that
|
* directory entries, then we must have found a file that
|
||||||
* was created while the dump was in progress. Since we have
|
* was created while the dump was in progress. Since we have
|
||||||
* no name for it, we discard it knowing that it will be
|
* no name for it, we discard it knowing that it will be
|
||||||
* on the next incremental tape.
|
* on the next incremental tape.
|
||||||
*/
|
*/
|
||||||
|
@ -366,7 +366,7 @@ removeentry(ep)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Table of unused string entries, sorted by length.
|
* Table of unused string entries, sorted by length.
|
||||||
*
|
*
|
||||||
* Entries are allocated in STRTBLINCR sized pieces so that names
|
* Entries are allocated in STRTBLINCR sized pieces so that names
|
||||||
* of similar lengths can use the same entry. The value of STRTBLINCR
|
* of similar lengths can use the same entry. The value of STRTBLINCR
|
||||||
* is chosen so that every entry has at least enough space to hold
|
* is chosen so that every entry has at least enough space to hold
|
||||||
@ -422,7 +422,7 @@ freename(name)
|
|||||||
char *name;
|
char *name;
|
||||||
{
|
{
|
||||||
struct strhdr *tp, *np;
|
struct strhdr *tp, *np;
|
||||||
|
|
||||||
tp = &strtblhdr[strlen(name) / STRTBLINCR];
|
tp = &strtblhdr[strlen(name) / STRTBLINCR];
|
||||||
np = (struct strhdr *)name;
|
np = (struct strhdr *)name;
|
||||||
np->next = tp->next;
|
np->next = tp->next;
|
||||||
|
@ -300,7 +300,7 @@ getvol(nextvol)
|
|||||||
if (command == 'R' || command == 'r' || curfile.action != SKIP) {
|
if (command == 'R' || command == 'r' || curfile.action != SKIP) {
|
||||||
newvol = nextvol;
|
newvol = nextvol;
|
||||||
wantnext = 1;
|
wantnext = 1;
|
||||||
} else {
|
} else {
|
||||||
newvol = 0;
|
newvol = 0;
|
||||||
wantnext = 0;
|
wantnext = 0;
|
||||||
}
|
}
|
||||||
@ -398,7 +398,7 @@ getvol(nextvol)
|
|||||||
* If coming to this volume at random, skip to the beginning
|
* If coming to this volume at random, skip to the beginning
|
||||||
* of the next record.
|
* of the next record.
|
||||||
*/
|
*/
|
||||||
dprintf(stdout, "read %ld recs, tape starts with %ld\n",
|
dprintf(stdout, "read %ld recs, tape starts with %ld\n",
|
||||||
tpblksread, tmpbuf.c_firstrec);
|
tpblksread, tmpbuf.c_firstrec);
|
||||||
if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) {
|
if (tmpbuf.c_type == TS_TAPE && (tmpbuf.c_flags & DR_NEWHEADER)) {
|
||||||
if (!wantnext) {
|
if (!wantnext) {
|
||||||
@ -477,7 +477,7 @@ setdumpnum()
|
|||||||
#ifdef RRESTORE
|
#ifdef RRESTORE
|
||||||
if (host)
|
if (host)
|
||||||
rmtioctl(MTFSF, dumpnum - 1);
|
rmtioctl(MTFSF, dumpnum - 1);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (ioctl(mt, (int)MTIOCTOP, (char *)&tcom) < 0)
|
if (ioctl(mt, (int)MTIOCTOP, (char *)&tcom) < 0)
|
||||||
fprintf(stderr, "ioctl MTFSF: %s\n", strerror(errno));
|
fprintf(stderr, "ioctl MTFSF: %s\n", strerror(errno));
|
||||||
@ -1094,7 +1094,7 @@ gethead(buf)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* If we are restoring a filesystem with old format inodes,
|
* If we are restoring a filesystem with old format inodes,
|
||||||
* copy the uid/gid to the new location.
|
* copy the uid/gid to the new location.
|
||||||
*/
|
*/
|
||||||
if (oldinofmt) {
|
if (oldinofmt) {
|
||||||
@ -1247,11 +1247,11 @@ checksum(buf)
|
|||||||
} else {
|
} else {
|
||||||
/* What happens if we want to read restore tapes
|
/* What happens if we want to read restore tapes
|
||||||
for a 16bit int machine??? */
|
for a 16bit int machine??? */
|
||||||
do
|
do
|
||||||
i += swabl(*buf++);
|
i += swabl(*buf++);
|
||||||
while (--j);
|
while (--j);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i != CHECKSUM) {
|
if (i != CHECKSUM) {
|
||||||
fprintf(stderr, "Checksum error %o, inode %d file %s\n", i,
|
fprintf(stderr, "Checksum error %o, inode %d file %s\n", i,
|
||||||
curfile.ino, curfile.name);
|
curfile.ino, curfile.name);
|
||||||
@ -1328,7 +1328,7 @@ swabst(cp, sp)
|
|||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
n = (n * 10) + (*cp++ - '0');
|
n = (n * 10) + (*cp++ - '0');
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 's': case 'w': case 'h':
|
case 's': case 'w': case 'h':
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
n = 1;
|
n = 1;
|
||||||
|
@ -329,7 +329,7 @@ dirlookup(name)
|
|||||||
{
|
{
|
||||||
struct direct *dp;
|
struct direct *dp;
|
||||||
ino_t ino;
|
ino_t ino;
|
||||||
|
|
||||||
ino = ((dp = pathsearch(name)) == NULL) ? 0 : dp->d_ino;
|
ino = ((dp = pathsearch(name)) == NULL) ? 0 : dp->d_ino;
|
||||||
|
|
||||||
if (ino == 0 || TSTINO(ino, dumpmap) == 0)
|
if (ino == 0 || TSTINO(ino, dumpmap) == 0)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user