summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>1999-10-06 18:20:44 +0000
committeralfred <alfred@FreeBSD.org>1999-10-06 18:20:44 +0000
commitf7b632b8ac0fa12163d431402e23a2f103823e68 (patch)
treed1effec431c68bdcb2608d500ecc01e2ce755a3b /sbin
parent3d8af19ed38a1a19106c86428993d06f261a9fba (diff)
downloadFreeBSD-src-f7b632b8ac0fa12163d431402e23a2f103823e68.zip
FreeBSD-src-f7b632b8ac0fa12163d431402e23a2f103823e68.tar.gz
Put the umount request through the same translation as the mount
request. Fix some uninitialized warnings and a style bug while we are here. Problem still exists where a failed umount can be misreported as success. Submitted by: Martin Blapp <mb@imp.ch>
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mountd/mountd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c
index cc5e572..3c8beb3 100644
--- a/sbin/mountd/mountd.c
+++ b/sbin/mountd/mountd.c
@@ -413,7 +413,7 @@ mntsrv(rqstp, transp)
* or a regular file if the -r option was specified
* and it exists.
*/
- if (realpath(rpcpath, dirpath) == 0 ||
+ if (realpath(rpcpath, dirpath) == NULL ||
stat(dirpath, &stb) < 0 ||
(!S_ISDIR(stb.st_mode) &&
(dir_only || !S_ISREG(stb.st_mode))) ||
@@ -502,12 +502,17 @@ mntsrv(rqstp, transp)
svcerr_weakauth(transp);
return;
}
- if (!svc_getargs(transp, xdr_dir, dirpath)) {
+ if (!svc_getargs(transp, xdr_dir, rpcpath)) {
syslog(LOG_NOTICE, "undecodable umount request from %s",
inet_ntoa(saddrin));
svcerr_decode(transp);
return;
}
+ if (realpath(rpcpath, dirpath) == NULL) {
+ syslog(LOG_NOTICE, "umount request from %s "
+ "for non existent path %s",
+ inet_ntoa(saddrin), dirpath);
+ }
if (!svc_sendreply(transp, xdr_void, (caddr_t)NULL))
syslog(LOG_ERR, "can't send reply");
hp = gethostbyaddr((caddr_t)&saddr, sizeof(saddr), AF_INET);
@@ -745,6 +750,9 @@ get_exportlist()
char *cp, *endcp, *dirp, *hst, *usr, *dom, savedc;
int len, has_host, exflags, got_nondir, dirplen, num, i, netgrp;
+ dirp = NULL;
+ dirplen = 0;
+
/*
* First, get rid of the old list
*/
@@ -1342,6 +1350,7 @@ do_opt(cpp, endcpp, ep, grp, has_hostp, exflagsp, cr)
char *cp, *endcp, *cpopt, savedc, savedc2;
int allflag, usedarg;
+ savedc2 = '\0';
cpopt = *cpp;
cpopt++;
cp = *endcpp;
OpenPOWER on IntegriCloud