svn commit: r365720 - head/sys/conf
Author: gordon Date: Mon Sep 14 14:45:30 2020 New Revision: 365720 URL: https://svnweb.freebsd.org/changeset/base/365720 Log: Partially revert r346018 and use the if/then construct instead of shell. There are a couple of places in the tree that directly parse the newvers.sh script looking for the BRANCH variable. I found two locations, one in release/Makefile and the other in bin/freebsd-version/Makefile. While there is a good argument that BRANCH_OVERRIDE should properly propagate in those circumstances and the new behavior is thus better, the reality is this change broke freebsd-update's ability to find timestamps in binaries and resulted in a large number of gratuitous changes. Reported by: freebsd-update Discussed with: cperciva MFC after:1 day Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh == --- head/sys/conf/newvers.shMon Sep 14 14:24:54 2020(r365719) +++ head/sys/conf/newvers.shMon Sep 14 14:45:30 2020(r365720) @@ -54,7 +54,10 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH="${BRANCH_OVERRIDE:-CURRENT}" +BRANCH="CURRENT" +if [ -n "${BRANCH_OVERRIDE}" ]; then + BRANCH=${BRANCH_OVERRIDE} +fi RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r362620 - head/secure/lib/libcrypto
Author: gordon Date: Thu Jun 25 19:35:37 2020 New Revision: 362620 URL: https://svnweb.freebsd.org/changeset/base/362620 Log: Revert OPENSSL_NO_SSL3_METHOD to keep ABI compatibility. This define caused a couple of symbols to disappear. To keep ABI compatibility, we are going to keep the symbols exposed, but leave SSLv3 as not in the default config (this is what OPENSSL_NO_SSL3 achieves). The ramifications of this is an application can still use SSLv3 if it specifically calls the SSLv3_method family of APIs. Reported by: kib, others Reviewed by: kib Differential Revision:https://reviews.freebsd.org/D25451 Modified: head/secure/lib/libcrypto/opensslconf.h.in Modified: head/secure/lib/libcrypto/opensslconf.h.in == --- head/secure/lib/libcrypto/opensslconf.h.in Thu Jun 25 19:27:22 2020 (r362619) +++ head/secure/lib/libcrypto/opensslconf.h.in Thu Jun 25 19:35:37 2020 (r362620) @@ -79,9 +79,6 @@ extern "C" { #ifndef OPENSSL_NO_SSL3 # define OPENSSL_NO_SSL3 #endif -#ifndef OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_SSL3_METHOD -#endif #ifndef OPENSSL_NO_UBSAN # define OPENSSL_NO_UBSAN #endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r361392 - head/secure/lib/libcrypto
Author: gordon Date: Fri May 22 16:53:39 2020 New Revision: 361392 URL: https://svnweb.freebsd.org/changeset/base/361392 Log: Remove support for SSLv3 from the OpenSSL build. This is the default configuration in OpenSSL 1.1.1 already. This moves to align with that default. Reported by: jmg Approved by: jkim, cem, emaste, philip Differential Revision:https://reviews.freebsd.org/D24945 Modified: head/secure/lib/libcrypto/opensslconf.h.in Modified: head/secure/lib/libcrypto/opensslconf.h.in == --- head/secure/lib/libcrypto/opensslconf.h.in Fri May 22 16:51:00 2020 (r361391) +++ head/secure/lib/libcrypto/opensslconf.h.in Fri May 22 16:53:39 2020 (r361392) @@ -76,6 +76,12 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +#endif +#ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +#endif #ifndef OPENSSL_NO_UBSAN # define OPENSSL_NO_UBSAN #endif ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r360146 - head/crypto/openssl/ssl
Author: gordon Date: Tue Apr 21 15:44:20 2020 New Revision: 360146 URL: https://svnweb.freebsd.org/changeset/base/360146 Log: Fix OpenSSL remote denial of service. See https://www.openssl.org/news/secadv/20200421.txt for details. Approved by: so Security: CVE-2020-1967 Modified: head/crypto/openssl/ssl/t1_lib.c Modified: head/crypto/openssl/ssl/t1_lib.c == --- head/crypto/openssl/ssl/t1_lib.cTue Apr 21 13:57:51 2020 (r360145) +++ head/crypto/openssl/ssl/t1_lib.cTue Apr 21 15:44:20 2020 (r360146) @@ -2130,7 +2130,7 @@ static int tls1_check_sig_alg(SSL *s, X509 *x, int def sigalg = use_pc_sigalgs ? tls1_lookup_sigalg(s->s3->tmp.peer_cert_sigalgs[i]) : s->shared_sigalgs[i]; -if (sig_nid == sigalg->sigandhash) +if (sigalg != NULL && sig_nid == sigalg->sigandhash) return 1; } return 0; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r357212 - head/lib/libfetch
Author: gordon Date: Tue Jan 28 18:37:18 2020 New Revision: 357212 URL: https://svnweb.freebsd.org/changeset/base/357212 Log: Fix urldecode buffer overrun. Reported by: Duncan Overbruck Security: CVE-2020-7450 Modified: head/lib/libfetch/fetch.c Modified: head/lib/libfetch/fetch.c == --- head/lib/libfetch/fetch.c Tue Jan 28 18:32:19 2020(r357211) +++ head/lib/libfetch/fetch.c Tue Jan 28 18:37:18 2020(r357212) @@ -332,6 +332,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dle } if (dlen-- > 0) *dst++ = c; + else + return (NULL); } return (s); } @@ -381,11 +383,15 @@ fetchParseURL(const char *URL) if (p && *p == '@') { /* username */ q = fetch_pctdecode(u->user, URL, URL_USERLEN); + if (q == NULL) + goto ouch; /* password */ - if (*q == ':') + if (*q == ':') { q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); - + if (q == NULL) + goto ouch; + } p++; } else { p = URL; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r344952 - head/bin/chmod
Author: gordon Date: Sat Mar 9 00:30:13 2019 New Revision: 344952 URL: https://svnweb.freebsd.org/changeset/base/344952 Log: Correct wording around '-' masks. PR: 236407 Reported by: Brian Saia MFC after:1 week Modified: head/bin/chmod/chmod.1 Modified: head/bin/chmod/chmod.1 == --- head/bin/chmod/chmod.1 Sat Mar 9 00:27:50 2019(r344951) +++ head/bin/chmod/chmod.1 Sat Mar 9 00:30:13 2019(r344952) @@ -259,7 +259,7 @@ If no value is supplied for each permission bit specified in .Ar perm , for which the corresponding bit in the file mode creation mask -is clear, is cleared. +is set, is cleared. Otherwise, the mode bits represented by the specified .Ar who and ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r341484 - head/usr.sbin/bhyve
Author: gordon Date: Tue Dec 4 18:28:25 2018 New Revision: 341484 URL: https://svnweb.freebsd.org/changeset/base/341484 Log: Always treat firmware request and response sizes as unsigned. This fixes an incomplete bounds check on the guest-supplied request size where a very large request size could be interpreted as a negative value and not be caught by the bounds check. Submitted by: jhb Reported by: Reno Robert Approved by: so Security: FreeBSD-SA-18:14.bhyve Security: CVE-2018-17160 Modified: head/usr.sbin/bhyve/fwctl.c Modified: head/usr.sbin/bhyve/fwctl.c == --- head/usr.sbin/bhyve/fwctl.c Tue Dec 4 17:57:01 2018(r341483) +++ head/usr.sbin/bhyve/fwctl.c Tue Dec 4 18:28:25 2018(r341484) @@ -79,8 +79,8 @@ static u_int ident_idx; struct op_info { int op; - int (*op_start)(int len); - void (*op_data)(uint32_t data, int len); + int (*op_start)(uint32_t len); + void (*op_data)(uint32_t data, uint32_t len); int (*op_result)(struct iovec **data); void (*op_done)(struct iovec *data); }; @@ -119,7 +119,7 @@ errop_set(int err) } static int -errop_start(int len) +errop_start(uint32_t len) { errop_code = ENOENT; @@ -128,7 +128,7 @@ errop_start(int len) } static void -errop_data(uint32_t data, int len) +errop_data(uint32_t data, uint32_t len) { /* ignore */ @@ -188,7 +188,7 @@ static int fget_cnt; static size_t fget_size; static int -fget_start(int len) +fget_start(uint32_t len) { if (len > FGET_STRSZ) @@ -200,7 +200,7 @@ fget_start(int len) } static void -fget_data(uint32_t data, int len) +fget_data(uint32_t data, uint32_t len) { *((uint32_t *) _str[fget_cnt]) = data; @@ -285,8 +285,8 @@ static struct req_info { struct op_info *req_op; int resp_error; int resp_count; - int resp_size; - int resp_off; + size_t resp_size; + size_t resp_off; struct iovec *resp_biov; } rinfo; @@ -346,13 +346,14 @@ fwctl_request_start(void) static int fwctl_request_data(uint32_t value) { - int remlen; /* Make sure remaining size is >= 0 */ - rinfo.req_size -= sizeof(uint32_t); - remlen = MAX(rinfo.req_size, 0); + if (rinfo.req_size <= sizeof(uint32_t)) + rinfo.req_size = 0; + else + rinfo.req_size -= sizeof(uint32_t); - (*rinfo.req_op->op_data)(value, remlen); + (*rinfo.req_op->op_data)(value, rinfo.req_size); if (rinfo.req_size < sizeof(uint32_t)) { fwctl_request_done(); @@ -401,7 +402,7 @@ static int fwctl_response(uint32_t *retval) { uint32_t *dp; - int remlen; + ssize_t remlen; switch(rinfo.resp_count) { case 0: @@ -436,7 +437,7 @@ fwctl_response(uint32_t *retval) } if (rinfo.resp_count > 3 && - rinfo.resp_size - rinfo.resp_off <= 0) { + rinfo.resp_off >= rinfo.resp_size) { fwctl_response_done(); return (1); } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r338982 - head/sys/kern
Author: gordon Date: Thu Sep 27 18:39:54 2018 New Revision: 338982 URL: https://svnweb.freebsd.org/changeset/base/338982 Log: Clear stack allocated data structure to prevent kernel memory leak. Reported by: Thomas Barabosch, Fraunhofer FKIE Reviewed by: wes@ Approved by: re (implicit) Approved by: so Security: FreeBSD-EN-18:12.mem Security: CVE-2018-17155 Modified: head/sys/kern/kern_context.c Modified: head/sys/kern/kern_context.c == --- head/sys/kern/kern_context.cThu Sep 27 18:36:30 2018 (r338981) +++ head/sys/kern/kern_context.cThu Sep 27 18:39:54 2018 (r338982) @@ -70,6 +70,7 @@ sys_getcontext(struct thread *td, struct getcontext_ar if (uap->ucp == NULL) ret = EINVAL; else { + bzero(, sizeof(ucontext_t)); get_mcontext(td, _mcontext, GET_MC_CLEAR_RET); PROC_LOCK(td->td_proc); uc.uc_sigmask = td->td_sigmask; @@ -110,6 +111,7 @@ sys_swapcontext(struct thread *td, struct swapcontext_ if (uap->oucp == NULL || uap->ucp == NULL) ret = EINVAL; else { + bzero(, sizeof(ucontext_t)); get_mcontext(td, _mcontext, GET_MC_CLEAR_RET); bzero(uc.__spare__, sizeof(uc.__spare__)); PROC_LOCK(td->td_proc); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r338603 - head/sys/kern
Author: gordon Date: Wed Sep 12 04:57:34 2018 New Revision: 338603 URL: https://svnweb.freebsd.org/changeset/base/338603 Log: Correct ELF header parsing code to prevent invalid ELF sections from disclosing memory. Submitted by: markj Reported by: Thomas Barabosch, Fraunhofer FKIE Approved by: re (implicit) Approved by: so Security: FreeBSD-SA-18:12.elf Security: CVE-2018-6924 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/imgact_elf.c head/sys/kern/vfs_vnops.c Modified: head/sys/kern/imgact_elf.c == --- head/sys/kern/imgact_elf.c Tue Sep 11 23:54:31 2018(r338602) +++ head/sys/kern/imgact_elf.c Wed Sep 12 04:57:34 2018(r338603) @@ -839,7 +839,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i break; case PT_INTERP: /* Path to interpreter */ - if (phdr[i].p_filesz > MAXPATHLEN) { + if (phdr[i].p_filesz < 2 || + phdr[i].p_filesz > MAXPATHLEN) { uprintf("Invalid PT_INTERP\n"); error = ENOEXEC; goto ret; @@ -870,6 +871,11 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i } else { interp = __DECONST(char *, imgp->image_header) + phdr[i].p_offset; + if (interp[interp_name_len - 1] != '\0') { + uprintf("Invalid PT_INTERP\n"); + error = ENOEXEC; + goto ret; + } } break; case PT_GNU_STACK: Modified: head/sys/kern/vfs_vnops.c == --- head/sys/kern/vfs_vnops.c Tue Sep 11 23:54:31 2018(r338602) +++ head/sys/kern/vfs_vnops.c Wed Sep 12 04:57:34 2018(r338603) @@ -527,6 +527,8 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, struct vn_io_fault_args args; int error, lock_flags; + if (offset < 0 && vp->v_type != VCHR) + return (EINVAL); auio.uio_iov = auio.uio_iovcnt = 1; aiov.iov_base = base; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r337936 - in head/sys/contrib/libsodium: . builds builds/msvc builds/msvc/build builds/msvc/properties builds/msvc/vs2010 builds/msvc/vs2010/libsodium builds/msvc/vs2012 builds/msvc/vs
On Fri, Aug 17, 2018 at 12:23:51AM +, Conrad Meyer wrote: > Author: cem > Date: Fri Aug 17 00:23:50 2018 > New Revision: 337936 > URL: https://svnweb.freebsd.org/changeset/base/337936 > > Log: > Bring in libsodium to sys/contrib > > Bring in https://github.com/jedisct1/libsodium at > 461ac93b260b91db8ad957f5a576860e3e9c88a1 (August 7, 2018), unmodified. > > libsodium is derived from Daniel J. Bernstein et al.'s 2011 NaCl > ("Networking and Cryptography Library," pronounced "salt") software library. > At the risk of oversimplifying, libsodium primarily exists to make it easier > to use NaCl. NaCl and libsodium provide high quality implementations of a > number of useful cryptographic concepts (as well as the underlying > primitics) seeing some adoption in newer network protocols. > > I considered but dismissed cleaning up the directory hierarchy and > discarding artifacts of other build systems in favor of remaining close to > upstream (and easing future updates). > > Nothing is integrated into the build system yet, so in that sense, no > functional change. Hi! so@ here. Please don't integrate an additional crypto library without consultation from secteam. Bringing in a different crypto implementation has very serious downstream costs. Additionally, I don't see any discussion on current, hackers, arch, or security with a plan for why this is coming into the tree. That said, I've been on vacation the last two weeks, so if I missed something, please feel free to point it out to me. Thanks, Gordon signature.asc Description: PGP signature
svn commit: r331981 - head/sys/dev/vt
Author: gordon Date: Wed Apr 4 05:21:46 2018 New Revision: 331981 URL: https://svnweb.freebsd.org/changeset/base/331981 Log: Limit glyph count in vtfont_load to avoid integer overflow. Invalid font data passed to PIO_VFONT can result in an integer overflow in glyphsize. Characters may then be drawn on the console using glyph map entries that point beyond the end of allocated glyph memory, resulting in a kernel memory disclosure. Submitted by: emaste Reported by: Dr. Silvio Cesare of InfoSect Security: CVE-2018-6917 Security: FreeBSD-SA-18:04.vt Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_font.c Modified: head/sys/dev/vt/vt_font.c == --- head/sys/dev/vt/vt_font.c Wed Apr 4 04:26:21 2018(r331980) +++ head/sys/dev/vt/vt_font.c Wed Apr 4 05:21:46 2018(r331981) @@ -44,6 +44,7 @@ static MALLOC_DEFINE(M_VTFONT, "vtfont", "vt font"); /* Some limits to prevent abnormal fonts from being loaded. */ #defineVTFONT_MAXMAPPINGS 65536 +#defineVTFONT_MAXGLYPHS131072 #defineVTFONT_MAXGLYPHSIZE 2097152 #defineVTFONT_MAXDIMENSION 128 @@ -173,7 +174,8 @@ vtfont_load(vfnt_t *f, struct vt_font **ret) /* Make sure the dimensions are valid. */ if (f->width < 1 || f->height < 1) return (EINVAL); - if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION) + if (f->width > VTFONT_MAXDIMENSION || f->height > VTFONT_MAXDIMENSION || + f->glyph_count > VTFONT_MAXGLYPHS) return (E2BIG); /* Not too many mappings. */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r325942 - head
Author: gordon Date: Fri Nov 17 15:46:19 2017 New Revision: 325942 URL: https://svnweb.freebsd.org/changeset/base/325942 Log: Correct grammar nit. Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Fri Nov 17 15:45:35 2017(r325941) +++ head/UPDATING Fri Nov 17 15:46:19 2017(r325942) @@ -66,7 +66,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: 20171102: Building in a FreeBSD src checkout will automatically create object directories now rather than store files in the current directory if - 'make obj' was not ran. Calling 'make obj' is no longer necesarry. + 'make obj' was not ran. Calling 'make obj' is no longer necessary. This feature can be disabled by setting WITHOUT_AUTO_OBJ=yes in /etc/src-env.conf (not /etc/src.conf), or passing the option in the environment. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r325865 - in head/sys: compat/freebsd32 kern
Author: gordon Date: Wed Nov 15 22:30:21 2017 New Revision: 325865 URL: https://svnweb.freebsd.org/changeset/base/325865 Log: Properly bzero kldstat structure to prevent kernel information leak. Submitted by: kib Reported by: TJ Corley Security: CVE-2017-1088 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_linker.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c == --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 15 22:13:10 2017 (r325864) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Nov 15 22:30:21 2017 (r325865) @@ -3331,8 +3331,8 @@ freebsd32_copyout_strings(struct image_params *imgp) int freebsd32_kldstat(struct thread *td, struct freebsd32_kldstat_args *uap) { - struct kld_file_stat stat; - struct kld32_file_stat stat32; + struct kld_file_stat *stat; + struct kld32_file_stat *stat32; int error, version; if ((error = copyin(>stat->version, , sizeof(version))) @@ -3342,17 +3342,22 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_ version != sizeof(struct kld32_file_stat)) return (EINVAL); - error = kern_kldstat(td, uap->fileid, ); - if (error != 0) - return (error); - - bcopy([0], [0], sizeof(stat.name)); - CP(stat, stat32, refs); - CP(stat, stat32, id); - PTROUT_CP(stat, stat32, address); - CP(stat, stat32, size); - bcopy([0], [0], sizeof(stat.pathname)); - return (copyout(, uap->stat, version)); + stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO); + stat32 = malloc(sizeof(*stat32), M_TEMP, M_WAITOK | M_ZERO); + error = kern_kldstat(td, uap->fileid, stat); + if (error == 0) { + bcopy(>name[0], >name[0], sizeof(stat->name)); + CP(*stat, *stat32, refs); + CP(*stat, *stat32, id); + PTROUT_CP(*stat, *stat32, address); + CP(*stat, *stat32, size); + bcopy(>pathname[0], >pathname[0], + sizeof(stat->pathname)); + error = copyout(stat32, uap->stat, version); + } + free(stat, M_TEMP); + free(stat32, M_TEMP); + return (error); } int Modified: head/sys/kern/kern_linker.c == --- head/sys/kern/kern_linker.c Wed Nov 15 22:13:10 2017(r325864) +++ head/sys/kern/kern_linker.c Wed Nov 15 22:30:21 2017(r325865) @@ -1229,7 +1229,7 @@ out: int sys_kldstat(struct thread *td, struct kldstat_args *uap) { - struct kld_file_stat stat; + struct kld_file_stat *stat; int error, version; /* @@ -1242,10 +1242,12 @@ sys_kldstat(struct thread *td, struct kldstat_args *ua version != sizeof(struct kld_file_stat)) return (EINVAL); - error = kern_kldstat(td, uap->fileid, ); - if (error != 0) - return (error); - return (copyout(, uap->stat, version)); + stat = malloc(sizeof(*stat), M_TEMP, M_WAITOK | M_ZERO); + error = kern_kldstat(td, uap->fileid, stat); + if (error == 0) + error = copyout(stat, uap->stat, version); + free(stat, M_TEMP); + return (error); } int ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r324696 - in head/contrib/wpa: src/ap src/common src/rsn_supp wpa_supplicant
Author: gordon Date: Tue Oct 17 17:22:36 2017 New Revision: 324696 URL: https://svnweb.freebsd.org/changeset/base/324696 Log: Update wpa_supplicant/hostapd for 2017-01 vulnerability release. hostapd: Avoid key reinstallation in FT handshake Prevent reinstallation of an already in-use group key Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases Fix TK configuration to the driver in EAPOL-Key 3/4 retry case Prevent installation of an all-zero TK Fix PTK rekeying to generate a new ANonce TDLS: Reject TPK-TK reconfiguration WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used WNM: Ignore WNM-Sleep Mode Response without pending request FT: Do not allow multiple Reassociation Response frames TDLS: Ignore incoming TDLS Setup Response retries Submitted by: jhb Obtained from:https://w1.fi/security/2017-01/ (against later version) Security: FreeBSD-SA-17:07 Security: CERT VU#228519 Security: CVE-2017-13077 Security: CVE-2017-13078 Security: CVE-2017-13079 Security: CVE-2017-13080 Security: CVE-2017-13081 Security: CVE-2017-13082 Security: CVE-2017-13086 Security: CVE-2017-13087 Security: CVE-2017-13088 Differential Revision:https://reviews.freebsd.org/D12693 Modified: head/contrib/wpa/src/ap/wpa_auth.c head/contrib/wpa/src/ap/wpa_auth.h head/contrib/wpa/src/ap/wpa_auth_ft.c head/contrib/wpa/src/ap/wpa_auth_i.h head/contrib/wpa/src/common/wpa_common.h head/contrib/wpa/src/rsn_supp/tdls.c head/contrib/wpa/src/rsn_supp/wpa.c head/contrib/wpa/src/rsn_supp/wpa_ft.c head/contrib/wpa/src/rsn_supp/wpa_i.h head/contrib/wpa/wpa_supplicant/ctrl_iface.c head/contrib/wpa/wpa_supplicant/events.c head/contrib/wpa/wpa_supplicant/wnm_sta.c head/contrib/wpa/wpa_supplicant/wpa_supplicant_i.h Modified: head/contrib/wpa/src/ap/wpa_auth.c == --- head/contrib/wpa/src/ap/wpa_auth.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth.c Tue Oct 17 17:22:36 2017 (r324696) @@ -1893,6 +1893,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) } +static int wpa_auth_sm_ptk_update(struct wpa_state_machine *sm) +{ + if (random_get_bytes(sm->ANonce, WPA_NONCE_LEN)) { + wpa_printf(MSG_ERROR, + "WPA: Failed to get random data for ANonce"); + sm->Disconnect = TRUE; + return -1; + } + wpa_hexdump(MSG_DEBUG, "WPA: Assign new ANonce", sm->ANonce, + WPA_NONCE_LEN); + sm->TimeoutCtr = 0; + return 0; +} + + SM_STATE(WPA_PTK, INITPMK) { u8 msk[2 * PMK_LEN]; @@ -2414,9 +2429,12 @@ SM_STEP(WPA_PTK) SM_ENTER(WPA_PTK, AUTHENTICATION); else if (sm->ReAuthenticationRequest) SM_ENTER(WPA_PTK, AUTHENTICATION2); - else if (sm->PTKRequest) - SM_ENTER(WPA_PTK, PTKSTART); - else switch (sm->wpa_ptk_state) { + else if (sm->PTKRequest) { + if (wpa_auth_sm_ptk_update(sm) < 0) + SM_ENTER(WPA_PTK, DISCONNECTED); + else + SM_ENTER(WPA_PTK, PTKSTART); + } else switch (sm->wpa_ptk_state) { case WPA_PTK_INITIALIZE: break; case WPA_PTK_DISCONNECT: @@ -3206,6 +3224,14 @@ int wpa_auth_sta_wpa_version(struct wpa_state_machine if (sm == NULL) return 0; return sm->wpa; +} + + +int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm) +{ + if (!sm || !wpa_key_mgmt_ft(sm->wpa_key_mgmt)) + return 0; + return sm->tk_already_set; } Modified: head/contrib/wpa/src/ap/wpa_auth.h == --- head/contrib/wpa/src/ap/wpa_auth.h Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth.h Tue Oct 17 17:22:36 2017 (r324696) @@ -271,6 +271,7 @@ int wpa_auth_pairwise_set(struct wpa_state_machine *sm int wpa_auth_get_pairwise(struct wpa_state_machine *sm); int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); +int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry); struct rsn_pmksa_cache_entry * Modified: head/contrib/wpa/src/ap/wpa_auth_ft.c == --- head/contrib/wpa/src/ap/wpa_auth_ft.c Tue Oct 17 16:29:50 2017 (r324695) +++ head/contrib/wpa/src/ap/wpa_auth_ft.c Tue Oct 17 17:22:36 2017 (r324696) @@ -780,6 +780,14 @@ void wpa_ft_install_ptk(struct wpa_state_machine
svn commit: r323709 - head/usr.sbin/tcpdump/tcpdump
Author: gordon Date: Mon Sep 18 16:42:13 2017 New Revision: 323709 URL: https://svnweb.freebsd.org/changeset/base/323709 Log: Revert tcpdump to using the source manpage instead of having a copy here. This helps future maintainability of tcpdump so we don't forget to update the manpage (like we have previously). Stolen from: usr.bin/file/Makefile Reviewed by: jilles Approved by: delphij (mentor) MFC after:1 week Differential Revision:https://reviews.freebsd.org/D12403 Deleted: head/usr.sbin/tcpdump/tcpdump/tcpdump.1 Modified: head/usr.sbin/tcpdump/tcpdump/Makefile Modified: head/usr.sbin/tcpdump/tcpdump/Makefile == --- head/usr.sbin/tcpdump/tcpdump/Makefile Mon Sep 18 15:17:07 2017 (r323708) +++ head/usr.sbin/tcpdump/tcpdump/Makefile Mon Sep 18 16:42:13 2017 (r323709) @@ -173,7 +173,7 @@ SRCS= addrtoname.c \ tcpdump.c \ util-print.c \ version.c -CLEANFILES+= version.c +CLEANFILES+= version.c ${MAN} CFLAGS+= -I${.CURDIR} -I${TCPDUMP_DISTDIR} CFLAGS+= -DHAVE_CONFIG_H @@ -210,3 +210,9 @@ version.c: ${TCPDUMP_DISTDIR}/VERSION > version.c .include + +.for mp in ${MAN} +${mp}: ${mp}.in + sed -e 's/@MAN_MISC_INFO@/7/g' -e 's/@MAN_FILE_FORMATS@/5/g' \ + ${.ALLSRC} > ${.TARGET} +.endfor ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r323683 - in head: contrib/file contrib/file/doc contrib/file/magic contrib/file/magic/Magdir contrib/file/python contrib/file/src contrib/file/tests lib/libmagic
Author: gordon Date: Sun Sep 17 19:14:38 2017 New Revision: 323683 URL: https://svnweb.freebsd.org/changeset/base/323683 Log: MFV r323678: file 5.32 Approved by: emaste (mentor) MFC after:2 weeks Differential Revision:https://reviews.freebsd.org/D12400 Added: head/contrib/file/magic/Magdir/apache - copied unchanged from r323678, vendor/file/dist/magic/Magdir/apache head/contrib/file/magic/Magdir/bhl - copied unchanged from r323678, vendor/file/dist/magic/Magdir/bhl head/contrib/file/magic/Magdir/gconv - copied unchanged from r323678, vendor/file/dist/magic/Magdir/gconv head/contrib/file/magic/Magdir/gpu - copied unchanged from r323678, vendor/file/dist/magic/Magdir/gpu head/contrib/file/magic/Magdir/webassembly - copied unchanged from r323678, vendor/file/dist/magic/Magdir/webassembly head/contrib/file/magic/Magdir/yara - copied unchanged from r323678, vendor/file/dist/magic/Magdir/yara head/contrib/file/tests/hddrawcopytool.result - copied unchanged from r323678, vendor/file/dist/tests/hddrawcopytool.result head/contrib/file/tests/hddrawcopytool.testfile - copied unchanged from r323678, vendor/file/dist/tests/hddrawcopytool.testfile Modified: head/contrib/file/ChangeLog head/contrib/file/aclocal.m4 head/contrib/file/config.guess head/contrib/file/config.sub head/contrib/file/configure head/contrib/file/configure.ac head/contrib/file/doc/file.man head/contrib/file/doc/libmagic.man head/contrib/file/doc/magic.man head/contrib/file/magic/Localstuff head/contrib/file/magic/Magdir/adventure head/contrib/file/magic/Magdir/amanda head/contrib/file/magic/Magdir/amigaos head/contrib/file/magic/Magdir/android head/contrib/file/magic/Magdir/animation head/contrib/file/magic/Magdir/apple head/contrib/file/magic/Magdir/archive head/contrib/file/magic/Magdir/att3b head/contrib/file/magic/Magdir/audio head/contrib/file/magic/Magdir/blackberry head/contrib/file/magic/Magdir/blender head/contrib/file/magic/Magdir/c-lang head/contrib/file/magic/Magdir/cad head/contrib/file/magic/Magdir/cafebabe head/contrib/file/magic/Magdir/clipper head/contrib/file/magic/Magdir/coff head/contrib/file/magic/Magdir/commands head/contrib/file/magic/Magdir/compress head/contrib/file/magic/Magdir/console head/contrib/file/magic/Magdir/cups head/contrib/file/magic/Magdir/database head/contrib/file/magic/Magdir/der head/contrib/file/magic/Magdir/diff head/contrib/file/magic/Magdir/dolby head/contrib/file/magic/Magdir/dump head/contrib/file/magic/Magdir/dyadic head/contrib/file/magic/Magdir/editors head/contrib/file/magic/Magdir/filesystems head/contrib/file/magic/Magdir/flash head/contrib/file/magic/Magdir/fonts head/contrib/file/magic/Magdir/fsav head/contrib/file/magic/Magdir/games head/contrib/file/magic/Magdir/geo head/contrib/file/magic/Magdir/gnu head/contrib/file/magic/Magdir/gpt head/contrib/file/magic/Magdir/gringotts head/contrib/file/magic/Magdir/hitachi-sh head/contrib/file/magic/Magdir/ibm370 head/contrib/file/magic/Magdir/ibm6000 head/contrib/file/magic/Magdir/icc head/contrib/file/magic/Magdir/images head/contrib/file/magic/Magdir/intel head/contrib/file/magic/Magdir/isz head/contrib/file/magic/Magdir/jpeg head/contrib/file/magic/Magdir/kerberos head/contrib/file/magic/Magdir/kml head/contrib/file/magic/Magdir/linux head/contrib/file/magic/Magdir/lisp head/contrib/file/magic/Magdir/m4 head/contrib/file/magic/Magdir/macintosh head/contrib/file/magic/Magdir/make head/contrib/file/magic/Magdir/maple head/contrib/file/magic/Magdir/marc21 head/contrib/file/magic/Magdir/mathematica head/contrib/file/magic/Magdir/metastore head/contrib/file/magic/Magdir/meteorological head/contrib/file/magic/Magdir/microfocus head/contrib/file/magic/Magdir/mime head/contrib/file/magic/Magdir/misctools head/contrib/file/magic/Magdir/modem head/contrib/file/magic/Magdir/mozilla head/contrib/file/magic/Magdir/msdos head/contrib/file/magic/Magdir/msvc head/contrib/file/magic/Magdir/msx head/contrib/file/magic/Magdir/mup head/contrib/file/magic/Magdir/nasa head/contrib/file/magic/Magdir/netbsd head/contrib/file/magic/Magdir/netscape head/contrib/file/magic/Magdir/nitpicker head/contrib/file/magic/Magdir/os2 head/contrib/file/magic/Magdir/os9 head/contrib/file/magic/Magdir/pbf head/contrib/file/magic/Magdir/pc88 head/contrib/file/magic/Magdir/pc98 head/contrib/file/magic/Magdir/pdf head/contrib/file/magic/Magdir/pdp head/contrib/file/magic/Magdir/perl head/contrib/file/magic/Magdir/pgf head/contrib/file/magic/Magdir/pgp head/contrib/file/magic/Magdir/printer head/contrib/file/magic/Magdir/project head/contrib/file/magic/Magdir/psdbms head/contrib/file/magic/Magdir/python head/contrib/file/magic/Magdir/riff head/contrib/file/magic/Magdir/ruby head/contrib/file/magic/Magdir/sccs
svn commit: r323550 - in head: . etc/defaults etc/periodic/weekly libexec/makewhatis.local share/man/man5 sys/mips/rmi targets/pseudo/userland tools/build/mk tools/build/options usr.bin usr.bin/cat...
Author: gordon Date: Wed Sep 13 16:35:16 2017 New Revision: 323550 URL: https://svnweb.freebsd.org/changeset/base/323550 Log: Deorbit catman. The tradeoff of disk for performance has long since tipped in favor of just rendering the manpage instead of relying on pre-formatted catpages. Note, this does not impede the ability to use existing catpages, it just removes the utility to generate them. Reviewed by: imp, allanjude Approved by: emaste (mentor) Differential Revision:https://reviews.freebsd.org/D12317 Deleted: head/etc/periodic/weekly/330.catman head/usr.bin/catman/ Modified: head/ObsoleteFiles.inc head/etc/defaults/periodic.conf head/etc/periodic/weekly/Makefile head/libexec/makewhatis.local/Makefile head/libexec/makewhatis.local/makewhatis.local.8 head/libexec/makewhatis.local/makewhatis.local.sh head/share/man/man5/periodic.conf.5 head/share/man/man5/rc.conf.5 head/share/man/man5/src.conf.5 head/sys/mips/rmi/rootfs_list.txt head/targets/pseudo/userland/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/build/options/WITHOUT_MAN_UTILS head/usr.bin/Makefile head/usr.bin/su/su.1 head/usr.sbin/crunch/examples/really-big.conf Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Wed Sep 13 16:23:59 2017(r323549) +++ head/ObsoleteFiles.inc Wed Sep 13 16:35:16 2017(r323550) @@ -38,6 +38,13 @@ # xargs -n1 | sort | uniq -d; # done +# 20170913: remove unneeded catman utility +OLD_FILES+=etc/periodic/weekly/330.catman +OLD_FILES+=usr/bin/catman +OLD_FILES+=usr/libexec/catman.local +OLD_FILES+=usr/share/man/man1/catman.1.gz +OLD_FILES+=usr/share/man/man8/catman.local.8.gz + # 20170802: ksyms(4) ioctl interface was removed OLD_FILES+=usr/include/sys/ksyms.h Modified: head/etc/defaults/periodic.conf == --- head/etc/defaults/periodic.conf Wed Sep 13 16:23:59 2017 (r323549) +++ head/etc/defaults/periodic.conf Wed Sep 13 16:35:16 2017 (r323550) @@ -181,9 +181,6 @@ weekly_locate_enable="YES" # Update locate weekly # 320.whatis weekly_whatis_enable="YES" # Update whatis weekly -# 330.catman -weekly_catman_enable="NO" # Preformat man pages - # 340.noid weekly_noid_enable="NO"# Find unowned files weekly_noid_dirs="/" # Look here Modified: head/etc/periodic/weekly/Makefile == --- head/etc/periodic/weekly/Makefile Wed Sep 13 16:23:59 2017 (r323549) +++ head/etc/periodic/weekly/Makefile Wed Sep 13 16:35:16 2017 (r323550) @@ -13,7 +13,7 @@ FILES+= 310.locate .endif .if ${MK_MAN_UTILS} != "no" -FILES+=320.whatis 330.catman +FILES+=320.whatis .endif .include Modified: head/libexec/makewhatis.local/Makefile == --- head/libexec/makewhatis.local/Makefile Wed Sep 13 16:23:59 2017 (r323549) +++ head/libexec/makewhatis.local/Makefile Wed Sep 13 16:35:16 2017 (r323550) @@ -3,7 +3,5 @@ SCRIPTS= makewhatis.local.sh MAN= makewhatis.local.8 SCRIPTSDIR=${LIBEXECDIR} -LINKS= ${SCRIPTSDIR}/makewhatis.local ${SCRIPTSDIR}/catman.local -MLINKS=makewhatis.local.8 catman.local.8 .include Modified: head/libexec/makewhatis.local/makewhatis.local.8 == --- head/libexec/makewhatis.local/makewhatis.local.8Wed Sep 13 16:23:59 2017(r323549) +++ head/libexec/makewhatis.local/makewhatis.local.8Wed Sep 13 16:35:16 2017(r323550) @@ -27,22 +27,19 @@ .Dt MAKEWHATIS.LOCAL 8 .Os .Sh NAME -.Nm makewhatis.local , catman.local -.Nd start makewhatis or catman for local file systems +.Nm makewhatis.local +.Nd start makewhatis for local file systems .Sh SYNOPSIS .Nm /usr/libexec/makewhatis.local .Op options .Ar directories ... -.Nm /usr/libexec/catman.local -.Op options -.Ar directories ... .Sh DESCRIPTION The .Nm utility starts .Xr makewhatis 1 only for file systems physically mounted on the system -where the +where .Nm is being executed. Running makewhatis @@ -53,25 +50,14 @@ your NFS server -- all NFS clients start makewhatis at So use this wrapper for .Xr cron 8 instead of calling makewhatis directly. -The -.Nm catman.local -utility is using for same purposes as -.Nm -but for -.Xr catman 1 . .Sh FILES .Bl -tag -width /etc/periodic/weekly/320.whatis.XXX -compact .It Pa /etc/periodic/weekly/320.whatis run .Nm every week -.It Pa /etc/periodic/weekly/330.catman -run -.Nm catman.local -every week
svn commit: r323342 - head/usr.sbin/manctl
Author: gordon Date: Sat Sep 9 03:09:02 2017 New Revision: 323342 URL: https://svnweb.freebsd.org/changeset/base/323342 Log: The purge option hasn't been implemented since 1994 when we imported this code. I think it is safe to say it's not going to be. I'm also working to de-orbit catman, so remove the reference in the manpage. Reviewed by: allanjude Modified: head/usr.sbin/manctl/manctl.8 head/usr.sbin/manctl/manctl.sh Modified: head/usr.sbin/manctl/manctl.8 == --- head/usr.sbin/manctl/manctl.8 Sat Sep 9 02:28:21 2017 (r323341) +++ head/usr.sbin/manctl/manctl.8 Sat Sep 9 03:09:02 2017 (r323342) @@ -33,7 +33,6 @@ .Nm .Op Fl compress .Op Fl uncompress -.Op Fl purge .Op Fl help .Ar path ... .Sh DESCRIPTION @@ -50,9 +49,6 @@ Print options and exit. Compress uncompressed man pages (eliminating .so's). .It Fl uncompress Uncompress compressed man pages. -.It Fl purge -Purge old formatted man pages (not implemented yet). .El .Sh SEE ALSO -.Xr catman 1 , .Xr man 1 Modified: head/usr.sbin/manctl/manctl.sh == --- head/usr.sbin/manctl/manctl.sh Sat Sep 9 02:28:21 2017 (r323341) +++ head/usr.sbin/manctl/manctl.sh Sat Sep 9 03:09:02 2017 (r323342) @@ -39,7 +39,6 @@ # this is now two-pass. If possible, .so's # are replaced with hard links # uncompress compressed man pages -# purge old formatted man pages (not implemented yet) # Things to watch out for: # Hard links - careful with g(un)zipping! # .so's - throw everything through soelim before gzip! @@ -49,16 +48,6 @@ PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH # -# purge cat? directories -# -do_purge() -{ - echo "purge $@" 2>&1 - echo "not implemented yet\n" 2>&1 -} - - -# # Uncompress one page # uncompress_page() @@ -351,8 +340,6 @@ ctl_usage() { echo "usage: $1 -compress ... " 1>&2 echo " $1 -uncompress ... " 1>&2 - echo " $1 -purge ... " 1>&2 - echo " $1 -purge expire ... " 1>&2 exit 1 } @@ -375,6 +362,5 @@ if [ $# -lt 2 ] ; then ctl_usage $0 ; fi ; case "$1" in -compress) shift ; do_compress "$@" ;; -uncompress)shift ; do_uncompress "$@" ;; - -purge) shift ; do_purge "$@" ;; *) ctl_usage $0 ;; esac ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r323278 - head/contrib/file/src
Author: gordon Date: Thu Sep 7 18:54:54 2017 New Revision: 323278 URL: https://svnweb.freebsd.org/changeset/base/323278 Log: Fix an incorrectly used conditional causing a stack buffer overflow. Reported by: Thomas Jarosch of Intra2net AG Reviewed by: emaste, jhb Security: CVE-2017-1000249 Modified: head/contrib/file/src/readelf.c Modified: head/contrib/file/src/readelf.c == --- head/contrib/file/src/readelf.c Thu Sep 7 17:51:35 2017 (r323277) +++ head/contrib/file/src/readelf.c Thu Sep 7 18:54:54 2017 (r323278) @@ -509,7 +509,7 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, size_t noff, size_t doff, int *flags) { if (namesz == 4 && strcmp((char *)[noff], "GNU") == 0 && - type == NT_GNU_BUILD_ID && (descsz >= 4 || descsz <= 20)) { + type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) { uint8_t desc[20]; const char *btype; uint32_t i; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r298552 - head/share/misc
Author: gordon (ports committer) Date: Sun Apr 24 21:19:00 2016 New Revision: 298552 URL: https://svnweb.freebsd.org/changeset/base/298552 Log: Add myself (finally) to the port committer's dot file. Approved by: mat (mentor) Differential Revision:https://reviews.freebsd.org/D6074 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot == --- head/share/misc/committers-ports.dotSun Apr 24 20:31:22 2016 (r298551) +++ head/share/misc/committers-ports.dotSun Apr 24 21:19:00 2016 (r298552) @@ -110,6 +110,7 @@ gerald [label="Gerald Pfeifer\ngerald@Fr gjb [label="Glen Barber\n...@freebsd.org\n2012/06/19"] glarkin [label="Greg Larkin\nglar...@freebsd.org\n2008/07/17"] glewis [label="Greg Lewis\ngle...@freebsd.org\n2002/04/08"] +gordon [label="Gordon Tetlow\ngor...@freebsd.org\n2014/10/14"] grembo [label="Michael Gmelin\ngre...@freebsd.org\n2014/01/21"] gnn [label="George Neville-Neil\n...@freebsd.org\n2013/09/04"] hq [label="Herve Quiroz\n...@freebsd.org\n2004/08/05"] @@ -347,6 +348,7 @@ eik -> trhodes erwin -> brix erwin -> clement erwin -> gabor +erwin -> gordon erwin -> lbr erwin -> lth erwin -> simon @@ -456,6 +458,7 @@ makc -> rakuco mat -> bmah mat -> dvl +mat -> gordon mat -> thierry mezz -> tmclaugh ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r223818 - head/usr.sbin/pwd_mkdb
Author: gordon Date: Wed Jul 6 06:34:08 2011 New Revision: 223818 URL: http://svn.freebsd.org/changeset/base/223818 Log: Only increment the ypcnt once per data record. The old implementation was incrementing it twice making it impossible to iterate the table since the records were 1, 3, 5, 7 (or 2, 4, 6, 8 for the v3 records). MFC after:10 days Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c Modified: head/usr.sbin/pwd_mkdb/pwd_mkdb.c == --- head/usr.sbin/pwd_mkdb/pwd_mkdb.c Wed Jul 6 05:42:52 2011 (r223817) +++ head/usr.sbin/pwd_mkdb/pwd_mkdb.c Wed Jul 6 06:34:08 2011 (r223818) @@ -351,14 +351,16 @@ main(int argc, char *argv[]) if ((dp-put)(sdp, key, data, 0) == -1) error(put); } - ypcnt = 1; + ypcnt = 0; data.data = (u_char *)buf; sdata.data = (u_char *)sbuf; key.data = (u_char *)tbuf; for (cnt = 1; scan(fp, pwd); ++cnt) { if (!is_comment - (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-')) + (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-')) { yp_enabled = 1; + ypcnt++; + } if (is_comment) --cnt; #defineCOMPACT(e) t = e; while ((*p++ = *t++)); @@ -456,7 +458,6 @@ main(int argc, char *argv[]) tbuf[0] = CURRENT_VERSION(_PW_KEYYPBYNUM); store = htonl(ypcnt); memmove(tbuf + 1, store, sizeof(store)); - ypcnt++; key.size = sizeof(store) + 1; if ((dp-put)(dp, key, data, method) == -1) error(put); @@ -547,7 +548,6 @@ main(int argc, char *argv[]) tbuf[0] = LEGACY_VERSION(_PW_KEYYPBYNUM); store = HTOL(ypcnt); memmove(tbuf + 1, store, sizeof(store)); - ypcnt++; key.size = sizeof(store) + 1; if ((dp-put)(dp, key, data, method) == -1) error(put); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r220910 - head/gnu/usr.bin/man
Author: gordon Date: Thu Apr 21 07:14:10 2011 New Revision: 220910 URL: http://svn.freebsd.org/changeset/base/220910 Log: Remove GNU man implemenation now that the BSD version has cooked for a while. Deleted: head/gnu/usr.bin/man/ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r220261 - head/usr.bin/man
Author: gordon Date: Sat Apr 2 05:01:09 2011 New Revision: 220261 URL: http://svn.freebsd.org/changeset/base/220261 Log: Overhaul locale handling. Use locale(1) to determine the locale instead of trying to hand roll it. Correctly construct groff call based on charset and locale independently, not the mix between the two. Submitted by: uqs@ Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh == --- head/usr.bin/man/man.sh Sat Apr 2 03:48:15 2011(r220260) +++ head/usr.bin/man/man.sh Sat Apr 2 05:01:09 2011(r220261) @@ -312,11 +312,10 @@ man_display_page() { # device flag (-T) we have to pass to eqn(1) and groff(1). Then, # setup the pipeline of commands based on the user's request. - # Apparently the locale flags are switched on where the manpage is - # found not just the locale env variables. - nroff_dev=ascii - case X${use_locale}X${manpage} in - XyesX*/${man_lang}*${man_charset}/*) + # If the manpage is from a particular charset, we need to setup nroff + # to properly output for the correct device. + case ${manpage} in + *.${man_charset}/*) # I don't pretend to know this; I'm just copying from the # previous version of man(1). case $man_charset in @@ -327,9 +326,20 @@ man_display_page() { *) nroff_dev=ascii ;; esac - NROFF=$NROFF -T$nroff_dev -dlocale=$man_lang.$man_charset + NROFF=$NROFF -T$nroff_dev EQN=$EQN -T$nroff_dev + # Iff the manpage is from the locale and not just the charset, + # then we need to define the locale string. + case ${manpage} in + */${man_lang}_${man_country}.${man_charset}/*) + NROFF=$NROFF -dlocale=$man_lang.$man_charset + ;; + */${man_lang}.${man_charset}/*) + NROFF=$NROFF -dlocale=$man_lang.$man_charset + ;; + esac + # Allow language specific calls to override the default # set of utilities. l=$(echo $man_lang | tr [:lower:] [:upper:]) @@ -557,28 +567,38 @@ man_setup() { # Usage: man_setup_locale # Setup necessary locale variables. man_setup_locale() { + local lang_cc + + locpaths='.' + man_charset='US-ASCII' + # Setup locale information. if [ -n $oflag ]; then - decho Using non-localized manpages - unset use_locale - elif [ -n $LC_ALL ]; then - parse_locale $LC_ALL - elif [ -n $LC_CTYPE ]; then - parse_locale $LC_CTYPE - elif [ -n $LANG ]; then - parse_locale $LANG - fi - - if [ -n $use_locale ]; then - locpaths=${man_lang}_${man_country}.${man_charset} - locpaths=$locpaths:$man_lang.$man_charset - if [ $man_lang != en ]; then - locpaths=$locpaths:en.$man_charset - fi - locpaths=$locpaths:. + decho 'Using non-localized manpages' else - locpaths=. + # Use the locale tool to give us the proper LC_CTYPE + eval $( $LOCALE ) + + case $LC_CTYPE in + C) ;; + POSIX) ;; + [a-z][a-z]_[A-Z][A-Z]\.*) + lang_cc=${LC_CTYPE%.*} + man_lang=${LC_CTYPE%_*} + man_country=${lang_cc#*_} + man_charset=${LC_CTYPE#*.} + locpaths=$LC_CTYPE + locpaths=$locpaths:$man_lang.$man_charset + if [ $man_lang != en ]; then + locpaths=$locpaths:en.$man_charset + fi + locpaths=$locpaths:. + ;; + *) echo 'Unknown locale, assuming C' 2 + ;; + esac fi + decho Using locale paths: $locpaths } @@ -660,28 +680,6 @@ parse_file() { done $file } -# Usage: parse_locale localestring -# Setup locale variables for proper parsing. -parse_locale() { - local lang_cc - - case $1 in - C) ;; - POSIX) ;; - [a-z][a-z]_[A-Z][A-Z]\.*) lang_cc=${1%.*} - man_lang=${1%_*} - man_country=${lang_cc#*_} - man_charset=${1#*.} - use_locale=yes -
svn commit: r217767 - head/usr.sbin/freebsd-update
Author: gordon Date: Mon Jan 24 04:32:59 2011 New Revision: 217767 URL: http://svn.freebsd.org/changeset/base/217767 Log: Honor $PAGER instead of always calling more. Approved by: colin@ MFC after:1 week Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh == --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 24 00:01:06 2011(r217766) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 24 04:32:59 2011(r217767) @@ -1875,7 +1875,7 @@ fetch_create_manifest () { echo -n been downloaded because the files have been echo modified locally: cat modifiedfiles - fi | more + fi | $PAGER rm modifiedfiles # If no files will be updated, tell the user and exit @@ -1905,7 +1905,7 @@ fetch_create_manifest () { echo -n The following files will be removed echo as part of updating to ${RELNUM}-p${RELPATCHNUM}: cat files.removed - fi | more + fi | $PAGER rm files.removed # Report added files, if any @@ -1914,7 +1914,7 @@ fetch_create_manifest () { echo -n The following files will be added echo as part of updating to ${RELNUM}-p${RELPATCHNUM}: cat files.added - fi | more + fi | $PAGER rm files.added # Report updated files, if any @@ -1924,7 +1924,7 @@ fetch_create_manifest () { echo as part of updating to ${RELNUM}-p${RELPATCHNUM}: cat files.updated - fi | more + fi | $PAGER rm files.updated # Create a directory for the install manifest. @@ -3202,6 +3202,11 @@ cmd_IDS () { # Make sure we find utilities from the base system export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PATH} +# Set a pager if the user doesn't +if [ -z $PAGER ]; then + PAGER=/usr/bin/more +fi + # Set LC_ALL in order to avoid problems with character ranges like [A-Z]. export LC_ALL=C ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r216426 - head/usr.bin/man
Author: gordon Date: Tue Dec 14 06:07:18 2010 New Revision: 216426 URL: http://svn.freebsd.org/changeset/base/216426 Log: Move sysctl invocation to using a variable that's fully pathed. This prevents errors for users that don't have /sbin in their PATH. Submitted by: Max Boyarov Approved by: mentor (wes@ implicit) Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh == --- head/usr.bin/man/man.sh Tue Dec 14 05:47:35 2010(r216425) +++ head/usr.bin/man/man.sh Tue Dec 14 06:07:18 2010(r216426) @@ -535,10 +535,10 @@ man_setup() { MACHINE=${mflag##*:} fi if [ -z $MACHINE_ARCH ]; then - MACHINE_ARCH=$(sysctl -n hw.machine_arch) + MACHINE_ARCH=$($SYSCTL -n hw.machine_arch) fi if [ -z $MACHINE ]; then - MACHINE=$(sysctl -n hw.machine) + MACHINE=$($SYSCTL -n hw.machine) fi decho Using architecture: $MACHINE_ARCH:$MACHINE @@ -895,6 +895,7 @@ EQN=/usr/bin/eqn COL=/usr/bin/col NROFF='/usr/bin/groff -S -Wall -mtty-char -man' PIC=/usr/bin/pic +SYSCTL=/sbin/sysctl TBL=/usr/bin/tbl TROFF='/usr/bin/groff -S -man' REFER=/usr/bin/refer ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213644 - head
Author: gordon Date: Sat Oct 9 05:50:04 2010 New Revision: 213644 URL: http://svn.freebsd.org/changeset/base/213644 Log: Add entries to remove manpath.config from etc and the examples directory. Approved by: wes (mentor implicit) Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc == --- head/ObsoleteFiles.inc Sat Oct 9 05:31:08 2010(r213643) +++ head/ObsoleteFiles.inc Sat Oct 9 05:50:04 2010(r213644) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101002: removed manpath.config +OLD_FILES+=etc/manpath.config +OLD_FILES+=usr/share/examples/etc/manpath.config # 20100910: renamed sbuf_overflowed to sbuf_error OLD_FILES+=usr/share/man/man9/sbuf_overflowed.9.gz # 20100815: retired last traces of chooseproc(9) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213645 - head/share/examples/etc
Author: gordon Date: Sat Oct 9 05:57:23 2010 New Revision: 213645 URL: http://svn.freebsd.org/changeset/base/213645 Log: Remove the manpath.config entry now that it's no longer installed. Submitted by: b. f. Approved by: wes (mentor implicit) Modified: head/share/examples/etc/README.examples Modified: head/share/examples/etc/README.examples == --- head/share/examples/etc/README.examples Sat Oct 9 05:50:04 2010 (r213644) +++ head/share/examples/etc/README.examples Sat Oct 9 05:57:23 2010 (r213645) @@ -35,7 +35,6 @@ login.conf- login class capabilities da mac.conf - TrustedBSD MAC userland policy configuration file mail.rc- systemwide initialization files for mail(1) make.conf - example configuration variables for system builds -manpath.config - configuration file for man(1) motd - sample Message of the Day netconfig - network configuration data base netstart - network startup script run from /etc/rc ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213507 - head/usr.bin/man
Author: gordon Date: Thu Oct 7 06:34:47 2010 New Revision: 213507 URL: http://svn.freebsd.org/changeset/base/213507 Log: Add the ability to display specific manual pages if passed on the commandline. This mirrors the old (undocumented) GNU man functionality. Also document this feature in the implementation notes section of the manpage. Submitted by: arundel Approved by: wes (mentor implicit) Modified: head/usr.bin/man/man.1 head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.1 == --- head/usr.bin/man/man.1 Thu Oct 7 00:37:40 2010(r213506) +++ head/usr.bin/man/man.1 Thu Oct 7 06:34:47 2010(r213507) @@ -225,6 +225,13 @@ will search the following paths when con .It .Pa /usr/share/man/man4 .El +.Ss Displaying Specific Manual Files +The +.Nm +utility also supports displaying a specific manual page if passed a path +to the file as long as it contains a +.Sq / +character. .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : Modified: head/usr.bin/man/man.sh == --- head/usr.bin/man/man.sh Thu Oct 7 00:37:40 2010(r213506) +++ head/usr.bin/man/man.sh Thu Oct 7 06:34:47 2010(r213507) @@ -356,6 +356,20 @@ man_display_page() { man_find_and_display() { local found_page locpath p path sect + # Check to see if it's a file. But only if it has a '/' in + # the filename. + case $1 in + */*)if [ -f $1 -a -r $1 ]; then + decho Found a usable page, displaying that + found_page=yes + unset use_cat + manpage=$1 + man_display_page + return + fi + ;; + esac + IFS=: for sect in $MANSECT; do decho Searching section $sect 2 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213470 - head/usr.bin/man
Author: gordon Date: Wed Oct 6 07:22:56 2010 New Revision: 213470 URL: http://svn.freebsd.org/changeset/base/213470 Log: If LANG/LC_CTYPE/LC_ALL is set and the localized man page contains a page also in the base set, the man utility when invoked with -a would display pages for each locale in the same tree: $ LANG=en_GB.ISO8859-15 man -wa man /usr/share/man/en.ISO8859-15/man1/man.1.gz /usr/share/man/man1/man.1.gz /usr/share/man/en.ISO8859-15/man7/man.7.gz /usr/share/man/man7/man.7.gz Use continue to break out of the loop for the current locale. This results in behavior more closely matching the old GNU man implementation: $ LANG=en_GB.ISO8859-15 man -wa man /usr/share/man/en.ISO8859-15/man1/man.1.gz /usr/share/man/en.ISO8859-15/man7/man.7.gz This will still search for a copy of the file in other manual path locations. If there was a /usr/local/man/man1/man.1.gz file, it would still be displayed. This is also consistent with the GNU man implementation. Submitted by: arundel Approved by: wes (mentor implicit) Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh == --- head/usr.bin/man/man.sh Wed Oct 6 04:30:40 2010(r213469) +++ head/usr.bin/man/man.sh Wed Oct 6 07:22:56 2010(r213470) @@ -368,7 +368,9 @@ man_find_and_display() { if find_file $p $sect $MACHINE $1; then found_page=yes man_display_page - if [ -z $aflag ]; then + if [ -n $aflag ]; then + continue 2 + else return fi fi @@ -378,7 +380,9 @@ man_find_and_display() { if find_file $p $sect $MACHINE_ARCH $1; then found_page=yes man_display_page - if [ -z $aflag ]; then + if [ -n $aflag ]; then + continue 2 + else return fi fi @@ -387,7 +391,9 @@ man_find_and_display() { if find_file $p $sect '' $1; then found_page=yes man_display_page - if [ -z $aflag ]; then + if [ -n $aflag ]; then + continue 2 + else return fi fi ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213454 - head/usr.bin/man
Author: gordon Date: Tue Oct 5 16:14:08 2010 New Revision: 213454 URL: http://svn.freebsd.org/changeset/base/213454 Log: Add reference to intro(1) in SEE ALSO section. PR: docs/151216 Approved by: wes (mentor, implicit) Modified: head/usr.bin/man/man.1 Modified: head/usr.bin/man/man.1 == --- head/usr.bin/man/man.1 Tue Oct 5 15:40:59 2010(r213453) +++ head/usr.bin/man/man.1 Tue Oct 5 16:14:08 2010(r213454) @@ -290,6 +290,7 @@ System configuration file. Local configuration files. .El .Sh SEE ALSO +.Xr intro 1 , .Xr apropos 1 , .Xr locale 1 , .Xr manpath 1 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213404 - head
Author: gordon Date: Mon Oct 4 15:39:53 2010 New Revision: 213404 URL: http://svn.freebsd.org/changeset/base/213404 Log: Add updating entry for manpath.config deprecation. Approved by: wes (mentor) Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Mon Oct 4 15:28:01 2010(r213403) +++ head/UPDATING Mon Oct 4 15:39:53 2010(r213404) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20101002: + The man(1) utility has been replaced by a new version that no longer + uses /etc/manpath.config. Please consult man.conf(5) for how to + migrate local entries to the new format. + 20100915: A workaround for a fixed ld bug has been removed in kernel code, so make sure that your system ld is built from sources after ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213391 - in head: gnu/usr.bin usr.bin
Author: gordon Date: Sun Oct 3 22:24:14 2010 New Revision: 213391 URL: http://svn.freebsd.org/changeset/base/213391 Log: Retire GNU man in favor of the newly written BSDL version. Approved by: wes (mentor) Modified: head/gnu/usr.bin/Makefile head/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile == --- head/gnu/usr.bin/Makefile Sun Oct 3 21:56:20 2010(r213390) +++ head/gnu/usr.bin/Makefile Sun Oct 3 22:24:14 2010(r213391) @@ -13,7 +13,6 @@ SUBDIR= ${_binutils} \ ${_gperf} \ ${_grep} \ ${_groff} \ - ${_man} \ patch \ ${_rcs} \ sdiff \ @@ -44,10 +43,6 @@ _dtc=dtc _texinfo= texinfo .endif -.if ${MK_MAN_UTILS} != no -_man= man -.endif - .if ${MK_RCS} != no _rcs= rcs .endif Modified: head/usr.bin/Makefile == --- head/usr.bin/Makefile Sun Oct 3 21:56:20 2010(r213390) +++ head/usr.bin/Makefile Sun Oct 3 22:24:14 2010(r213391) @@ -5,7 +5,7 @@ # XXX MISSING: deroff diction graph learn plot # spell spline struct xsend -# XXX Use GNU versions: apropos diff ld man patch whatis +# XXX Use GNU versions: diff ld patch # Moved to secure: bdes # @@ -94,6 +94,7 @@ SUBDIR= alias \ lzmainfo \ m4 \ ${_makewhatis} \ + ${_man} \ mesg \ minigzip \ ministat \ @@ -266,6 +267,7 @@ SUBDIR+=make .if ${MK_MAN_UTILS} != no _makewhatis= makewhatis +_man= man .endif .if ${MK_NETCAT} != no ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213394 - head/etc
Author: gordon Date: Mon Oct 4 01:07:04 2010 New Revision: 213394 URL: http://svn.freebsd.org/changeset/base/213394 Log: No longer install /etc/manpath.config since the BSDL man utilities don't use it. Approved by: wes (mentor) Modified: head/etc/Makefile Modified: head/etc/Makefile == --- head/etc/Makefile Sun Oct 3 23:43:23 2010(r213393) +++ head/etc/Makefile Mon Oct 4 01:07:04 2010(r213394) @@ -68,10 +68,6 @@ BIN1+= hosts.lpd printcap BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc .endif -.if ${MK_MAN_UTILS} != no -BIN1+= ${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config -.endif - .if ${MK_NTP} != no BIN1+= ntp.conf .endif ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213395 - head/sys/sys
Author: gordon Date: Mon Oct 4 01:08:31 2010 New Revision: 213395 URL: http://svn.freebsd.org/changeset/base/213395 Log: Bump __FreeBSD_version for switch from GNU man to BSDL man. Approved by: wes (mentor) Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hMon Oct 4 01:07:04 2010(r213394) +++ head/sys/sys/param.hMon Oct 4 01:08:31 2010(r213395) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900021 /* Master, propagated to newvers */ +#define __FreeBSD_version 900022 /* Master, propagated to newvers */ #ifndef LOCORE #include sys/types.h ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213349 - head/usr.bin/man
Author: gordon Date: Sat Oct 2 06:55:04 2010 New Revision: 213349 URL: http://svn.freebsd.org/changeset/base/213349 Log: Fix up whatis/apropos issue displaying all output on a single due to forgotten quotes. Submitted by: Brandon Gooch Approved by: wes (mentor, implicit) Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh == --- head/usr.bin/man/man.sh Sat Oct 2 06:54:59 2010(r213348) +++ head/usr.bin/man/man.sh Sat Oct 2 06:55:04 2010(r213349) @@ -719,11 +719,11 @@ search_whatis() { bad=${bad#\\n} if [ -n $good ]; then - echo -e $good | $PAGER + echo -e $good | $PAGER fi if [ -n $bad ]; then - echo -e $bad 2 + echo -e $bad 2 fi exit $rval ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r213317 - head/usr.bin/man
Author: gordon Date: Fri Oct 1 03:59:18 2010 New Revision: 213317 URL: http://svn.freebsd.org/changeset/base/213317 Log: Implementaiton of man, manpath, whatis, and apropos written entirely in sh. Features of this new version in favor of the old one: BSD licensed -- old one is GPL. Imports configuration from /etc/man.conf and LOCALBASE/etc/man.d/*.conf allowing ports to extend the base functionality. The pluggable configuration can supplement the manual search path (retiring use.perl), add locales, and override language specific toolsets (attempt to merge the japanese/man port into the base system as much as possible). Much effort has been made to make this version mirror the functionality of the existing implementation. For 99% of users, it should be a drop in replacement. PR: gnu/143271, gnu/4419 Reviewed by: dougb (previous versions) Approved by: wes (mentor) Added: head/usr.bin/man/ head/usr.bin/man/Makefile (contents, props changed) head/usr.bin/man/apropos.1 (contents, props changed) head/usr.bin/man/man.1 (contents, props changed) head/usr.bin/man/man.conf.5 (contents, props changed) head/usr.bin/man/man.sh (contents, props changed) head/usr.bin/man/manpath.1 (contents, props changed) Added: head/usr.bin/man/Makefile == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/man/Makefile Fri Oct 1 03:59:18 2010(r213317) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +SCRIPTS= man.sh +LINKS= ${BINDIR}/man ${BINDIR}/apropos \ + ${BINDIR}/man ${BINDIR}/manpath \ + ${BINDIR}/man ${BINDIR}/whatis + +MAN= man.1 manpath.1 apropos.1 man.conf.5 +MLINKS=apropos.1 whatis.1 + +.include bsd.prog.mk Added: head/usr.bin/man/apropos.1 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/man/apropos.1 Fri Oct 1 03:59:18 2010(r213317) @@ -0,0 +1,88 @@ +.\- +.\ Copyright (c) 2010 Gordon Tetlow +.\ All rights reserved. +.\ +.\ Redistribution and use in source and binary forms, with or without +.\ modification, are permitted provided that the following conditions +.\ are met: +.\ 1. Redistributions of source code must retain the above copyright +.\ notice, this list of conditions and the following disclaimer. +.\ 2. Redistributions in binary form must reproduce the above copyright +.\ notice, this list of conditions and the following disclaimer in the +.\ documentation and/or other materials provided with the distribution. +.\ +.\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\ SUCH DAMAGE. +.\ +.\ $FreeBSD$ +.\ +.Dd September 1, 2010 +.Dt APROPOS 1 +.Os +.Sh NAME +.Nm apropos , +.Nm whatis +.Nd keyword search whatis documentation databases +.Sh SYNOPSIS +.Nm +.Op Fl d +.Ar keyword ... +.Nm whatis +.Op Fl d +.Ar keyword ... +.Sh DESCRIPTION +The +.Nm +utility searches a set of databases looking for documentation matching each +.Ar keyword +and displays the results. +The +.Nm whatis +utility does the same search but only on complete words. +.Bl -tag -width .Fl d +.It Fl d +Print extra debugging information. +.El +.Pp +The +.Ar keyword +is simply passed to +.Xr grep 1 +allowing for extended regular expression matches. +.Sh ENVIRONMENT +The following environment variables affect the execution of +.Nm : +.Bl -tag -width .Ev PAGER +.It Ev MANLOCALES , MANPATH , PATH +Used to find the location of the +.Nm whatis +database files. See +.Xr manpath 1 +for additional information. +.It Ev PAGER +Program used to display files. +If unset, +.Ic more -s +is used. +.El +.Sh DIAGNOSTICS +The +.Nm +utility exits 0 if a keyword matched and 1 if no keywords are matched or no +.Nm whatis +databases are found. +.Sh SEE ALSO +.Xr grep 1 , +.Xr makewhatis 1 , +.Xr man 1 , +.Xr manpath 1 , +.Xr man.conf 5 Added: head/usr.bin/man/man.1 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/man/man.1 Fri Oct 1 03:59:18 2010(r213317) @@ -0,0 +1,299 @@ +.\- +.\ Copyright
svn commit: r208648 - head/usr.sbin/newsyslog
Author: gordon Date: Sat May 29 22:52:17 2010 New Revision: 208648 URL: http://svn.freebsd.org/changeset/base/208648 Log: Convert newsyslog to using queue(3) macros instead of a home rolled version. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after:2 months Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Sat May 29 20:24:01 2010 (r208647) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:52:17 2010 (r208648) @@ -113,6 +113,7 @@ __FBSDID($FreeBSD$); #defineDEBUG_MARKERdebug struct conf_entry { + STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ char *pid_file; /* PID file */ char *r_reason; /* The reason this file is being rotated */ @@ -129,7 +130,6 @@ struct conf_entry { int flags; /* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */ int sig;/* Signal to send */ int def_cfg;/* Using the default rule for this file */ - struct conf_entry *next;/* Linked list pointer */ }; struct sigwork_entry { @@ -153,6 +153,7 @@ typedef enum { FREE_ENT, KEEP_ENT } fk_entry; +STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); @@ -186,9 +187,9 @@ char daytime[DAYTIME_LEN]; /* The curren * used for rotation-tracking messages. */ char hostname[MAXHOSTNAMELEN]; /* hostname */ -static struct conf_entry *get_worklist(char **files); -static void parse_file(FILE *cf, const char *cfname, struct conf_entry **work_p, - struct conf_entry **glob_p, struct conf_entry **defconf_p); +static struct cflist *get_worklist(char **files); +static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, + struct conf_entry *defconf_p); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); @@ -205,9 +206,8 @@ static struct zipwork_entry * sigwork_entry *, int, const char *); static void set_swpid(struct sigwork_entry *, const struct conf_entry *); static int sizefile(const char *); -static void expand_globs(struct conf_entry **work_p, - struct conf_entry **glob_p); -static void free_clist(struct conf_entry **firstent); +static void expand_globs(struct cflist *work_p, struct cflist *glob_p); +static void free_clist(struct cflist *list); static void free_entry(struct conf_entry *ent); static struct conf_entry *init_entry(const char *fname, struct conf_entry *src_entry); @@ -233,8 +233,8 @@ static void createlog(const struct conf_ int main(int argc, char **argv) { - fk_entry free_or_keep; - struct conf_entry *p, *q; + struct cflist *worklist; + struct conf_entry *p; struct sigwork_entry *stmp; struct zipwork_entry *ztmp; @@ -247,18 +247,17 @@ main(int argc, char **argv) if (needroot getuid() geteuid()) errx(1, must have root privs); - p = q = get_worklist(argv); + worklist = get_worklist(argv); /* * Rotate all the files which need to be rotated. Note that * some users have *hundreds* of entries in newsyslog.conf! */ - while (p) { - free_or_keep = do_entry(p); - p = p-next; - if (free_or_keep == FREE_ENT) - free_entry(q); - q = p; + while (!STAILQ_EMPTY(worklist)) { + p = STAILQ_FIRST(worklist); + STAILQ_REMOVE_HEAD(worklist, cf_nextp); + if (do_entry(p) == FREE_ENT) + free_entry(p); } /* @@ -365,7 +364,6 @@ init_entry(const char *fname, struct con tempwork-sig = SIGHUP; tempwork-def_cfg = 0; } - tempwork-next = NULL; return (tempwork); } @@ -403,21 +401,18 @@ free_entry(struct conf_entry *ent) } static void -free_clist(struct conf_entry **firstent) +free_clist(struct cflist *list) { - struct conf_entry *ent, *nextent; - - if (firstent == NULL) - return; /* There is nothing to do. */ + struct conf_entry *ent; - ent = *firstent; - firstent = NULL; - - while (ent) { - nextent = ent-next; + while (!STAILQ_EMPTY(list)) { + ent = STAILQ_FIRST(list); + STAILQ_REMOVE_HEAD(list, cf_nextp); free_entry(ent); - ent = nextent; } + + free(list); + list = NULL; } static fk_entry @@ -732,17 +727,26 @@ usage(void) * Parse a configuration file and
svn commit: r208649 - head/usr.sbin/newsyslog
Author: gordon Date: Sat May 29 22:55:59 2010 New Revision: 208649 URL: http://svn.freebsd.org/changeset/base/208649 Log: Add file include processing for newsyslog. Format for the include line in /etc/newsyslog.conf is: include /etc/defaults/newsyslog.conf Other notes of interest: Globbing is supported in include statements. Properly detect circular include loop dependencies. Reviewed by: gad@ Approved by: wes@ (mentor) MFC after:2 months Modified: head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.c == --- head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:52:17 2010 (r208648) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 29 22:55:59 2010 (r208649) @@ -111,6 +111,7 @@ __FBSDID($FreeBSD$); #defineDEFAULT_MARKER default #defineDEBUG_MARKERdebug +#defineINCLUDE_MARKER include struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; @@ -149,6 +150,11 @@ struct zipwork_entry { char zw_fname[1]; /* the file to compress */ }; +struct include_entry { + STAILQ_ENTRY(include_entry) inc_nextp; + const char *file; /* Name of file to process */ +}; + typedef enum { FREE_ENT, KEEP_ENT } fk_entry; @@ -156,6 +162,7 @@ typedef enum { STAILQ_HEAD(cflist, conf_entry); SLIST_HEAD(swlisthead, sigwork_entry) swhead = SLIST_HEAD_INITIALIZER(swhead); SLIST_HEAD(zwlisthead, zipwork_entry) zwhead = SLIST_HEAD_INITIALIZER(zwhead); +STAILQ_HEAD(ilist, include_entry); int dbg_at_times; /* -D Show details of 'trim_at' code */ @@ -189,10 +196,12 @@ char hostname[MAXHOSTNAMELEN];/* hostna static struct cflist *get_worklist(char **files); static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, - struct conf_entry *defconf_p); + struct conf_entry *defconf_p, struct ilist *inclist); +static void add_to_queue(const char *fname, struct ilist *inclist); static char *sob(char *p); static char *son(char *p); static int isnumberstr(const char *); +static int isglobstr(const char *); static char *missing_field(char *p, char *errline); static void change_attrs(const char *, const struct conf_entry *); static fk_entry do_entry(struct conf_entry *); @@ -731,13 +740,15 @@ static struct cflist * get_worklist(char **files) { FILE *f; - const char *fname; char **given; - struct cflist *filelist, *globlist, *cmdlist; + struct cflist *cmdlist, *filelist, *globlist; struct conf_entry *defconf, *dupent, *ent; + struct ilist inclist; + struct include_entry *inc; int gmatch, fnres; defconf = NULL; + STAILQ_INIT(inclist); filelist = malloc(sizeof(struct cflist)); if (filelist == NULL) @@ -748,21 +759,29 @@ get_worklist(char **files) err(1, malloc of globlist); STAILQ_INIT(globlist); - fname = conf; - if (fname == NULL) - fname = _PATH_CONF; + inc = malloc(sizeof(struct include_entry)); + if (inc == NULL) + err(1, malloc of inc); + inc-file = conf; + if (inc-file == NULL) + inc-file = _PATH_CONF; + STAILQ_INSERT_TAIL(inclist, inc, inc_nextp); + + STAILQ_FOREACH(inc, inclist, inc_nextp) { + if (strcmp(inc-file, -) != 0) + f = fopen(inc-file, r); + else { + f = stdin; + inc-file = stdin; + } + if (!f) + err(1, %s, inc-file); - if (strcmp(fname, -) != 0) - f = fopen(fname, r); - else { - f = stdin; - fname = stdin; + if (verbose) + printf(Processing %s\n, inc-file); + parse_file(f, filelist, globlist, defconf, inclist); + (void) fclose(f); } - if (!f) - err(1, %s, fname); - - parse_file(f, filelist, globlist, defconf); - (void) fclose(f); /* * All config-file information has been read in and turned into @@ -965,14 +984,16 @@ expand_globs(struct cflist *work_p, stru */ static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p, -struct conf_entry *defconf_p) +struct conf_entry *defconf_p, struct ilist *inclist) { char line[BUFSIZ], *parse, *q; char *cp, *errline, *group; struct conf_entry *working; struct passwd *pwd; struct group *grp; + glob_t pglob; int eol, ptm_opts, res, special; + size_t i; errline = NULL; while (fgets(line, BUFSIZ, cf)) { @@ -1017,6 +1038,37 @@ parse_file(FILE *cf, struct cflist *work