summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Work-around a race condition on ia64 while unlocking a contested lock.marcel2009-12-141-0/+3
| | | | | | | | The race condition is believed to be in UMTX_OP_MUTEX_WAKE. On ia64, we simply go to the kernel to unlock. The big question is why this is only a race condition on ia64... MFC after: 3 days
* Explicitly say that this is an internal library which is intended to bedelphij2009-12-131-1/+10
| | | | | | | | | used within FreeBSD base system only, and discourage user applications from using it. User applications should use the expat version from the ports/package collection. Reviewed by: simon (earlier version) MFC after: 2 weeks
* Fix libusb_open_device_with_vid_pid() to return a NULL if no device isscf2009-12-121-2/+2
| | | | | | | found instead of the last device in its search list. Reviewed by: thompsa MFC after: 5 days
* Remove a dead store.scf2009-12-121-2/+2
| | | | MFC after: 5 days
* The hostname passed to ulog_login(3) may be optional.ed2009-12-111-1/+2
| | | | | | | Don't trip on a null pointer being passed to this function when performing a local login. Noticed by: dougb
* Convert pam_lastlog(8) to libulog.ed2009-12-113-88/+27
| | | | | | | | | | | The information used by the "Last login:"-line is obtained by using ulog_setutxfile(3) to switch to the lastlog database. Login and logout are performed using the utility functions ulog_login(3) and ulog_logout(3). This also means we must build libulog during bootstrap. Approved by: des
* Bump the man page date to the date of the last update.syrinx2009-12-111-1/+1
| | | | Noticed by: bz
* Add support for TACACS+ accounting to libtacplus(3).syrinx2009-12-114-0/+142
| | | | | Submitted by: Michael Pounov misho@aitbg.com OKed by: emaste
* Add a missing else that negated the truncation of ki_ngroups tobrooks2009-12-101-1/+1
| | | | | | NGROUPS. Submitted by: Dmitry Pryanishnikov <lynx dot ripe at gmail dot com>
* Merge two cpio fixes from libarchive.googlecode.com:kientzle2009-12-101-2/+5
| | | | | | | | | 1) Avoid an infinite loop in the header resync for certain malformed archives. 2) Don't try to match hardlinks if the nlinks count is < 2. This reduces the likelihood of a false hardlink match due to ino truncation. MFC after: 7 days
* Simplify arena_run_reg_dalloc(), and remove a bug that was due to incorrectjasone2009-12-101-89/+28
| | | | initialization of ssize_invs.
* Fix the posix_memalign() changes in r196861 to actually return a NULL pointerjasone2009-12-101-0/+1
| | | | | | as intended. PR: standards/138307
* sem_init(3): document process shared semaphores and their restrictionsjilles2009-12-081-18/+9
|
* Install libulog in /lib.ed2009-12-071-0/+2
| | | | | | | | | Because several applications in /bin use libulog (or may use it in the nearby future), it must not live inside /usr. It seems like we don't need to add the copy from /usr/lib to ObsoleteFiles.inc, because it's cleaned up during installation of libulog automatically. Reported by: ume
* Revert behavior change to setenv(), unsetenv() and putenv() until a morescf2009-12-071-3/+6
| | | | thorough security review has been completed.
* Update the getenv(3) man page to reflect the recent change to the behaviorscf2009-12-061-9/+9
| | | | | | | of setenv(), putenv() and unsetenv() when dealing with corrupt entries in environ. They now output a warning and complete their task without error. MFC after: 1 week
* Change the behavior of setenv(), putenv() and unsetenv() to continue parsingscf2009-12-061-6/+3
| | | | | | | | | | | | instead of returning an error if a corrupt (not a "name=value" string) entry in the environ array is detected when (re)-building the internal environment. This should prevent applications or libraries from experiencing issues arising from the expectation that these calls will complete even with corrupt entries. The behavior is now as it was prior to 7.0. Reviewed by: jilles MFC after: 1 week
* Improve the comment within getenv() explaining the search order it takes toscf2009-12-061-8/+9
| | | | | | | | | | find a variable. Include a note that it must not cause the internal environment to be generated since malloc() depends upon getenv(). To call malloc() would create a circular dependency. Recommended by: green Approved by: jilles MFC after: 1 week
* Add a libutempter compatibility interface to libulog.ed2009-12-065-4/+263
| | | | | | | | | | | | | | | The ulog_login_pseudo(3) and ulog_logout_pseudo(3) interfaces provide a functionality identical to what libutempter has to offer. Just transform libutempter's calls into the before mentioned functions. libutempter doesn't work with utmpx, so instead of fixing I thought the easiest way would be to integrate this functionality. libutempter is used by applications like xterm and the KDE libraries, so if I ever change the underlying file format, these applications will keep working automatically. Also increase __FreeBSD_version to indicate the addition (as well as the import of libulog).
* Massively extend libulog:ed2009-12-0511-158/+736
| | | | | | | | | | | | | | - Just like struct utmp, store strings inside struct utmpx itself. This is needed to make things like pututxline() work. - Add ut_id and ut_pid fields, even though they have little use in our implementation. - It turns out our "reboot" wtmp entries indicate a system boot, so remove REBOOT_TIME - Implement getutxline() and pututxline - Add getutxuser() and setutxfile(), which allows us to crawl wtmp and lastlog files as well. - Add _ULOG_POSIX_NAMES, so we can already use the POSIX names if we really want to.
* Fix many "function declaration isn't a prototype" warnings in libc.ed2009-12-0512-42/+27
| | | | | I've only fixed code that seems to be written by `us'. There are still many warnings like this present in resolv/, rpc/, stdtime/ and yp/.
* Don't let the C library depend on <utmp.h>.ed2009-12-053-14/+12
| | | | | | The maximum length of a username has nothing to do with the size of the username in the utmp files. Use MAXLOGNAME, which is defined as 17 (UT_USERSIZE + 1).
* Remove warnings from exec.c.ed2009-12-051-20/+19
| | | | | | | | The entries in the argv array are not const themselves, but sometimes we want to fill in const values. Just make the array const and use __DECONST() to make it const for the execve()-call itself. Also convert the only K&R prototype to ANSI.
* Use ANSI C prototypes inside termios.ed2009-12-051-31/+13
| | | | While there, add a missing __unused to hide a warning in tcsetbreak().
* Remove (hidden) warning about missing prototypes for fdevname(3).ed2009-12-051-0/+1
|
* Add a missing word to a sentence in the return values section.trhodes2009-12-041-1/+1
|
* - Update the Spanish NLS cataloggabor2009-12-031-5/+51
| | | | | | | | | | | Reviewed by: carvay, the.infamous.paul@gmail.com, Joan Picanyol i Puig <lists-freebsd-es@biaix.org>, Ing . Marcos Luis Ortiz Valmaseda <mlortiz@uci.cu>, eskanete@gmail.com, Jose M Rodriguez <josemi@freebsd.jazztel.es>, Guillermo Hernandez <guillermo@QuerySoft.es>, dani.doni@gmail.com
* Use USER_PROCESS instead of LOGIN_PROCESS.ed2009-12-033-6/+6
| | | | | | POSIX isn't clear about how the fields should be used, but according to utmpx(5) on Linux, LOGIN_PROCESS refers to a TTY that's still running a getty.
* Also implement ut_type.ed2009-12-033-0/+52
| | | | | I thought we couldn't emulate this field, but we can derive this field by looking at special values for ut_host, ut_line and ut_name.
* Add a new library: libulog.ed2009-12-0310-2/+693
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the things I really want to do, is to get rid of the limitations of our current utmp(5) mechanism: - It only allows 8 byte TTY device names. - The hostname only allows 16 bytes of storage. I'm not a big fan of <utmpx.h>, but I think we should at least try to add parts of it. Unfortunately we cannot implement <utmpx.h>, because we miss various fields, such as ut_id, ut_pid, etc. The API provided by libulog shares some similarities with <utmpx.h>, so it shouldn't be too hard to port these applications eventually. In most simple cases, it should just be a matter of removing the ulog_ prefix everywhere. As a bonus, it also implements a function called ulog_login_pseudo(), which allows unprivileged applications to write log entries, provided they have a valid file descriptor to a pseudo-terminal master device. libulog will allow a smoother transition to a new file format by adding a library interface to deal with utmp/wtmp/lastlog files. I initially thought about adding the functionality to libutil, but because I'm not planning on keeping this library around forever, we'd better keep it separated. Next items on the todo list: 1. Port applications in the base system (and ports) to libulog, instead of letting them use <utmp.h>. 2. Remove <utmp.h>, implement <utmpx.h> and reimplement this library on top. 3. Port as many applications as possible back to <utmpx.h>.
* The fd_mask type is an unsigned long, not an int, so treat the mask as ajhb2009-12-031-2/+2
| | | | | | | | | | long instead of an int when examining the results of select() to look for RPC requests. Previously this routine would ignore RPC requests to sockets whose file descriptor mod 64 was greater than 31 on a 64-bit platform. PR: amd64/141130 Submitted by: liujb of array networks MFC after: 3 days
* Properly support -fPIE by linking PIE binaries with specially-builtkib2009-12-029-35/+93
| | | | | | | | | | | | | | Scrt1.o instead of crt1.o, since the later is built as non-PIC. Separate i386-elf crt1.c into the pure assembler part and C code, supplying all data extracted by assembler stub as explicit parameters [1]. Hide and localize _start1 symbol used as an interface between asm and C code. In collaboration with: kan Inspired by: PR i386/127387 [1] Prodded and tested by: rdivacky [1] MFC after: 3 weeks
* Make <libutil.h> work when included by itself.ed2009-12-021-0/+28
| | | | | | | There are several reasons why it didn't work: - It was missing <sys/cdefs.h> for __BEGIN_DECLS. - It uses various primitive types that were not declared.
* Fix the dprintf() prototype.brueffer2009-12-021-2/+2
| | | | | | PR: 141087 Submitted by: Jeremy Huddleston <jeremyhu@apple.com> MFC after: 3 days
* Add an .Nm for strncat.brueffer2009-12-011-2/+3
| | | | | | PR: 141037 Submitted by: Jeremy Huddleston <jeremyhu@apple.com> MFC after: 3 days
* Temporarily revert the previous change because the linker has beengreen2009-12-011-36/+28
| | | | modified so that it will abort when the environment is bad.
* Describe what setpgid(2) does when pgid=0. The text has beenkeramida2009-12-011-0/+5
| | | | | | | | | | copied from NetBSD's manpage, and it also matches the behavior described by the Open Group's online copy of setpgid.2 at http://www.opengroup.org/onlinepubs/009695399/functions/setpgid.html Obtained from: NetBSD Submitted by: Petros Barbayiannis <petrosbarbayiannis@yahoo.gr> MFC after: 1 week
* Do not gratuitously fail *env(3) operations due to corrupt ('='-less)green2009-12-011-28/+36
| | | | | | | | | | | | | **environ entries. This puts non-getenv(3) operations in line with getenv(3) in that bad environ entries do not cause all operations to fail. There is still some inconsistency in that getenv(3) in the absence of any environment-modifying operation does not emit corrupt environ entry warnings. I also fixed another inconsistency in getenv(3) where updating the global environ pointer would not be reflected in the return values. It would have taken an intermediary setenv(3)/putenv(3)/unsetenv(3) in order to see the change.
* Update to BIND 9.6.1-P2. The vulnerability this is designed to fix isdougb2009-11-301-0/+4
| | | | | | related to DNSSEC validation on a resolving name server that allows access to untrusted users. If your system does not fall into all 3 of these categories you do not need to update immediately.
* Revert r199830 for now. Too many ports dlopen() libraries linked withkib2009-11-281-1/+1
| | | | libthr, but forgot to link main binary with it.
* - correct xref sectionsdanger2009-11-282-4/+4
| | | | | | PR: docs/140940 Submitted by: Bruce Cran <bruce@cran.org.uk> MFC after: 1 week
* Properly use the envp argument in execvPe().ed2009-11-271-2/+2
| | | | | | | | | | | | | | | execvPe() is called by _execvpe(), which we added to implement posix_spawnp(). We just took execvP() and added the envp argument. Unfortunately we forgot to change the implementation to use envp over environ. This fixes the following piece of code: | char * const arg[2] = { "env", NULL }; | char * const env[2] = { "FOO=BAR", NULL }; | posix_spawnp(NULL, "/usr/bin/env", NULL, NULL, arg, env); MFC after: 2 weeks
* Reset path name back to original correctly in fts_build() whenjh2009-11-261-5/+2
| | | | | | | | | | | FTS_NOCHDIR option is used. fts_build() could strip a trailing slash from path name in post-order visit if a path pointing to an empty directory was given for fts_open(). PR: bin/133907, kern/134513 Reviewed by: das Approved by: trasz (mentor) MFC after: 1 month
* Clarify that the value of the fts_info field is different in post-order.jh2009-11-261-4/+3
| | | | | | Discussed with: das Approved by: trasz (mentor) MFC after: 1 week
* Libthr cannot be dynamically loaded into the running process.kib2009-11-261-1/+1
| | | | | | | Mark it with -z nodlopen for now. Discussed with: jhb, kan MFC after: 3 weeks
* Implement sighold, sigignore, sigpause, sigrelse, sigset functionskib2009-11-264-8/+250
| | | | | | | | | | from SUSv4 XSI. Note that the functions are obsoleted, and only provided to ease porting from System V-like systems. Since sigpause already exists in compat with different interface, XSI sigpause is named xsi_sigpause. Reviewed by: davidxu MFC after: 3 weeks
* sigset() is the name of function specified by SUSv4.kib2009-11-261-4/+4
| | | | | | Replace it to avoid conflict. MFC after: 3 weeks
* In tac_get_av_value() empty attributes should be handled like 0-lengthattilio2009-11-251-1/+6
| | | | | | | | | | strings rather than unset strings. Fix the present wrong behaviour. Obtained from: Sandvine Incorporated Reviewed by: emaste Sponsored by: Sandvine Incorporated MFC: 1 week
* Fix a socket leak in ftp_request() after that a connection is established.attilio2009-11-251-3/+9
| | | | | | | Submitted by: Sandvine Incorporated Reviewed by: des, emaste Sponsored by: Sandvine Incorporated MFC: 1 week
* Style: use structure assignment rather than memcpy() to copy awollman2009-11-251-1/+1
| | | | structure.
OpenPOWER on IntegriCloud