summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* stdio.h --> unistd.hAndrey A. Chernov1995-03-091-1/+1
| | | | Notes: svn path=/head/; revision=6966
* Don't build swab.o here. It gets built in libc/i386/string. PreviouslyBruce Evans1995-03-071-1/+1
| | | | | | | | | the copy built from here was overwritten by the other copy and the other copy was put in library-building command lines twice. ld now objects to duplicated modules. Notes: svn path=/head/; revision=6937
* On snap 950210, format %s (print seconds from the epoch) is missingJoerg Wunsch1995-03-012-1/+23
| | | | | | | | | | | | from the code in strftime.c . This affects both the library code and all the commands using it (e.g. date +%s). Note that %s is not required by ANSI, but we've already got it in 1.1.5.1. Suggested by: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Notes: svn path=/head/; revision=6815
* Don't attempt to lstat() the POSIXLY invalid empty pathname.Bruce Evans1995-02-251-1/+1
| | | | | | | | realpath() still accepts "" as an arg and converts it to a canonical pathname for the current directory. Notes: svn path=/head/; revision=6700
* Explain the full story, and make it understandable too.Poul-Henning Kamp1995-02-251-2/+7
| | | | Notes: svn path=/head/; revision=6693
* fix the synopsis to showPoul-Henning Kamp1995-02-241-5/+1
| | | | | | | | | | | | | | | | | void | *signal(int sig, void (*func)(int)) instead of | void | *signal(sig, func()) | | void | (*func)() Notes: svn path=/head/; revision=6681
* Add missing #include <time.h> with time() prototypeAndrey A. Chernov1995-02-241-0/+1
| | | | Notes: svn path=/head/; revision=6677
* Minor optimization.Andrey A. Chernov1995-02-181-7/+9
| | | | Notes: svn path=/head/; revision=6544
* Minor optimizationAndrey A. Chernov1995-02-181-7/+4
| | | | Notes: svn path=/head/; revision=6538
* Copyrights cleanupAndrey A. Chernov1995-02-184-22/+38
| | | | Notes: svn path=/head/; revision=6537
* Bruce pointed out, that a misleading warning would be issuedStefan Eßer1995-02-171-1/+1
| | | | | | | | | | in an (unlikely) border case (maxgroups==1 and the user is on an /etc/group line for the same group and that group only ...). Now this case is dealt with as before ... Notes: svn path=/head/; revision=6536
* Protect against duplicate gids in group list (as could be theStefan Eßer1995-02-171-2/+5
| | | | | | | result of being a member of some group in both /etc/group and YP). Notes: svn path=/head/; revision=6530
* Don't pick _warn module nowAndrey A. Chernov1995-02-171-10/+34
| | | | Notes: svn path=/head/; revision=6523
* Correct the parameters for the fchown. The third was erroneouslyAndreas Schulz1995-02-171-1/+1
| | | | | | | specified as uid_t but should be gid_t. Notes: svn path=/head/; revision=6511
* Add 8bit collate stuffAndrey A. Chernov1995-02-165-110/+150
| | | | | | | Submitted by: alex@elvisti.kiev.ua Notes: svn path=/head/; revision=6509
* Add 8-bit collate stuffAndrey A. Chernov1995-02-165-2/+270
| | | | | | | Submitted by: alex@elvisti.kiev.ua Notes: svn path=/head/; revision=6485
* Document Transaction TCP extensions to generic system calls.Garrett Wollman1995-02-152-15/+46
| | | | Notes: svn path=/head/; revision=6471
* Backed out Keith Bostic's getcwd/$PWD hack. It is causing things to breakDavid Greenman1995-02-072-31/+6
| | | | | | | all over the place. Notes: svn path=/head/; revision=6227
* Document the getenv(PWD) feature.Poul-Henning Kamp1995-02-051-1/+7
| | | | Notes: svn path=/head/; revision=6203
* Collapsed _masterpw_breakout_yp() and _pw_breakout_yp() into aBill Paul1995-02-051-72/+20
| | | | | | | single function. Notes: svn path=/head/; revision=6190
* A cute hack to speed up things by Keith: if getenv("PWD") is the samePoul-Henning Kamp1995-02-041-5/+24
| | | | | | | | | | | inode as ".", then just return that. I added a check so it must start with a '/'. Reviewed by: phk Submitted by: bostic@cs.berkeley.edu (Keith Bostic) Notes: svn path=/head/; revision=6182
* Include <time.h> instead of <sys/time.h> to get CLK_TCK. IncludingBruce Evans1995-02-031-1/+1
| | | | | | | | <sys/time.h> works because <sys/time.h> includes <time.h> if KERNEL is not defined, but is ugly. Notes: svn path=/head/; revision=6171
* Change CLK_TCK to CLOCKS_PER_SEC.Bruce Evans1995-02-031-1/+2
| | | | | | | | | Add a missing apostrophe that suggests inverting the frequency to get tick size. It read better before because `CLK_TCK' suggests a tick size although it is actually a frequency. Notes: svn path=/head/; revision=6169
* Change CLK_TCK to CLOCKS_PER_SEC. (CLK_TCK is a deprecated POSIX featureBruce Evans1995-02-031-2/+3
| | | | | | | | | and is not necessarily related to the ANSI CLOCKS_PER_SEC). Parenthesize macro args. Notes: svn path=/head/; revision=6167
* Fix previous change to preserve const'ness.Bruce Evans1995-02-031-2/+2
| | | | Notes: svn path=/head/; revision=6166
* Fixed a rather serious bug that presents itself when FreeBSD is configuredBill Paul1995-02-031-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as an NIS client. The pw_breakout_yp routines that are used to populate the _pw_passwd structire only do anything if the bits in the pw_fields member _pw_passwd are cleared. Unfortunately, we can get into a state where pw_fields has garbage in it right before the YP lookup functions are called, which causes the breakout functions to screw up in a big way. Here's how to duplicate the problem: - Configure FreeBSD as an NIS client - Log in as a user who's password database records reside only in the NIS passwd maps. - Type ps -aux Result: your processes appear to be owned by 'root' or 'deamon.' /bin/ls can exhibit the same problem. The reason this happens: - When ps(1) needs to match a username to a UID, it calls getpwuid(). - root is in the local password file, so getpwuid() calls __hashpw() and __hashpw() populates the _pw_passwd struct, including the pw_fields member. This happens before NIS lookups take place because, by coincidence, ps(1) tends to display processes owned by root before it happens upon a proccess owned by you. - When your UID comes up, __hashpw() fails to find your entry in the local password database, so it bails out, BUT THE BITS IN THE pw_fields STRUCTURE OF _pw_passwd ARE NEVER CLEARED AND STILL CONTAIN INFORMATION FROM THE PREVIOUS CALL TO __hash_pw()!! - If we have NIS enabled, the NIS lookup functions are called. - The pw_breakout_yp routines see that the pw_fields bits are set and decline to place the data retrieved from the NIS passwd maps into the _pw_passwd structure. - getpwuid() returns the results of the last __hashpw() lookup instead of the valid NIS data. - Hijinxs ensue when user_from_uid() caches this bogus information and starts handing out the wrong usernames. AAAARRRRRRRRRGGGGGGHHHHHHHHHH!!! *Please* don't tell me I'm the only person to have noticed this. Fixed by having __hashpw() check the state of pw_fields just before bailing out on a failed lookup and clearing away any leftover garbage. What a fun way to spend an afternoon. Notes: svn path=/head/; revision=6145
* Fix for that last fix... pass the hat. :)Bill Paul1995-02-011-2/+1
| | | | Notes: svn path=/head/; revision=6096
* Small fix to _getyppass(): sometimes we can construct the wrong mapnameBill Paul1995-02-011-1/+2
| | | | | | | when looking for master.passwd.whatever. Notes: svn path=/head/; revision=6095
* Some changes for YP password map handling:Bill Paul1995-01-311-6/+114
| | | | | | | | | | | | | | | | | | | | | | | | - FreeBSD's NIS server can supply a master.passwd map, which has more fields in it than a standard passwd map, so we need a _master_pw_breakout() fuction. - When doing passwd map lookups, look for master.passwd.* by attempting a _yp_first() on master.passwd.byname. If it exists, we're being served by a FreeBSD NIS server and we should use this map. - If we aren't the superuser, retrieve only the standard passwd maps. If we're being served by a FreeBSD system, then the passwd map has no passwords in it, and it won't serve us the master.passwd map unless we're superuser anyway. There's a small speed hit for the superuser inherent in the check for the master.passwd map, but this lets us dynamically decide what to do rather than rely on a non-standard config file somewhere. Since all of this is bypassed for normal users, they shouldn't notice the difference. Notes: svn path=/head/; revision=6076
* Be sure to properly fail if there are not enough fields. ProblemDavid Greenman1995-01-271-2/+4
| | | | | | | reported by MARC Giannoni <marc@cmc.eng.comsat.com>, this fix is by me. Notes: svn path=/head/; revision=5964
* Reclaim memory used for telldir cookies on closedir.Doug Rabson1995-01-272-0/+30
| | | | Notes: svn path=/head/; revision=5958
* First round of changes to clean up the RCSID mess in libc:David Greenman1995-01-2383-233/+371
| | | | | | | | | | | 1) Changed LIB_SCCS and SYSLIB_SCCS to LIB_RCS and SYSLIB_RCS. 2) Changed sccsid[] variables to rcsid[] 3) Moved all RCSID strings into .text 4) Converted all SCCSID's to RCS $Id$'s 5) Added missing $Id$'s after copyright. Notes: svn path=/head/; revision=5790
* Changed LIB_SCCS and SYSLIB_SCCS #defines to LIB_RCS and SYSLIB_RCS.David Greenman1995-01-231-4/+4
| | | | Notes: svn path=/head/; revision=5789
* (Very) minor improvement from NetBSD/J.T.Conklin.David Greenman1995-01-222-4/+4
| | | | Notes: svn path=/head/; revision=5783
* Added leaner and meaner swab() function by J.T. Conklin.David Greenman1995-01-222-1/+105
| | | | Notes: svn path=/head/; revision=5780
* Fix unbalanced #endif introduced by yesterday's change.Garrett Wollman1995-01-191-1/+1
| | | | Notes: svn path=/head/; revision=5714
* Fix handling of 'e' format floating point so that it prints trailing zerosDoug Rabson1995-01-191-1/+0
| | | | | | | correctly. Notes: svn path=/head/; revision=5707
* Prevent sites from shooting themselves in the foot while enabling/disablingGarrett Wollman1995-01-171-1/+1
| | | | | | | | | | YP by disallowing `+' entries as logins in all cases. (This handles the case of a `+' entry in the password file but YP not running, which should never happen but is easy enough to check for so we'll apply some prophylaxis.) Notes: svn path=/head/; revision=5703
* Add the sys/types.h include to the necessary documented includes for theAndreas Schulz1994-12-311-0/+1
| | | | | | | getrusage call. Notes: svn path=/head/; revision=5324
* fixunsdfsi.S:Bruce Evans1994-12-271-37/+22
| | | | | | | | | Embalm. Rewrite to do things much the same as gcc-2: use fistpq for speed and elegance, and mishandle overflow consistently. __fixunsdfsi() is no longer called by gcc. Notes: svn path=/head/; revision=5246
* sigsetjmp.S:Bruce Evans1994-12-272-6/+4
| | | | | | | Remove unnecessary .text statement. Notes: svn path=/head/; revision=5245
* Remove unnecessary .align statement.Bruce Evans1994-12-274-4/+0
| | | | Notes: svn path=/head/; revision=5244
* Fix a spelling error and add a comment about possible improvements.Bruce Evans1994-12-271-3/+17
| | | | Notes: svn path=/head/; revision=5243
* Fix the bug reported by Torbjorn Granlund <tege@cygnus.com>:Bruce Evans1994-12-251-5/+5
| | | | | | | | | The documentation for mrand48 and lrand48 is mixed up. mrand48 returns a full 32 bit number, while lrand48 only returns 31 bits. Notes: svn path=/head/; revision=5228
* Add missing getdomainname manual page.Guido van Rooij1994-12-182-3/+103
| | | | | | | | | Reviewed by: Submitted by: Obtained from: 1.1.5.1 with a few modifictaions. Notes: svn path=/head/; revision=5152
* Obtained from: 1.1.5Bruce Evans1994-12-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getcwd() has two off-by-one bugs in FreeBSD-2.0: 1. getcwd(buf, size) fails when the size is just large enough. 2. getcwd(buf + 1, 1) incorrectly succeeds when the current directory is "/". buf[0] and buf[2] are clobbered. (I modified Bruce's original patch to return the proper error code [ERANGE] in the case of #2, but otherwise... -DG) This program demonstrates the bug: --- #include <stdlib.h> #include <string.h> #include <stdio.h> #include <unistd.h> int main(void) { char buf[5]; int errors; errors = 0; if (chdir("/tmp") != 0) { perror("chdir"); abort(); } if (getcwd(buf, 5) == NULL) { perror("oops, getcwd failed for buffer size = size required"); ++errors; } if (chdir("/") != 0) { perror("chdir"); abort(); } buf[0] = 0; buf[2] = 1; if (getcwd(buf + 1, 1) != NULL) { fprintf(stderr, "oops, getcwd succeeded for buffer size = one too small\n"); ++errors; } if (buf[0] != 0) { fprintf(stderr, "oops, getcwd scribbled on memory before start of buffer\n"); ++errors; } if (buf[2] != 1) { fprintf(stderr, "oops, getcwd scribbled on memory after end of buffer\n"); ++errors; } exit(errors == 0 ? 0 : 1); } Notes: svn path=/head/; revision=5072
* Obtained from: 386BSD-0.1 patchkit; also fixed in 1.1.5Bruce Evans1994-12-121-2/+3
| | | | | | | | | Compare unsigned chars. Return the place after where the character was found and not the start of the string. Notes: svn path=/head/; revision=5071
* Fix execl[e]. Multiple execle's failed because of bogus caching of theBruce Evans1994-12-121-16/+14
| | | | | | | | | | | pointer returned by realloc(). All callers free the pointer if the execve fails. Nuke the caching. This essentially restores buildargv() to the 1.1.5 version. Also fix a memory leak if realloc() fails. Also nuke similar but non-broken caching in execvp(). malloc() should be efficient enough. Notes: svn path=/head/; revision=5070
* Comment out the man page of rstat.1 from Makefile.inc. There is no rstatAndreas Schulz1994-12-114-5/+5
| | | | | | | | | | command available yet. Changed an entry in getprcent.3 from rpcinfo(8C) to rpcinfo(8). Changed an entry in getrpcport.3 from 3R to 3. Changed two entries in rpc.3 from 3N to 3. Notes: svn path=/head/; revision=5049
* Added the mpool.3 manpage to the installed manpages. It is referred from theAndreas Schulz1994-12-111-0/+1
| | | | | | | other manpages and there is no conflict. Notes: svn path=/head/; revision=5048