MFC @199204

This commit is contained in:
Oleksandr Tymoshenko 2009-11-12 00:36:22 +00:00
commit 874108aed9
924 changed files with 45849 additions and 19763 deletions

View file

@ -272,7 +272,7 @@ LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
.endif
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -mfancy-math-387 -DCOMPAT_32BIT \
-iprefix ${LIB32TMP}/usr/ \
-isystem ${LIB32TMP}/usr/include/ \
-L${LIB32TMP}/usr/lib32 \
-B${LIB32TMP}/usr/lib32
@ -599,11 +599,14 @@ installcheck_UGID:
.if ${MK_INFO} != "no"
_install-info= install-info
.endif
.if ${MK_ZONEINFO} != "no"
_zoneinfo= zic tzsetup
.endif
ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
date echo egrep find grep ${_install-info} \
ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \
test true uname wc zic
test true uname wc ${_zoneinfo}
#
# distributeworld
@ -929,6 +932,10 @@ _ar= usr.bin/ar
_mklocale= usr.bin/mklocale
.endif
.if ${BOOTSTRAPPING} < 900002
_sed= usr.bin/sed
.endif
.if ${BOOTSTRAPPING} < 700018
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
.endif
@ -954,6 +961,7 @@ bootstrap-tools:
usr.bin/makewhatis \
${_mklocale} \
usr.bin/rpcgen \
${_sed} \
usr.bin/xinstall \
${_gensnmptree} \
usr.sbin/config \
@ -1033,7 +1041,6 @@ cross-tools:
.for _tool in \
gnu/usr.bin/binutils \
gnu/usr.bin/cc \
usr.bin/sed \
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
${_btxld} \
${_crunchide} \
@ -1122,7 +1129,7 @@ lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
_secure_lib_libssh= secure/lib/libssh
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
.if ${MK_KERBEROS} != "no"
kerberos5/lib/libgssapi_krb5__L: kerberos5/lib/libkrb5__L \
kerberos5/lib/libgssapi_krb5__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
lib/libmd__L kerberos5/lib/libroken__L secure/lib/libcrypto__L \
lib/libcrypt__L

View file

@ -14,6 +14,11 @@
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
#
# 20091027: pselect.3 implemented as syscall
OLD_FILES+=usr/share/man/man3/pselect.3.gz
# 20091005: fusword.9 and susword.9 removed
OLD_FILES+=usr/share/man/man9/fusword.9.gz
OLD_FILES+=usr/share/man/man9/susword.9.gz
# 20090909: vesa and dpms promoted to be i386/amd64 common
OLD_FILES+=usr/include/machine/pc/vesa.h
OLD_FILES+=usr/share/man/man4/i386/dpms.4.gz
@ -26,6 +31,49 @@ OLD_FILES+=usr/share/man/man8/lukemftpd.8.gz
OLD_FILES+=etc/mtree/BSD.local.dist
OLD_FILES+=etc/mtree/BSD.x11.dist
OLD_FILES+=etc/mtree/BSD.x11-4.dist
# 20090812: net80211 documentation overhaul
OLD_FILES+=usr/share/man/man9/ieee80211_add_rates.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_add_xrates.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_alloc_node.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_attach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_begin_scan.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_cfgget.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_cfgset.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_chan2ieee.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_chan2mode.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_create_ibss.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_crypto_attach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_crypto_detach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_decap.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_dump_pkt.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_dup_bss.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_encap.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_end_scan.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_find_node.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_fix_rate.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_free_allnodes.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_ieee2mhz.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_ioctl.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_lookup_node.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_media2rate.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_media_change.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_media_init.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_media_status.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_mhz2ieee.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_next_scan.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_node_attach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_node_detach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_node_lateattach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_print_essid.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_proto_attach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_proto_detach.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_rate2media.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_recv_mgmt.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_send_mgmt.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_setmode.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_timeout_nodes.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_watchdog.9.gz
OLD_FILES+=usr/share/man/man9/ieee80211_wep_crypt.9.gz
# 20090801: vimage.h removed in favour of vnet.h
OLD_FILES+=usr/include/sys/vimage.h
# 20090719: library version bump for 8.0
@ -503,6 +551,8 @@ OLD_FILES+=usr/include/dev/usb/usb_quirks.h
OLD_FILES+=usr/include/dev/usb/usbcdc.h
OLD_FILES+=usr/include/dev/usb/usbdivar.h
OLD_FILES+=usr/include/dev/usb/uxb360gp_rdesc.h
OLD_FILES+=usr/sbin/usbdevs
OLD_FILES+=usr/share/man/man8/usbdevs.8.gz
# 20090203: removal of pccard header files
OLD_FILES+=usr/include/pccard/cardinfo.h
OLD_FILES+=usr/include/pccard/cis.h

View file

@ -22,6 +22,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
machines to maximize performance. (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
20091109:
The layout of the structure ieee80211req_scan_result has changed.
Applications that require wireless scan results (e.g. ifconfig(8))
from net80211 need to be recompiled.
20091025:
The iwn(4) driver has been updated to support the 5000 and 5150 series.
There's one kernel module for each firmware. Adding "device iwnfw"
to the kernel configuration file means including all three firmware
images inside the kernel. If you want to include just the one for
your wireless card, use the the devices iwn4965fw, iwn5000fw or
iwn5150fw.
20090926:
The rc.d/network_ipv6, IPv6 configuration script has been integrated
into rc.d/netif. The changes are the following:
@ -529,6 +542,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
# Map old usb library to new one for usb2 stack
libusb-0.1.so.8 libusb20.so.1
20090209:
All USB ethernet devices now attach as interfaces under the name ueN
(eg. ue0). This is to provide a predictable name as vendors often
change usb chipsets in a product without notice.
20090203:
The ichsmb(4) driver has been changed to require SMBus slave
addresses be left-justified (xxxxxxx0b) rather than right-justified.
@ -624,6 +642,15 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW:
userland (libpmc(3)) and the kernel module (hwpmc(4)) in
sync.
20081009:
atapci kernel module now includes only generic PCI ATA
driver. AHCI driver moved to ataahci kernel module.
All vendor-specific code moved into separate kernel modules:
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek,
atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron,
atamarvell, atamicron, atanational, atanetcell, atanvidia,
atapromise, ataserverworks, atasiliconimage, atasis, atavia
20080820:
The TTY subsystem of the kernel has been replaced by a new
implementation, which provides better scalability and an

View file

@ -2,6 +2,5 @@
# $FreeBSD$
PROG= cat
WARNS?= 6
.include <bsd.prog.mk>

View file

@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const char *fromcode)
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
if (iconv_open == NULL)
goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
if (dl_iconv == NULL)
goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
if (dl_iconv_close == NULL)
goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
dlfunc_err:
dlclose(iconvlib);
iconvlib = NULL;
return (iconv_t)-1;
}

View file

@ -30,7 +30,7 @@
.\" Developed by the TrustedBSD Project.
.\" Support for POSIX.1e access control lists.
.\"
.Dd September 04, 2009
.Dd September 4, 2009
.Dt GETFACL 1
.Os
.Sh NAME

View file

@ -399,7 +399,7 @@ main(int argc, char *argv[])
* If not -F, -d or -l options, follow any symbolic links listed on
* the command line.
*/
if (!f_longform && !f_listdir && !f_type)
if (!f_longform && !f_listdir && (!f_type || f_slash))
fts_options |= FTS_COMFOLLOW;
/*

View file

@ -70,7 +70,7 @@ static int vcmp(const void *, const void *);
/* PLEASE KEEP THE TABLE BELOW SORTED ALPHABETICALLY!!! */
static VAR var[] = {
{"%cpu", "%CPU", NULL, 0, pcpu, NULL, 4, 0, CHAR, NULL, 0},
{"%cpu", "%CPU", NULL, 0, pcpu, NULL, 5, 0, CHAR, NULL, 0},
{"%mem", "%MEM", NULL, 0, pmem, NULL, 4, 0, CHAR, NULL, 0},
{"acflag", "ACFLG", NULL, 0, kvar, NULL, 3, KOFF(ki_acflag), USHORT,
"x", 0},
@ -159,7 +159,7 @@ static VAR var[] = {
UINT, UIDFMT, 0},
{"rgroup", "RGROUP", NULL, LJUST|DSIZ, rgroupname, s_rgroupname,
USERLEN, 0, CHAR, NULL, 0},
{"rss", "RSS", NULL, 0, kvar, NULL, 5, KOFF(ki_rssize), PGTOK, "ld", 0},
{"rss", "RSS", NULL, 0, kvar, NULL, 6, KOFF(ki_rssize), PGTOK, "ld", 0},
{"rtprio", "RTPRIO", NULL, 0, priorityr, NULL, 7, KOFF(ki_pri), CHAR,
NULL, 0},
{"ruid", "RUID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_ruid),
@ -207,7 +207,7 @@ static VAR var[] = {
NULL, 0},
{"usrpri", "", "upr", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{"vsize", "", "vsz", 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{"vsz", "VSZ", NULL, 0, vsize, NULL, 5, 0, CHAR, NULL, 0},
{"vsz", "VSZ", NULL, 0, vsize, NULL, 6, 0, CHAR, NULL, 0},
{"wchan", "WCHAN", NULL, LJUST, wchan, NULL, 6, 0, CHAR, NULL, 0},
{"xstat", "XSTAT", NULL, 0, kvar, NULL, 4, KOFF(ki_xstat), USHORT,
"x", 0},

View file

@ -51,6 +51,13 @@ __FBSDID("$FreeBSD$");
int yylex(void);
struct varname
{
struct varname *next;
char name[1];
};
static struct varname *varnames;
#undef YY_INPUT
#define YY_INPUT(buf,result,max) \
result = (*buf = *arith_buf++) ? 1 : YY_NULL;
@ -80,11 +87,14 @@ int yylex(void);
* If variable doesn't exist, we should initialize
* it to zero.
*/
char *temp;
struct varname *temp;
if (lookupvar(yytext) == NULL)
setvarsafe(yytext, "0", 0);
temp = (char *)ckmalloc(strlen(yytext) + 1);
yylval.s_value = strcpy(temp, yytext);
temp = ckmalloc(sizeof(struct varname) +
strlen(yytext));
temp->next = varnames;
varnames = temp;
yylval.s_value = strcpy(temp->name, yytext);
return ARITH_VAR;
}
@ -130,5 +140,15 @@ int yylex(void);
void
arith_lex_reset(void)
{
struct varname *name, *next;
YY_NEW_FILE;
name = varnames;
while (name != NULL) {
next = name->next;
ckfree(name);
name = next;
}
varnames = NULL;
}

View file

@ -713,12 +713,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
do_clearcmdentry = 1;
}
find_command(argv[0], &cmdentry, 1, path);
if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */
exitstatus = 127;
flushout(&errout);
return;
}
find_command(argv[0], &cmdentry, 0, path);
/* implement the bltin builtin here */
if (cmdentry.cmdtype == CMDBUILTIN && cmdentry.u.index == BLTINCMD) {
for (;;) {
@ -740,7 +735,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
/* Fork off a child process if necessary. */
if (cmd->ncmd.backgnd
|| (cmdentry.cmdtype == CMDNORMAL
|| ((cmdentry.cmdtype == CMDNORMAL || cmdentry.cmdtype == CMDUNKNOWN)
&& ((flags & EV_EXIT) == 0 || have_traps()))
|| ((flags & EV_BACKCMD) != 0
&& (cmdentry.cmdtype != CMDBUILTIN

View file

@ -429,6 +429,7 @@ loop:
outfmt(out2, "%s: %s\n", name, strerror(e));
}
entry->cmdtype = CMDUNKNOWN;
entry->u.index = 0;
return;
success:

View file

@ -657,7 +657,7 @@ again: /* jump here after setting a variable with ${var=text} */
}
varlen = 0;
startloc = expdest - stackblock();
if (!set && uflag) {
if (!set && uflag && *var != '@' && *var != '*') {
switch (subtype) {
case VSNORMAL:
case VSTRIMLEFT:

View file

@ -82,7 +82,6 @@ struct heredoc {
STATIC struct heredoc *heredoclist; /* list of here documents to read */
STATIC int parsebackquote; /* nonzero if we are inside backquotes */
STATIC int doprompt; /* if set, prompt the user */
STATIC int needprompt; /* true if interactive and at start of line */
STATIC int lasttoken; /* last token read */
@ -1043,7 +1042,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
endword:
if (syntax == ARISYNTAX)
synerror("Missing '))'");
if (syntax != BASESYNTAX && ! parsebackquote && eofmark == NULL)
if (syntax != BASESYNTAX && eofmark == NULL)
synerror("Unterminated quoted string");
if (varnest != 0) {
startlinno = plinno;
@ -1303,20 +1302,22 @@ parsesub: {
parsebackq: {
struct nodelist **nlpp;
int savepbq;
union node *n;
char *volatile str;
struct jmploc jmploc;
struct jmploc *const savehandler = handler;
int savelen;
int saveprompt;
const int bq_startlinno = plinno;
savepbq = parsebackquote;
if (setjmp(jmploc.loc)) {
if (str)
ckfree(str);
parsebackquote = 0;
handler = savehandler;
if (exception == EXERROR) {
startlinno = bq_startlinno;
synerror("Error in command substitution");
}
longjmp(handler->loc, 1);
}
INTOFF;
@ -1397,7 +1398,6 @@ done:
nlpp = &(*nlpp)->next;
*nlpp = (struct nodelist *)stalloc(sizeof (struct nodelist));
(*nlpp)->next = NULL;
parsebackquote = oldstyle;
if (oldstyle) {
saveprompt = doprompt;
@ -1433,7 +1433,6 @@ done:
str = NULL;
INTON;
}
parsebackquote = savepbq;
handler = savehandler;
if (arinest || dblquote)
USTPUTC(CTLBACKQ | CTLQUOTE, out);

View file

@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
.Dd May 31, 2009
.Dd October 24, 2009
.Dt SH 1
.Os
.Sh NAME
@ -296,7 +296,10 @@ sh -T -c "trap 'exit 1' 2 ; some-blocking-program"
.Ed
.It Fl u Li nounset
Write a message to standard error when attempting
to expand a variable that is not set, and if the
to expand a variable, a positional parameter or
the special parameter
.Va \&!
that is not set, and if the
shell is not interactive, exit immediately.
.It Fl V Li vi
Enable the built-in
@ -1227,6 +1230,9 @@ In all cases, the
final value of
.Ar parameter
is substituted.
Quoting inside
.Ar word
does not prevent field splitting or pathname expansion.
Only variables, not positional
parameters or special parameters, can be
assigned in this way.

View file

@ -1,6 +1,5 @@
# $FreeBSD$
PROG= uuidgen
WARNS?= 6
.include <bsd.prog.mk>

View file

@ -1790,11 +1790,14 @@ zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
/* We don't support those properties on FreeBSD. */
switch (prop) {
case ZFS_PROP_SHAREISCSI:
case ZFS_PROP_DEVICES:
case ZFS_PROP_ACLMODE:
case ZFS_PROP_ACLINHERIT:
case ZFS_PROP_ZONED:
case ZFS_PROP_SHAREISCSI:
case ZFS_PROP_ISCSIOPTIONS:
case ZFS_PROP_XATTR:
case ZFS_PROP_VSCAN:
case ZFS_PROP_NBMAND:
case ZFS_PROP_SHARESMB:
(void) snprintf(errbuf, sizeof (errbuf),
"property '%s' not supported on FreeBSD", propname);
ret = zfs_error(hdl, EZFS_PERM, errbuf);

View file

@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_event_t *event) {
if (sevent->result == ISC_R_CANCELED) {
debug("in cancel handler");
isc_socket_detach(&query->sock);
sockcount--;
INSIST(sockcount >= 0);
debug("sockcount=%d", sockcount);
if (query->sock != NULL) {
isc_socket_detach(&query->sock);
sockcount--;
INSIST(sockcount >= 0);
debug("sockcount=%d", sockcount);
}
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
l = query->lookup;

View file

@ -1989,7 +1989,7 @@ char *cmd_str;
int number;
int i;
char *ptr;
char *direction = NULL;
char *direction = "d";
struct text *t_line;
ptr = cmd_str;

View file

@ -1614,7 +1614,7 @@ override_options (void)
"-mtune=generic instead as appropriate.");
if (!ix86_arch_string)
ix86_arch_string = TARGET_64BIT ? "x86-64" : "i386";
ix86_arch_string = TARGET_64BIT ? "x86-64" : "i486";
if (!strcmp (ix86_arch_string, "generic"))
error ("generic CPU can be used only for -mtune= switch");
if (!strncmp (ix86_arch_string, "generic", 7))

View file

@ -403,22 +403,30 @@ add_addr_to_iflist(pcap_if_t **alldevs, const char *name, u_int flags,
pcap_addr_t *curaddr, *prevaddr, *nextaddr;
#ifdef SIOCGIFDESCR
struct ifreq ifrdesc;
#ifdef __FreeBSD__
#define _IFDESCRSIZE 64
char ifdescr[_IFDESCRSIZE];
#else
char ifdescr[IFDESCRSIZE];
int s;
#endif
int s;
#ifdef SIOCGIFDESCR
/*
* Get the description for the interface.
*/
memset(&ifrdesc, 0, sizeof ifrdesc);
strlcpy(ifrdesc.ifr_name, name, sizeof ifrdesc.ifr_name);
#ifdef __FreeBSD__
ifrdesc.ifr_buffer.buffer = ifdescr;
ifrdesc.ifr_buffer.length = _IFDESCRSIZE;
#else
ifrdesc.ifr_data = (caddr_t)&ifdescr;
#endif
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s >= 0) {
if (ioctl(s, SIOCGIFDESCR, &ifrdesc) == 0 &&
strlen(ifrdesc.ifr_data) != 0)
description = ifrdesc.ifr_data;
strlen(ifdescr) != 0)
description = ifdescr;
close(s);
}
#endif

View file

@ -476,6 +476,12 @@ _nc_wgetch(WINDOW *win,
/* resizeterm can push KEY_RESIZE */
if (cooked_key_in_fifo()) {
*result = fifo_pull(sp);
/*
* Get the ERR from queue -- it is from WINCH,
* so we should take it out, the "error" is handled.
*/
if (fifo_peek(sp) == -1)
fifo_pull(sp);
returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
}
}

View file

@ -109,7 +109,7 @@ will be failure regardless of the success of later modules.
.It Cm requisite
If this module succeeds, the result of the chain will be success
unless a later module fails.
If it module fails, the chain is broken and the result is failure.
If the module fails, the chain is broken and the result is failure.
.It Cm sufficient
If this module succeeds, the chain is broken and the result is
success.

View file

@ -124,6 +124,7 @@ struct tok tcp_option_values[] = {
{ TCPOPT_CCECHO, "" },
{ TCPOPT_SIGNATURE, "md5" },
{ TCPOPT_AUTH, "enhanced auth" },
{ TCPOPT_UTO, "uto" },
{ 0, NULL }
};
@ -613,6 +614,17 @@ tcp_print(register const u_char *bp, register u_int length,
*/
break;
case TCPOPT_UTO:
datalen = 2;
LENCHECK(datalen);
uint utoval = EXTRACT_16BITS(cp);
if (utoval & 0x0001)
utoval = (utoval >> 1) * 60;
else
utoval >>= 1;
(void)printf(" %u", utoval);
break;
default:
datalen = len - 2;
for (i = 0; i < datalen; ++i) {

View file

@ -83,6 +83,8 @@ struct tcphdr {
#define TCPOLEN_SIGNATURE 18
#define TCP_SIGLEN 16 /* length of an option 19 digest */
#define TCPOPT_AUTH 20 /* Enhanced AUTH option */
#define TCPOPT_UTO 28 /* tcp user timeout (rfc5482) */
#define TCPOLEN_UTO 4
#define TCPOPT_TSTAMP_HDR \
(TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)

View file

@ -1291,6 +1291,8 @@ main(int argc, char **argv)
/*
* Mop-up.
*/
/* Take care of these (especially HUP) here instead of inside flush. */
handle_pending_signals();
if (intty) {
if (loginsh) {
xprintf("logout\n");

View file

@ -7,7 +7,7 @@
*
* A list of symbols which need munging is obtained as follows:
*
* nm libssh.a | awk '$2 == "T" && $3 !~ /^ssh_/ { print "#define", $3, "ssh_" $3 }'
* nm libssh.a | awk '/[0-9a-z] [A-Z] / && $3 !~ /^ssh_/ { print "#define", $3, "ssh_" $3 }'
*
* $FreeBSD$
*/
@ -18,6 +18,7 @@
#define acss_setkey ssh_acss_setkey
#define acss_setsubkey ssh_acss_setsubkey
#define add_host_to_hostfile ssh_add_host_to_hostfile
#define add_recv_bytes ssh_add_recv_bytes
#define addargs ssh_addargs
#define addr_match_list ssh_addr_match_list
#define ask_permission ssh_ask_permission
@ -111,6 +112,8 @@
#define channel_open_message ssh_channel_open_message
#define channel_output_poll ssh_channel_output_poll
#define channel_permit_all_opens ssh_channel_permit_all_opens
#define channel_post ssh_channel_post
#define channel_pre ssh_channel_pre
#define channel_prepare_select ssh_channel_prepare_select
#define channel_print_adm_permitted_opens ssh_channel_print_adm_permitted_opens
#define channel_register_cleanup ssh_channel_register_cleanup
@ -150,14 +153,19 @@
#define cipher_set_key_string ssh_cipher_set_key_string
#define cipher_set_keycontext ssh_cipher_set_keycontext
#define cipher_set_keyiv ssh_cipher_set_keyiv
#define ciphers ssh_ciphers
#define ciphers_valid ssh_ciphers_valid
#define cleanhostname ssh_cleanhostname
#define cleanup_exit ssh_cleanup_exit
#define clear_cached_addr ssh_clear_cached_addr
#define colon ssh_colon
#define compat13 ssh_compat13
#define compat20 ssh_compat20
#define compat_cipher_proposal ssh_compat_cipher_proposal
#define compat_datafellows ssh_compat_datafellows
#define convtime ssh_convtime
#define current_keys ssh_current_keys
#define datafellows ssh_datafellows
#define debug ssh_debug
#define debug ssh_debug
#define debug2 ssh_debug2
@ -175,6 +183,7 @@
#define dh_new_group14 ssh_dh_new_group14
#define dh_new_group_asc ssh_dh_new_group_asc
#define dh_pub_is_valid ssh_dh_pub_is_valid
#define dispatch ssh_dispatch
#define dispatch_init ssh_dispatch_init
#define dispatch_protocol_error ssh_dispatch_protocol_error
#define dispatch_protocol_ignore ssh_dispatch_protocol_ignore
@ -205,6 +214,7 @@
#define get_local_port ssh_get_local_port
#define get_peer_ipaddr ssh_get_peer_ipaddr
#define get_peer_port ssh_get_peer_port
#define get_recv_bytes ssh_get_recv_bytes
#define get_remote_ipaddr ssh_get_remote_ipaddr
#define get_remote_name_or_ip ssh_get_remote_name_or_ip
#define get_remote_port ssh_get_remote_port
@ -213,9 +223,12 @@
#define get_u32 ssh_get_u32
#define get_u64 ssh_get_u64
#define getrrsetbyname ssh_getrrsetbyname
#define glob ssh_glob
#define globfree ssh_globfree
#define host_hash ssh_host_hash
#define hostfile_read_key ssh_hostfile_read_key
#define hpdelim ssh_hpdelim
#define incoming_stream ssh_incoming_stream
#define init_rng ssh_init_rng
#define ipv64_normalise_mapped ssh_ipv64_normalise_mapped
#define kex_derive_keys ssh_kex_derive_keys
@ -268,6 +281,7 @@
#define mac_init ssh_mac_init
#define mac_setup ssh_mac_setup
#define mac_valid ssh_mac_valid
#define macs ssh_macs
#define match_host_and_ip ssh_match_host_and_ip
#define match_hostname ssh_match_hostname
#define match_list ssh_match_list
@ -279,6 +293,7 @@
#define ms_subtract_diff ssh_ms_subtract_diff
#define ms_to_timeval ssh_ms_to_timeval
#define mysignal ssh_mysignal
#define outgoing_stream ssh_outgoing_stream
#define packet_add_padding ssh_packet_add_padding
#define packet_backup_state ssh_packet_backup_state
#define packet_close ssh_packet_close
@ -363,9 +378,13 @@
#define refresh_progress_meter ssh_refresh_progress_meter
#define replacearg ssh_replacearg
#define restore_uid ssh_restore_uid
#define resume_in_progress ssh_resume_in_progress
#define resume_kex ssh_resume_kex
#define rijndael_decrypt ssh_rijndael_decrypt
#define rijndael_encrypt ssh_rijndael_encrypt
#define rijndael_set_key ssh_rijndael_set_key
#define roaming_read ssh_roaming_read
#define roaming_write ssh_roaming_write
#define rsa_generate_additional_parameters ssh_rsa_generate_additional_parameters
#define rsa_private_decrypt ssh_rsa_private_decrypt
#define rsa_public_encrypt ssh_rsa_public_encrypt
@ -393,6 +412,7 @@
#define tty_make_modes ssh_tty_make_modes
#define tty_parse_modes ssh_tty_parse_modes
#define tun_open ssh_tun_open
#define umac_ctx ssh_umac_ctx
#define umac_delete ssh_umac_delete
#define umac_final ssh_umac_final
#define umac_new ssh_umac_new

View file

@ -17,7 +17,6 @@
#VersionAddendum FreeBSD-20091001
#Port 22
#Protocol 2
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

View file

@ -600,6 +600,7 @@ harvest_ethernet="YES" # Entropy device harvests ethernet randomness
harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness
dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
watchdogd_enable="NO" # Start the software watchdog daemon
watchdogd_flags="" # Flags to watchdogd (if enabled)
devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" # Files containing
# devfs(8) rules.
devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev

View file

@ -162,7 +162,7 @@ X|Xwindow|X window system:\
:fd@:nd@:cd@:rw:sp#9600:
P|Pc|Pc console:\
:ht:np:sp#115200:
:ht:np:sp#9600:
#
# Wierdo special case for fast crt's with hardcopy devices

View file

@ -356,6 +356,16 @@ afexists()
inet6)
${SYSCTL_N} net.inet6 > /dev/null 2>&1
;;
ipx)
${SYSCTL_N} net.ipx > /dev/null 2>&1
;;
atm)
if [ -x /sbin/atmconfig ]; then
/sbin/atmconfig diag list > /dev/null 2>&1
else
return 1
fi
;;
*)
err 1 "afexists(): Unsupported address family: $_af"
;;

View file

@ -8,12 +8,12 @@
auth sufficient pam_opie.so no_warn no_fake_prompts
auth requisite pam_opieaccess.so no_warn allow_local
#auth sufficient pam_krb5.so no_warn
#auth sufficient pam_ssh.so no_warn try_first_pass
#auth sufficient pam_ssh.so no_warn try_first_pass
auth required pam_unix.so no_warn try_first_pass
# account
account required pam_nologin.so
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_unix.so
# session

View file

@ -11,9 +11,9 @@ auth required pam_unix.so no_warn try_first_pass
# account
account required pam_nologin.so
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_unix.so
# session
#session optional pam_ssh.so
#session optional pam_ssh.so want_agent
session required pam_permit.so

View file

@ -13,12 +13,12 @@ auth required pam_unix.so no_warn try_first_pass
# account
account required pam_nologin.so
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_login_access.so
account required pam_unix.so
# session
#session optional pam_ssh.so
#session optional pam_ssh.so want_agent
session required pam_permit.so
# password

View file

@ -13,12 +13,12 @@ auth required pam_unix.so no_warn try_first_pass
# account
account required pam_nologin.so
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_login_access.so
account required pam_unix.so
# session
#session optional pam_ssh.so
#session optional pam_ssh.so want_agent
session required pam_permit.so
# password

View file

@ -12,12 +12,12 @@ auth requisite pam_opieaccess.so no_warn allow_local
auth required pam_unix.so no_warn try_first_pass nullok
# account
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_login_access.so
account required pam_unix.so
# session
#session optional pam_ssh.so
#session optional pam_ssh.so want_agent
session required pam_lastlog.so no_fail
# password

View file

@ -13,12 +13,12 @@ auth required pam_unix.so no_warn try_first_pass
# account
account required pam_nologin.so
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_login_access.so
account required pam_unix.so
# session
#session optional pam_ssh.so
#session optional pam_ssh.so want_agent
session required pam_lastlog.so no_fail
# password

View file

@ -11,11 +11,11 @@ auth required pam_unix.so no_warn try_first_pass
# account
account required pam_nologin.so
#account required pam_krb5.so
#account required pam_krb5.so
account required pam_unix.so
# session
#session required pam_ssh.so want_agent
#session required pam_ssh.so want_agent
session required pam_lastlog.so no_fail
# password

View file

@ -31,7 +31,7 @@ bgfsck_start ()
bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds"
fi
if [ -z "${rc_force}" ]; then
[ -z "${rc_quiet}" ] && echo "${bgfsck_msg}."
check_startmsgs && echo "${bgfsck_msg}."
fi
(sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \

View file

@ -25,7 +25,7 @@ cleartmp_start()
${tmp}/.ICE-unix ${tmp}/.font-unix"
if checkyesno ${rcvar1}; then
[ -z "${rc_quiet}" ] && echo "Clearing ${tmp}."
check_startmsgs && echo "Clearing ${tmp}."
# This is not needed for mfs, but doesn't hurt anything.
# Things to note:
@ -44,7 +44,7 @@ cleartmp_start()
elif checkyesno clear_tmp_X; then
# Remove X lock files, since they will prevent you from
# restarting X. Remove other X related directories.
[ -z "${rc_quiet}" ] && echo "Clearing ${tmp} (X related)."
check_startmsgs && echo "Clearing ${tmp} (X related)."
rm -rf ${tmp}/.X[0-9]-lock ${x11_socket_dirs}
fi
if checkyesno clear_tmp_X; then

View file

@ -20,6 +20,8 @@ defaultroute_start()
{
local output carrier nocarrier nl
afexists inet || return 0
# Return without waiting if we don't have dhcp interfaces or
# if none of the dhcp interfaces is plugged in.
dhcp_interfaces=`list_net_interfaces dhcp`

View file

@ -3,7 +3,7 @@
#
# PROVIDE: faith
# REQUIRE: netif routing
# REQUIRE: netif
# KEYWORD: nojail
. /etc/rc.subr
@ -39,9 +39,7 @@ faith_up()
route change -inet6 ${prefix} -prefixlen ${prefixlen} \
-ifp faith0
done
if [ -z "${rc_quiet}" ]; then
ifconfig faith0
fi
check_startmsgs && ifconfig faith0
;;
esac
}

View file

@ -23,7 +23,7 @@ fsck_start()
# During fsck ignore SIGQUIT
trap : 3
[ -z "${rc_quiet}" ] && echo "Starting file system checks:"
check_startmsgs && echo "Starting file system checks:"
if checkyesno background_fsck; then
fsck -F -p
else

View file

@ -49,9 +49,9 @@ hostid_set()
# Set both kern.hostuuid and kern.hostid.
#
[ -z "${rc_quiet}" ] && echo "Setting hostuuid: ${uuid}."
check_startmsgs && echo "Setting hostuuid: ${uuid}."
${SYSCTL_W} kern.hostuuid="${uuid}" >/dev/null
[ -z "${rc_quiet}" ] && echo "Setting hostid: ${id}."
check_startmsgs && echo "Setting hostid: ${id}."
${SYSCTL_W} kern.hostid=${id} >/dev/null
}

View file

@ -72,8 +72,9 @@ hostname_start()
# All right, it is safe to invoke hostname(1) now.
#
[ -z "${rc_quiet}" ] && echo "Setting hostname: ${hostname}."
check_startmsgs && echo -n "Setting hostname: ${hostname}"
/bin/hostname "${hostname}"
check_startmsgs && echo '.'
}
load_rc_config $name

View file

@ -9,6 +9,7 @@
# KEYWORD: nojail
. /etc/rc.subr
. /etc/network.subr
name="ip6addrctl"
rcvar=`set_rcvar`
@ -23,6 +24,8 @@ set_rcvar_obsolete ipv6_enable ipv6_prefer
ip6addrctl_prefer_ipv6()
{
afexists inet6 || return 0
ip6addrctl flush >/dev/null 2>&1
ip6addrctl add ::1/128 50 0
ip6addrctl add ::/0 40 1
@ -34,6 +37,8 @@ ip6addrctl_prefer_ipv6()
ip6addrctl_prefer_ipv4()
{
afexists inet6 || return 0
ip6addrctl flush >/dev/null 2>&1
ip6addrctl add ::ffff:0:0/96 50 0
ip6addrctl add ::1/128 40 1
@ -45,30 +50,27 @@ ip6addrctl_prefer_ipv4()
ip6addrctl_start()
{
if ifconfig lo0 inet6 >/dev/null 2>&1; then
# We have IPv6 support in kernel.
afexists inet6 || return 0
# install the policy of the address selection algorithm.
if [ -f /etc/ip6addrctl.conf ]; then
ip6addrctl flush >/dev/null 2>&1
ip6addrctl install /etc/ip6addrctl.conf
checkyesno ip6addrctl_verbose && ip6addrctl
# install the policy of the address selection algorithm.
if [ -f /etc/ip6addrctl.conf ]; then
ip6addrctl flush >/dev/null 2>&1
ip6addrctl install /etc/ip6addrctl.conf
checkyesno ip6addrctl_verbose && ip6addrctl
else
if checkyesno ipv6_prefer; then
ip6addrctl_prefer_ipv6
else
if checkyesno ipv6_prefer; then
ip6addrctl_prefer_ipv6
else
ip6addrctl_prefer_ipv4
fi
ip6addrctl_prefer_ipv4
fi
fi
}
ip6addrctl_stop()
{
if ifconfig lo0 inet6 >/dev/null 2>&1; then
# We have IPv6 support in kernel.
ip6addrctl flush >/dev/null 2>&1
fi
afexists inet6 || return 0
ip6addrctl flush >/dev/null 2>&1
}
load_rc_config $name

View file

@ -728,4 +728,4 @@ fi
if [ -n "$*" ]; then
jail_list="$*"
fi
run_rc_command "${cmd}"
run_rc_command "${cmd}" &

View file

@ -36,7 +36,7 @@ ldconfig_start()
_LDC="${_LDC} ${i}"
fi
done
[ -z "${rc_quiet}" ] && echo 'ELF ldconfig path:' ${_LDC}
check_startmsgs && echo 'ELF ldconfig path:' ${_LDC}
${ldconfig} -elf ${_ins} ${_LDC}
case `sysctl -n hw.machine_arch` in
@ -55,7 +55,7 @@ ldconfig_start()
_LDC="${_LDC} ${i}"
fi
done
[ -z "${rc_quiet}" ] &&
check_startmsgs &&
echo '32-bit compatibility ldconfig path:' ${_LDC}
${ldconfig} -32 -m ${_ins} ${_LDC}
;;
@ -72,8 +72,7 @@ ldconfig_start()
_LDC="${_LDC} ${i}"
fi
done
[ -z "${rc_quiet}" ] &&
echo 'a.out ldconfig path:' ${_LDC}
check_startmsgs && echo 'a.out ldconfig path:' ${_LDC}
${ldconfig} -aout ${_ins} ${_LDC}
;;
esac

View file

@ -22,7 +22,7 @@ motd_start()
# Must be done *before* interactive logins are possible
# to prevent possible race conditions.
#
[ -z "${rc_quiet}" ] && echo -n 'Updating motd:'
check_startmsgs && echo -n 'Updating motd:'
if [ ! -f /etc/motd ]; then
install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
fi
@ -42,7 +42,7 @@ motd_start()
}
rm -f $T
[ -z "${rc_quiet}" ] && echo .
check_startmsgs && echo '.'
}
load_rc_config $name

View file

@ -28,7 +28,7 @@ mountcritlocal_start()
esac
# Mount everything except nfs filesystems.
[ -z "${rc_quiet}" ] && echo -n 'Mounting local file systems:'
check_startmsgs && echo -n 'Mounting local file systems:'
mount_excludes='no'
for i in ${netfs_types}; do
fstype=${i%:*}
@ -37,7 +37,7 @@ mountcritlocal_start()
mount_excludes=${mount_excludes%,}
mount -a -t ${mount_excludes}
err=$?
[ -z "${rc_quiet}" ] && echo '.'
check_startmsgs && echo '.'
case ${err} in
0)

View file

@ -51,8 +51,9 @@ moused_start()
mytype="$moused_type"
fi
[ -z "${rc_quiet}" ] && echo -n "Starting ${ms} moused."
check_startmsgs && echo -n "Starting ${ms} moused"
/usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${pidarg}
check_startmsgs && echo '.'
mousechar_arg=
case ${mousechar_start} in

View file

@ -143,7 +143,7 @@ network_common()
;;
esac
echo "${_str} Network:${_ok}."
if [ -z "${rc_quiet}" ]; then
if check_startmsgs; then
for ifn in ${_ok}; do
/sbin/ifconfig ${ifn}
done

View file

@ -26,29 +26,51 @@ netoptions_init()
netoptions_start()
{
if checkyesno log_in_vain; then
local _af
for _af in inet inet6; do
afexists ${_af} && eval netoptions_${_af}
done
[ -n "${_netoptions_initdone}" ] && echo '.'
}
netoptions_inet()
{
case ${log_in_vain} in
[12])
netoptions_init
echo -n " log_in_vain=${log_in_vain}"
${SYSCTL_W} net.inet.tcp.log_in_vain="${log_in_vain}" >/dev/null
${SYSCTL_W} net.inet.udp.log_in_vain="${log_in_vain}" >/dev/null
fi
${SYSCTL_W} net.inet.tcp.log_in_vain=${log_in_vain} >/dev/null
${SYSCTL_W} net.inet.udp.log_in_vain=${log_in_vain} >/dev/null
;;
*)
${SYSCTL_W} net.inet.tcp.log_in_vain=0 >/dev/null
${SYSCTL_W} net.inet.udp.log_in_vain=0 >/dev/null
;;
esac
if checkyesno tcp_extensions; then
${SYSCTL_W} net.inet.tcp.rfc1323=1 >/dev/null
else
netoptions_init
echo -n ' rfc1323 extensions=NO'
echo -n " rfc1323 extensions=${tcp_extensions}"
${SYSCTL_W} net.inet.tcp.rfc1323=0 >/dev/null
fi
if ! checkyesno tcp_keepalive; then
if checkyesno tcp_keepalive; then
${SYSCTL_W} net.inet.tcp.always_keepalive=1 >/dev/null
else
netoptions_init
echo -n ' TCP keepalive=NO'
echo -n " TCP keepalive=${tcp_keepalive}"
${SYSCTL_W} net.inet.tcp.always_keepalive=0 >/dev/null
fi
if checkyesno tcp_drop_synfin; then
netoptions_init
echo -n ' drop SYN+FIN packets=YES'
echo -n " drop SYN+FIN packets=${tcp_drop_synfin}"
${SYSCTL_W} net.inet.tcp.drop_synfin=1 >/dev/null
else
${SYSCTL_W} net.inet.tcp.drop_synfin=0 >/dev/null
fi
case ${ip_portrange_first} in
@ -66,17 +88,17 @@ netoptions_start()
${SYSCTL_W} net.inet.ip.portrange.last=$ip_portrange_last >/dev/null
;;
esac
}
if afexists inet6; then
if checkyesno ipv6_ipv4mapping; then
${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
else
echo -n " no-ipv4-mapped-ipv6"
${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
fi
netoptions_inet6()
{
if checkyesno ipv6_ipv4mapping; then
netoptions_init
echo -n " ipv4-mapped-ipv6=${ipv6_ipv4mapping}"
${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
else
${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
fi
[ -n "${_netoptions_initdone}" ] && echo '.'
}
load_rc_config $name

View file

@ -17,9 +17,9 @@ stop_cmd=":"
newsyslog_start()
{
[ -z "${rc_quiet}" ] && echo -n "Creating and/or trimming log files:"
check_startmsgs && echo -n 'Creating and/or trimming log files'
${command} ${rc_flags}
[ -z "${rc_quiet}" ] && echo "."
check_startmsgs && echo '.'
}
load_rc_config $name

View file

@ -22,7 +22,8 @@ nfsclient_start()
#
if [ -n "${nfs_access_cache}" ]; then
[ -z "${rc_quiet}" ] && echo "NFS access cache time=${nfs_access_cache}"
check_startmsgs &&
echo "NFS access cache time=${nfs_access_cache}"
if ! sysctl vfs.nfs.access_cache_timeout=${nfs_access_cache} >/dev/null; then
warn "failed to set access cache timeout"
fi

View file

@ -25,19 +25,21 @@ required_modules="pf"
pf_start()
{
[ -z "${rc_quiet}" ] && echo "Enabling pf."
check_startmsgs && echo -n 'Enabling pf'
$pf_program -F all > /dev/null 2>&1
$pf_program -f "$pf_rules" $pf_flags
if ! $pf_program -s info | grep -q "Enabled" ; then
$pf_program -e
fi
check_startmsgs && echo '.'
}
pf_stop()
{
if $pf_program -s info | grep -q "Enabled" ; then
[ -z "${rc_quiet}" ] && echo "Disabling pf."
echo -n 'Disabling pf'
$pf_program -d
echo '.'
fi
}

View file

@ -13,87 +13,108 @@
. /etc/network.subr
name="routing"
start_cmd="routing_start"
start_cmd="routing_start doall"
stop_cmd="routing_stop"
extra_commands="options static"
static_cmd="static_start"
options_cmd="options_start"
static_cmd="routing_start static"
options_cmd="routing_start options"
afcheck()
{
case $_af in
""|inet|inet6|ipx|atm)
;;
*)
err 1 "Unsupported address family: $_af."
;;
esac
}
routing_start()
{
static_start "$@"
options_start "$@"
local _cmd _af _a
_cmd=$1
_af=$2
afcheck
case $_af in
inet|inet6|ipx|atm)
setroutes $_cmd $_af
;;
"")
for _a in inet inet6 ipx atm; do
afexists $_a && setroutes $_cmd $_a
done
;;
esac
[ -n "${_ropts_initdone}" ] && echo '.'
}
routing_stop()
{
static_stop "$@"
route -n flush
local _af _a
_af=$1
afcheck
case $_af in
inet|inet6|ipx|atm)
eval static_${_af} delete
eval routing_stop_${_af}
;;
"")
for _a in inet inet6 ipx atm; do
afexists $_a || continue
eval static_${_a} delete
eval routing_stop_${_a}
done
;;
esac
}
setroutes()
{
case $1 in
static)
static_$2 add
;;
options)
options_$2
;;
doall)
static_$2 add
options_$2
;;
esac
}
routing_stop_inet()
{
route -n flush -inet
}
routing_stop_inet6()
{
local i
route -n flush -inet6
for i in ${ipv6_network_interfaces}; do
ifconfig $i inet6 -defaultif
done
}
static_start()
routing_stop_atm()
{
local _af
_af=$1
case ${_af} in
inet)
do_static inet add
;;
inet6)
do_static inet6 add
;;
atm)
do_static atm add
;;
*)
do_static inet add
if afexists inet6; then
do_static inet6 add
fi
do_static atm add
;;
esac
return 0
}
static_stop()
routing_stop_ipx()
{
local _af
_af=$1
case ${_af} in
inet)
do_static inet delete
;;
inet6)
do_static inet6 delete
;;
atm)
do_static atm delete
;;
*)
do_static inet delete
if afexists inet6; then
do_static inet6 delete
fi
do_static atm delete
;;
esac
return 0
}
do_static()
{
local _af _action
_af=$1
_action=$2
eval $1_static $2
}
inet_static()
static_inet()
{
local _action
_action=$1
@ -115,7 +136,7 @@ inet_static()
fi
}
inet6_static()
static_inet6()
{
local _action i
_action=$1
@ -222,9 +243,9 @@ inet6_static()
esac
}
atm_static()
static_atm()
{
local _action i
local _action i route_args
_action=$1
if [ -n "${natm_static_routes}" ]; then
@ -235,6 +256,10 @@ atm_static()
fi
}
static_ipx()
{
}
_ropts_initdone=
ropts_init()
{
@ -244,63 +269,89 @@ ropts_init()
fi
}
options_start()
options_inet()
{
if checkyesno icmp_bmcastecho; then
ropts_init
echo -n ' broadcast ping responses=YES'
sysctl net.inet.icmp.bmcastecho=1 >/dev/null
${SYSCTL_W} net.inet.icmp.bmcastecho=1 > /dev/null
else
${SYSCTL_W} net.inet.icmp.bmcastecho=0 > /dev/null
fi
if checkyesno icmp_drop_redirect; then
ropts_init
echo -n ' ignore ICMP redirect=YES'
sysctl net.inet.icmp.drop_redirect=1 >/dev/null
${SYSCTL_W} net.inet.icmp.drop_redirect=1 > /dev/null
else
${SYSCTL_W} net.inet.icmp.drop_redirect=0 > /dev/null
fi
if checkyesno icmp_log_redirect; then
ropts_init
echo -n ' log ICMP redirect=YES'
sysctl net.inet.icmp.log_redirect=1 >/dev/null
${SYSCTL_W} net.inet.icmp.log_redirect=1 > /dev/null
else
${SYSCTL_W} net.inet.icmp.log_redirect=0 > /dev/null
fi
if checkyesno gateway_enable; then
ropts_init
echo -n ' IPv4 gateway=YES'
sysctl net.inet.ip.forwarding=1 >/dev/null
fi
if checkyesno ipv6_gateway_enable; then
ropts_init
echo -n ' IPv6 gateway=YES'
sysctl net.inet6.ip6.forwarding=1 >/dev/null
${SYSCTL_W} net.inet.ip.forwarding=1 > /dev/null
else
${SYSCTL_W} net.inet.ip.forwarding=0 > /dev/null
fi
if checkyesno forward_sourceroute; then
ropts_init
echo -n ' do source routing=YES'
sysctl net.inet.ip.sourceroute=1 >/dev/null
${SYSCTL_W} net.inet.ip.sourceroute=1 > /dev/null
else
${SYSCTL_W} net.inet.ip.sourceroute=0 > /dev/null
fi
if checkyesno accept_sourceroute; then
ropts_init
echo -n ' accept source routing=YES'
sysctl net.inet.ip.accept_sourceroute=1 >/dev/null
fi
if checkyesno ipxgateway_enable; then
ropts_init
echo -n ' IPX gateway=YES'
sysctl net.ipx.ipx.ipxforwarding=1 >/dev/null
${SYSCTL_W} net.inet.ip.accept_sourceroute=1 > /dev/null
else
${SYSCTL_W} net.inet.ip.accept_sourceroute=0 > /dev/null
fi
if checkyesno arpproxy_all; then
ropts_init
echo -n ' ARP proxyall=YES'
sysctl net.link.ether.inet.proxyall=1 >/dev/null
${SYSCTL_W} net.link.ether.inet.proxyall=1 > /dev/null
else
${SYSCTL_W} net.link.ether.inet.proxyall=0 > /dev/null
fi
}
[ -n "${_ropts_initdone}" ] && echo '.'
options_inet6()
{
if checkyesno ipv6_gateway_enable; then
ropts_init
echo -n ' IPv6 gateway=YES'
${SYSCTL_W} net.inet6.ip6.forwarding=1 > /dev/null
else
${SYSCTL_W} net.inet6.ip6.forwarding=0 > /dev/null
fi
}
options_atm()
{
}
options_ipx()
{
if checkyesno ipxgateway_enable; then
ropts_init
echo -n ' IPX gateway=YES'
${SYSCTL_W} net.ipx.ipx.ipxforwarding=1 > /dev/null
else
${SYSCTL_W} net.ipx.ipx.ipxforwarding=0 > /dev/null
fi
}
load_rc_config $name

View file

@ -69,7 +69,7 @@ savecore_start()
${crashinfo_program} -d ${dumpdir}
fi
else
[ -z "${rc_quiet}" ] && echo "No core dumps found"
check_startmsgs && echo 'No core dumps found.'
fi
}

View file

@ -3,7 +3,7 @@
#
# PROVIDE: stf
# REQUIRE: netif routing
# REQUIRE: netif
# KEYWORD: nojail
. /etc/rc.subr
@ -53,9 +53,8 @@ stf_up()
ifconfig stf0 create >/dev/null 2>&1
ifconfig stf0 inet6 2002:${ipv4_in_hexformat}:${stf_interface_ipv6_slaid:-0}:${stf_interface_ipv6_ifid} \
prefixlen ${stf_prefixlen}
if [ -z "${rc_quiet}" ]; then
/sbin/ifconfig stf0
fi
check_startmsgs && /sbin/ifconfig stf0
# disallow packets to malicious 6to4 prefix
route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject

View file

@ -397,6 +397,20 @@ wait_for_pids()
fi
}
#
# check_startmsgs
# If rc_quiet is set (usually as a result of using faststart at
# boot time) check if rc_startmsgs is enabled.
#
check_startmsgs()
{
if [ -n "$rc_quiet" ]; then
checkyesno rc_startmsgs
else
return 0
fi
}
#
# run_rc_command argument
# Search for argument in the list of supported commands, which is:
@ -579,7 +593,7 @@ run_rc_command()
rc_fast=yes
rc_quiet=yes
;;
force*) # "force prefix; always run
force*) # "force" prefix; always run
rc_force=yes
_rc_prefix=force
rc_arg=${rc_arg#${_rc_prefix}}
@ -602,7 +616,7 @@ run_rc_command()
esac
eval _override_command=\$${name}_program
command=${command:-${_override_command}}
command=${_override_command:-$command}
_keywords="start stop restart rcvar $extra_commands"
rc_pid=
@ -708,13 +722,7 @@ run_rc_command()
# setup the full command to run
#
_show_startmsgs=1
if [ -n "${rc_quiet}" ]; then
if ! checkyesno rc_startmsgs; then
unset _show_startmsgs
fi
fi
[ -n "$_show_startmsgs" ] && echo "Starting ${name}."
check_startmsgs && echo "Starting ${name}."
if [ -n "$_chroot" ]; then
_doit="\
${_nice:+nice -n $_nice }\

View file

@ -1521,6 +1521,8 @@ nfa 1155/tcp #Network File Access
nfa 1155/udp #Network File Access
phone 1167/udp #conference calling
skkserv 1178/tcp #SKK (kanji input)
openvpn 1194/tcp #OpenVPN
openvpn 1194/udp #OpenVPN
lupa 1212/tcp
lupa 1212/udp
nerv 1222/tcp #SNI R&D network

View file

@ -68,6 +68,17 @@ the damage. Having a bootable tape (for larger machines) is not a bad idea
either. If you need some help, give us a call.
-- CommUNIXque 1:1, ASCAR Business Systems
%
1/2
12 + 144 + 20 + 3*4 2
---------------------- + 5 * 11 = 9 + 0
7
A dozen, a gross and a score,
Plus three times the square root of four,
Divided by seven,
Plus five times eleven,
Equals nine squared plus zero, no more!
%
-- Gifts for Children --
@ -673,17 +684,6 @@ Liza Minnelli.
-- Dave Barry, "In Search of Excellence"
%
... with liberty and justice for all who can afford it.
%
1/2
12 + 144 + 20 + 3*4 2
---------------------- + 5 * 11 = 9 + 0
7
A dozen, a gross and a score,
Plus three times the square root of four,
Divided by seven,
Plus five times eleven,
Equals nine squared plus zero, no more!
%
7,140 pounds on the Sun
97 pounds on Mercury or Mars
@ -2515,12 +2515,6 @@ which is why you should do them yourself. There is no point in paying
other people to screw things up when you can easily screw them up
yourself for far less money. This article can help you.
-- Dave Barry, "The Taming of the Screw"
%
I'd say that VCS is more like the anal sex of the software
world: Everybody talks about it, some people do it, some people enjoy
it, but typically only vague implications about the best techniques
are ever voiced in public.
-- Warner Losh, on Version Control Systems
%
"I'll tell you what I know, then," he decided. "The pin I'm wearing
means I'm a member of the IA. That's Inamorati Anonymous. An inamorato is
@ -18126,7 +18120,7 @@ tail on me, go ahead. They'd be very bored.
commenting on rumors of womanizing.
%
Food for thought is no substitute for the real thing.
-- Walt Kelly, "Putluck Pogo"
-- Walt Kelly, "Potluck Pogo"
%
Foolproof Operation:
No provision for adjustment.
@ -25228,7 +25222,8 @@ them scream.
-- Sylvestre Matuschka, "the Hungarian Train Wreck Freak",
escaped prison 1937, not heard from since
%
Iam
I
am
not
very
happy
@ -33070,6 +33065,10 @@ versions of songs from The Wizard of Oz.
%
May a Misguided Platypus lay its Eggs in your Jockey Shorts
%
May all your Emus lay soft boiled eggs, and may all your
Kangaroos be born with iPods already fitted.
-- Aussie New Years wish, found on hasselbladinfo.com
%
May all your PUSHes be POPped.
%
May Euell Gibbons eat your only copy of the manual!
@ -59769,6 +59768,17 @@ You've been telling me to relax all the way here,
and now you're telling me just to be myself?
-- The Return of the Secaucus Seven
%
You've decked the halls with a dozen miles' length of electric lights.
Your front lawn is a gleaming testament of incandescent wonder. The neighbors
wear sunglasses 24/7, and orbiting satellites have officially picked up
and pinpointed your house as the brightest spot on earth.
You've finally put together the Christmas wonderland of your dreams... now
if only you could get a good picture of it.
Photographing holiday lights is no easy task.
-- from an email sent by photojojo.com
%
You've got to have a gimmick if your band sucks.
-- Gary Giddens
%
@ -59809,18 +59819,3 @@ since I first called my brother's father dad.
Zymurgy's Law of Volunteer Labor:
People are always available for work in the past tense.
%
You've decked the halls with a dozen miles' length of electric lights.
Your front lawn is a gleaming testament of incandescent wonder. The neighbors
wear sunglasses 24/7, and orbiting satellites have officially picked up
and pinpointed your house as the brightest spot on earth.
You've finally put together the Christmas wonderland of your dreams... now
if only you could get a good picture of it.
Photographing holiday lights is no easy task.
-- from an email sent by photojojo.com
%
May all your Emus lay soft boiled eggs, and may all your
Kangaroos be born with iPods already fitted.
-- Aussie New Years wish, found on hasselbladinfo.com
%

View file

@ -1152,6 +1152,12 @@ and stuck it in my back."
"Not my remains, Al!"
"Gabriel's trumpet will produce you from the ass of a pig."
-- Al Swearingen, E. B. Farnum, _Deadwood_
%
I'd say that VCS is more like the anal sex of the software
world: Everybody talks about it, some people do it, some people enjoy
it, but typically only vague implications about the best techniques
are ever voiced in public.
-- Warner Losh, on Version Control Systems
%
"I'll tell ya, Jeb," Wilbur said to his friend, "the tractor
business ain't doin' too well. I ain't sold one all month.

View file

@ -3300,6 +3300,7 @@ postjudice
Postnews
Postpetroleum
potholes
Potluck
potty
Poul
Pournelle
@ -3376,7 +3377,6 @@ Purshottam
PUSHes
pushy
pussycats
Putluck
Putt's
PVLC
PxP

0
games/fortune/datfiles/gerrold.limerick Executable file → Normal file
View file

View file

@ -4,4 +4,6 @@
PROG= number
MAN= number.6
WARNS?= 6
.include <bsd.prog.mk>

View file

@ -88,9 +88,7 @@ void usage(void);
int lflag;
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int ch, first;
char line[256];
@ -275,7 +273,7 @@ void
pfract(len)
int len;
{
static char *pref[] = { "", "ten-", "hundred-" };
static char const * const pref[] = { "", "ten-", "hundred-" };
switch(len) {
case 1:

View file

@ -2,6 +2,7 @@
NO_PROFILE=
.include <bsd.own.mk>
MK_SSP= no
.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
GCCDIR= ${.CURDIR}/../../../contrib/gcc

View file

@ -114,6 +114,20 @@ typedef __nl_item nl_item;
#define D_MD_ORDER 57 /* month/day order (local extension) */
#endif
/* standalone months forms for %OB */
#define ALTMON_1 58
#define ALTMON_2 59
#define ALTMON_3 60
#define ALTMON_4 61
#define ALTMON_5 62
#define ALTMON_6 63
#define ALTMON_7 64
#define ALTMON_8 65
#define ALTMON_9 66
#define ALTMON_10 67
#define ALTMON_11 68
#define ALTMON_12 69
__BEGIN_DECLS
char *nl_langinfo(nl_item);
__END_DECLS

View file

@ -36,6 +36,7 @@
__BEGIN_DECLS
char *basename(const char *);
char *basename_r(const char *, char *);
char *dirname(const char *);
#if 0
char *regcmp(const char *, ...);

View file

@ -2,8 +2,8 @@
LIB= gssapi_krb5
LDFLAGS= -Wl,-Bsymbolic
LDADD= -lkrb5 -lhx509 -lcrypto -lroken -lasn1 -lcom_err -lcrypt
DPADD= ${LIBKRB5} ${LIBHX509} ${LIBCRYPTO} ${LIBROKEN} ${LIBASN1} \
LDADD= -lgssapi -lkrb5 -lhx509 -lcrypto -lroken -lasn1 -lcom_err -lcrypt
DPADD= ${LIBGSSAPI} ${LIBKRB5} ${LIBHX509} ${LIBCRYPTO} ${LIBROKEN} ${LIBASN1} \
${LIBCOM_ERR} ${LIBCRYPT}
INCS= ${KRB5DIR}/lib/gssapi/gssapi/gssapi_krb5.h

View file

@ -2,8 +2,8 @@
LIB= gssapi_spnego
LDFLAGS= -Wl,-Bsymbolic
LDADD= -lasn1
DPADD= ${LIBASN1}
LDADD= -lgssapi -lasn1
DPADD= ${LIBGSSAPI} ${LIBASN1}
SRCS= accept_sec_context.c \
compat.c \

View file

@ -272,7 +272,7 @@ otherwise 0.
.Pp
The
.Fn bt_devinfo
function populates prodivded
function populates provided
.Vt bt_devinfo
structure with the information about given Bluetooth device.
The caller is expected to pass Bluetooth device name in the

View file

@ -163,8 +163,8 @@ int bt_devclose(int s);
int bt_devsend (int s, uint16_t opcode, void *param, size_t plen);
ssize_t bt_devrecv (int s, void *buf, size_t size, time_t to);
int bt_devreq (int s, struct bt_devreq *r, time_t to);
int bt_devfilter(int s, struct bt_devfilter const *new,
struct bt_devfilter *old);
int bt_devfilter(int s, struct bt_devfilter const *newp,
struct bt_devfilter *oldp);
void bt_devfilter_pkt_set(struct bt_devfilter *filter, uint8_t type);
void bt_devfilter_pkt_clr(struct bt_devfilter *filter, uint8_t type);
int bt_devfilter_pkt_tst(struct bt_devfilter const *filter, uint8_t type);

View file

@ -21,7 +21,7 @@ SRCS+= __getosreldate.c __xuname.c \
initgroups.c isatty.c isinf.c isnan.c jrand48.c lcong48.c \
lockf.c lrand48.c mrand48.c nftw.c nice.c \
nlist.c nrand48.c opendir.c \
pause.c pmadvise.c popen.c posix_spawn.c pselect.c \
pause.c pmadvise.c popen.c posix_spawn.c \
psignal.c pw_scan.c pwcache.c \
raise.c readdir.c readpassphrase.c rewinddir.c \
scandir.c seed48.c seekdir.c sem.c semctl.c \
@ -62,7 +62,7 @@ MAN+= alarm.3 arc4random.3 \
posix_spawnattr_getpgroup.3 posix_spawnattr_getschedparam.3 \
posix_spawnattr_getschedpolicy.3 posix_spawnattr_init.3 \
posix_spawnattr_getsigdefault.3 posix_spawnattr_getsigmask.3 \
pselect.3 psignal.3 pwcache.3 \
psignal.3 pwcache.3 \
raise.3 rand48.3 readpassphrase.3 rfork_thread.3 \
scandir.3 sem_destroy.3 sem_getvalue.3 sem_init.3 \
sem_open.3 sem_post.3 sem_timedwait.3 sem_wait.3 \
@ -76,6 +76,7 @@ MAN+= alarm.3 arc4random.3 \
MLINKS+=arc4random.3 arc4random_addrandom.3 arc4random.3 arc4random_stir.3 \
arc4random.3 arc4random_buf.3 arc4random.3 arc4random_uniform.3
MLINKS+=basename.3 basename_r.3
MLINKS+=ctermid.3 ctermid_r.3
MLINKS+=devname.3 devname_r.3
MLINKS+=devname.3 fdevname.3

View file

@ -223,7 +223,6 @@ FBSD_1.0 {
posix_madvise;
popen;
pclose;
pselect;
psignal;
raise;
readdir;
@ -367,6 +366,7 @@ FBSD_1.1 {
};
FBSD_1.2 {
basename_r;
getpagesizes;
};
@ -453,7 +453,6 @@ FBSDprivate_1.0 {
__opendir2;
__pause;
_pause;
__pselect;
__pw_scan; /* Used by (at least) libutil */
__raise;
_raise;

View file

@ -27,7 +27,7 @@
.\" $OpenBSD: basename.3,v 1.12 2000/04/18 03:01:25 aaron Exp $
.\" $FreeBSD$
.\"
.Dd October 12, 2006
.Dd October 6, 2009
.Dt BASENAME 3
.Os
.Sh NAME
@ -37,6 +37,8 @@
.In libgen.h
.Ft char *
.Fn basename "const char *path"
.Ft char *
.Fn basename_r "const char *path" "char *bname"
.Sh DESCRIPTION
The
.Fn basename
@ -58,6 +60,12 @@ If
is a null pointer or the empty string, a pointer to the string
.Qq \&.
is returned.
.Pp
The
.Fn basename_r
variation accepts a buffer of at least
.Dv MAXPATHLEN
bytes in which to store the resulting component.
.Sh IMPLEMENTATION NOTES
The
.Fn basename
@ -65,15 +73,17 @@ function
returns a pointer to internal storage space allocated on the first call
that will be overwritten
by subsequent calls.
.Fn basename_r
is therefore preferred for threaded applications.
.Sh RETURN VALUES
On successful completion,
.Fn basename
returns a pointer to the last component of
and
.Fn basename_r
return pointers to the last component of
.Fa path .
.Pp
If
.Fn basename
fails, a null pointer is returned and the global variable
If they fail, a null pointer is returned and the global variable
.Va errno
is set to indicate the error.
.Sh ERRORS

View file

@ -40,18 +40,12 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
char *
basename(path)
basename_r(path, bname)
const char *path;
char *bname;
{
static char *bname = NULL;
const char *endp, *startp;
if (bname == NULL) {
bname = (char *)malloc(MAXPATHLEN);
if (bname == NULL)
return(NULL);
}
/* Empty or NULL string gets treated as "." */
if (path == NULL || *path == '\0') {
(void)strcpy(bname, ".");
@ -82,3 +76,17 @@ basename(path)
bname[endp - startp + 1] = '\0';
return(bname);
}
char *
basename(path)
const char *path;
{
static char *bname = NULL;
if (bname == NULL) {
bname = (char *)malloc(MAXPATHLEN);
if (bname == NULL)
return (NULL);
}
return (basename_r(path, bname));
}

View file

@ -150,5 +150,6 @@ const char *const sys_errlist[] = {
"Multihop attempted", /* 90 - EMULTIHOP */
"Link has been severed", /* 91 - ENOLINK */
"Protocol error", /* 92 - EPROTO */
"Capabilities insufficient", /* 93 - ENOTCAPABLE */
};
const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]);

View file

@ -128,7 +128,7 @@ printfmt(char *msgverb, long class, const char *label, int sev,
size += strlen(sevname);
if (text != MM_NULLTXT)
size += strlen(text);
if (text != MM_NULLACT)
if (act != MM_NULLACT)
size += strlen(act);
if (tag != MM_NULLTAG)
size += strlen(tag);

View file

@ -28,7 +28,7 @@
.\" @(#)fts.3 8.5 (Berkeley) 4/16/94
.\" $FreeBSD$
.\"
.Dd January 26, 2008
.Dd October 5, 2009
.Dt FTS 3
.Os
.Sh NAME
@ -776,7 +776,7 @@ may fail and set
as follows:
.Bl -tag -width Er
.It Bq Er EINVAL
The options were invalid.
The options were invalid, or the list were empty.
.El
.Sh SEE ALSO
.Xr find 1 ,

View file

@ -124,6 +124,12 @@ fts_open(argv, options, compar)
return (NULL);
}
/* fts_open() requires at least one path */
if (*argv == NULL) {
errno = EINVAL;
return (NULL);
}
/* Allocate/initialize the stream. */
if ((priv = malloc(sizeof(*priv))) == NULL)
return (NULL);

View file

@ -62,13 +62,14 @@ getcwd(pt, size)
dev_t dev;
ino_t ino;
int first;
char *bpt, *bup;
char *bpt;
struct stat s;
dev_t root_dev;
ino_t root_ino;
size_t ptsize, upsize;
size_t ptsize;
int save_errno;
char *ept, *eup, *up, c;
char *ept, c;
int fd;
/*
* If no buffer specified by the user, allocate one as necessary.
@ -106,18 +107,6 @@ getcwd(pt, size)
bpt = ept - 1;
*bpt = '\0';
/*
* Allocate 1024 bytes for the string of "../"'s.
* Should always be enough. If it's not, allocate
* as necessary. Special case the first stat, it's ".", not "..".
*/
if ((up = malloc(upsize = 1024)) == NULL)
goto err;
eup = up + upsize;
bup = up;
up[0] = '.';
up[1] = '\0';
/* Save root values, so know when to stop. */
if (stat("/", &s))
goto err;
@ -128,7 +117,7 @@ getcwd(pt, size)
for (first = 1;; first = 0) {
/* Stat the current level. */
if (lstat(up, &s))
if (dir != NULL ? _fstat(dirfd(dir), &s) : lstat(".", &s))
goto err;
/* Save current node values. */
@ -144,32 +133,22 @@ getcwd(pt, size)
* been that way and stuff would probably break.
*/
bcopy(bpt, pt, ept - bpt);
free(up);
if (dir)
(void) closedir(dir);
return (pt);
}
/*
* Build pointer to the parent directory, allocating memory
* as necessary. Max length is 3 for "../", the largest
* possible component name, plus a trailing NUL.
*/
while (bup + 3 + MAXNAMLEN + 1 >= eup) {
if ((up = reallocf(up, upsize *= 2)) == NULL)
goto err;
bup = up;
eup = up + upsize;
}
*bup++ = '.';
*bup++ = '.';
*bup = '\0';
/* Open and stat parent directory. */
if (!(dir = opendir(up)) || _fstat(dirfd(dir), &s))
fd = _openat(dir != NULL ? dirfd(dir) : AT_FDCWD,
"..", O_RDONLY);
if (fd == -1)
goto err;
/* Add trailing slash for next directory. */
*bup++ = '/';
*bup = '\0';
if (dir)
(void) closedir(dir);
if (!(dir = fdopendir(fd)) || _fstat(dirfd(dir), &s)) {
_close(fd);
goto err;
}
/*
* If it's a mount point, have to stat each element because
@ -190,10 +169,10 @@ getcwd(pt, size)
goto notfound;
if (ISDOT(dp))
continue;
bcopy(dp->d_name, bup, dp->d_namlen + 1);
/* Save the first error for later. */
if (lstat(up, &s)) {
if (fstatat(dirfd(dir), dp->d_name, &s,
AT_SYMLINK_NOFOLLOW)) {
if (!save_errno)
save_errno = errno;
errno = 0;
@ -227,11 +206,6 @@ getcwd(pt, size)
*--bpt = '/';
bpt -= dp->d_namlen;
bcopy(dp->d_name, bpt, dp->d_namlen);
(void) closedir(dir);
dir = NULL;
/* Truncate any file name. */
*bup = '\0';
}
notfound:
@ -250,7 +224,6 @@ err:
free(pt);
if (dir)
(void) closedir(dir);
free(up);
errno = save_errno;
return (NULL);

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWN 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWN_FILE_ACTIONS_INIT 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_GETFLAGS 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_GETPGROUP 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_GETSCHEDPARAM 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_GETSCHEDPOLICY 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_GETSIGDEFAULT 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_GETSIGMASK 3
.Os
.Sh NAME

View file

@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd Mar 24, 2008
.Dd March 24, 2008
.Dt POSIX_SPAWNATTR_INIT 3
.Os
.Sh NAME

View file

@ -1,78 +0,0 @@
/*
* Copyright 2000 Massachusetts Institute of Technology
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
* granted, provided that both the above copyright notice and this
* permission notice appear in all copies, that both the above
* copyright notice and this permission notice appear in all
* supporting documentation, and that the name of M.I.T. not be used
* in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. M.I.T. makes
* no representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
* ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
* SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "namespace.h"
#include <sys/select.h>
#include <sys/time.h>
#include <errno.h>
#include <signal.h>
#include "un-namespace.h"
__weak_reference(__pselect, pselect);
/*
* Emulate the POSIX 1003.1g-2000 `pselect' interface. This is the
* same as the traditional BSD `select' function, except that it uses
* a timespec rather than a timeval, doesn't modify the timeout argument,
* and allows the user to specify a signal mask to apply during the select.
*/
int
__pselect(int count, fd_set * __restrict rfds, fd_set * __restrict wfds,
fd_set * __restrict efds, const struct timespec * __restrict timo,
const sigset_t * __restrict mask)
{
sigset_t omask;
struct timeval tvtimo, *tvp;
int rv, sverrno;
if (timo) {
TIMESPEC_TO_TIMEVAL(&tvtimo, timo);
tvp = &tvtimo;
} else
tvp = 0;
if (mask != 0) {
rv = _sigprocmask(SIG_SETMASK, mask, &omask);
if (rv != 0)
return rv;
}
rv = _select(count, rfds, wfds, efds, tvp);
if (mask != 0) {
sverrno = errno;
_sigprocmask(SIG_SETMASK, &omask, (sigset_t *)0);
errno = sverrno;
}
return rv;
}

View file

@ -28,8 +28,10 @@
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <fcntl.h>
#include <paths.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -73,6 +75,24 @@ wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags)
return (0);
}
static size_t
we_read_fully(int fd, char *buffer, size_t len)
{
size_t done;
ssize_t nread;
done = 0;
do {
nread = _read(fd, buffer + done, len - done);
if (nread == -1 && errno == EINTR)
continue;
if (nread <= 0)
break;
done += nread;
} while (done != len);
return done;
}
/*
* we_askshell --
* Use the `wordexp' /bin/sh builtin function to do most of the work
@ -90,20 +110,31 @@ we_askshell(const char *words, wordexp_t *we, int flags)
size_t sofs; /* Offset into we->we_strings */
size_t vofs; /* Offset into we->we_wordv */
pid_t pid; /* Process ID of child */
pid_t wpid; /* waitpid return value */
int status; /* Child exit status */
int error; /* Our return value */
int serrno; /* errno to return */
char *ifs; /* IFS env. var. */
char *np, *p; /* Handy pointers */
char *nstrings; /* Temporary for realloc() */
char **nwv; /* Temporary for realloc() */
sigset_t newsigblock, oldsigblock;
serrno = errno;
if ((ifs = getenv("IFS")) == NULL)
ifs = " \t\n";
if (pipe(pdes) < 0)
return (WRDE_NOSPACE); /* XXX */
(void)sigemptyset(&newsigblock);
(void)sigaddset(&newsigblock, SIGCHLD);
(void)_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
if ((pid = fork()) < 0) {
serrno = errno;
_close(pdes[0]);
_close(pdes[1]);
(void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
errno = serrno;
return (WRDE_NOSPACE); /* XXX */
}
else if (pid == 0) {
@ -114,6 +145,7 @@ we_askshell(const char *words, wordexp_t *we, int flags)
int devnull;
char *cmd;
(void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
_close(pdes[0]);
if (_dup2(pdes[1], STDOUT_FILENO) < 0)
_exit(1);
@ -139,10 +171,11 @@ we_askshell(const char *words, wordexp_t *we, int flags)
* the expanded words separated by nulls.
*/
_close(pdes[1]);
if (_read(pdes[0], wbuf, 8) != 8 || _read(pdes[0], bbuf, 8) != 8) {
_close(pdes[0]);
_waitpid(pid, &status, 0);
return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
if (we_read_fully(pdes[0], wbuf, 8) != 8 ||
we_read_fully(pdes[0], bbuf, 8) != 8) {
error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX;
serrno = errno;
goto cleanup;
}
wbuf[8] = bbuf[8] = '\0';
nwords = strtol(wbuf, NULL, 16);
@ -162,33 +195,38 @@ we_askshell(const char *words, wordexp_t *we, int flags)
if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 +
(flags & WRDE_DOOFFS ? we->we_offs : 0)) *
sizeof(char *))) == NULL) {
_close(pdes[0]);
_waitpid(pid, &status, 0);
return (WRDE_NOSPACE);
error = WRDE_NOSPACE;
goto cleanup;
}
we->we_wordv = nwv;
if ((nstrings = realloc(we->we_strings, we->we_nbytes)) == NULL) {
_close(pdes[0]);
_waitpid(pid, &status, 0);
return (WRDE_NOSPACE);
error = WRDE_NOSPACE;
goto cleanup;
}
for (i = 0; i < vofs; i++)
if (we->we_wordv[i] != NULL)
we->we_wordv[i] += nstrings - we->we_strings;
we->we_strings = nstrings;
if (_read(pdes[0], we->we_strings + sofs, nbytes) != nbytes) {
_close(pdes[0]);
_waitpid(pid, &status, 0);
return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
if (we_read_fully(pdes[0], we->we_strings + sofs, nbytes) != nbytes) {
error = flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX;
serrno = errno;
goto cleanup;
}
if (_waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) ||
WEXITSTATUS(status) != 0) {
_close(pdes[0]);
return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
}
error = 0;
cleanup:
_close(pdes[0]);
do
wpid = _waitpid(pid, &status, 0);
while (wpid < 0 && errno == EINTR);
(void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
if (error != 0) {
errno = serrno;
return (error);
}
if (wpid < 0 || !WIFEXITED(status) || WEXITSTATUS(status) != 0)
return (flags & WRDE_UNDEF ? WRDE_BADVAL : WRDE_SYNTAX);
/*
* Break the null-terminated expanded word strings out into

View file

@ -80,6 +80,7 @@
#define listen _listen
#define nanosleep _nanosleep
#define open _open
#define openat _openat
#define poll _poll
#define pthread_atfork _pthread_atfork
#define pthread_attr_destroy _pthread_attr_destroy

View file

@ -61,6 +61,7 @@
#undef listen
#undef nanosleep
#undef open
#undef openat
#undef poll
#undef pthread_atfork
#undef pthread_attr_destroy

View file

@ -50,9 +50,9 @@ For any locale, this includes the following standard characters:
.It "\&``\et''\t`` ''"
.El
.Pp
In the "C" locale
In the "C" locale, a successful
.Fn isblank
successful test is limited to this characters only.
test is limited to these characters only.
The value of the argument must be representable as an
.Vt "unsigned char"
or the value of

View file

@ -93,6 +93,12 @@ nl_langinfo(nl_item item)
case ABMON_9: case ABMON_10: case ABMON_11: case ABMON_12:
ret = (char*) __get_current_time_locale()->mon[_REL(ABMON_1)];
break;
case ALTMON_1: case ALTMON_2: case ALTMON_3: case ALTMON_4:
case ALTMON_5: case ALTMON_6: case ALTMON_7: case ALTMON_8:
case ALTMON_9: case ALTMON_10: case ALTMON_11: case ALTMON_12:
ret = (char*)
__get_current_time_locale()->alt_month[_REL(ALTMON_1)];
break;
case ERA:
/* XXX: need to be implemented */
ret = "";

View file

@ -30,7 +30,17 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include "namespace.h"
#include <netdb.h>
#if defined(NLS)
#include <nl_types.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include "reentrant.h"
#endif
#include "un-namespace.h"
/* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */
/* for backward compatibility with userland code prior to 2553bis-02 */
@ -52,9 +62,57 @@ static const char *ai_errlist[] = {
"Argument buffer overflow" /* EAI_OVERFLOW */
};
#if defined(NLS)
static char gai_buf[NL_TEXTMAX];
static once_t gai_init_once = ONCE_INITIALIZER;
static thread_key_t gai_key;
static int gai_keycreated = 0;
static void
gai_keycreate(void)
{
gai_keycreated = (thr_keycreate(&gai_key, free) == 0);
}
#endif
const char *
gai_strerror(int ecode)
{
#if defined(NLS)
nl_catd catd;
char *buf;
if (thr_main() != 0)
buf = gai_buf;
else {
if (thr_once(&gai_init_once, gai_keycreate) != 0 ||
!gai_keycreated)
goto thr_err;
if ((buf = thr_getspecific(gai_key)) == NULL) {
if ((buf = malloc(sizeof(gai_buf))) == NULL)
goto thr_err;
if (thr_setspecific(gai_key, buf) != 0) {
free(buf);
goto thr_err;
}
}
}
catd = catopen("libc", NL_CAT_LOCALE);
if (ecode > 0 && ecode < EAI_MAX)
strlcpy(buf, catgets(catd, 3, ecode, ai_errlist[ecode]),
sizeof(gai_buf));
else if (ecode == 0)
strlcpy(buf, catgets(catd, 3, NL_MSGMAX - 1, "Success"),
sizeof(gai_buf));
else
strlcpy(buf, catgets(catd, 3, NL_MSGMAX, "Unknown error"),
sizeof(gai_buf));
catclose(catd);
return buf;
thr_err:
#endif
if (ecode >= 0 && ecode < EAI_MAX)
return ai_errlist[ecode];
return "Unknown error";

View file

@ -55,8 +55,7 @@ static void inet6_insert_padopt(u_char *p, int len);
* byte, the length byte, and the option data.
*/
int
inet6_option_space(nbytes)
int nbytes;
inet6_option_space(int nbytes)
{
nbytes += 2; /* we need space for nxt-hdr and length fields */
return(CMSG_SPACE((nbytes + 7) & ~7));
@ -68,10 +67,7 @@ inet6_option_space(nbytes)
* success or -1 on an error.
*/
int
inet6_option_init(bp, cmsgp, type)
void *bp;
struct cmsghdr **cmsgp;
int type;
inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type)
{
struct cmsghdr *ch = (struct cmsghdr *)bp;
@ -98,11 +94,8 @@ inet6_option_init(bp, cmsgp, type)
* earlier. It must have a value between 0 and 7, inclusive.
*/
int
inet6_option_append(cmsg, typep, multx, plusy)
struct cmsghdr *cmsg;
const u_int8_t *typep;
int multx;
int plusy;
inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx,
int plusy)
{
int padlen, optlen, off;
u_char *bp = (u_char *)cmsg + cmsg->cmsg_len;
@ -171,11 +164,7 @@ inet6_option_append(cmsg, typep, multx, plusy)
*
*/
u_int8_t *
inet6_option_alloc(cmsg, datalen, multx, plusy)
struct cmsghdr *cmsg;
int datalen;
int multx;
int plusy;
inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy)
{
int padlen, off;
u_int8_t *bp = (u_char *)cmsg + cmsg->cmsg_len;
@ -238,9 +227,7 @@ inet6_option_alloc(cmsg, datalen, multx, plusy)
* (RFC 2292, 6.3.5)
*/
int
inet6_option_next(cmsg, tptrp)
const struct cmsghdr *cmsg;
u_int8_t **tptrp;
inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp)
{
struct ip6_ext *ip6e;
int hdrlen, optlen;
@ -296,10 +283,7 @@ inet6_option_next(cmsg, tptrp)
* it's a typo. The variable should be type of u_int8_t **.
*/
int
inet6_option_find(cmsg, tptrp, type)
const struct cmsghdr *cmsg;
u_int8_t **tptrp;
int type;
inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type)
{
struct ip6_ext *ip6e;
int hdrlen, optlen;
@ -352,8 +336,7 @@ inet6_option_find(cmsg, tptrp, type)
* calculated length and the limitation of the buffer.
*/
static int
ip6optlen(opt, lim)
u_int8_t *opt, *lim;
ip6optlen(u_int8_t *opt, u_int8_t *lim)
{
int optlen;

Some files were not shown because too many files have changed in this diff Show more