diff options
author | imp <imp@FreeBSD.org> | 1999-09-07 23:07:03 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1999-09-07 23:07:03 +0000 |
commit | 6d47ec31fc7dd62ef8f7148bb05e18baddd0d1d6 (patch) | |
tree | fbaa4bbb56acf10362ad0eb82898bf2f86b1628c /contrib/amd | |
parent | e16a3900a7835b58a16e19a58511db912f1081f8 (diff) | |
download | FreeBSD-src-6d47ec31fc7dd62ef8f7148bb05e18baddd0d1d6.zip FreeBSD-src-6d47ec31fc7dd62ef8f7148bb05e18baddd0d1d6.tar.gz |
MFS: amd mount disabling and overflow protection.
Reported by: gallatin@freebsd.org
Diffstat (limited to 'contrib/amd')
-rw-r--r-- | contrib/amd/amd/amq_subr.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/contrib/amd/amd/amq_subr.c b/contrib/amd/amd/amq_subr.c index d6f9f89..69869fb 100644 --- a/contrib/amd/amd/amq_subr.c +++ b/contrib/amd/amd/amq_subr.c @@ -38,7 +38,7 @@ * * %W% (Berkeley) %G% * - * $Id: amq_subr.c,v 1.2 1998/09/04 04:42:28 obrien Exp $ + * $Id: amq_subr.c,v 1.3 1999/01/13 20:03:54 obrien Exp $ * */ /* @@ -204,11 +204,24 @@ ok_security(struct svc_req *rqstp) int * amqproc_mount_1_svc(voidp argp, struct svc_req *rqstp) { - static int rc; - char *s = *(amq_string *) argp; + static int rc = EINVAL; + char s[AMQ_STRLEN]; char *cp; + char dq[20]; + struct sockaddr_in *sin; + + if ((sin = amu_svc_getcaller(rqstp->rq_xprt)) == NULL) { + plog(XLOG_ERROR, "amu_svc_getcaller returned NULL"); + return &rc; + } + + strncpy(s, *(amq_string *) argp, AMQ_STRLEN-1); + s[AMQ_STRLEN-1] = '\0'; /* null terminate, to be sure */ + plog(XLOG_ERROR, + "amq requested mount of %s from %s.%d", + s, inet_dquad(dq, sin->sin_addr.s_addr), + ntohs(sin->sin_port)); - plog(XLOG_INFO, "amq requested mount of %s", s); /* * Minimalist security check. */ |