From owner-freebsd-bugs Sat Jan 12 3:20:11 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6B2E737B41E for ; Sat, 12 Jan 2002 03:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g0CBK1q91638; Sat, 12 Jan 2002 03:20:01 -0800 (PST) (envelope-from gnats) Received: from meta.lo-res.org (meta.lo-res.org [195.58.189.92]) by hub.freebsd.org (Postfix) with ESMTP id D513A37B419 for ; Sat, 12 Jan 2002 03:19:00 -0800 (PST) Received: (from aaron@localhost) by meta.lo-res.org (8.11.6/8.11.6) id g0CBItn49632; Sat, 12 Jan 2002 12:18:55 +0100 (CET) (envelope-from aaron) Message-Id: <200201121118.g0CBItn49632@meta.lo-res.org> Date: Sat, 12 Jan 2002 12:18:55 +0100 (CET) From: aaron Reply-To: aaron To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/33809: mount_nfs has trouble with embedded ':' in path Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 33809 >Category: bin >Synopsis: mount_nfs has trouble with embedded ':' in path >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jan 12 03:20:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: aaron >Release: FreeBSD 4.5-PRERELEASE i386 >Organization: lo-res >Environment: System: FreeBSD meta.lo-res.org 4.5-PRERELEASE FreeBSD 4.5-PRERELEASE #4: Sun Dec 30 17:36:27 CET 2001 root@meta.lo-res.org:/usr/people/scratch/usr/people/src/sys/meta i386 >Description: try mounting a nfs share where the path contains a ':' root@www:~>mount_nfs 10.1.2.3:/u2/ftp/priv/mp3/Welle\:Erdball /mnt mount_nfs: bad net address 10.1.2.3:/u2/ftp/priv/mp3/Welle With all common ways to escape ':' in the shell it does not work Seems like mount_nfs cuts off the path at the first (even escaped) ':'. >How-To-Repeat: Create a directory on your nfs server containing a ':'. export it, kill -HUP mountd Try to mount it on a client machine. >Fix: When taking a look at /usr/src/sbin/mount_nfs/ \ mount_nfs.c the problem seems to be at line 593: [ function: getnfsargs() ] if ((delimp = strrchr(spec, ':')) != NULL) { ^^^^^^^^^^ this gives a '\:' no chance. Neither does it take into account that I might have specified the path enclosed with single quotes "'" (e.g. mount_nfs hostname.com:'/my/path:rest/' /mnt A possible (probably not very good) solution seems to be to use strchr() (match for first occurence of ':'). At least this would fit to our common belief that the share name is seperated from the host name by the leftmost ':'. I tested it and it works. However I did not check for side effects. Hope it helped and was precise enough. Keep on ! great project --- mount_nfs.orig.c Sat Jan 12 12:11:01 2002 +++ mount_nfs.c Sat Jan 12 12:11:47 2002 @@ -590,10 +590,10 @@ size_t len; static char nam[MNAMELEN + 1]; - if ((delimp = strrchr(spec, ':')) != NULL) { + if ((delimp = strchr(spec, ':')) != NULL) { hostp = spec; spec = delimp + 1; - } else if ((delimp = strrchr(spec, '@')) != NULL) { + } else if ((delimp = strchr(spec, '@')) != NULL) { warnx("path@server syntax is deprecated, use server:path"); hostp = delimp + 1; } else { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message