From owner-freebsd-hackers Thu Jan 11 09:02:41 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id JAA04285 for hackers-outgoing; Thu, 11 Jan 1996 09:02:41 -0800 (PST) Received: from gateway.cybernet.com (gateway.cybernet.com [192.245.33.1]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id JAA04279 for ; Thu, 11 Jan 1996 09:02:34 -0800 (PST) Received: from root@spiffy.cybernet.com by gateway.cybernet.com (8.6.8/1.0A) id MAA14798; Thu, 11 Jan 1996 12:54:19 -0500 Date: Thu, 11 Jan 1996 12:54:19 -0500 Message-ID: X-Mailer: XFMail 0.3-beta [p0] on FreeBSD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <8510.821325314@time.cdrom.com> Reply-To: root@spiffy.cybernet.com Organization: Cybernet Systems Corporation From: "Mark J. Taylor" To: "Jordan K. Hubbard" Subject: Re: samba and win95 Cc: Daniel Leeds , Sender: owner-hackers@freebsd.org Precedence: bulk On 01/11/96 03:16:58 Jordan K. Hubbard wrote: >>> anyone here using samba with windows95? im not having success in being >> able to mount my win95 machine from freebsd using smbclient. win95 >> machine can mount freebsd machine fine tho. > >I've only done it in that direction as well. Are you sure samba is >"two way" like this? :-) > > Jordan I use smbclient all the time to access files on Win '95 and NT machines from my FreeBSD machines. I even have a cool CGI script (written in /bin/sh) to give me access to these files and directories. It's kinda cool- it presents an interface a lot like ftp://xxx.yyy.zzz/ would. Anyone interested? It currently uses guest access. Could be modified to use another name, and prompt for a password. Since it is so short, I'll put it here (please feel free to modify and redistribute it- it could use some error checking put in): #!/bin/sh # sambadir # samba directory script # use: http://xxx.com/cgi-bin/sambadir?::server:resource[:dir[:dir[...]]] # note: spaces in server, resource, or dir names must be replaced with '+' # symbol. This script does it automatically. echo Content-type: text/html echo server=`echo "$*" | awk -F : '{print "\\\\\\\\" $3 "\\\\" $4}'` dir=`echo "$*" | awk -F : '{for (i=5; i<=NF; i++){if (i>5){printf ":"}; printf $ i}}' | /usr/bin/sed 's#:#\\\\#g'` path=`echo "$*" | /usr/bin/sed 's# #+#g'` echo "" echo "Directory listing of $server:$dir" echo "" printf "cd \"%s\"\ndir\n" "$dir" | /usr/local/samba/bin/smbclient $server -U gue st -N | awk 'BEGIN{done=0}/blocks available/{done=1}{if ((NR>5) && (!done)) prin t $0}' | awk '/DA/{print "d " $0; continue}/ /{print "f " $0; continue}' | /usr/ bin/colrm 38 | awk -v path="$path" '/^d/{printf "\"DIR"; for (i=2; i
\n"; continue}/^f/{printf "\"FILE\"
"; for ( i=2; i
\n"}' echo "" #!/bin/sh # sambafile # samba file access script # use: http://xxx.com/cgi-bin/sambafile?::server:resource[:dir]:file # note: spaces in server, resource, or dir names must be replaced with '+' # symbol. echo Content-type: text/plain echo server=`echo "$*" | awk -F : '{print "\\\\\\\\" $3 "\\\\" $4}'` dir=`echo "$*" | awk -F : '{for (i=5; i5){printf ":"}; printf $i }}' | /usr/bin/sed 's#:#\\\\#g'` file=`echo "$*" | awk -F : '{print $NF}'` printf "cd \"%s\"\nget \"%s\" -\n" "$dir" "$file" | /usr/local/samba/bin/smbclie nt $server -U guest -N -E 2> /dev/null When I get it all spiffied up, I'll post it again. -Mark Taylor mtaylor@cybernet.com