Re: Accessing Samba - Mount Volume Possible?

2002-05-06 Thread Jason Bourque

I got it to work


[NETBIOS:USER:SHARE]

I didn't have the first line of the .nsmbrc file in all caps.

And I added this optional parameter.

 -N  Do not ask for a password.  At run time, mount_smbfs reads the
 ~/.nsmbrc file for additional configuration parameters and a
 password.  If no password is found the mount_smbfs prompts for
 it.


Thanks to all those who helped.

Jason Bourque


On 5/3/02 9:55 AM, "Jason Bourque" <[EMAIL PROTECTED]> wrote:

> I have yet to get this to work. It is the only thing holding me back from
> fully automating this.
> 
> Jason Bourque
> 
> 
> On 5/3/02 9:33 AM, "Adam Witney" <[EMAIL PROTECTED]> wrote:
> 
>> 
>> Yes, me also. However I was unable to get it to read the password file
>> (.nsmbrc) and it always prompted me for a password.
>> 
>> Any ideas why this is so?
>> 
>> Thanks
>> 
>> adam
>> 
>>> Rich,
>>> 
>>> This was _absolutely_ tremendously helpful. Thanks.
>>> 
>>> /Michael
>>> 
>>> 
>>> #!/usr/bin/perl
>>> 
>>> if(-f "/users/userid/.nsmbrc") {
>>> print "mounting share\n";
>>> system('mount_smbfs -W workgroupname //username@domain/share
>>> /users/userid/myshare');
>>> } else {
>>> print "password file does not exist\n";
>>> }
>>> 
>>> __END__
>>> 
>>> 
>> 
> 




Re: Accessing Samba - Mount Volume Possible?

2002-05-03 Thread nellA hciR

since creating the file, have you logged out and back in?

- hcir

On Friday, May 3, 2002, at 05:33 , Adam Witney wrote:

>
> Yes, me also. However I was unable to get it to read the password file
> (.nsmbrc) and it always prompted me for a password.




Re: Accessing Samba - Mount Volume Possible?

2002-05-03 Thread Jason Bourque

I have yet to get this to work. It is the only thing holding me back from
fully automating this.

Jason Bourque


On 5/3/02 9:33 AM, "Adam Witney" <[EMAIL PROTECTED]> wrote:

> 
> Yes, me also. However I was unable to get it to read the password file
> (.nsmbrc) and it always prompted me for a password.
> 
> Any ideas why this is so?
> 
> Thanks
> 
> adam
> 
>> Rich,
>> 
>> This was _absolutely_ tremendously helpful. Thanks.
>> 
>> /Michael
>> 
>> 
>> #!/usr/bin/perl
>> 
>> if(-f "/users/userid/.nsmbrc") {
>> print "mounting share\n";
>> system('mount_smbfs -W workgroupname //username@domain/share
>> /users/userid/myshare');
>> } else {
>> print "password file does not exist\n";
>> }
>> 
>> __END__
>> 
>> 
> 




Re: Accessing Samba - Mount Volume Possible?

2002-05-03 Thread Adam Witney


Yes, me also. However I was unable to get it to read the password file
(.nsmbrc) and it always prompted me for a password.

Any ideas why this is so?

Thanks

adam

> Rich,
> 
> This was _absolutely_ tremendously helpful. Thanks.
> 
> /Michael
> 
> 
> #!/usr/bin/perl
> 
> if(-f "/users/userid/.nsmbrc") {
> print "mounting share\n";
> system('mount_smbfs -W workgroupname //username@domain/share
> /users/userid/myshare');
> } else {
> print "password file does not exist\n";
> }
> 
> __END__
> 
> 




Re: Accessing Samba - Mount Volume Possible?

2002-05-03 Thread Michael Turner

Rich,

This was _absolutely_ tremendously helpful. Thanks.

/Michael


#!/usr/bin/perl

if(-f "/users/userid/.nsmbrc") {
print "mounting share\n";
system('mount_smbfs -W workgroupname //username@domain/share 
/users/userid/myshare');
} else {
print "password file does not exist\n";
}

__END__




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Jason Bourque

-hcir

Good to hear from you.

I will try your code, but could you tell me exactly how you create the
password file?

Do you use the shell and where do you put it?


Thanks,

Jason Bourque
Co-Director Boston AppleScript Users Group



On 5/1/02 4:24 PM, "nellA hciR" <[EMAIL PROTECTED]> wrote:

> #!/usr/bin/perl
> 
> if(-f "/users/userid/.nsmbrc") {
> print "mounting share\n";
> system('mount_smbfs -W workgroupname //username@domain/share
> /users/userid/myshare');
> } else {
> print "password file does not exist\n";
> }
> 
> __END__
> 
> contents of ~/.nsmbrc
> 
> [DOMAIN:USERNAME:SHARE]
> addr=0.0.0.0
> password=yourpasss
> workgroup=WORKGROUPNAME
> 
> - hcir
> On Wednesday, May 1, 2002, at 10:39 , Jason Bourque wrote:
> 
>> Hello,
>> 
>> Is it possible to write a perl script that will mount a share via samba?
>> 
>> Any sample code would be great.
> 




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Jason Bourque

Well, I actually write AppleScript for a living and use Dave on OS 9 to
mount everyting outside of appletalk.

But yesterday my copy of Dave X came in and would you know its not
scriptable! 

I contacted support and they said it was not them but OS X that had limited
AppleScript support. And that any day now a version would come out with
additional AppleScript support.


So I started to look at my options. Perl came to mind. I will need to
integrate it into my AppleScript workflow.


Thanks,

Jason Bourque
Co-Director Boston AppleScript Users Group



On 5/1/02 4:29 PM, "Randy Boring" <[EMAIL PROTECTED]> wrote:

>> On Wed, 1 May 2002, Jason Bourque wrote:
>> 
>>> Is it possible to write a perl script that will mount a share via samba?
>>> 
>>> Any sample code would be great.
>> 
>> Great question!  I'm interested in this, too.  I think smbmount might be
>> the command to use, but I haven't been able to get it to work.
>> 
>> I've read, also, that smbmounting more than one fileshare causes kernel
>> instability.  Does anybody know what list to go to, or where I might ask
>> about things like this?  I'm trying to support several MacOS X users in a
>> university environment where we have a bunch of Samba-based network
>> shares, and I'd like to plug them in better.
>> 
>> 
>> --
>> MattLangford
> 
> Pre-warning, I'm biased, as I work for Thursby Software Systems, Inc.
> 
> Samba is mostly a server, so it's not likely that you really want to
> mount _via_ Samba, you probably want to mount a Samba volume via an SMB
> or CIFS client.  Actually, the Samba package does include a way to mount
> a filesystem as a client, but I don't believe that this works on OS X.
> (They also include a rudimentary command-line client, which I don't
> believe you want.)  Apple does ship an smb client with OS X, but yes it
> has problems, only one of which is being limited to one mount at a time.
> (Lack of browsing the network is another.)
> 
> DAVE, on the other hand, is a robust client (and server if you want),
> which can connect to many shares at once, handles FAT and NTFS volumes
> and servers of many kinds (Windows 95/98/ME/NT/2K/XP and many UNIX-based
> servers including Samba servers).  To answer your question, it also
> supports mounting via AppleScript.
> 
> The syntax for mounting via DAVE for Mac OS 9 is along the lines of
> mount share "share" on server "servername" user "randy" password "foo"
> domain "ENG" volume named "desktop volume name"
> or
> mount share "cifs://server/share"
> 
> In DAVE for OS X it should be similar.  In fact, it is a bit better, as
> there is a way to include the necessary username (and domain) and
> password in the URL, too.  But I'm running 9, not X, so you'll want to
> look it up in the online docs.
> 
> Once you've gotten DAVE to mount your volume via AppleScript, I'm sure
> someone here can help you redo the one-line AppleScript in Perl.
> 
> -Randy
> 
> ##
> #   Thursby Software Systems, Inc.   #
> ##
> # Randy Boring   Network Engineer#
> # 5840 W. Interstate 20 Suite 100Arlington, Texas 76017  #
> # Phone: 817-478-5070Fax: 817-561-2313   #
> # email: [EMAIL PROTECTED]   web: www.thursby.com#
> ##
> ##
> 




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Matthew Langford


On Wed, 1 May 2002, David Souza wrote:
> NFS Mounts:
> 
> 
> At 2:42 PM -0500 5/1/02, Matthew Langford wrote:
> >I've read, also, that smbmounting more than one fileshare causes kernel
> >instability.  Does anybody know what list to go to, or where I might ask
> >about things like this?  I'm trying to support several MacOS X users in a
> >university environment where we have a bunch of Samba-based network
> >shares, and I'd like to plug them in better.

Unfortunately, NFS raises more issues than it solves.  Let's see, the UIDs
aren't going to match.  Oh, wait, now I've got to incorporate the MacOS X
NetInfo into our NIS domain.  Instead of worrying about one account
username and password being compromised, I have to worry about all of NIS
being compromised in this strange, unknown NetInfo beast.  And NFS locking
issues...server reconnects...case sensitivity...and invisible files
popping up everywhere.  Things handled transparently by Samba servers
(well, mostly).

I'll look into it, though.  Maybe I can overcome my inherent skepticism
and conservativity.  :)  

The problem I have with mount_smbfs, or the Go To...  command in the
Finder, is this:  I have two servers aliased to the same machine, IVY and
KUDZU.  When I try to mount smb://kudzu/homes, mount_smbfs tries to get
\\IVY\homes.  I can't figure out why mount_smbfs is changing the name of
the server.  KUDZU is the WINS server, KUDZU is the domain server if I
specify a domain (it seems to make no difference), but it always uses IVY.
Giving it a fully qualified domain name does not help, either. 



--
MattLangford 





Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Ian Ragsdale

On 5/1/02 3:29 PM, "Randy Boring" <[EMAIL PROTECTED]> wrote:

> Pre-warning, I'm biased, as I work for Thursby Software Systems, Inc.
> 

I'll keep that in mind. :)

> Samba is mostly a server, so it's not likely that you really want to
> mount _via_ Samba, you probably want to mount a Samba volume via an SMB
> or CIFS client.  Actually, the Samba package does include a way to mount
> a filesystem as a client, but I don't believe that this works on OS X.
> (They also include a rudimentary command-line client, which I don't
> believe you want.)  Apple does ship an smb client with OS X, but yes it
> has problems, only one of which is being limited to one mount at a time.
> (Lack of browsing the network is another.)
> 

I agree that Apple's current smb implementation has problems, especially the
lack of browsing capabilities, but it does NOT have a problem mounting more
than one share at a time - I do this on a regular basis.  I know you have a
product to sell but lets keep it truthful. :)

You were probably thinking about the competing product Sharity (from
Objective Development), which in it's demo form only allows one mount at a
time (but has very nice browsing capabilities).

> DAVE, on the other hand, is a robust client (and server if you want),
> which can connect to many shares at once, handles FAT and NTFS volumes
> and servers of many kinds (Windows 95/98/ME/NT/2K/XP and many UNIX-based
> servers including Samba servers).  To answer your question, it also
> supports mounting via AppleScript.
> 

I will agree with you that Dave was a great product on OS 9 - I don't really
have much experience with it on OS X, beyond one of the first betas.

Ian




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Randy Boring

>On Wed, 1 May 2002, Jason Bourque wrote:
>
>> Is it possible to write a perl script that will mount a share via samba?
>> 
>> Any sample code would be great.
>
>Great question!  I'm interested in this, too.  I think smbmount might be
>the command to use, but I haven't been able to get it to work.
>
>I've read, also, that smbmounting more than one fileshare causes kernel
>instability.  Does anybody know what list to go to, or where I might ask
>about things like this?  I'm trying to support several MacOS X users in a
>university environment where we have a bunch of Samba-based network
>shares, and I'd like to plug them in better.
>
>
>--
>MattLangford

Pre-warning, I'm biased, as I work for Thursby Software Systems, Inc.

Samba is mostly a server, so it's not likely that you really want to 
mount _via_ Samba, you probably want to mount a Samba volume via an SMB 
or CIFS client.  Actually, the Samba package does include a way to mount 
a filesystem as a client, but I don't believe that this works on OS X.  
(They also include a rudimentary command-line client, which I don't 
believe you want.)  Apple does ship an smb client with OS X, but yes it 
has problems, only one of which is being limited to one mount at a time.  
(Lack of browsing the network is another.)

DAVE, on the other hand, is a robust client (and server if you want), 
which can connect to many shares at once, handles FAT and NTFS volumes 
and servers of many kinds (Windows 95/98/ME/NT/2K/XP and many UNIX-based 
servers including Samba servers).  To answer your question, it also 
supports mounting via AppleScript.

The syntax for mounting via DAVE for Mac OS 9 is along the lines of 
  mount share "share" on server "servername" user "randy" password "foo" 
domain "ENG" volume named "desktop volume name"
or
  mount share "cifs://server/share"

In DAVE for OS X it should be similar.  In fact, it is a bit better, as 
there is a way to include the necessary username (and domain) and 
password in the URL, too.  But I'm running 9, not X, so you'll want to 
look it up in the online docs.

Once you've gotten DAVE to mount your volume via AppleScript, I'm sure 
someone here can help you redo the one-line AppleScript in Perl.

 -Randy

##
#   Thursby Software Systems, Inc.   #
##
# Randy Boring   Network Engineer#
# 5840 W. Interstate 20 Suite 100Arlington, Texas 76017  #
# Phone: 817-478-5070Fax: 817-561-2313   #
# email: [EMAIL PROTECTED]   web: www.thursby.com#
## 
##




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread nellA hciR

#!/usr/bin/perl

if(-f "/users/userid/.nsmbrc") {
print "mounting share\n";
system('mount_smbfs -W workgroupname //username@domain/share 
/users/userid/myshare');
} else {
print "password file does not exist\n";
}

__END__

contents of ~/.nsmbrc

[DOMAIN:USERNAME:SHARE]
addr=0.0.0.0
password=yourpasss
workgroup=WORKGROUPNAME

- hcir
On Wednesday, May 1, 2002, at 10:39 , Jason Bourque wrote:

> Hello,
>
> Is it possible to write a perl script that will mount a share via samba?
>
> Any sample code would be great.




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread David Souza

NFS Mounts:


At 2:42 PM -0500 5/1/02, Matthew Langford wrote:
>On Wed, 1 May 2002, Jason Bourque wrote:
>
>>  Is it possible to write a perl script that will mount a share via samba?
>>
>>  Any sample code would be great.
>
>Great question!  I'm interested in this, too.  I think smbmount might be
>the command to use, but I haven't been able to get it to work.
>
>I've read, also, that smbmounting more than one fileshare causes kernel
>instability.  Does anybody know what list to go to, or where I might ask
>about things like this?  I'm trying to support several MacOS X users in a
>university environment where we have a bunch of Samba-based network
>shares, and I'd like to plug them in better.
>
>
>--
>MattLangford


-- 
**
 David Souza voice:408-974-1992
 Web Specialist http://www.apple.com/developer/
 Worldwide Developer Relations  mailto:[EMAIL PROTECTED]
**
Five days in May, over a hundred sessions, thousands of engineers,
 One great OS. Mac OS X, the ultimate development platform.

   Apple's Worldwide Developers Conference 2002, May 6-10
   For details, visit http://developer.apple.com/wwdc2002
**



Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread ellem


On Wednesday, May 1, 2002, at 02:39 PM, Jason Bourque wrote:

> Hello,
>
> Is it possible to write a perl script that will mount a share via samba?
>

just `backtick` it?  (untested)

> Any sample code would be great.
>
> Thanks,
>
> Jason Bourque
>
>

--
Lou Moran
[EMAIL PROTECTED]
http://ellem.dyn.dhs.org:5281/
(OS X)




Re: Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Matthew Langford


On Wed, 1 May 2002, Jason Bourque wrote:

> Is it possible to write a perl script that will mount a share via samba?
> 
> Any sample code would be great.

Great question!  I'm interested in this, too.  I think smbmount might be
the command to use, but I haven't been able to get it to work.

I've read, also, that smbmounting more than one fileshare causes kernel
instability.  Does anybody know what list to go to, or where I might ask
about things like this?  I'm trying to support several MacOS X users in a
university environment where we have a bunch of Samba-based network
shares, and I'd like to plug them in better.


--
MattLangford 




Accessing Samba - Mount Volume Possible?

2002-05-01 Thread Jason Bourque

Hello,

Is it possible to write a perl script that will mount a share via samba?

Any sample code would be great.

Thanks,

Jason Bourque