diff options
author | dim <dim@FreeBSD.org> | 2015-10-01 19:02:45 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-10-01 19:02:45 +0000 |
commit | c88ca1c4064bdfc5aa9a040453a2bedcab5563cf (patch) | |
tree | 65e063ba4063b01c208d44deddda2fe59ac5f224 /lib | |
parent | d3edc9664e05776279ed8ad8a20ad14cdd579030 (diff) | |
parent | e6448d3ce04113fa55305f4d9b53a92f11189be6 (diff) | |
download | FreeBSD-src-c88ca1c4064bdfc5aa9a040453a2bedcab5563cf.zip FreeBSD-src-c88ca1c4064bdfc5aa9a040453a2bedcab5563cf.tar.gz |
Merge ^/head r288197 through r288456.
Diffstat (limited to 'lib')
91 files changed, 266 insertions, 235 deletions
diff --git a/lib/clang/include/Makefile b/lib/clang/include/Makefile index 7f639b5..1cea2e2 100644 --- a/lib/clang/include/Makefile +++ b/lib/clang/include/Makefile @@ -65,7 +65,7 @@ INCS= __stddef_max_align_t.h \ xtestintrin.h \ ${GENINCS} GENINCS= arm_neon.h -CLEANFILES= ${GENINCS} +CLEANFILES= ${GENINCS} ${GENINCS:C/\.h$/.d/} # avoid a circular dependency GENDIRDEPS_FILTER+= Nusr.bin/clang/clang-tblgen.host diff --git a/lib/clang/libllvminterpreter/Makefile.depend b/lib/clang/libllvminterpreter/Makefile.depend index 4fc7d45..ff32938 100644 --- a/lib/clang/libllvminterpreter/Makefile.depend +++ b/lib/clang/libllvminterpreter/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ include \ include/xlocale \ diff --git a/lib/csu/arm/Makefile.depend b/lib/csu/arm/Makefile.depend index e8d7c61..79506ce 100644 --- a/lib/csu/arm/Makefile.depend +++ b/lib/csu/arm/Makefile.depend @@ -1,10 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - -DEP_MACHINE := ${.PARSEFILE:E} - DIRDEPS = \ include \ diff --git a/lib/csu/arm/crti.S b/lib/csu/arm/crti.S index 40e83bb..c6c37eb 100644 --- a/lib/csu/arm/crti.S +++ b/lib/csu/arm/crti.S @@ -19,3 +19,4 @@ _fini: stmdb sp!, {fp, ip, lr, pc} sub fp, ip, #4 + .section .note.GNU-stack,"",%progbits diff --git a/lib/csu/arm/crtn.S b/lib/csu/arm/crtn.S index 962f0ed..25bbd57 100644 --- a/lib/csu/arm/crtn.S +++ b/lib/csu/arm/crtn.S @@ -8,3 +8,5 @@ __FBSDID("$FreeBSD$"); .section .fini,"ax",%progbits ldmea fp, {fp, sp, pc} mov pc, lr + + .section .note.GNU-stack,"",%progbits diff --git a/lib/csu/i386/Makefile.depend b/lib/csu/i386/Makefile.depend index 76d719e..79506ce 100644 --- a/lib/csu/i386/Makefile.depend +++ b/lib/csu/i386/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ include \ diff --git a/lib/csu/mips/Makefile.depend b/lib/csu/mips/Makefile.depend index e8d7c61..79506ce 100644 --- a/lib/csu/mips/Makefile.depend +++ b/lib/csu/mips/Makefile.depend @@ -1,10 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - -DEP_MACHINE := ${.PARSEFILE:E} - DIRDEPS = \ include \ diff --git a/lib/csu/powerpc/Makefile.depend b/lib/csu/powerpc/Makefile.depend index e8d7c61..79506ce 100644 --- a/lib/csu/powerpc/Makefile.depend +++ b/lib/csu/powerpc/Makefile.depend @@ -1,10 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - -DEP_MACHINE := ${.PARSEFILE:E} - DIRDEPS = \ include \ diff --git a/lib/csu/powerpc64/Makefile.depend b/lib/csu/powerpc64/Makefile.depend index e8d7c61..79506ce 100644 --- a/lib/csu/powerpc64/Makefile.depend +++ b/lib/csu/powerpc64/Makefile.depend @@ -1,10 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - -DEP_MACHINE := ${.PARSEFILE:E} - DIRDEPS = \ include \ diff --git a/lib/csu/sparc64/Makefile.depend b/lib/csu/sparc64/Makefile.depend index e8d7c61..79506ce 100644 --- a/lib/csu/sparc64/Makefile.depend +++ b/lib/csu/sparc64/Makefile.depend @@ -1,10 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - -DEP_MACHINE := ${.PARSEFILE:E} - DIRDEPS = \ include \ diff --git a/lib/libblocksruntime/Makefile.depend b/lib/libblocksruntime/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libblocksruntime/Makefile.depend +++ b/lib/libblocksruntime/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libc/arm/aeabi/aeabi_asm_double.S b/lib/libc/arm/aeabi/aeabi_asm_double.S index 7a5af82..ced4d78 100644 --- a/lib/libc/arm/aeabi/aeabi_asm_double.S +++ b/lib/libc/arm/aeabi/aeabi_asm_double.S @@ -117,3 +117,5 @@ ENTRY(__aeabi_cdcmpeq) msr cpsr_c, ip RET END(__aeabi_cdcmpeq) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/aeabi/aeabi_asm_float.S b/lib/libc/arm/aeabi/aeabi_asm_float.S index e05daa5..de6b1c8 100644 --- a/lib/libc/arm/aeabi/aeabi_asm_float.S +++ b/lib/libc/arm/aeabi/aeabi_asm_float.S @@ -108,3 +108,5 @@ ENTRY(__aeabi_cfcmpeq) msr cpsr_c, ip RET END(__aeabi_cfcmpeq) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/aeabi/aeabi_vfp_double.S b/lib/libc/arm/aeabi/aeabi_vfp_double.S index aae49f8..be4309d 100644 --- a/lib/libc/arm/aeabi/aeabi_vfp_double.S +++ b/lib/libc/arm/aeabi/aeabi_vfp_double.S @@ -201,3 +201,4 @@ AEABI_ENTRY(dsub) RET AEABI_END(dsub) + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/aeabi/aeabi_vfp_float.S b/lib/libc/arm/aeabi/aeabi_vfp_float.S index 7de8daf..c9df41c 100644 --- a/lib/libc/arm/aeabi/aeabi_vfp_float.S +++ b/lib/libc/arm/aeabi/aeabi_vfp_float.S @@ -188,3 +188,4 @@ AEABI_ENTRY(fsub) RET AEABI_END(fsub) + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/__aeabi_read_tp.S b/lib/libc/arm/gen/__aeabi_read_tp.S index 670d0b8..224d6a6 100644 --- a/lib/libc/arm/gen/__aeabi_read_tp.S +++ b/lib/libc/arm/gen/__aeabi_read_tp.S @@ -45,3 +45,4 @@ END(__aeabi_read_tp) .word ARM_TP_ADDRESS #endif + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/_ctx_start.S b/lib/libc/arm/gen/_ctx_start.S index 41bfff9..faedfb5 100644 --- a/lib/libc/arm/gen/_ctx_start.S +++ b/lib/libc/arm/gen/_ctx_start.S @@ -8,3 +8,5 @@ ENTRY(_ctx_start) bl _C_LABEL(ctx_done) bl _C_LABEL(abort) END(_ctx_start) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S index 853f61c..e3c67fa 100644 --- a/lib/libc/arm/gen/_setjmp.S +++ b/lib/libc/arm/gen/_setjmp.S @@ -157,3 +157,5 @@ botch: b . #endif END(_longjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/alloca.S b/lib/libc/arm/gen/alloca.S index e4a73d4..2539b7a 100644 --- a/lib/libc/arm/gen/alloca.S +++ b/lib/libc/arm/gen/alloca.S @@ -44,3 +44,5 @@ ENTRY(alloca) mov r0, sp /* r0 = base of new space */ RET END(alloca) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/divsi3.S b/lib/libc/arm/gen/divsi3.S index 82de5de..fac0663 100644 --- a/lib/libc/arm/gen/divsi3.S +++ b/lib/libc/arm/gen/divsi3.S @@ -389,3 +389,5 @@ ENTRY(__divsi3) mov r0, r3 RET END(__divsi3) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S index c9ae329..4e3850d 100644 --- a/lib/libc/arm/gen/setjmp.S +++ b/lib/libc/arm/gen/setjmp.S @@ -158,3 +158,5 @@ ENTRY(__longjmp) bl PIC_SYM(_C_LABEL(abort), PLT) 1: b 1b /* Cannot get here */ END(__longjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/gen/sigsetjmp.S b/lib/libc/arm/gen/sigsetjmp.S index 3743e89..236f531 100644 --- a/lib/libc/arm/gen/sigsetjmp.S +++ b/lib/libc/arm/gen/sigsetjmp.S @@ -66,3 +66,5 @@ ENTRY(siglongjmp) beq PIC_SYM(_C_LABEL(_longjmp), PLT) b PIC_SYM(_C_LABEL(longjmp), PLT) END(siglongjmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S index cc7f396..0ed8152 100644 --- a/lib/libc/arm/string/ffs.S +++ b/lib/libc/arm/string/ffs.S @@ -84,3 +84,5 @@ ENTRY(ffs) RET #endif END(ffs) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/memcmp.S b/lib/libc/arm/string/memcmp.S index 6fd8130..33a11b7 100644 --- a/lib/libc/arm/string/memcmp.S +++ b/lib/libc/arm/string/memcmp.S @@ -181,3 +181,5 @@ ENTRY(memcmp) RET #endif END(memcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/memcpy_arm.S b/lib/libc/arm/string/memcpy_arm.S index 56fb703..57b0449 100644 --- a/lib/libc/arm/string/memcpy_arm.S +++ b/lib/libc/arm/string/memcpy_arm.S @@ -334,3 +334,5 @@ ENTRY(memcpy) sub r1, r1, #1 b .Lmemcpy_l4 END(memcpy) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/memcpy_xscale.S b/lib/libc/arm/string/memcpy_xscale.S index a451de4..ab01544 100644 --- a/lib/libc/arm/string/memcpy_xscale.S +++ b/lib/libc/arm/string/memcpy_xscale.S @@ -1784,3 +1784,5 @@ ENTRY(memcpy) bx lr #endif /* !_STANDALONE */ END(memcpy) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/memmove.S b/lib/libc/arm/string/memmove.S index 2cd5a5e..8f96147 100644 --- a/lib/libc/arm/string/memmove.S +++ b/lib/libc/arm/string/memmove.S @@ -609,3 +609,5 @@ END(memmove) #else END(bcopy) #endif + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S index 6d76901..96d2f93 100644 --- a/lib/libc/arm/string/memset.S +++ b/lib/libc/arm/string/memset.S @@ -263,3 +263,5 @@ END(bzero) #else END(memset) #endif + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/strcmp.S b/lib/libc/arm/string/strcmp.S index d610fea..1cdce8b 100644 --- a/lib/libc/arm/string/strcmp.S +++ b/lib/libc/arm/string/strcmp.S @@ -43,3 +43,5 @@ ENTRY(strcmp) sub r0, r2, r3 RET END(strcmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/strlen.S b/lib/libc/arm/string/strlen.S index c9334f9..240fa7d 100644 --- a/lib/libc/arm/string/strlen.S +++ b/lib/libc/arm/string/strlen.S @@ -83,3 +83,5 @@ ENTRY(strlen) mov r0, r1 RET END(strlen) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/string/strncmp.S b/lib/libc/arm/string/strncmp.S index a5c0320..affcaa0 100644 --- a/lib/libc/arm/string/strncmp.S +++ b/lib/libc/arm/string/strncmp.S @@ -56,3 +56,5 @@ ENTRY(strncmp) sub r0, r2, r3 RET END(strncmp) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/Ovfork.S b/lib/libc/arm/sys/Ovfork.S index 4520e02..73c619e 100644 --- a/lib/libc/arm/sys/Ovfork.S +++ b/lib/libc/arm/sys/Ovfork.S @@ -53,3 +53,5 @@ ENTRY(vfork) and r0, r0, r1 /* r0 == 0 if child, else unchanged */ mov r15, r2 END(vfork) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/brk.S b/lib/libc/arm/sys/brk.S index e5f8336..bf1b4fb 100644 --- a/lib/libc/arm/sys/brk.S +++ b/lib/libc/arm/sys/brk.S @@ -91,3 +91,5 @@ ENTRY(_brk) .Lcurbrk: .word PIC_SYM(CURBRK, GOT) END(_brk) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/cerror.S b/lib/libc/arm/sys/cerror.S index 26f5211..5fad698 100644 --- a/lib/libc/arm/sys/cerror.S +++ b/lib/libc/arm/sys/cerror.S @@ -47,3 +47,5 @@ ASENTRY(CERROR) mvn r1, #0x00000000 ldmfd sp!, {r4, pc} END(CERROR) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/pipe.S b/lib/libc/arm/sys/pipe.S index 77ce0fc..778e923 100644 --- a/lib/libc/arm/sys/pipe.S +++ b/lib/libc/arm/sys/pipe.S @@ -49,3 +49,5 @@ ENTRY(_pipe) mov r0, #0x00000000 RET END(_pipe) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/ptrace.S b/lib/libc/arm/sys/ptrace.S index 876da32..dade223 100644 --- a/lib/libc/arm/sys/ptrace.S +++ b/lib/libc/arm/sys/ptrace.S @@ -47,3 +47,5 @@ ENTRY(ptrace) bcs PIC_SYM(CERROR, PLT) RET END(ptrace) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/sbrk.S b/lib/libc/arm/sys/sbrk.S index 5cd9a03..25622c4 100644 --- a/lib/libc/arm/sys/sbrk.S +++ b/lib/libc/arm/sys/sbrk.S @@ -78,3 +78,5 @@ ENTRY(_sbrk) .Lcurbrk: .word PIC_SYM(CURBRK, GOT) END(_sbrk) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/shmat.S b/lib/libc/arm/sys/shmat.S index 3fc3d02..3574b1d 100644 --- a/lib/libc/arm/sys/shmat.S +++ b/lib/libc/arm/sys/shmat.S @@ -5,3 +5,5 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" RSYSCALL(shmat) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/sigreturn.S b/lib/libc/arm/sys/sigreturn.S index 1e0f245..c377e4a 100644 --- a/lib/libc/arm/sys/sigreturn.S +++ b/lib/libc/arm/sys/sigreturn.S @@ -40,3 +40,5 @@ __FBSDID("$FreeBSD$"); */ RSYSCALL(sigreturn) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/arm/sys/syscall.S b/lib/libc/arm/sys/syscall.S index 73e6b83..c88d1ae 100644 --- a/lib/libc/arm/sys/syscall.S +++ b/lib/libc/arm/sys/syscall.S @@ -36,3 +36,5 @@ __FBSDID("$FreeBSD$"); #include "SYS.h" RSYSCALL(syscall) + + .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index 173592a..2f240a8 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -87,11 +87,14 @@ static int fnmatch1(const char *pattern, const char *string, const char *stringstart, int flags, mbstate_t patmbs, mbstate_t strmbs) { + const char *bt_pattern, *bt_string; + mbstate_t bt_patmbs, bt_strmbs; char *newp; char c; wchar_t pc, sc; size_t pclen, sclen; + bt_pattern = bt_string = NULL; for (;;) { pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs); if (pclen == (size_t)-1 || pclen == (size_t)-2) @@ -107,16 +110,18 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart, case EOS: if ((flags & FNM_LEADING_DIR) && sc == '/') return (0); - return (sc == EOS ? 0 : FNM_NOMATCH); + if (sc == EOS) + return (0); + goto backtrack; case '?': if (sc == EOS) return (FNM_NOMATCH); if (sc == '/' && (flags & FNM_PATHNAME)) - return (FNM_NOMATCH); + goto backtrack; if (sc == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) - return (FNM_NOMATCH); + goto backtrack; string += sclen; break; case '*': @@ -128,7 +133,7 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart, if (sc == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) - return (FNM_NOMATCH); + goto backtrack; /* Optimize for pattern with * at end or before /. */ if (c == EOS) @@ -144,33 +149,24 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart, break; } - /* General case, use recursion. */ - while (sc != EOS) { - if (!fnmatch1(pattern, string, stringstart, - flags, patmbs, strmbs)) - return (0); - sclen = mbrtowc(&sc, string, MB_LEN_MAX, - &strmbs); - if (sclen == (size_t)-1 || - sclen == (size_t)-2) { - sc = (unsigned char)*string; - sclen = 1; - memset(&strmbs, 0, sizeof(strmbs)); - } - if (sc == '/' && flags & FNM_PATHNAME) - break; - string += sclen; - } - return (FNM_NOMATCH); + /* + * First try the shortest match for the '*' that + * could work. We can forget any earlier '*' since + * there is no way having it match more characters + * can help us, given that we are already here. + */ + bt_pattern = pattern, bt_patmbs = patmbs; + bt_string = string, bt_strmbs = strmbs; + break; case '[': if (sc == EOS) return (FNM_NOMATCH); if (sc == '/' && (flags & FNM_PATHNAME)) - return (FNM_NOMATCH); + goto backtrack; if (sc == '.' && (flags & FNM_PERIOD) && (string == stringstart || ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) - return (FNM_NOMATCH); + goto backtrack; switch (rangematch(pattern, sc, flags, &newp, &patmbs)) { @@ -180,7 +176,7 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart, pattern = newp; break; case RANGE_NOMATCH: - return (FNM_NOMATCH); + goto backtrack; } string += sclen; break; @@ -195,14 +191,39 @@ fnmatch1(const char *pattern, const char *string, const char *stringstart, /* FALLTHROUGH */ default: norm: + string += sclen; if (pc == sc) ; else if ((flags & FNM_CASEFOLD) && (towlower(pc) == towlower(sc))) ; - else - return (FNM_NOMATCH); - string += sclen; + else { + backtrack: + /* + * If we have a mismatch (other than hitting + * the end of the string), go back to the last + * '*' seen and have it match one additional + * character. + */ + if (bt_pattern == NULL) + return (FNM_NOMATCH); + sclen = mbrtowc(&sc, bt_string, MB_LEN_MAX, + &bt_strmbs); + if (sclen == (size_t)-1 || + sclen == (size_t)-2) { + sc = (unsigned char)*bt_string; + sclen = 1; + memset(&bt_strmbs, 0, + sizeof(bt_strmbs)); + } + if (sc == EOS) + return (FNM_NOMATCH); + if (sc == '/' && flags & FNM_PATHNAME) + return (FNM_NOMATCH); + bt_string += sclen; + pattern = bt_pattern, patmbs = bt_patmbs; + string = bt_string, strmbs = bt_strmbs; + } break; } } diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 313431a..51b6c26 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -137,9 +137,8 @@ __fts_open_44bsd(char * const *argv, int options, } /* Allocate/initialize the stream. */ - if ((priv = malloc(sizeof(*priv))) == NULL) + if ((priv = calloc(1, sizeof(*priv))) == NULL) return (NULL); - memset(priv, 0, sizeof(*priv)); sp = &priv->ftsp_fts; sp->fts_compar = compar; sp->fts_options = options; diff --git a/lib/libc/gen/wordexp.3 b/lib/libc/gen/wordexp.3 index 2fc20ef..dd4605f 100644 --- a/lib/libc/gen/wordexp.3 +++ b/lib/libc/gen/wordexp.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2015 +.Dd September 30, 2015 .Dt WORDEXP 3 .Os .Sh NAME @@ -108,8 +108,9 @@ function frees the memory allocated by .Sh IMPLEMENTATION NOTES The .Fn wordexp -function is implemented by executing -.Xr sh 1 . +function is implemented using the undocumented +.Ic freebsd_wordexp +shell built-in command. .Sh RETURN VALUES The .Fn wordexp @@ -191,18 +192,19 @@ and functions conform to .St -p1003.1-2001 . .Sh BUGS -Do not pass untrusted user data to -.Fn wordexp , -regardless of whether the -.Dv WRDE_NOCMD -flag is set. -The -.Fn wordexp -function attempts to detect input that would cause commands to be -executed before passing it to the shell -but it does not use the same parser so it may be fooled. -.Pp The current .Fn wordexp implementation does not recognize multibyte characters other than UTF-8, since the shell (which it invokes to perform expansions) does not. +.Sh SECURITY CONSIDERATIONS +Pathname generation may create output that is exponentially larger than the +input size. +.Pp +Although this implementation detects command substitution reliably for +.Dv WRDE_NOCMD , +the attack surface remains fairly large. +Also, some other implementations +(such as older versions of this one) +may execute command substitutions even if +.Dv WRDE_NOCMD +is set. diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index 859ca50..3791e1e 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -32,6 +32,7 @@ #include <fcntl.h> #include <paths.h> #include <signal.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -43,7 +44,7 @@ __FBSDID("$FreeBSD$"); static int we_askshell(const char *, wordexp_t *, int); -static int we_check(const char *, int); +static int we_check(const char *); /* * wordexp -- @@ -65,7 +66,7 @@ wordexp(const char * __restrict words, wordexp_t * __restrict we, int flags) we->we_strings = NULL; we->we_nbytes = 0; } - if ((error = we_check(words, flags)) != 0) { + if ((error = we_check(words)) != 0) { wordfree(we); return (error); } @@ -94,17 +95,37 @@ we_read_fully(int fd, char *buffer, size_t len) return done; } +static bool +we_write_fully(int fd, const char *buffer, size_t len) +{ + size_t done; + ssize_t nwritten; + + done = 0; + do { + nwritten = _write(fd, buffer + done, len - done); + if (nwritten == -1 && errno == EINTR) + continue; + if (nwritten <= 0) + return (false); + done += nwritten; + } while (done != len); + return (true); +} + /* * we_askshell -- - * Use the `wordexp' /bin/sh builtin function to do most of the work - * in expanding the word string. This function is complicated by + * Use the `freebsd_wordexp' /bin/sh builtin function to do most of the + * work in expanding the word string. This function is complicated by * memory management. */ static int we_askshell(const char *words, wordexp_t *we, int flags) { - int pdes[2]; /* Pipe to child */ - char buf[18]; /* Buffer for byte and word count */ + int pdesw[2]; /* Pipe for writing words */ + int pdes[2]; /* Pipe for reading output */ + char wfdstr[sizeof(int) * 3 + 1]; + char buf[35]; /* Buffer for byte and word count */ long nwords, nbytes; /* Number of words, bytes from child */ long i; /* Handy integer */ size_t sofs; /* Offset into we->we_strings */ @@ -119,18 +140,25 @@ we_askshell(const char *words, wordexp_t *we, int flags) char **nwv; /* Temporary for realloc() */ sigset_t newsigblock, oldsigblock; const char *ifs; - char save; serrno = errno; ifs = getenv("IFS"); - if (pipe2(pdes, O_CLOEXEC) < 0) + if (pipe2(pdesw, O_CLOEXEC) < 0) + return (WRDE_NOSPACE); /* XXX */ + snprintf(wfdstr, sizeof(wfdstr), "%d", pdesw[0]); + if (pipe2(pdes, O_CLOEXEC) < 0) { + _close(pdesw[0]); + _close(pdesw[1]); return (WRDE_NOSPACE); /* XXX */ + } (void)sigemptyset(&newsigblock); (void)sigaddset(&newsigblock, SIGCHLD); (void)__libc_sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock); if ((pid = fork()) < 0) { serrno = errno; + _close(pdesw[0]); + _close(pdesw[1]); _close(pdes[0]); _close(pdes[1]); (void)__libc_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); @@ -146,43 +174,54 @@ we_askshell(const char *words, wordexp_t *we, int flags) _dup2(pdes[1], STDOUT_FILENO) : _fcntl(pdes[1], F_SETFD, 0)) < 0) _exit(1); + if (_fcntl(pdesw[0], F_SETFD, 0) < 0) + _exit(1); execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", - "-c", "IFS=$1;eval \"$2\";eval \"echo;set -- $3\";" - "IFS=;a=\"$*\";printf '%08x' \"$#\" \"${#a}\";" - "printf '%s\\0' \"$@\"", + "-c", "IFS=$1;eval \"$2\";" + "freebsd_wordexp -f \"$3\" ${4:+\"$4\"}", "", ifs != NULL ? ifs : " \t\n", - flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words, + flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", + wfdstr, + flags & WRDE_NOCMD ? "-p" : "", (char *)NULL); _exit(1); } /* - * We are the parent; read the output of the shell wordexp function, - * which is a byte indicating that the words were parsed successfully, - * a 32-bit hexadecimal word count, a 32-bit hexadecimal byte count - * (not including terminating null bytes), followed by the expanded - * words separated by nulls. + * We are the parent; write the words. */ _close(pdes[1]); - switch (we_read_fully(pdes[0], buf, 17)) { + _close(pdesw[0]); + if (!we_write_fully(pdesw[1], words, strlen(words))) { + _close(pdesw[1]); + error = WRDE_SYNTAX; + goto cleanup; + } + _close(pdesw[1]); + /* + * Read the output of the shell wordexp function, + * which is a byte indicating that the words were parsed successfully, + * a 64-bit hexadecimal word count, a dummy byte, a 64-bit hexadecimal + * byte count (not including terminating null bytes), followed by the + * expanded words separated by nulls. + */ + switch (we_read_fully(pdes[0], buf, 34)) { case 1: - error = WRDE_BADVAL; + error = buf[0] == 'C' ? WRDE_CMDSUB : WRDE_BADVAL; serrno = errno; goto cleanup; - case 17: + case 34: break; default: error = WRDE_SYNTAX; serrno = errno; goto cleanup; } - save = buf[9]; - buf[9] = '\0'; - nwords = strtol(buf + 1, NULL, 16); - buf[9] = save; buf[17] = '\0'; - nbytes = strtol(buf + 9, NULL, 16) + nwords; + nwords = strtol(buf + 1, NULL, 16); + buf[34] = '\0'; + nbytes = strtol(buf + 18, NULL, 16) + nwords; /* * Allocate or reallocate (when flags & WRDE_APPEND) the word vector @@ -255,83 +294,96 @@ cleanup: * we_check -- * Check that the string contains none of the following unquoted * special characters: <newline> |&;<>(){} - * or command substitutions when WRDE_NOCMD is set in flags. + * This mainly serves for {} which are normally legal in sh. + * It deliberately does not attempt to model full sh syntax. */ static int -we_check(const char *words, int flags) +we_check(const char *words) { char c; - int dquote, level, quote, squote; + /* Saw \ or $, possibly not special: */ + bool quote = false, dollar = false; + /* Saw ', ", ${, ` or $(, possibly not special: */ + bool have_sq = false, have_dq = false, have_par_begin = false; + bool have_cmd = false; + /* Definitely saw a ', ", ${, ` or $(, need a closing character: */ + bool need_sq = false, need_dq = false, need_par_end = false; + bool need_cmd_old = false, need_cmd_new = false; - quote = squote = dquote = 0; while ((c = *words++) != '\0') { switch (c) { case '\\': - if (squote == 0) - quote ^= 1; + quote = !quote; + continue; + case '$': + if (quote) + quote = false; + else + dollar = !dollar; continue; case '\'': - if (quote + dquote == 0) - squote ^= 1; + if (!quote && !have_sq && !have_dq) + need_sq = true; + else + need_sq = false; + have_sq = true; break; case '"': - if (quote + squote == 0) - dquote ^= 1; + if (!quote && !have_sq && !have_dq) + need_dq = true; + else + need_dq = false; + have_dq = true; break; case '`': - if (quote + squote == 0 && flags & WRDE_NOCMD) - return (WRDE_CMDSUB); - while ((c = *words++) != '\0' && c != '`') - if (c == '\\' && (c = *words++) == '\0') - break; - if (c == '\0') - return (WRDE_SYNTAX); + if (!quote && !have_sq && !have_cmd) + need_cmd_old = true; + else + need_cmd_old = false; + have_cmd = true; break; - case '|': case '&': case ';': case '<': case '>': - case '{': case '}': case '(': case ')': case '\n': - if (quote + squote + dquote == 0) + case '{': + if (!quote && !dollar && !have_sq && !have_dq && + !have_cmd) return (WRDE_BADCHAR); + if (dollar) { + if (!quote && !have_sq) + need_par_end = true; + have_par_begin = true; + } break; - case '$': - if ((c = *words++) == '\0') - break; - else if (quote + squote == 0 && c == '(') { - if (flags & WRDE_NOCMD && *words != '(') - return (WRDE_CMDSUB); - level = 1; - while ((c = *words++) != '\0') { - if (c == '\\') { - if ((c = *words++) == '\0') - break; - } else if (c == '(') - level++; - else if (c == ')' && --level == 0) - break; - } - if (c == '\0' || level != 0) - return (WRDE_SYNTAX); - } else if (quote + squote == 0 && c == '{') { - level = 1; - while ((c = *words++) != '\0') { - if (c == '\\') { - if ((c = *words++) == '\0') - break; - } else if (c == '{') - level++; - else if (c == '}' && --level == 0) - break; - } - if (c == '\0' || level != 0) - return (WRDE_SYNTAX); - } else - --words; + case '}': + if (!quote && !have_sq && !have_dq && !have_par_begin && + !have_cmd) + return (WRDE_BADCHAR); + need_par_end = false; + break; + case '(': + if (!quote && !dollar && !have_sq && !have_dq && + !have_cmd) + return (WRDE_BADCHAR); + if (dollar) { + if (!quote && !have_sq) + need_cmd_new = true; + have_cmd = true; + } + break; + case ')': + if (!quote && !have_sq && !have_dq && !have_cmd) + return (WRDE_BADCHAR); + need_cmd_new = false; + break; + case '|': case '&': case ';': case '<': case '>': case '\n': + if (!quote && !have_sq && !have_dq && !have_cmd) + return (WRDE_BADCHAR); break; default: break; } - quote = 0; + quote = dollar = false; } - if (quote + squote + dquote != 0) + if (quote || dollar || need_sq || need_dq || need_par_end || + need_cmd_old || need_cmd_new) return (WRDE_SYNTAX); return (0); diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index a4414fa..e4fe1b2 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -102,7 +102,7 @@ SYM_MAPS+= ${LIBC_SRCTOP}/sys/Symbol.map CLEANFILES+= ${SASM} ${SPSEUDO} .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*} NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' .else NOTE_GNU_STACK='' diff --git a/lib/libc/tests/gen/posix_spawn/Makefile b/lib/libc/tests/gen/posix_spawn/Makefile index d2dfa54..f20bbd7 100644 --- a/lib/libc/tests/gen/posix_spawn/Makefile +++ b/lib/libc/tests/gen/posix_spawn/Makefile @@ -21,6 +21,8 @@ PROGS+= h_spawnattr SCRIPTS= h_nonexec SCRIPTS+= h_zero +CLEANFILES+= h_nonexec + .include "../../Makefile.netbsd-tests" h_zero: diff --git a/lib/libc/tests/stdio/fmemopen2_test.c b/lib/libc/tests/stdio/fmemopen2_test.c index d137780..9555173 100644 --- a/lib/libc/tests/stdio/fmemopen2_test.c +++ b/lib/libc/tests/stdio/fmemopen2_test.c @@ -97,6 +97,7 @@ ATF_TC_BODY(test_preexisting, tc) /* Close the FILE *. */ rc = fclose(fp); + ATF_REQUIRE(rc == 0); /* Check that the string was not modified after the first 4 bytes. */ ATF_REQUIRE(strcmp(str, str3) == 0); diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index dae1624..86daee4 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -233,7 +233,7 @@ SYMLINKS+=libcompiler_rt_p.a ${LIBDIR}/libgcc_p.a .endif .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "powerpc" + ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_ARCH:Marmv6*} AFLAGS+=--noexecstack ACFLAGS+=-Wa,--noexecstack .endif diff --git a/lib/libcrypt/tests/Makefile.depend b/lib/libcrypt/tests/Makefile.depend index d0caca1..dd2539c 100644 --- a/lib/libcrypt/tests/Makefile.depend +++ b/lib/libcrypt/tests/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libcuse/Makefile.depend b/lib/libcuse/Makefile.depend index 441e1ee..0a2f351 100644 --- a/lib/libcuse/Makefile.depend +++ b/lib/libcuse/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libcxxrt/Makefile.depend.host b/lib/libcxxrt/Makefile.depend.host index 9f46a2f..971c379 100644 --- a/lib/libcxxrt/Makefile.depend.host +++ b/lib/libcxxrt/Makefile.depend.host @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ usr.bin/clang/clang \ diff --git a/lib/libevent/Makefile.depend b/lib/libevent/Makefile.depend index ccd19e5..18be76b 100644 --- a/lib/libevent/Makefile.depend +++ b/lib/libevent/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ include \ include/xlocale \ diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 3095e06..ae8b79d 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -495,7 +495,8 @@ fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len) hints.ai_protocol = 0; hints.ai_flags = AI_NUMERICHOST; /* port is not relevant for this purpose */ - getaddrinfo(host, "443", &hints, &res); + if (getaddrinfo(host, "443", &hints, &res) != 0) + res = NULL; free(host); return res; } diff --git a/lib/libgpib/Makefile.depend b/lib/libgpib/Makefile.depend index 4370d1e..3699b06 100644 --- a/lib/libgpib/Makefile.depend +++ b/lib/libgpib/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/BIG5/Makefile.depend b/lib/libiconv_modules/BIG5/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/BIG5/Makefile.depend +++ b/lib/libiconv_modules/BIG5/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/DECHanyu/Makefile.depend b/lib/libiconv_modules/DECHanyu/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/DECHanyu/Makefile.depend +++ b/lib/libiconv_modules/DECHanyu/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/EUC/Makefile.depend b/lib/libiconv_modules/EUC/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/EUC/Makefile.depend +++ b/lib/libiconv_modules/EUC/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/EUCTW/Makefile.depend b/lib/libiconv_modules/EUCTW/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/EUCTW/Makefile.depend +++ b/lib/libiconv_modules/EUCTW/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/GBK2K/Makefile.depend b/lib/libiconv_modules/GBK2K/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/GBK2K/Makefile.depend +++ b/lib/libiconv_modules/GBK2K/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/HZ/Makefile.depend b/lib/libiconv_modules/HZ/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/HZ/Makefile.depend +++ b/lib/libiconv_modules/HZ/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/ISO2022/Makefile.depend b/lib/libiconv_modules/ISO2022/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/ISO2022/Makefile.depend +++ b/lib/libiconv_modules/ISO2022/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/JOHAB/Makefile.depend b/lib/libiconv_modules/JOHAB/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/JOHAB/Makefile.depend +++ b/lib/libiconv_modules/JOHAB/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/MSKanji/Makefile.depend b/lib/libiconv_modules/MSKanji/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/MSKanji/Makefile.depend +++ b/lib/libiconv_modules/MSKanji/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/UES/Makefile.depend b/lib/libiconv_modules/UES/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/UES/Makefile.depend +++ b/lib/libiconv_modules/UES/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/UTF1632/Makefile.depend b/lib/libiconv_modules/UTF1632/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/UTF1632/Makefile.depend +++ b/lib/libiconv_modules/UTF1632/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/UTF7/Makefile.depend b/lib/libiconv_modules/UTF7/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/UTF7/Makefile.depend +++ b/lib/libiconv_modules/UTF7/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/UTF8/Makefile.depend b/lib/libiconv_modules/UTF8/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/UTF8/Makefile.depend +++ b/lib/libiconv_modules/UTF8/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/VIQR/Makefile.depend b/lib/libiconv_modules/VIQR/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/VIQR/Makefile.depend +++ b/lib/libiconv_modules/VIQR/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/ZW/Makefile.depend b/lib/libiconv_modules/ZW/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/ZW/Makefile.depend +++ b/lib/libiconv_modules/ZW/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/iconv_none/Makefile.depend b/lib/libiconv_modules/iconv_none/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/iconv_none/Makefile.depend +++ b/lib/libiconv_modules/iconv_none/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/iconv_std/Makefile.depend b/lib/libiconv_modules/iconv_std/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/iconv_std/Makefile.depend +++ b/lib/libiconv_modules/iconv_std/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/mapper_646/Makefile.depend b/lib/libiconv_modules/mapper_646/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/mapper_646/Makefile.depend +++ b/lib/libiconv_modules/mapper_646/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/mapper_none/Makefile.depend b/lib/libiconv_modules/mapper_none/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/mapper_none/Makefile.depend +++ b/lib/libiconv_modules/mapper_none/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/mapper_parallel/Makefile.depend b/lib/libiconv_modules/mapper_parallel/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/mapper_parallel/Makefile.depend +++ b/lib/libiconv_modules/mapper_parallel/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/mapper_serial/Makefile.depend b/lib/libiconv_modules/mapper_serial/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/mapper_serial/Makefile.depend +++ b/lib/libiconv_modules/mapper_serial/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/mapper_std/Makefile.depend b/lib/libiconv_modules/mapper_std/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/mapper_std/Makefile.depend +++ b/lib/libiconv_modules/mapper_std/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libiconv_modules/mapper_zone/Makefile.depend b/lib/libiconv_modules/mapper_zone/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libiconv_modules/mapper_zone/Makefile.depend +++ b/lib/libiconv_modules/mapper_zone/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libmilter/Makefile.depend b/lib/libmilter/Makefile.depend index 17c2027..f78862e 100644 --- a/lib/libmilter/Makefile.depend +++ b/lib/libmilter/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/librpcsec_gss/Makefile.depend b/lib/librpcsec_gss/Makefile.depend index b376142..a352749 100644 --- a/lib/librpcsec_gss/Makefile.depend +++ b/lib/librpcsec_gss/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libsmb/Makefile.depend b/lib/libsmb/Makefile.depend index 441168d..4d66c46 100644 --- a/lib/libsmb/Makefile.depend +++ b/lib/libsmb/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libstand/Makefile.depend b/lib/libstand/Makefile.depend index bb85bcd..57cd80c 100644 --- a/lib/libstand/Makefile.depend +++ b/lib/libstand/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ include \ include/arpa \ diff --git a/lib/libstdbuf/Makefile.depend b/lib/libstdbuf/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libstdbuf/Makefile.depend +++ b/lib/libstdbuf/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libstdthreads/Makefile.depend b/lib/libstdthreads/Makefile.depend index 441e1ee..0a2f351 100644 --- a/lib/libstdthreads/Makefile.depend +++ b/lib/libstdthreads/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libugidfw/ugidfw.c b/lib/libugidfw/ugidfw.c index a1e36d2..e533d1e 100644 --- a/lib/libugidfw/ugidfw.c +++ b/lib/libugidfw/ugidfw.c @@ -1233,7 +1233,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *errstr) name[len] = rulenum; len++; - error = sysctl(name, len, NULL, NULL, &rule, sizeof(rule)); + error = sysctl(name, len, NULL, NULL, &rule, 0); if (error) { len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules", rulenum, strerror(errno)); diff --git a/lib/libunbound/Makefile.depend b/lib/libunbound/Makefile.depend index 45199c4..9ae472e 100644 --- a/lib/libunbound/Makefile.depend +++ b/lib/libunbound/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/libvgl/Makefile.depend b/lib/libvgl/Makefile.depend index 09164c1..dde2d60 100644 --- a/lib/libvgl/Makefile.depend +++ b/lib/libvgl/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/ncurses/form/Makefile.depend b/lib/ncurses/form/Makefile.depend index fc0fd0c..e753747 100644 --- a/lib/ncurses/form/Makefile.depend +++ b/lib/ncurses/form/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/ncurses/formw/Makefile.depend b/lib/ncurses/formw/Makefile.depend index 04d041a4..1448c10 100644 --- a/lib/ncurses/formw/Makefile.depend +++ b/lib/ncurses/formw/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/ncurses/menu/Makefile.depend b/lib/ncurses/menu/Makefile.depend index cb8d80b..7dbcb2b 100644 --- a/lib/ncurses/menu/Makefile.depend +++ b/lib/ncurses/menu/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/ncurses/menuw/Makefile.depend b/lib/ncurses/menuw/Makefile.depend index 771e004..0ffbc9b 100644 --- a/lib/ncurses/menuw/Makefile.depend +++ b/lib/ncurses/menuw/Makefile.depend @@ -1,8 +1,6 @@ # $FreeBSD$ # Autogenerated - do NOT edit! -DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} - DIRDEPS = \ gnu/lib/csu \ gnu/lib/libgcc \ diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index fe68a39..94fb03a 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -282,6 +282,7 @@ CFLAGS+= -DFREEBSD_NATIVE -DTERMIOS # Installed HEADERS= curses.h term.h termcap.h unctrl.h SRCHDRS= ncurses_dll.h +CLEANFILES+= ncurses_dll.h .if defined(ENABLE_WIDEC) INCS= ${HEADERS} ${SRCHDRS} |