[Pkg-samba-maint] Bug#463367: smbfs: Vague error: "mount error 6 = No such device or address"

A. Costa agcosta at gis.net
Sun Feb 3 11:31:46 UTC 2008


Have several thoughts about error messages, in reply to SL's comments.
Here's one, maybe more later...

On Thu, 31 Jan 2008 09:48:37 -0800
Steve Langasek <vorlon at debian.org> wrote:

> > This requires the program's internal error checking logic to
> > distinguish between server names and share names.  Which it probably
> > should, if it doesn't already.
> 
> A fine suggestion, but unless you plan to provide a patch, please
> discuss this with upstream directly; this is going to be low enough
> down my todo list that I'm unlikely to ever work on it.

There are high level ways to do it, i.e. a wrapper script.  Attached is
a runnable script that shows the concept, and also may be useful to
users** in the same boat:

	# cifs_samba_check.sh host share
	% cifs_samba_check.sh 192.168.1.51 hdb1 ; echo $?
	host 192.168.1.51 exists
	samba/cifs ports present on 192.168.1.51
	share hdb1 exists
	0

	% cifs_samba_check.sh 192.168.1.51 hdb9 ; echo $?
	host 192.168.1.51 exists
	samba/cifs ports present on 192.168.1.51
	can't find share hdb9
	3

	% ~/cifs_samba_check.sh 192.168.1.59 hdb9 ; echo $?
	can't find host 192.168.1.59
	1

(Haven't put in a util check or '--help' yet...)

(**if necessary: apt-get install nmap host smbclient )

High level net utils are called from three true/false functions:

	host_exist()  # syntax: host_exist host
	{ host $1 > /dev/null 2> /dev/null ; }

	# ports 139 & 445 are a bit of a guess.
	samba_exist() # syntax: samba_exist host
	{ 
		[ `nmap -p "139,445" $1 | grep 'tcp open' | wc -l` = 2 ]
	}

	share_grep() 	# syntax: share_grep sharename hostname
	{
		smbclient -L $2 -N 2>&1 | \
		grep -A 99 "Sharename       Type      Comment" | \
		egrep -m 1 -B 99 "^$" | tail -n +3 | head -n -1 | \
		grep -q $1
	}

...my networking skills are feeble, and I hope there are better ways of
writing such functions.

HTH...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cifs_samba_check.sh
Type: text/x-sh
Size: 977 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-samba-maint/attachments/20080203/c93f1b80/attachment.sh 


More information about the Pkg-samba-maint mailing list