From 64f76012e64d5f42d43ab6fb30440366a4a4286f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 1 May 2000 20:20:13 +0000 Subject: Remove trailing '/' in exports pathnames so mount requests will match properly. --- sbin/mountd/mountd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sbin/mountd') diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c index 2595af5026e..a3699884fcd 100644 --- a/sbin/mountd/mountd.c +++ b/sbin/mountd/mountd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mountd.c,v 1.29 1999/04/21 02:13:57 alex Exp $ */ +/* $OpenBSD: mountd.c,v 1.30 2000/05/01 20:20:12 millert Exp $ */ /* $NetBSD: mountd.c,v 1.31 1996/02/18 11:57:53 fvdl Exp $ */ /* @@ -2062,6 +2062,11 @@ check_dirpath(dirp) int ret = 1; struct stat sb; + /* Remove trailing '/' */ + cp = dirp + strlen(dirp) - 1; + while (cp > dirp && *cp == '/') + *cp-- = '\0'; + cp = dirp + 1; while (*cp && ret) { if (*cp == '/') { -- cgit v1.2.3