Commit Graph

348 Commits

Author SHA1 Message Date
John Dyson
5ae9116a7d Clean-up my modification of popen.c for vfork. Bruce's (this) is better.
Submitted by:	Bruce Evans <bde@freebsd.org>
1997-04-20 20:17:04 +00:00
Bruce Evans
a3315650db Fixed #include and/or prototype bugs in synopsis. 1997-04-19 15:57:20 +00:00
Daniel O'Callaghan
a6f96c4131 Fix punctuation: "it's" -> "its" 1997-04-17 23:31:47 +00:00
John Dyson
1174d9f9df Fix the problem in popen that makes correct vfork semantics fail.
Specifically, popen modifies a variable "pdes[1]" in the child
in such a way that it breaks code in the parent (due to the address
space sharing.)
1997-04-16 03:26:50 +00:00
Bruce Evans
69b10155b5 Fixed another prototype bug in synopsis. 1997-04-14 13:37:18 +00:00
David Nugent
5afcddae37 Fix typo. 1997-04-13 16:55:56 +00:00
David Nugent
b06ebb3255 Implement two new keywords and status flags for entries in /etc/ttys;
TTY_NETWORK (network), TTY_DIALUP (dialup), which determine a basic
connection type. TTY_DIALUP in particular will replace the old out of
date heuristic "tty[dD]*" in login.c (and better than the current
hard-coded method).
1997-04-13 15:16:03 +00:00
David Nugent
c8207e03ba Add MLINKS for isdialuptty(3) & isnetworktty(3). 1997-04-13 15:12:14 +00:00
Bruce Evans
08398af376 Fixed #include and/or prototype bugs in synopsis. 1997-04-13 13:16:20 +00:00
Mike Pritchard
b0b21f924b Typo police. Part of PR# 3242.
Submitted by:	Philippe Charnier <charnier@xp11.frmug.org>
1997-04-09 23:05:04 +00:00
Andrey A. Chernov
21d58869ce Speedup in case locale not used 1997-04-04 19:16:08 +00:00
Andrey A. Chernov
6a575f6e24 Eliminate some function calls when locale not used 1997-04-04 19:08:19 +00:00
Andrey A. Chernov
5058254947 Speedup in case locale not used 1997-04-04 18:44:19 +00:00
Mike Pritchard
5d00c0a499 Honor the nouser/nogroup flag when determing if NULL should
be returned if a cached uid/gid does not exist in the password
file.
1997-04-03 01:51:34 +00:00
Mike Pritchard
1595890a1f The user_from_{uid,gid} routines would return garbage if the
uid/gid in question was in the cache, but did not exist
in the password file.  This causes the -nouser and -nogroup
options to find(1) to only print the first file owned by
an unknown user/group in some cases.
1997-04-02 06:20:04 +00:00
David Nugent
c333ae82c1 Remove minor warning (for -Wall -Wshadow); clarifies code. 1997-03-26 15:42:09 +00:00
Warner Losh
62f187a4cf Buffer overflow. Similar, but different, to the fix that Julian A submitted
in PR 2580.

Obtained from: BSDi by way of Keith Bostic

Should be in 2.2 and 2.1.x.  I'll merge into 2.2.
1997-03-23 23:31:50 +00:00
Mike Pritchard
8a7f0369b3 Use the .Tn macro for generic FreeBSD references. Other minor cleanup. 1997-03-21 20:57:20 +00:00
Mike Pritchard
9de8ddb8bc Mdoc cleanup. 1997-03-21 20:46:30 +00:00
John Polstra
cf49f43912 Add backward compatibility so that static executables built on
modern FreeBSD systems will syslog properly on older systems that
still name the logging socket "/dev/log".  This includes pre-2.2
versions of FreeBSD as well as BSD/OS systems.  If the connect to
"/var/run/log" fails, the function now tries to connect to
"/dev/log" as a fallback.
1997-03-20 16:28:27 +00:00
Bruce Evans
1d23531445 FIxed arg types (mostly missing consts) in synopsis. 1997-03-19 00:58:07 +00:00
Bruce Evans
09589ca82e FIxed arg types (mostly missing consts) in synopsis. 1997-03-19 00:52:58 +00:00
Bruce Evans
7a30f18397 Added missing #include of <stdarg.h> to synopsis. Moved prototypes for
`v' functions after this #include (same organisation as in printf.3 for
printf/vprintf).
1997-03-19 00:43:13 +00:00
Bruce Evans
3ce29386aa Fixed missing function types in synopsis. 1997-03-19 00:32:42 +00:00
Bruce Evans
f68da8d891 Fixed synopsis (put all of the function (return) type info in .Ft and
none in .Fn).
1997-03-19 00:06:09 +00:00
Peter Wemm
098f04f5d1 Back out a dubious Lite2 change to "optimise" getcwd() to look at $PWD
because it's potentially dangerous (think: symlink races).  Move
realpath() back to it's original location, and remove getcwd_physical()
by renaming it back to getcwd() and zapping the original getcwd wrapper.

Noticed by: bde
1997-03-13 06:45:38 +00:00
Mike Pritchard
1d104f9fbd More cleanup - I didn't realize that this was a new man page
and need extra attention :-)
1997-03-12 15:21:57 +00:00
Mike Pritchard
1da7386d34 Mdoc cleanup. 1997-03-12 15:14:07 +00:00
Bruce Evans
c047aec843 Fixed merging error. Lite2 fixed premature failure and didn't
touch duplicate group suppression, but the merge blew away our
duplicate group suppression.

The merge also blew away the -Wall cleanup in rev.1.5, but that
was misformatted, so I didn't restore it.
1997-03-12 14:54:22 +00:00
Bruce Evans
03dcee8db1 Fixed errors in the Lite2 merge. Some style changes were mismerged.
My changes to preserve errno across free() and close() and to report
fstat() errors properly were blown away.

Updated the FreeBSD changes to match the Lite2 style fixes.
1997-03-12 12:35:44 +00:00
Bruce Evans
e1dfe717ec Document that popen() uses a bidirectional pipe (in FreeBSD) and not a
socket pair (as in Lite2).
1997-03-11 19:28:24 +00:00
Bruce Evans
035e5608d5 Fixed cleaning up after malloc failure, which was broken by Lite2.
We don't use socketpair(), so don't #include <sys/socket.h>.

Restored some gcc-quieting parentheses that were lost in the Lite2 merge.
1997-03-11 18:51:43 +00:00
Bruce Evans
1662ffff99 Install the Lite2 getvfsbyname.3. The old getvfsbyname() interface is
still available and described in getvfsent.3.
1997-03-11 18:20:06 +00:00
Bruce Evans
6d50b78d4d Fixed #include's in synopsis. 1997-03-11 18:16:02 +00:00
Peter Wemm
adf6ad9e69 Merge from Lite2:
filesystem include updates, duplicate group suppression, cleanups,
  filesystem whiteout support (unionfs), bidir popen().
1997-03-11 11:52:33 +00:00
Peter Wemm
0014b4c0e1 Merge from Lite2: man page updates 1997-03-11 11:47:52 +00:00
Peter Wemm
1edb99c337 Merge from Lite2 (YAMFL2? :-)
Document that popen() can now create bidirectional pipes and handles.
Note that this needs to be updated since we have a native bidirectional
pipe and don't use socketpair() here.
1997-03-11 11:46:19 +00:00
Peter Wemm
e5574dc8c0 Merge from Lite2 (+realpath.3) 1997-03-11 11:42:56 +00:00
Peter Wemm
9dc1164189 merge from Lite2 - realpath() now shares a lot of code with getcwd()
and is now in the same file.
1997-03-11 11:37:59 +00:00
Peter Wemm
662909a780 Import CSRG 4.4BSD-Lite2 lib/libc onto vendor branch 1997-03-11 11:29:42 +00:00
Peter Wemm
e5493ddb0f This commit was generated by cvs2svn to compensate for changes in r23658,
which included commits to RCS files with non-trunk default branches.
1997-03-11 11:29:42 +00:00
Peter Wemm
0b7ae03c1a Import CSRG 4.4BSD-Lite2 includes onto vendor branch 1997-03-11 11:11:37 +00:00
Bill Paul
09e8462819 Fix brain-o in SunOS passwd.adjunct stuff: !strstr(s, "##") is a) bad
style and b) the wrong logic. Should be strstr(s, "##") != NULL. (Note
that the passwd.adjunct stuff has not been merged into 2.2 so this bug
is not in that branch.)
1997-03-10 16:47:19 +00:00
Mike Pritchard
2d3868141d The first argument to fts_set was wrong. Part of PR# 2917. 1997-03-09 00:43:49 +00:00
Mike Pritchard
e2493e0fc3 Pause() is made obsolete by sigsuspend(2), not sigpause(3).
Part of PR# 2917.
1997-03-09 00:42:46 +00:00
Wolfram Schneider
4ccb26e49a Allow comments in group database.
The character `#' introduces a comment. Leading spaces and tabs are
ignored: '^[ \t]*#.*\n$'

Count an empty line - only spaces, tabs or newline - also as a comment.
(to be compatibel with password database comments). '^[ \t]*\n$'
1997-03-08 16:21:40 +00:00
Bruce Evans
cdd42308ce Enabled the Lite2 getvfsbyname(). It's actually named new_getvfsbyname()
for now so that we don't lose library compatibility.  Applications should
define _NEW_VFSCONF and use getvfsbyname() instead of new_getvfsbyname()
if they want the new vfsconf interface.  Parts of the old interface
(enough to load vfs modules, I hope) are still available.
1997-03-03 13:08:33 +00:00
Andrey A. Chernov
09f3779132 Don't add/subtract 1 to MAXLOGNAME, it is already NUL-terminated 1997-03-03 08:11:28 +00:00
Mike Pritchard
10fd17786f Change vfc_typenum back to vfc_index in response to bde's
commit to getvfsent.c rev 1.10.
1997-03-03 06:02:54 +00:00
Bruce Evans
0df382bd0f Changed vfc_typenum back to vfc_index. The old vfsconf struct is now
visible again, and the new vfsconf struct didn't match reality.
1997-03-03 05:53:54 +00:00
Bruce Evans
08f68ac6a6 Attempt to import Lite2's getvfsbyname.c. 1997-03-02 18:13:14 +00:00
Bruce Evans
095777c6a0 This commit was generated by cvs2svn to compensate for changes in r23291,
which included commits to RCS files with non-trunk default branches.
1997-03-02 18:13:14 +00:00
Mike Pritchard
7dbe27136f Oops! I accidently commited a change that wasn't ready for prime
time yet. Revert to rev 1.2.
1997-02-28 06:26:26 +00:00
Mike Pritchard
cd1b6738ab The struct vfsconf element vfc_index is now vfs_typenum. 1997-02-28 06:22:29 +00:00
Mike Pritchard
28f86af297 Correct the xref section - it was incorrectly using .Fn instead
of .Xr for the xrefs.
1997-02-28 05:46:19 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Peter Wemm
b97fa2ef50 Revert $FreeBSD$ to $Id$ 1997-02-22 14:13:04 +00:00
Daniel O'Callaghan
589dde865b Typogrammatical error 'with' -> 'when'.
This could be put into 2.2.
1997-02-20 06:50:31 +00:00
Wolfram Schneider
b8dc034799 Add forgotten man page link fts_set.3 -> fts.3 1997-02-16 22:32:13 +00:00
David Nugent
a60c8a80bc Allow commonly-used "insecure" as a valid keyword in /etc/ttys.
This prevents keywords after "insecure" occurs being errnoeously
parsed as comments.
1997-02-15 05:45:00 +00:00
Adam David
590f415db7 lite2 remame: vfc_index --> vfc_typenum 1997-02-12 01:34:38 +00:00
Julian Elischer
c840cec7c5 Submitted by: John Birrell
uthreads update from the author.
1997-02-05 23:26:09 +00:00
Mike Pritchard
21ac7f5f23 Don't use hardcoded *roff font change requests. 1997-01-31 01:06:39 +00:00
Mike Pritchard
c492ccdb9a Very minor mdoc cleanup. 1997-01-31 00:25:12 +00:00
Mike Pritchard
1ffa645077 Update to reflect current include files. 1997-01-30 23:01:49 +00:00
Mike Pritchard
a734cc76a8 Dont' mlink getgrent.3 to setgrfile.3, since there is no
setgrfile() function.
1997-01-30 22:52:50 +00:00
Wolfram Schneider
75141cc987 Sort cross references. 1997-01-20 23:23:22 +00:00
Alexander Langer
8abdc2eb40 Sweep through the tree fixing mmap() usage:
- Use MAP_FAILED instead of the constant -1 to indicate
    failure (required by POSIX).
  - Removed flag arguments of '0' (required by POSIX).
  - Fixed code which expected an error return of 0.
  - Fixed code which thought any address with the high bit set
    was an error.
  - Check for failure where no checks were present.

Discussed with:	bde
1997-01-16 21:58:40 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
David Nugent
4ae89ecddd Added group= facility to /etc/ttys for tty grouping for more
more manageable and convenient referencing by login.conf (login
class database) and (e.g.) login.access.

This is the first of a group of commits which implements the login
class capabilities database.
1997-01-02 08:05:43 +00:00
Mike Pritchard
cb22292338 Spelling/mdoc police. 1996-12-30 21:08:45 +00:00
Bill Paul
1d2493ff77 Small yet significant tweaks/cleanups:
- getpwent:
  o adjunctbuf should be NUL terminated after copying
  o _pw_breakout_yp() needs to know the length of the buffer returned
    from YP so it can properly NUL terminate its local buffer.

- getgrent:
  o YP buffers should be YPMAXRECORD + 2 bytes long and NUL terminated.
    (Previously they were hardcoded to 1024 bytes.)

- getnetgrent:
  o YP data should be copied with snprintf(), not sprintf()

These are 2.2 candidates. I will wait a few days to make sure these don't
break anything and then, if there are no objections, move them to the 2.2
branch.
1996-12-27 19:28:46 +00:00
Alexander Langer
205390f373 Make a note in the standards section that sysconf isn't completely
POSIX conforming.
1996-12-27 03:39:03 +00:00
Wolfram Schneider
ebddb6b4fe Use dynamic allocated buffers instead static buffers. No member or
line length limit anymore - now 500 members or 5000 members are
possible. For security group lines longer than 256K will be count as
an error. 256K should be enough for 65536 users.

Support comments (lines that begin with a #) if compiled with
option -DGROUP_IGNORE_COMMENTS.

Fortunately it seems that all system utilities which use getgrent()
functions are dynamically linked executables. So you need only
rebuild libc.so.3.0 if you want this change. Note: if you have
an old X server which depend on libc.so.2.* you should rebuild
libc.so.2.* too.

Not a 2.2 candidate.
1996-12-25 21:51:24 +00:00
David Nugent
b8dd511777 Speeling fix. 1996-12-22 02:14:56 +00:00
Bill Paul
73418074a9 Add a missing #ifdef YP/#endif pair so that this module will
compile without -DYP.

Pointed out by: Wolfram Schneider
1996-12-21 18:36:44 +00:00
Mike Pritchard
495be781d9 Mention FreeBSD explicitly along with 4.2BSD so that the
reader will know that this information does apply to FreeBSD also.

Closes PR# 1618.

This can go into 2.2.
1996-12-15 23:23:17 +00:00
Mike Pritchard
487990280d Correct some xrefs/mlinks. 1996-12-14 23:27:20 +00:00
Steve Price
fb5cb2083a Merge Lite2 mods, and -Wall cleaning. undelete(2) cruft
not yet implemented is protected by a define (BSD4_4_LITE)
that should be removed when this call is supported by the
kernel.
1996-12-14 06:03:29 +00:00
Joerg Wunsch
4e17605909 Don't free the line buffer, since getttynam(3) might still reference
it.

Closes PR # bin/2196: Bug in src/libc/gen/gettty...

Submitted by:	davidn@blaze.net.au (David Nugent)
1996-12-12 23:52:34 +00:00
Mike Pritchard
222ca58f9a Change another reference to host names to domain names, and restore some
changes that were lost.

Pointed out by: bde
1996-12-09 16:50:39 +00:00
Jordan K. Hubbard
ecc9c8e3cd sethostname() returns int, not long. I could get used to having this
copy of insure++, too bad the runtime only works for BSD/OS. :-(

Maybe they'll be so impressed by my initial 15 entry bug report for it
that they'll take the FreeBSD version more seriously. :-) :-)
1996-12-05 18:27:20 +00:00
Jordan K. Hubbard
4186474051 _key is a char array and we don't need to pass its address to _buildkey()
when buildkey is expecting a char *.
1996-12-05 18:22:00 +00:00
Jordan K. Hubbard
8af0a47fba gethostname() returns int, not long. Answered my own question by
RTFM'ing.  Either both the header files and the man pages are wrong
or this code is, and I'll take the majority decision. :-)
1996-12-05 18:14:56 +00:00
Bill Paul
2be5d4cba8 Add support for detecting and hopefully using the passwd.adjunct.byname
NIS map which is present on SunOS NIS servers with the SunOS C2 security
hack^Woption installed. I'm convinced that the C2 security option restricts
access to the passwd.adjunct.byname map in the same way that I restrict
access to the master.passwd.{byname,buid} maps (checking for reserved ports),
which means that we should be able to handle passwd.adjunct.byname map
correctly.

If _havemaster() doesn't find a master.passwd.byname map, it will now
test for a passwd.adjunct.byname map before defaulting back to the
standard non-shadowed passwd.{byname,byuid} maps. If _pw_breakout_yp()
sees that the adjunct map was found and the password from the standard
maps starts with ##, it will try to grab the correct password field
from the adjunct map. As with the master.passwd maps, this only happens
if the caller is root, so the shadowing feature is preserved; non-root
users just get back ##username as the encrypted password.

Note that all we do is grab the second field from the passwd.adjunct.byname
entry, which is designated to be the real encrypted password. There are
other auditing fields in the entry but they aren't of much use to us.

Also switched back to using yp_order() to probe for the maps (instead
of yp_first()). The original problem with yp_order() was that it barfed
with NIS+ servers in YP compat mode since they don't support the
YPPROC_ORDER procedure. This condition is handled a bit more gracefully
in yplib now: we can detect the error and just punt on the probing.
1996-12-03 17:55:49 +00:00
Mike Pritchard
c5fe2345a9 Update getdomainname(3) to reflect that it operates on
domain names and not host names.

Pointed out by:  bde
Obtained from:  NetBSD
1996-12-01 00:10:28 +00:00
Bruce Evans
766631018f Fixed execvp() of an empty pathname to fail POSIXly. Previously it
attempted to exec the components of $PATH and it usually set errno
to the wrong value.

Found by:	NIST PCTS
1996-11-18 19:24:47 +00:00
Bruce Evans
1ad652a54c Fixed uninitialized variables for the '/'-in-pathname case in execvp().
Garbage in `eacces' caused the wrong errno to be set for non-EACCES errors.
Garbage in `etxtbsy' caused a semi-random retry strategy for ETXTBSY errors.

Found by:	NIST-PCTS.  gcc -Wall reported the problem, but -Wall is not
		enabled for libc.
1996-11-18 16:56:51 +00:00
Jeffrey Hsu
3384e369af Parameters pthread_getspecific() changed. 1996-11-11 09:11:59 +00:00
Bruce Evans
b1f6a5fb5d Document that the `old' count is returned for the ENOMEM case. 1996-11-04 17:03:34 +00:00
Andrey A. Chernov
edcfa07284 collate_range_cmp -> __collate_range_cmp 1996-10-31 04:32:27 +00:00
Joerg Wunsch
55e0d3b7cf Fix an off-by-one error in getvfsent().
Detected by: phkmalloc :)
1996-10-26 21:53:21 +00:00
Andrey A. Chernov
3deeb59da9 GNU-style changes:
1) Rename FNM_ICASE to FNM_CASEFOLD
2) Add FNM_LEADING_DIR
Add proper (unsigned char) casts to tolower().
Use 'char' function argument for proper sign extension
1996-10-23 16:40:20 +00:00
Joerg Wunsch
a098bfd775 Fix a potential memory leak i've introduced with my recent patch.
Reviewed by:	bde
1996-10-21 23:56:23 +00:00
Wolfram Schneider
95e4966c47 add flag FNM_ICASE for case insensitve search
Reviewed by: ache
1996-10-20 15:15:59 +00:00
Joerg Wunsch
5fae0297db Remove the arbitrary limit for the line length in /etc/ttys, and make
the buffer dynamic.

Closes PR # misc/1838: getttyent() arbitrary 100...
1996-10-19 16:29:10 +00:00
Peter Wemm
0d4453d303 Corrently null-terminate the path being passed to the opendir() calls,
malloc() does is not defined to return a zeroed buffer leading to
"strange" problems.

Submitted by: Karl Denninger <karl@mcs.com>, PR#1826
1996-10-17 00:40:04 +00:00
Wolfram Schneider
e83201b43a delete doubled words, e.g.: "the the" -> "the" 1996-10-05 22:27:30 +00:00
Bruce Evans
38c429d5bc Made this about as (in)complete as sysctl.8.
- removed references to nonexistent pathconf-related variables.
- document everything in CTL_MACHDEP(more than in sysctl.8) and
  80% of the things in CTL_KERN (same as in sysctl.8).
1996-09-29 18:12:52 +00:00
Wolfram Schneider
ac8ef33789 .Os NetBSD -> .Os FreeBSD.
The pages are not NetBSD specific and FreeBSD is not a child of NetBSD.
1996-09-28 22:46:35 +00:00