Commit Graph

5784 Commits

Author SHA1 Message Date
Dima Dorfman
ca4b6b3910 This API will appear in FreeBSD 4.6. 2002-03-09 05:19:21 +00:00
Dima Dorfman
235d6772d5 Bring a comment in line with the code, and fix some spelling errors
while I'm here.

PR:		35394
Submitted by:	andrew@ugh.net.au
2002-03-09 04:00:53 +00:00
Brian Feldman
44f7d6af24 Fix build. I commented out getpass() in readpassphrase.c because the
implementation did not match our manpage description (i.e., it could
return NULL).  I mistakenly thought we were still using getpass.c
because, for some reason, CVS never removed it from the tree.

Pointy hat received from:	alfred
Kick in the groin to:	CVS
2002-03-09 03:16:41 +00:00
Brian Feldman
a7a8a766e7 Update readpassphrase(3)to the latest revisions. Changes are mainly due
to return value constraints now changing as well as more intelligent
handling of signals.

Obtained from:	OpenBSD
2002-03-08 21:14:00 +00:00
Robert Watson
147273e8ca Improve punctuation consistency: all errors had a '.' after them
except ENOATTR.
2002-03-08 21:00:27 +00:00
Maxim Sobolev
f651c1533c Don't ignore system CFLAGS. 2002-03-07 16:56:19 +00:00
Mark Murray
3556489a52 Fix build for OpenPAM. The directories needed tweeking. 2002-03-07 16:03:56 +00:00
Brian Feldman
9d9737ecb2 Add new errno ``ENOATTR''. 2002-03-07 15:13:44 +00:00
Dag-Erling Smørgrav
38ca451d39 This file is not needed any more 2002-03-07 12:03:50 +00:00
Mark Murray
bbf177c2a9 Darn. There is (now was) a signed/unsigned issue that resulted in a
very long loop.

Reported by:	nnd@mail.nsk.ru (Nickolay Dudorov)
2002-03-07 10:41:11 +00:00
Brian Feldman
30da7e6299 Now pam_alreadyloggedin lives in the ports. 2002-03-07 02:23:19 +00:00
Daniel Eischen
ca4b2c1a79 Properly clear the status of a join operation if the joining thread is
canceled or the joinee is detached.
2002-03-06 19:28:41 +00:00
Brian Feldman
c53dd30bb3 Add the pam_alreadyloggedin(8) module, which allows for authentication
based on information that the user is already logged in.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-03-06 18:21:28 +00:00
Mark Murray
f2ac424af7 No functional change, but big code cleanup. WARNS, lint(1) and style(9). 2002-03-06 17:18:09 +00:00
Peter Pentchev
8a177c636f Unbreak the pam_krb5 build: cast a couple of const pointers
to normal char *.  A better fix might be some const'ifying
of the Heimdal code, but this will do to fix the build
for the present.

Approved by:	des
2002-03-06 16:49:02 +00:00
Dag-Erling Smørgrav
40e0f7deed Remove a bogus cast. 2002-03-06 15:24:51 +00:00
Maxim Konovalov
e98c156beb Add GETPID to the list of operations for which semctl(2) returns the value.
Reviewed by:	alfred, ru
Approved by:	ru
MFC after:	3 days
2002-03-06 14:14:36 +00:00
Dag-Erling Smørgrav
e0dd4a7813 Add forgotten NOPROFILE that broke world. 2002-03-06 12:11:05 +00:00
Eric Melville
ee6c974de4 Add a carriage return to each function declaration, and make use of ID tag
macros.

MFC after:	1 day
2002-03-06 03:26:11 +00:00
Dag-Erling Smørgrav
519b6a4c8f Switch to OpenPAM. Bump library version. Modules are now versioned, so
applications linked with Linux-PAM will still work.
Remove pam_get_pass(); OpenPAM has pam_get_authtok().
Remove pam_prompt(); OpenPAM has pam_{,v}{error,info,prompt}().
Remove pam_set_item(3) man page as OpenPAM has its own.

Sponsored by:	DARPA, NAI Labs
2002-03-05 21:56:25 +00:00
Tor Egge
df140f7277 When multiple threads call atexit at the same time, some operations must
be serialized.  A mutex is used to protect the critical regions.

sbrk() and brk() are not thread safe.  Replace use of sbrk() with
a call to malloc to avoid race when one thread calls atexit
while another thread calls malloc.

Reviewed by:	deischen
2002-03-05 17:34:37 +00:00
Dag-Erling Smørgrav
e3cd129613 Add missing dependency on libutil. 2002-03-05 12:52:03 +00:00
Jake Burkholder
3ff2c61db8 Add fpsetmask(). Needed to build miniperl.
Obtained from:	netbsd
2002-03-05 04:03:57 +00:00
Jake Burkholder
f496405572 Fix a bug where siglongjmp would clobber the argument to return from
sigsetjmp.  It would return the value of the signal flag, instead.

Pointy hat to:	jake
2002-03-05 04:02:04 +00:00
Thomas Moestl
49a64cb475 Connect the sparc64 userland fp emulator to the build. 2002-03-05 00:00:40 +00:00
Dima Dorfman
246b0f8487 Correct a typo.
PR:		35273
Submitted by:	Nicola Vitale <nivit@libero.it>
2002-03-03 01:13:47 +00:00
David E. O'Brien
118ce04e39 We need an frexp() function. 2002-03-01 01:58:20 +00:00
David E. O'Brien
2e6f61b9bc Minor style(9) nit + utilize ELF features for the FreeBSD ID. 2002-02-28 19:45:34 +00:00
David E. O'Brien
1e23f97e5c Minor style(9) nit + utilize ELF features for the FreeBSD ID. 2002-02-27 22:13:02 +00:00
Brian Feldman
92369d84a9 Check if string is not NULL, not *string, before setting *string. 2002-02-27 22:00:44 +00:00
David E. O'Brien
7f524f1fe9 We do not support the sparc platform. 2002-02-27 21:59:16 +00:00
David E. O'Brien
fc6e9db154 Minor WS change to improve readability. 2002-02-27 21:53:27 +00:00
Thomas Moestl
90ce56c287 Add the following functions/macros to support byte order conversions and
device drivers for bus system with other endinesses than the CPU (using
interfaces compatible to NetBSD):

- bwap16() and bswap32(). These have optimized implementations on some
  architectures; for those that don't, there exist generic implementations.
- macros to convert from a certain byte order to host byte order and vice
  versa, using a naming scheme like le16toh(), htole16().
  These are implemented using the bswap functions.
- stream bus space access functions, which do not perform a byte order
  conversion (while the normal access functions would if the bus endianess
  differs from the CPU endianess).

htons(), htonl(), ntohs() and ntohl() are implemented using the new
functions above for kernel usage. None of the above interfaces is currently
exported to user land.

Make use of the new functions in a few places where local implementations
of the same functionality existed.

Reviewed by:	mike, bde
Tested on alpha by:	mike
2002-02-27 17:16:18 +00:00
Dima Dorfman
76183f3453 Introduce a version field to `struct xucred' in place of one of the
spares (the size of the field was changed from u_short to u_int to
reflect what it really ends up being).  Accordingly, change users of
xucred to set and check this field as appropriate.  In the kernel,
this is being done inside the new cru2x() routine which takes a
`struct ucred' and fills out a `struct xucred' according to the
former.  This also has the pleasant sideaffect of removing some
duplicate code.

Reviewed by:	rwatson
2002-02-27 04:45:37 +00:00
Alfred Perlstein
ef18a7a841 use _GENERIC_DIRSIZ(dp) to avoid copying too much of the dirent over
the user supplied buffer.  this can be a problem when the user doesn't
supply a full dirent and we corrupt their memory.
2002-02-26 21:39:32 +00:00
Maxim Sobolev
b73aa6457c Per POSIX <grp.h> doesn't require <sys/types.h>.
Submitted by:	ache
2002-02-25 17:20:40 +00:00
Bruce Evans
3798cf8a70 #include <time.h> for the definition of time functions instead of
depending on namespace pollution 2 layers deep in <sys/stat.h>.

Sorted includes.
2002-02-25 12:02:03 +00:00
Bruce Evans
163ae6707c #include <stddef.h> for the definition of NULL instead of depending on
namespace pollution 2 layers deep in <sys/stat.h>.

Sorted includes.
2002-02-25 01:25:30 +00:00
Thomas Moestl
30d514918a Initialize the libc user trap handlers before passing control non-startup
code, so that the userland fp emulator will work.
2002-02-23 21:47:20 +00:00
Thomas Moestl
4895e965c3 Add userland floating point emulator code for sparc64. This is a port
of the (never committed) in-kernel version (with some optimizations and
cleanups), which in turn was ported from NetBSD.
2002-02-23 21:37:18 +00:00
Jake Burkholder
dfca860bfc Add ifdefs for sparc64. 2002-02-23 19:05:26 +00:00
Jake Burkholder
3b16ee2c6c Fix wrong offsets. Add offsets for %fsr and %tstate.
Submitted by:	tmm
2002-02-23 19:01:22 +00:00
Jake Burkholder
d1497824f0 Add space for %fsr and %tstate to utrapframe. Save them in the generic
user trap entry code.  Restore %asi and %ccr from the saved %tstate before
returning to the trapping user code.

Submitted by:	tmm
2002-02-23 19:00:30 +00:00
Brian Feldman
49b33de841 Also blindly attempt to fix broken world with respect to proc.p_runtime
changes.
2002-02-22 19:10:09 +00:00
John Birrell
9db56888ee Fix a bug where a short write to a non-blocking socket would
leave the descriptor locked, causing other threads to hang
if they happened to access the socket.

MFC after:	5 days
2002-02-22 04:26:54 +00:00
Chris D. Faulhaber
a82f127b41 o style(9) and consistency fix:
- if (!var) -> if (var == NULL)
o spelling fix (althouh -> although)

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2002-02-21 23:18:04 +00:00
Chris D. Faulhaber
9fd46b0237 o style(9) and consistency fixes:
- if (!var) -> if (var == NULL)
  - return val; -> return (val);

Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2002-02-21 23:17:19 +00:00
Chris D. Faulhaber
e146d0bc6a Add more argument checking
Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2002-02-21 23:13:06 +00:00
Chris D. Faulhaber
c61eb011c4 static'ize and declare functions
Reviewed by:	rwatson
Obtained from:	TrustedBSD Project
2002-02-21 23:12:25 +00:00
Alfred Perlstein
5bcd0580d7 Prefix structure members to protect them against clashes with eg.
c++ keywords.

This keeps us in sync with NetBSD because they actually committed
my delta first.

Ok'd by: lennard
2002-02-20 20:47:21 +00:00
Maxim Sobolev
c80f5647cb Create /var/log/lastlog if it doesn't exist.
Submitted by:	des
2002-02-20 07:47:06 +00:00
Warner Losh
576541a9e6 Fixed divots that I created when I moved prototypes of group_from_gid
and user_from_uid to grp.h and pwd.h.  Update the man pages.

Submitted by: David Malone
Pointy hat to: imp
2002-02-19 00:05:59 +00:00
Mike Barcroft
fd8e4ebc8c o Move NTOHL() and associated macros into <sys/param.h>. These are
deprecated in favor of the POSIX-defined lowercase variants.
o Change all occurrences of NTOHL() and associated marcros in the
  source tree to use the lowercase function variants.
o Add missing license bits to sparc64's <machine/endian.h>.
  Approved by: jake
o Clean up <machine/endian.h> files.
o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>.
o Remove prototypes for non-existent bswapXX() functions.
o Include <machine/endian.h> in <arpa/inet.h> to define the
  POSIX-required ntohl() family of functions.
o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>,
  and <sys/param.h>.
o Prepend underscores to the ntohl() family to help deal with
  complexities associated with having MD (asm and inline) versions, and
  having to prevent exposure of these functions in other headers that
  happen to make use of endian-specific defines.
o Create weak aliases to the canonical function name to help deal with
  third-party software forgetting to include an appropriate header.
o Remove some now unneeded pollution from <sys/types.h>.
o Add missing <arpa/inet.h> includes in userland.

Tested on:	alpha, i386
Reviewed by:	bde, jake, tmm
2002-02-18 20:35:27 +00:00
Gregory Neil Shapiro
095dae9d7a Update build infrastructure for sendmail 8.12. 2002-02-17 22:05:07 +00:00
Gregory Neil Shapiro
850dab1773 Add two new libraries which are part of sendmail 8.12. libsm is used only
for building sendmail and the associated utilities.  libmilter is a new
mail filtering API for sendmail.
2002-02-17 22:01:40 +00:00
Chris D. Faulhaber
e76872c11e o style and consistency fixes:
- if (!var) -> if (var == NULL)
  - return val; -> return (val);
o update copyright
2002-02-17 20:05:20 +00:00
Chris D. Faulhaber
efec00ac60 Error handling fixes for inflate. 2002-02-17 17:35:18 +00:00
Daniel Eischen
9e9c4443f6 Don't rely on <sys/signal.h> to include <sys/ucontext.h> 2002-02-17 17:21:27 +00:00
Ian Dowse
6112fceebd Fix two file descriptor leaks in the internal function local_rpcb()
that is used by a number of rpcbind-related library functions. Also
fix a rpc client leak in rpcb_set().

Submitted by:	mbr
Obtained from:	NetBSD
2002-02-16 17:05:49 +00:00
Garrett Wollman
5874617263 Document that the type of st_flags is now fflags_t. 2002-02-15 22:37:15 +00:00
Bruce Evans
bdc5bab2eb Don't leave stack garbage in the reserved fields of the header. 2002-02-15 02:37:08 +00:00
Bruce Evans
2c316efdf3 Fixed style bugs in rev.1.5:
- missing whitespace
- strange version of warn() built out of warnx() + strerror().  Just use
  warn().
- conversion of just one of the two perror()'s to warn*()

Actually use _warn() instead of _warn(), to keep up with namespace-
unpollution for warn().
2002-02-15 02:28:50 +00:00
Maxim Konovalov
b85282ba08 Prevent dup2(2) from closing internal libc_r pipe descriptors.
PR:		misc/28947
Reviewed by:	jasone, ru
Approved by:	jasone, ru
MFC after:	1 week
2002-02-14 15:26:59 +00:00
Maxim Konovalov
0878d2e5e9 Correct a typo pthread_attr_setscope() function fails unconditionally
due to.

PR:		misc/30699
Reviewed by:	jasone, ru
Approved by:	jasone, ru
MFC after:	1 week
2002-02-14 15:20:36 +00:00
Warner Losh
63195486ba Use new-style function declations. 2002-02-13 09:30:47 +00:00
Julian Elischer
65e4542fca I THINK this fixes 'make world'
I'll know as soon as I re-import it and compile it.. :-)
 There is no longer a 'pri' strict in the proc struct.
 the fields are scattered between the ksegrp and thread in question.
2002-02-13 00:10:04 +00:00
Dima Dorfman
c96bb7c5f2 Don't make it seem like vm.max_proc_mmap only affects MAP_FIXED.
PR:		34005
Submitted by:	Steven Grady <grady@digitaldeck..com>,
		Hiten Pandya <hitmaster2k@yahoo.com>
2002-02-10 21:07:56 +00:00
Robert Watson
c0858e0a77 Part III: Update extended attribute system call interface documentation.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-02-10 04:46:28 +00:00
Daniel Eischen
69c287d288 This has been sitting in my local tree long enough. Remove the use
of an alternate signal stack for handling signals.  Let the kernel
send signals on the stack of the current thread and teach the threads
signal handler how to deliver signals to the current thread if it
needs to.  Also, always store a threads context as a jmp_buf.  Eventually
this will change to be a ucontext_t or mcontext_t.

Other small nits.  Use struct pthread * instead of pthread_t in internal
library routines.  The threads code wants struct pthread *, and pthread_t
doesn't necessarily have to be the same.

Reviewed by:	jasone
2002-02-09 19:58:41 +00:00
Daniel Eischen
b68bb42b5c Silence a warning by initializing the return value. This wasn't
set in the case of a short write, and I think returning 0 for this
is what was intended.
2002-02-09 19:48:55 +00:00
Dag-Erling Smørgrav
7f28386a26 This file needs <syslog.h>.
Sponsored by:	DARPA, NAI Labs
2002-02-09 14:12:09 +00:00
Ruslan Ermilov
e47a40e7f7 Now that cross-tools ld(1) has been fixed to look for dynamic
dependencies in the correct place, record the fact that -lssh
depends on -lcrypto and -lz.

Removed false dependencies on -lz (except ssh(1) and sshd(8)).
Removed false dependencies on -lcrypto and -lutil for scp(1).

Reviewed by:	markm
2002-02-08 13:42:58 +00:00
Ruslan Ermilov
2ef702f52a FreeBSD 4.1 bootstrapping aid (__FBSDID is not there). 2002-02-08 09:34:17 +00:00
Julian Elischer
3daf63fc50 pre-emptively fix a KSE/M3 problem.
Make a slight change so that libkvm reaches the main thread via the
linked list, rather than assuming it is in the proc structure. Both
conditions are true in -current but only the first will be true in
the KSE M3 world.
2002-02-07 20:28:25 +00:00
Alfred Perlstein
866e3c9008 Move the AF_LOCAL check to the AF_INET check since portmap protocol
v. 2 only needs this. That also makes it shorter and simpler.

Submitted by: mbr
2002-02-06 19:14:02 +00:00
Mark Murray
30577d19fa Remove NO_WERROR, now that WARNS=n is gone. 2002-02-06 18:46:48 +00:00
Mark Murray
427e2d5c02 Comment out the WARNS= so as to not trample all over the GCC3 work. 2002-02-06 18:14:59 +00:00
Alfred Perlstein
d4210d7dba remove -M from RPCCOM, it slipped in with the tirpc upgrade.
Submitted by: mbr
2002-02-06 16:13:04 +00:00
Dag-Erling Smørgrav
dc584ddbc5 ANSIfy and remove some dead code.
Sponsored by:	DARPA, NAI Labs
2002-02-06 15:26:07 +00:00
Dag-Erling Smørgrav
ed4d1c46a2 Apply the following mechanical transformations in preparation for
ansification and constification:

    s{\s+__P\((\(.*?\))\)}{$1}g;
    s{\(\s+}{\(}g;
    s{\s+\)}{\)}g;
    s{\s+,}{,}g;
    s{(\s+)(for|if|switch|while)\(}{$1$2 \(}g;
    s{return ([^\(].*?);}{return ($1);}g;
    s{([\w\)])([!=+/\*-]?=)([\w\(+-])}{$1 $2 $3}g;
    s{\s+$}{\n};g

Also add $FreeBSD$ where needed.

MFC after:	1 week
2002-02-06 13:30:31 +00:00
Alfred Perlstein
1c71deff79 balance parens.
Submitted by: mbr
2002-02-05 23:56:29 +00:00
Alfred Perlstein
2abd9cf115 For RPC v2 we need to fill in ret->xp_raddr too. INET_6
is not supported in portmap, so we don't have to care about it.

Submitted by: mbr
2002-02-05 23:46:37 +00:00
Alfred Perlstein
8d6301358e Fix cc -Wall, fix rcsid warnings, add missing prototypes,
change prototypes to be the same as in the original sun tirpc code.
Remove ()P macro in a file where the mayority had ()P already removed.
Add them if the mayority use ()P macros.

Submitted by: mbr
Requested by: bde
2002-02-05 23:43:43 +00:00
Alfred Perlstein
e4db1131b8 Do not call addrinfo on local transport adresses, if returning a
server handle (for reuse or whatever). We just return now a handle
connected to the local rpcbind.

Do not try to call checkcache, if host = NULL;

Submitted by: mbr
2002-02-05 23:12:51 +00:00
Dag-Erling Smørgrav
5a51c23be3 Switch to a self-starting allocation scheme. 2002-02-05 22:15:16 +00:00
Dag-Erling Smørgrav
e19e6098b3 Reindent, and add parentheses to return statements. Some functions in
ftp.c and http.c now have exceedingly long lines due to deep nesting;
this will be corrected by reorganizing the code in a later revision.
2002-02-05 22:13:51 +00:00
Dag-Erling Smørgrav
551858f0b0 Eliminate a redundant loop. 2002-02-05 21:32:16 +00:00
Alfred Perlstein
49de9dcd8b style: return(x) -> return (x)
Submitted by: mbr
2002-02-05 19:31:16 +00:00
Alfred Perlstein
08760d5a57 Fix the credential handling code.
In NetBSD, Solaris, xprt->xp_p2 pointed directly to the credentials,
in FreeBSD xprt->xp_verf.oa_base was a pointer to a struct cmessage,
which is defined as follow:

struct cmessage {
        struct cmsghdr cmsg;
        struct cmsgcred cmcred;
};

The credentials were submitted the right way and xprt->xp_p2 pointed to them.
But cb_verf.oa_flavor was still empty. There was an assignment missing
in svc_recv() in svc_vc.c:

msg->rm_call.cb_verf.oa_flavor = AUTH_UNIX;

Also

+       if (addr.ss_family == AF_LOCAL) {
+               xprt->xp_raddr = *(struct sockaddr_in *)xprt->xp_rtaddr.buf;
+               xprt->xp_addrlen = sizeof (struct sockaddr_in);
+       }

was missing. But the first seems not to be needed:

I guess in rpc.yppasswdd there was a typo:

- transp>xp_verf.oa_flavor != AUTH_UNIX) {
+ rqstp->rq_cred.oa_flavor != AUTH_UNIX) {

This little fix does fix the breakage in rpc.yppasswdd :-)

+       if (msg.msg_controllen == 0 ||
+           (msg.msg_flags & MSG_CTRUNC) != 0)
+               return (-1);

We cannot set the cb_verf.oa_length in svc_recv() of svc_vc.c,
the credentials get overwritten then, and that's bad.

Submitted by: mbr
2002-02-05 19:30:30 +00:00
Alfred Perlstein
8858373f83 The clnt_create(KEYSERVSOCK, CRYPT_PROG, CRYPT_VERS, "unix") hacks
were removed and replaced them with clnt_tp_create, now the af_local
support is fixed.

I also removed the hack how rpcinfo contacted rpcbind, now we can
relay on clnt_tp_create create the client-handle for us.  Only
rpcbind itself needs a hardcoded socket-path.

Submitted by: mbr

Also add $FreeBSD
2002-02-05 19:26:04 +00:00
Dag-Erling Smørgrav
04f71c5352 Three times lucky: <stddef.h>, not <sys/param.h> 2002-02-05 08:01:32 +00:00
Dag-Erling Smørgrav
93cf4c1be3 Oops, the correct header to include for NULL is <sys/param.h>. 2002-02-05 07:53:00 +00:00
Dag-Erling Smørgrav
93deb2ae12 ANSIfy and constify.
Sponsored by:	DARPA, NAI Labs
2002-02-05 06:49:11 +00:00
Dag-Erling Smørgrav
0ae5018b3e #include <sys/types.h> for NULL (hidden by Linux-PAM header pollution)
Sponsored by:	DARPA, NAI Labs
2002-02-05 06:20:27 +00:00
Dag-Erling Smørgrav
8c66575de8 #include cleanup.
Sponsored by:	DARPA, NAI Labs
2002-02-05 06:08:26 +00:00
Jacques Vidrine
50ae594fa2 hex.c is new in libisc with 8.3.1-REL. 2002-02-04 19:18:23 +00:00
Mark Murray
34b28989d1 Explicitly declare (gcc internal) functions.
Submitted by:	ru
2002-02-04 17:59:25 +00:00
Dag-Erling Smørgrav
12b6e9a089 ssh_get_authentication_connection() gets its parameters from environment
variables, so temporarily switch to the PAM environment before calling it.

Submitted by:	Takanori Saneto <sanewo@ba2.so-net.ne.jp>
2002-02-04 17:15:44 +00:00
Mark Murray
95641278ef Protect "make buildworld" against -Werror, as this module does not
build cleanly.
2002-02-04 16:09:25 +00:00
Maxim Sobolev
c6de4ce791 Allow ldd(1) be used on shared libraries in addition to executables. 2002-02-04 10:33:48 +00:00