From: Chuck Lever Date: Tue, 15 Jul 2008 17:51:07 +0000 (-0400) Subject: Traditionally the mount command has looked for a ":" to separate the X-Git-Tag: nfs-utils-1-1-3~11 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=1d61a1116198714f50b081daecc663625124403d;hp=1d61a1116198714f50b081daecc663625124403d Traditionally the mount command has looked for a ":" to separate the server's hostname from the export path in the mounted on device name, like this: mount server:/export /mounted/on/dir The server's hostname is "server" and the export path is "/export". You can also substitute a specific IPv4 network address for the server hostname, like this: mount 192.168.0.55:/export /mounted/on/dir Raw IPv6 addresses present a problem, however, because they look something like this: fe80::200:5aff:fe00:30b Note the use of colons. To get around the presence of colons, copy the Solaris convention used for raw NFS server IPv6 addresses, which is to wrap the raw IPv6 address with square brackets. This is also suggested in RFC 4038. Introduce a new device name parser that can support traditional device names and square brackets. Place the parser in a separate source file so both the mount and umount paths can derive the server's hostname and export pathname the same way. Bonus points: add a check for NFS URLs and display an appropriate error message in that case. This is cleaner than failing with "unknown host: nfs". Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson ---