summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert r202447 by re-exposing the old uname(3) function.ed2010-01-192-3/+4
| | | | | | | | | | | | | | | | It makes hardly any sense to expose a symbol which should only be provided for binary compatibility, but it seems we don't have a lot of choice here. There are many autoconf scripts out there that try to create a binary that links against the old symbol to see whether uname(3) is present. These scripts fail to detect uname(3) now. It should be noted that the behaviour we implement is not against the standards: | The following shall be declared as a function and may also be defined | as a macro: | | int uname(struct utsname *);
* Add missing DPADD and fix whitespace.des2010-01-191-2/+3
| | | | Submitted by: ru
* Add HTTP digest authentication.des2010-01-192-67/+819
| | | | | Submitted by: Jean-Francois Dockes <jf@dockes.org> Forgotten by: des (repeatedly)
* fix a comment typoavg2010-01-181-1/+1
| | | | MFC after: 3 days
* Double checking my commit I found that comment saying thatache2010-01-181-7/+3
| | | | | | | | POSIX 2008 and XSI 7require strcoll() for opendir() is not true. I can't find such requirement in POSIX 2008 and XSI 7. So, back out that part of my commit, returning old strcmp(), and remove this misleading comment.
* Let pam_lastlog use random ut_id's.ed2010-01-182-14/+42
| | | | | | | | | | | | | | | | | By using random values for ut_id, not based on the TTY name, it is possible to run for example login(1) multiple times on the same TTY, without overwriting any previous records. The output of w(1) will then be as follows: | 12:26PM up 2 days, 2:31, 5 users, load averages: 0.01, 0.03, 0.03 | USER TTY FROM LOGIN@ IDLE WHAT | ed pts/2 mekker.80386.nl 12:26PM - w | root pts/2 - 12:26PM - w | root pts/2 - 12:26PM - w | root pts/2 - 12:26PM - w Approved by: des
* preserve errno when processing error cases.davidxu2010-01-181-1/+3
|
* a) Use strcoll() in opendir() and alphasort() as POSIX 2008 requires.ache2010-01-182-8/+4
| | | | | | | | | | | | | | | | | It also matches now how our 'ls' works for years. b) Remove comment expressed 2 fears: 1) One just simple describe how strcoll() works in _any_ context, not for directories only. Are we plan to remove strcoll() from everything just because it is little more complex than strcmp()? I doubt, and directories give nothing different here. Moreover, strcoll() used in 'ls' for years and nobody complaints yet. 2) Plain wrong statement about undefined strcoll() behaviour. strcoll() always gives predictable results, falling back to strcmp() on any trouble, see strcoll(3). No objections from -current list discussion.
* Perform several small cleanups to the utmpx code.ed2010-01-175-60/+62
| | | | | | | | | | | | | | | | - Massively reduce BSS usage. Let futx_to_utx() dynamically allocate the structure. There is only a very small amount of applications out there that needs to use the utmpx database. Wasting 1 KB on unused structures makes little sense. - Just let getutxid() search for matching ut_id's for any *PROCESS-type. This makes the code a bit more future-proof. - Fix a POSIX-mistake: when reading POSIX and the OpenSolaris implementation, getutxline() must return USER_PROCESS and LOGIN_PROCESS records whose ut_lines match. When reading POSIX, it seems LOGIN_PROCESS should not use ut_line at the first place. I have reported this issue.
* Add forgotten break; keyword to getutxid().ed2010-01-171-0/+2
| | | | | We should not fall through to the ut_id comparison. Only ut_type should be compared when using OLD_TIME, NEW_TIME, BOOT_TIME or SHUTDOWN_TIME.
* Unbreak builds with _FREEFALL_CONFIG=yes, by forcing a lower WARNSmarcel2010-01-171-0/+1
| | | | level in that case.
* Fix a regression that was introduced in r191882.ed2010-01-171-1/+1
| | | | | | | | | | | | | I changed login_tty() to only work when the application is not a session leader yet. This works fine for applications in the base system, but it turns out various applications call this function after daemonizing, which means they already use their own session. If setsid() fails, just call tcsetsid() on the current session. tcsetsid() will already perform proper security checks. Reported by: Oliver Lehmann MFC after: 1 week
* Simplify ttyslot(3).ed2010-01-171-25/+1
| | | | | | | | | | | After comparing how other systems deal with utmp/utmpx, I noticed many systems don't even care about ttyslot(3) anymore, since utmpx doesn't use TTY slots anyway. We don't provide any tools to access old utmp files anymore, so there is no use in letting applications write to a proper offset within the utmp file. Just let ttyslot(3) always return 0, which seems to be the default behaviour on operating systems like Linux as well.
* Correct a typo (when we talk about offset, it shoulddelphij2010-01-171-1/+1
| | | | | | be offset, not size). Submitted by: pluknet at gmail com
* Expose stripe offset and stripe size through libgeom and geom(8) userlanddelphij2010-01-174-1/+55
| | | | | | utilities. Reviewed by: pjd, mav (earlier version)
* Unexpose the old uname(3) function.ed2010-01-162-4/+3
| | | | | | Nowadays uname(3) is an inline function around __xuname(3). Prevent linkage of new binaries against this compatibility function, similar to what I did with ttyslot(3).
* Also call sem_module_init in sem_close to initialize mutexdavidxu2010-01-151-0/+2
| | | | with some attributes.
* Add wtmpcvt(1).ed2010-01-141-0/+1
| | | | | | | | | | This utility allows users to convert their wtmp databases to the new format. It makes no sense for users to keep their wtmp log files if they are unable to view them. It basically copies ut_line into ut_id as well. This makes it possible for last(1) and ac(8) to match login records with their corresponding logout record.
* Remove ttyslot from Symbol.map anyway.ed2010-01-141-1/+0
| | | | Requested by: kan
* Unbreak pututxline() on 32-bit architectures.ed2010-01-141-4/+4
| | | | | | | | I forgot to cast the size_t's back to off_t before negating them, causing all sorts of artifacts where the log files would grow to 2^32 - 197 bytes. Reported by: ume
* Revert the change to Symbol.map, made in r202274.ed2010-01-141-0/+1
| | | | | | | | | | | | | Even though we use __sym_compat(), we should list the symbol in Symbol.map. ttyslot() is now listed as follows, which seems to do the right thing: | Symbol table '.dynsym' contains 2755 entries: | Num: Value Size Type Bind Vis Ndx Name | 613: 00000000000477b0 121 FUNC GLOBAL DEFAULT 10 ttyslot@FBSD_1.0 Reported by: kib
* Don't use fseeko() to obtain the file offset.ed2010-01-141-1/+1
| | | | | I was a bit confused with lseek(), which returns the new offset. We should ftello() to obtain it using stdio.
* Add two changes that should have gone into commit r202274.ed2010-01-142-2/+1
| | | | | | | | | | Phase out ttyslot(3). The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots.
* Phase out ttyslot(3).ed2010-01-143-22/+6
| | | | | | | | The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots.
* Remove login(3), logout(3) and logwtmp(3) from libutil.ed2010-01-138-459/+4
| | | | | | | | | | These functions only apply to utmp(5). They cannot be kept intact when moving towards utmpx. The login(3) function would break, because its argument is an utmp structure. The logout(3) and logwtmp(3) functions cannot be used, since they provide a functionality which partially overlaps. Increment SHLIB_MAJOR to 9 to indicate the removal.
* Remove utmpx stub from libulog.ed2010-01-1314-1030/+45
| | | | | | | | | I'm not increasing the shlib major version for this, because not a single application outside the base system should have used these functions in such a short timespan. Rewrite ulog_login(3) and ulog_logout(3) to build on top of the utmpx implementation in libc.
* Let pam_lastlog use utmpx instead of libulog's utmpx interface.ed2010-01-131-5/+6
| | | | | It will still use ulog_login(3) and ulog_logout(3), which will remain present.
* Let libopie use utmpx instead of utmp.ed2010-01-132-6/+5
|
* Implement <utmpx.h>.ed2010-01-138-13/+1190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The utmpx interface is the standardized interface of the user accounting database. The standard only defines a subset of the functions that were present in System V-like systems. I'd like to highlight some of the traits my implementation has: - The standard allows the on-disk format to be different than the in-memory representation (struct utmpx). Most operating systems don't do this, but we do. This allows us to keep our ABI more stable, while giving us the opportunity to modify the on-disk format. It also allows us to use a common file format across different architectures (i.e. byte ordering). - Our implementation of pututxline() also updates wtmp and lastlog (now called utx.log and utx.lastlogin). This means the databases are more likely to be in sync. - Care must be taken that our implementation discard any fields that are not applicable. For example, our DEAD_PROCESS records do not hold a TTY name. Just a time stamp, a record identifier and a process identifier. It also guarantees that strings (ut_host, ut_line and ut_user) are null terminated. ut_id is obviously not null terminated, because it's not a string. - The API and its behaviour should be conformant to POSIX, but there may be things that slightly deviate from the standard. This implementation uses separate file descriptors when writing to the log files. It also doesn't use getutxid() to search for a field to overwrite. It uses an allocation strategy similar to getutxid(), but prevents DEAD_PROCESS records from accumulating. Make sure libulog doesn't overwrite the manpages shipped with our C library. Also keep the symbol list in Symbol.map sorted. I'll bump __FreeBSD_version later this evening. I first want to convert everything to <utmpx.h> and get rid of <utmp.h>.
* Return SEM_FAILED instead of NULL, though there are same, but thedavidxu2010-01-131-2/+3
| | | | | SEM_FAILED is more suitable name. In function, sem_close(), always set errno on error.
* Miscellaneous mdoc, spelling and inconsistency fixes.brueffer2010-01-1212-45/+54
| | | | | | PR: 142573, 142576 (mostly) Submitted by: brucec MFC after: 1 week
* Remove useless .TE groff macro.brueffer2010-01-121-1/+0
| | | | | Submitted by: Joerg Sonnenberger MFC after: 3 days
* Bug fix: add a missing initializer.jkoshy2010-01-121-0/+1
| | | | | Submitted by: Luca Pizzamiglio <luca.pizzamiglio at gmail dot com> PR: i386/142742
* Update manuals of sem_open and sem_init.davidxu2010-01-122-5/+5
| | | | Submitted by: ru
* Reset variable fields in case the transfer is opened againthompsa2010-01-101-1/+12
| | | | Submitted by: Hans Petter Selasky
* Give a less silly response to a silly request.cperciva2010-01-102-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | Prior to this commit, fread/fwrite calls with size * nmemb > SIZE_MAX were handled by reading or writing (size_t)(size * nmemb) bytes; for example, on 32-bit platforms, fread(ptr, 641, 6700417, f) would read 1 byte and indicate that the requested 6700417 blocks had been read. This commit adds a check for such integer overflows, and treats them as if an overly large request was passed to read/write; i.e., it sets errno to EINVAL, sets the error indicator on the file, and returns a short object count (0, to be specific). The overflow check involves an integer division, so as a performance optimization we check first to see if both size and nmemb are less than 2^16; if they are, no overflow is possible and we avoid the division. We assume here that size_t is at least 32 bits; this appears to be true on all platforms FreeBSD supports. Although this commit fixes an integer overflow, it is not likely to have any security implications, since any program which would be affected by this bug fix is quite clearly already very confused. Reviewed by: kib MFC after: 1 month
* Use the correct types to store uids and gids in the credential cache.brooks2010-01-091-4/+4
|
* Implement the fo_readdir method. This does not support longmarcel2010-01-091-1/+68
| | | | | | | file names. Obtained from: Juniper Networks, Inc. MFC after: 1 week
* Add a set of manual pages for pthread[_attr]_[sg]etaffinity(3).delphij2010-01-092-4/+8
| | | | | Reviewed by: davidxu MFC after: 2 weeks
* Update manual for sem_init and sem_open, restrictions of shared semaphoredavidxu2010-01-092-9/+17
| | | | | | and 14 characters in name length no longer exist. Reviewed by: deischen@
* Merge r195129 from project/mips to head by hand:imp2010-01-091-2/+6
| | | | | r195129 | gonzo | 2009-06-27 17:28:56 -0600 (Sat, 27 Jun 2009) | 2 lines - Use sysarch(2) in MIPS version of _tcb_set/_tcb_get
* Merge r195030 from project/mips to head by handimp2010-01-092-1/+19
| | | | | | | r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 lines - Switch to libc softfloat from libgcc implementation. The problem with latter is that it is not complete, fpsetXXX/fpgetXXX functions are missing.
* Merge r197800 from projects/mips to head by hand:imp2010-01-082-7/+4
| | | | | | r197800 | gonzo | 2009-10-06 00:35:52 -0600 (Tue, 06 Oct 2009) | 3 lines - curbrk variable for sbrk and brk should be the same - Add correct variable names to Symbol.map
* Merge r195025 from projects/mips to head by hand:imp2010-01-086-0/+0
| | | | | | | r195025 | gonzo | 2009-06-25 19:01:50 -0600 (Thu, 25 Jun 2009) | 4 lines - Move fpgetXXX.c/fpsetXXX.c sources to hardfloat subdir/ to prevenmt them from being mixed up with lib/libc/softfloat files with the same names
* Remove unnecessary quoting and markup, add missing punctuation.brueffer2010-01-081-3/+2
| | | | | | PR: 140494 Submitted by: Jeremy Huddleston <jeremyhu@apple.com>, bde MFC after: 1 week
* Further fix grammar.kib2010-01-071-1/+1
| | | | | Suggested by: alc MFC after: 3 days
* Fix a typo and bump date for the previous commit.brueffer2010-01-071-2/+2
|
* Remove BUGS section that no longer applies after recent changes to semaphoretrasz2010-01-071-8/+1
| | | | | | code. OK-ed by: davidxu
* Give some information on SF_MNOWAIT flag.kib2010-01-071-2/+10
| | | | MFC after: 3 days
* Don't forget to use fourth argument if O_CREAT is set in argument oflag.davidxu2010-01-071-1/+3
| | | | The fourth specifies initial value for the semaphore.
OpenPOWER on IntegriCloud