summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r301115ache2016-06-054-0/+8
| | | | | | Don't use fixup for C99 and up, the compiler result is already correct. Suggested by: bde
* MFC: r301448ache2016-06-051-2/+2
| | | | | Reflect error indication according to POSIX and what those functions currently do.
* MFC: r300956ache2016-06-051-41/+11
| | | | | | | | | | | | 1) Unifdef USE_WEAK_SEEDING since it is too obsolete to support and makes reading hard. 2) Instead of doing range transformation in each and every function here, do it single time directly in do_rand(). One "mod" operation overhead is not a big deal, but the code looks nicer and possible future functions additions or PRNG change do not miss range transformations neither have unneeded ones. 3) Use POSIX argument types for visible functions (cosmetic).
* Prepare for merge of r300956. One year old r288030 which fix prototypesache2016-06-051-4/+3
| | | | | can't be merged without conflicts and require merging of other versions too and I don't want to go deep in that unmerged commits chain.
* MFC: r300953ache2016-06-051-47/+15
| | | | | | | | | | | | | | | | | | 1) Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading harder. 2) ACM paper require seed to be in [1, 2^31-2] range, so use the same range shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case (non default) from negative seeds. 3) Don't check for valid "type" range in setstate(), it is always valid as calculated. Instead add a check that rear pointer not exceeed end pointer. MFC: r300965 Micro optimize: C standard guarantees that right shift for unsigned value fills left bits with zero, and we have exact 32bit unsigned value (uint32_t), so there is no reason to add "& 0x7fffffff" here.
* MFC r300341:bdrewery2016-06-042-2/+0
| | | | FTS: Remove stale reference to nfs4 fs which was removed in r192578.
* For EILSEQ case in mbsnrtowcs() and wcsnrtombs() update src to point toache2016-06-032-0/+3
| | | | | | | the character after the one this conversion stopped at. PR: 209907 Submitted by: Roel Standaert <roel@abittechnical.com> (partially)
* MFC r300666truckman2016-06-011-0/+1
| | | | | | | Call closedir() before returning from fetchListFile() to avoid a leak. Reported by: Coverity CID: 1016697
* MFC r300665truckman2016-06-011-1/+4
| | | | | | | Don't leak addrinfo in fetch_bind() Submitted by: Coverity CID: 1225038
* MFC r300664truckman2016-06-011-0/+1
| | | | | | | | | Fix Coverity CID 978183 Resource leak in rexec(). Close the socket if connect() fails to avoid leaking it. Reported by: Coverity CID: 978183
* MFC r300662truckman2016-06-011-3/+6
| | | | | | | | | Fix Coverity CID 1016714 Resource leak in process_file_actions_entry() Don't leak a file descriptor of _dup2() fails (shouldn't happen). Reported by: Coverity CID: 1016714
* MFC r300660truckman2016-06-011-1/+3
| | | | | | | | | Fix 1016718 Resource leak. Don't leak a file descriptor if fchdir() fails. Reported by: Coverity CID: 1016718
* MFC r297147, r297148, r297149, r297150, r297151:ian2016-05-317-63/+12
| | | | | | | | | | | | | | | | | | | | | | | Make both the loader and kernel use the interface-mtu option if the dhcp server provides it. Made up of these (semi-)related changes... [kernel...] If the dhcp server provides an interface-mtu option, parse the value and set that mtu on the interface. [libstand...] Garbage collect the bswap routines from libstand, use sys/endian.h. If the dhcp server delivers an interface-mtu option, parse it and store the value in a new global intf_mtu for use by the application. [loader...] If the dhcp server provided an interface-mtu option, transcribe the value to the boot.netif.mtu env var, which will be picked up by pre-existing code in nfs_mountroot() and used to configure the interface accordingly. PR: 187094
* MFC r300378:pfg2016-05-291-9/+6
| | | | | | | | | | | | | libc/regex: fix two buffer underruns. Fix some rather complex regex issues found on OpenBSD as part of some ongoing work to fix a sed(1) bug. Curiously the OpenBSD tests don't trigger segfaults on FreeBSD but the bugs were confirmed by running a port of FreeBSD's regex under OpenBSD's malloc. Huge thanks to Ingo for confirming the behavior. Obtained from: OpenBSD (CVS 1.20, 1.21)
* MFC r300420: vfork(2): Mention some risks of calling vfork() fromjilles2016-05-291-12/+28
| | | | application code.
* MFC: r300397ache2016-05-291-15/+10
| | | | | | | | | | | | | | 1) POSIX prohibits printing errors to stderr here and require returning NULL: "Upon successful completion, initstate() and setstate() shall return a pointer to the previous state array; otherwise, a null pointer shall be returned. Although some implementations of random() have written messages to standard error, such implementations do not conform to POSIX.1-2008." 2) Move error detections earlier to prevent state modifying.
* MFC r298192,299234,299238,299736:delphij2016-05-282-4/+7
| | | | file 5.27.
* MFC r300327:ken2016-05-251-0/+1
| | | | | | | | | | | | | | | ------------------------------------------------------------------------ r300327 | ken | 2016-05-20 13:30:52 -0600 (Fri, 20 May 2016) | 11 lines Add the density code for LTO-7 to libmt and the mt(1) man page. The density code and bits per mm values were obtained from an actual drive density report. The number of tracks were obtained from an LTO-7 hardware announcement on IBM's web site. ------------------------------------------------------------------------ Sponsored by: Spectra Logic
* MFC r299948truckman2016-05-231-0/+1
| | | | | | | | | | Set retval in the empty password case to avoid a path through the code that fails to set retval before falling through to the final return(). Reported by: emaste Reported by: Coverity CID: 1018711
* MFC r299654:ngie2016-05-231-18/+15
| | | | | | | | | Read the contents of the snapshot files properly - Use fgetln instead of fgets; localize complexity related to fgetln(3) inside the loop. - Skip over blank lines. - Skip over lines (properly) that start with a "#"
* MFC r299926truckman2016-05-231-2/+2
| | | | | | | | | | Hoist the getpwnam() call outside the first if/else block in pam_sm_chauthtok(). Set user = getlogin() inside the true branch so that it is initialized for the following PAM_LOG() call. This is how it is done in pam_sm_authenticate(). Reported by: Coverity CID: 272498
* MFC r299922truckman2016-05-231-1/+0
| | | | | | | | Don't call free_addrselectpolicy(&policyhead) before policyhead has been initialized. Reported by: Coverity CID: 1018727
* MFC r292000: Remove historical GNUC testemaste2016-05-207-40/+0
| | | | | | | The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in csu.
* MFC r299879, r299880truckman2016-05-201-1/+1
| | | | | | | | | | | | | | | | | r299879 | truckman | 2016-05-15 18:30:32 -0700 (Sun, 15 May 2016) | 7 lines Likely a false positive ... but make sure that -1 can't be used as an array index by splitting up a test. r299880 | truckman | 2016-05-15 18:38:24 -0700 (Sun, 15 May 2016) | 8 lines Since rdata is only used as an argument to the immediately following call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving rdata = &buf[n]; inside the if block. Reported by: Coverity CID: 603941
* MFC r299581truckman2016-05-201-1/+1
| | | | | | | | | Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL terminated. Don't bother checking for truncation since the subsequent stat() call should detect that and fail. Reported by: Coverity CID: 1018189
* MFC r297947:bdrewery2016-05-181-0/+1
| | | | Build libpam modules in parallel.
* MFC r298982:kib2016-05-161-8/+26
| | | | | | | Add EVFILT_VNODE open, read and close notifications. MFC r298984: Correct wording.
* MFC r298922:kib2016-05-161-2/+8
| | | | | | Issue NOTE_EXTEND when a directory entry is added to or removed from the monitored directory as the result of rename(2) operation. The renames staying in the directory are not reported.
* MFC r298839:ngie2016-05-131-3/+12
| | | | | | | | | Fix memory allocation edgecases in kvm_argv(..) - Don't leak nbufp on realloc failure in kvm_argv - Catch malloc errors with bufp - Set buflen last in the "buflen == 0" case to ensure that bufp/nbufp is properly reallocated on the next go around
* MFC r298842:ngie2016-05-131-0/+1
| | | | | | Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails CID: 1341474
* MFC r299114:kib2016-05-122-4/+2
| | | | | | | Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume cycle. PR: 209233
* Revert r298920 until we have addressed all known regressions on head/ afterdelphij2016-05-082-7/+4
| | | | | | | | settle. file is now downgraded to 5.25. PR: bin/209211 Requested by: Tomoaki AOKI Relnotes: yes
* MFC r298898:kib2016-05-081-0/+4
| | | | Explain NOTE_LINK reporting for the directories.
* MFC r298893:bcr2016-05-061-1/+52
| | | | | | | | | | | | | Provide an example to the kqueue man page, showing a basic usage example. Although it is an untypical example for the use of kqueue, it is better than nothing and should get people started. PR: 196844 Submitted by: fernando.apesteguia@gmail.com Reviewed by: kib Approved by: kib Differential Revision: https://reviews.freebsd.org/D6082
* MFC r297999:ngie2016-05-052-18/+18
| | | | Clean up trailing whitespace in lib/libcam; no functional change
* MFC r298753:ngie2016-05-041-38/+41
| | | | | | | | | | | | | | Fix va_list handling - Add missing va_end's after corresponding va_start's to cleanup state - Eliminate questionable bzero'ing of va_list passed in to do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..) and csio_{de,en}code_visit(..). Make va_list a pointer instead and pass NULL into the underlying functions to handler this in a portable way. - Do some minor style(9) clean up in affected functions. CID: 1018500-1018503
* MFC r298311,r298312:ngie2016-05-042-1/+2
| | | | | | | | | | | | | | | | | | | | | r298311: Make sure fmemopen succeeds in :test_append_binary_pos before calling ftell on the FILE object This fixes potential null pointer dereferences on failure CID: 1254952 r298312: Fix double fclose of `fp1` when freopen fails freopen handles closing file descriptors on error, with the exception of fdopen'ed descriptors, so closing an already fclose'd file descriptor is incorrect CID: 1338525
* MFC r298192: MFV r298178:delphij2016-05-022-4/+7
| | | | | | Update file to 5.26. Relnotes: yes
* MFC r298521;pfg2016-04-281-2/+2
| | | | | | | | | | | regex: prevent two improbable signed integer overflows. In matcher() we used an integer to index nsub of type size_t. In print() we used an integer to index nstates of type sopno, typedef'd long. In both cases the indexes never take negative values. Match the types to avoid any error.
* MFC r298156:wblock2016-04-241-4/+4
| | | | Fix markup on "\n" in printf so it renders correctly.
* MFC r297836:ngie2016-04-221-3/+3
| | | | | | | | Fix appending -O0 to CFLAGS The previous method would completely nerf CFLAGS once bsd.progs.mk had recursed into the per-PROG logic and make the CFLAGS for tap testcases to -O0, instead of appending to CFLAGS for all of the tap testcases.
* MFC r298303:ngie2016-04-221-2/+2
| | | | | Remove trailing whitespace and use `nitems(mib)` instead of `2` when calling sysctl(3)
* MFC 297942:pfg2016-04-209-10/+15
| | | | | | libgssapi: avoid NULL pointer dereferences. While here also use NULL instead of zero for pointers.
* MFC r297475:brooks2016-04-131-1/+3
| | | | | | | Document KTRFAC_FAULT and KTRFAC_FAULTEND. Obtained from: CheriBSD (9d70f563f1b033e6a9b51eaf3b145a8cbbc6617c) Sponsored by: DARPA, AFRL
* MFC r297626:bdrewery2016-04-131-1/+2
| | | | | Follow-up r295924: Only sync hash-based db files open for writing when closing.
* MFC r296685: libelf: correct byte count in cross-endian note translationemaste2016-04-111-0/+1
| | | | Sponsored by: The FreeBSD Foundation
* MFC r275430: libelf: Fix cross-endian ELF note file / memory conversionemaste2016-04-111-5/+5
| | | | | | | | | The namesz and descsz variables need to be used in native endianness. The sizes are in native order after swapping in the file to memory case, and before swapping in the memory to file case. This change is not identical to r275430 because r273443 was never merged to stable/10, and libelf moved from lib/ to contrib/elftoolchain/.
* MFC r297535:kib2016-04-112-2/+0
| | | | Remove unused variable.
* MFC r297557:ache2016-04-111-1/+1
| | | | SJIS encoding don't have single byte characters >= 224
* MFC r287753: setuid(2): Suggest O_CLOEXEC instead of fcntl(F_SETFD).jilles2016-04-091-7/+2
|
OpenPOWER on IntegriCloud