All of lore.kernel.org
 help / color / mirror / Atom feed
* unable to automount windows C$
@ 2008-12-10 19:49 Scott Belnap
  2008-12-23  6:13 ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Scott Belnap @ 2008-12-10 19:49 UTC (permalink / raw)
  To: autofs


[-- Attachment #1.1: Type: text/plain, Size: 4841 bytes --]

I'm trying to automount a windows machine.  I am able to automount any
directory that doesn't have a $ in the mount name.  Looks like the
parse_mount method is stripping out the $ from the mount name.  Any ideas on
how to fix this?

Dec  9 23:49:03 dc2 automount[19084]: handle_packet_missing_direct: token
122, name /cifs/laptop/C$, request pid 17857
Dec  9 23:49:03 dc2 automount[19084]: attempting to mount entry
/cifs/laptop/C$
Dec  9 23:49:03 dc2 automount[19084]: lookup_mount: lookup(program):
/cifs/laptop/C$ ->
-fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
://laptop/C$
Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun): expanded
entry:
-fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
://laptop/C
Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun): gathered
options:
fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun): core of
entry:
options=fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop,
loc=://laptop/C
Dec  9 23:49:03 dc2 automount[19084]: sun_mount: parse(sun): mounting root
/cifs, mountpoint /cifs/laptop/C$, what //laptop/C, fstype cifs, options
file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
Dec  9 23:49:03 dc2 automount[19084]: do_mount: //laptop/C
/cifs//cifs/laptop/C$ type cifs options
file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop using module
generic
Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic): calling
mkdir_path /cifs/laptop/C$
Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic): calling
mount -t cifs -s -o
file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop //laptop/C
/cifs/laptop/C$
Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code = -6
Dec  9 23:49:03 dc2 automount[19084]: >> retrying with upper case share name
Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code = -6
Dec  9 23:49:03 dc2 automount[19084]: >> mount error 6 = No such device or
address
Dec  9 23:49:03 dc2 automount[19084]: >> Refer to the mount.cifs(8) manual
page (e.g.man mount.cifs)
Dec  9 23:49:03 dc2 automount[19084]: spawn_mount: mount failed with error
code 16, retrying with the -f option
Dec  9 23:49:06 dc2 automount[19084]: >> unknown mount option f
Dec  9 23:49:06 dc2 automount[19084]: >> Usage:  /sbin/mount.cifs
<remotetarget> <dir> -o <options>
Dec  9 23:49:06 dc2 automount[19084]: >> Mount the remote target, specified
as a UNC name, to a local directory.
Dec  9 23:49:06 dc2 automount[19084]: >> Options:
Dec  9 23:49:06 dc2 automount[19084]: >> #011user=<arg>
Dec  9 23:49:06 dc2 automount[19084]: >> #011pass=<arg>
Dec  9 23:49:06 dc2 automount[19084]: >> #011dom=<arg>
Dec  9 23:49:06 dc2 automount[19084]: >> Less commonly used options:
Dec  9 23:49:06 dc2 automount[19084]: >>
#011credentials=<filename>,guest,perm,noperm,setuids,nosetuids,rw,ro,
Dec  9 23:49:06 dc2 automount[19084]: >>
#011sep=<char>,iocharset=<codepage>,suid,nosuid,exec,noexec,serverino,
Dec  9 23:49:06 dc2 automount[19084]: >>
#011directio,mapchars,nomapchars,nolock,servernetbiosname=<SRV_RFC1001NAME>
Dec  9 23:49:06 dc2 automount[19084]: >> Options not needed for servers
supporting CIFS Unix extensions
Dec  9 23:49:06 dc2 automount[19084]: >> #011(e.g. unneeded for mounts to
most Samba versions):
Dec  9 23:49:06 dc2 automount[19084]: >>
#011uid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>,sfu
Dec  9 23:49:06 dc2 automount[19084]: >> Rarely used options:
Dec  9 23:49:06 dc2 automount[19084]: >>
#011port=<tcpport>,rsize=<size>,wsize=<size>,unc=<unc_name>,ip=<ip_address>,
Dec  9 23:49:06 dc2 automount[19084]: >>
#011dev,nodev,nouser_xattr,netbiosname=<OUR_RFC1001NAME>,hard,soft,intr,
Dec  9 23:49:06 dc2 automount[19084]: >>
#011nointr,ignorecase,noposixpaths,noacl
Dec  9 23:49:06 dc2 automount[19084]: >> Options are described in more
detail in the manual page
Dec  9 23:49:06 dc2 automount[19084]: >> #011man 8 mount.cifs
Dec  9 23:49:06 dc2 automount[19084]: >> To display the version number of
the mount helper:
Dec  9 23:49:06 dc2 automount[19084]: >> #011/sbin/mount.cifs -V
Dec  9 23:49:06 dc2 automount[19084]: mount(generic): failed to mount
//laptop/C (type cifs) on /cifs/laptop/C$
Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 122
Dec  9 23:49:06 dc2 automount[19084]: handle_packet: type = 5
Dec  9 23:49:06 dc2 automount[19084]: handle_packet_missing_direct: token
123, name /cifs/laptop/C$, request pid 17857
Dec  9 23:49:06 dc2 automount[19084]: attempting to mount entry
/cifs/laptop/C$
Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 123
Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$

[-- Attachment #1.2: Type: text/html, Size: 5549 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2008-12-10 19:49 unable to automount windows C$ Scott Belnap
@ 2008-12-23  6:13 ` Ian Kent
  2009-05-11  0:43   ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2008-12-23  6:13 UTC (permalink / raw)
  To: Scott Belnap; +Cc: autofs

On Wed, 2008-12-10 at 12:49 -0700, Scott Belnap wrote:
> I'm trying to automount a windows machine.  I am able to automount any
> directory that doesn't have a $ in the mount name.  Looks like the
> parse_mount method is stripping out the $ from the mount name.  Any
> ideas on how to fix this?

I think you might need to escape the $ that gets clobbered. It is most
likely getting interpreted as a dollar macro expansion.

> 
> Dec  9 23:49:03 dc2 automount[19084]: handle_packet_missing_direct:
> token 122, name /cifs/laptop/C$, request pid 17857
> Dec  9 23:49:03 dc2 automount[19084]: attempting to mount
> entry /cifs/laptop/C$
> Dec  9 23:49:03 dc2 automount[19084]: lookup_mount:
> lookup(program): /cifs/laptop/C$ ->
> -fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop ://laptop/C$
> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun):
> expanded entry:
> -fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop ://laptop/C
> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun):
> gathered options:
> fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun): core of
> entry:
> options=fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop, loc=://laptop/C
> Dec  9 23:49:03 dc2 automount[19084]: sun_mount: parse(sun): mounting
> root /cifs, mountpoint /cifs/laptop/C$, what //laptop/C, fstype cifs,
> options file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
> Dec  9 23:49:03 dc2 automount[19084]:
> do_mount: //laptop/C /cifs//cifs/laptop/C$ type cifs options
> file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop using
> module generic
> Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic):
> calling mkdir_path /cifs/laptop/C$
> Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic):
> calling mount -t cifs -s -o
> file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop //laptop/C /cifs/laptop/C$
> Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code
> = -6
> Dec  9 23:49:03 dc2 automount[19084]: >> retrying with upper case
> share name
> Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code
> = -6
> Dec  9 23:49:03 dc2 automount[19084]: >> mount error 6 = No such
> device or address
> Dec  9 23:49:03 dc2 automount[19084]: >> Refer to the mount.cifs(8)
> manual page (e.g.man mount.cifs)
> Dec  9 23:49:03 dc2 automount[19084]: spawn_mount: mount failed with
> error code 16, retrying with the -f option
> Dec  9 23:49:06 dc2 automount[19084]: >> unknown mount option f
> Dec  9 23:49:06 dc2 automount[19084]: >> Usage:  /sbin/mount.cifs
> <remotetarget> <dir> -o <options>
> Dec  9 23:49:06 dc2 automount[19084]: >> Mount the remote target,
> specified as a UNC name, to a local directory.
> Dec  9 23:49:06 dc2 automount[19084]: >> Options:
> Dec  9 23:49:06 dc2 automount[19084]: >> #011user=<arg>
> Dec  9 23:49:06 dc2 automount[19084]: >> #011pass=<arg>
> Dec  9 23:49:06 dc2 automount[19084]: >> #011dom=<arg>
> Dec  9 23:49:06 dc2 automount[19084]: >> Less commonly used options:
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011credentials=<filename>,guest,perm,noperm,setuids,nosetuids,rw,ro,
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011sep=<char>,iocharset=<codepage>,suid,nosuid,exec,noexec,serverino,
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011directio,mapchars,nomapchars,nolock,servernetbiosname=<SRV_RFC1001NAME>
> Dec  9 23:49:06 dc2 automount[19084]: >> Options not needed for
> servers supporting CIFS Unix extensions
> Dec  9 23:49:06 dc2 automount[19084]: >> #011(e.g. unneeded for mounts
> to most Samba versions):
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011uid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>,sfu
> Dec  9 23:49:06 dc2 automount[19084]: >> Rarely used options:
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011port=<tcpport>,rsize=<size>,wsize=<size>,unc=<unc_name>,ip=<ip_address>,
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011dev,nodev,nouser_xattr,netbiosname=<OUR_RFC1001NAME>,hard,soft,intr,
> Dec  9 23:49:06 dc2 automount[19084]: >>
> #011nointr,ignorecase,noposixpaths,noacl
> Dec  9 23:49:06 dc2 automount[19084]: >> Options are described in more
> detail in the manual page
> Dec  9 23:49:06 dc2 automount[19084]: >> #011man 8 mount.cifs
> Dec  9 23:49:06 dc2 automount[19084]: >> To display the version number
> of the mount helper:
> Dec  9 23:49:06 dc2 automount[19084]: >> #011/sbin/mount.cifs -V
> Dec  9 23:49:06 dc2 automount[19084]: mount(generic): failed to
> mount //laptop/C (type cifs) on /cifs/laptop/C$
> Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 122
> Dec  9 23:49:06 dc2 automount[19084]: handle_packet: type = 5
> Dec  9 23:49:06 dc2 automount[19084]: handle_packet_missing_direct:
> token 123, name /cifs/laptop/C$, request pid 17857
> Dec  9 23:49:06 dc2 automount[19084]: attempting to mount
> entry /cifs/laptop/C$
> Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
> Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 123
> Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
> 
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2008-12-23  6:13 ` Ian Kent
@ 2009-05-11  0:43   ` Matthew Jurgens
  2009-05-12  4:45     ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-05-11  0:43 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs, Scott Belnap


[-- Attachment #1.1: Type: text/plain, Size: 6009 bytes --]

I've had this same problem from time to time and since upgrading to 
Fedora 10 it has come back:
Fedora 10 - kernel 2.6.27.21-170.2.56.fc10.i686.PAE
autofs-5.0.3-41.i386

The correctly mounted manual entry:
//xp0/C$ on /mnt type cifs (rw,mand)

The autofs entry:
//xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)

If you need anymore debug info let me know

Ian Kent wrote:
> On Wed, 2008-12-10 at 12:49 -0700, Scott Belnap wrote:
>   
>> I'm trying to automount a windows machine.  I am able to automount any
>> directory that doesn't have a $ in the mount name.  Looks like the
>> parse_mount method is stripping out the $ from the mount name.  Any
>> ideas on how to fix this?
>>     
>
> I think you might need to escape the $ that gets clobbered. It is most
> likely getting interpreted as a dollar macro expansion.
>
>   
>> Dec  9 23:49:03 dc2 automount[19084]: handle_packet_missing_direct:
>> token 122, name /cifs/laptop/C$, request pid 17857
>> Dec  9 23:49:03 dc2 automount[19084]: attempting to mount
>> entry /cifs/laptop/C$
>> Dec  9 23:49:03 dc2 automount[19084]: lookup_mount:
>> lookup(program): /cifs/laptop/C$ ->
>> -fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop ://laptop/C$
>> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun):
>> expanded entry:
>> -fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop ://laptop/C
>> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun):
>> gathered options:
>> fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun): core of
>> entry:
>> options=fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop, loc=://laptop/C
>> Dec  9 23:49:03 dc2 automount[19084]: sun_mount: parse(sun): mounting
>> root /cifs, mountpoint /cifs/laptop/C$, what //laptop/C, fstype cifs,
>> options file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>> Dec  9 23:49:03 dc2 automount[19084]:
>> do_mount: //laptop/C /cifs//cifs/laptop/C$ type cifs options
>> file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop using
>> module generic
>> Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic):
>> calling mkdir_path /cifs/laptop/C$
>> Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic):
>> calling mount -t cifs -s -o
>> file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop //laptop/C /cifs/laptop/C$
>> Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code
>> = -6
>> Dec  9 23:49:03 dc2 automount[19084]: >> retrying with upper case
>> share name
>> Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code
>> = -6
>> Dec  9 23:49:03 dc2 automount[19084]: >> mount error 6 = No such
>> device or address
>> Dec  9 23:49:03 dc2 automount[19084]: >> Refer to the mount.cifs(8)
>> manual page (e.g.man mount.cifs)
>> Dec  9 23:49:03 dc2 automount[19084]: spawn_mount: mount failed with
>> error code 16, retrying with the -f option
>> Dec  9 23:49:06 dc2 automount[19084]: >> unknown mount option f
>> Dec  9 23:49:06 dc2 automount[19084]: >> Usage:  /sbin/mount.cifs
>> <remotetarget> <dir> -o <options>
>> Dec  9 23:49:06 dc2 automount[19084]: >> Mount the remote target,
>> specified as a UNC name, to a local directory.
>> Dec  9 23:49:06 dc2 automount[19084]: >> Options:
>> Dec  9 23:49:06 dc2 automount[19084]: >> #011user=<arg>
>> Dec  9 23:49:06 dc2 automount[19084]: >> #011pass=<arg>
>> Dec  9 23:49:06 dc2 automount[19084]: >> #011dom=<arg>
>> Dec  9 23:49:06 dc2 automount[19084]: >> Less commonly used options:
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011credentials=<filename>,guest,perm,noperm,setuids,nosetuids,rw,ro,
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011sep=<char>,iocharset=<codepage>,suid,nosuid,exec,noexec,serverino,
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011directio,mapchars,nomapchars,nolock,servernetbiosname=<SRV_RFC1001NAME>
>> Dec  9 23:49:06 dc2 automount[19084]: >> Options not needed for
>> servers supporting CIFS Unix extensions
>> Dec  9 23:49:06 dc2 automount[19084]: >> #011(e.g. unneeded for mounts
>> to most Samba versions):
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011uid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>,sfu
>> Dec  9 23:49:06 dc2 automount[19084]: >> Rarely used options:
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011port=<tcpport>,rsize=<size>,wsize=<size>,unc=<unc_name>,ip=<ip_address>,
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011dev,nodev,nouser_xattr,netbiosname=<OUR_RFC1001NAME>,hard,soft,intr,
>> Dec  9 23:49:06 dc2 automount[19084]: >>
>> #011nointr,ignorecase,noposixpaths,noacl
>> Dec  9 23:49:06 dc2 automount[19084]: >> Options are described in more
>> detail in the manual page
>> Dec  9 23:49:06 dc2 automount[19084]: >> #011man 8 mount.cifs
>> Dec  9 23:49:06 dc2 automount[19084]: >> To display the version number
>> of the mount helper:
>> Dec  9 23:49:06 dc2 automount[19084]: >> #011/sbin/mount.cifs -V
>> Dec  9 23:49:06 dc2 automount[19084]: mount(generic): failed to
>> mount //laptop/C (type cifs) on /cifs/laptop/C$
>> Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 122
>> Dec  9 23:49:06 dc2 automount[19084]: handle_packet: type = 5
>> Dec  9 23:49:06 dc2 automount[19084]: handle_packet_missing_direct:
>> token 123, name /cifs/laptop/C$, request pid 17857
>> Dec  9 23:49:06 dc2 automount[19084]: attempting to mount
>> entry /cifs/laptop/C$
>> Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
>> Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 123
>> Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
>>
>> _______________________________________________
>> autofs mailing list
>> autofs@linux.kernel.org
>> http://linux.kernel.org/mailman/listinfo/autofs
>>     
>
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs
>
>   

[-- Attachment #1.2: Type: text/html, Size: 6889 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-11  0:43   ` Matthew Jurgens
@ 2009-05-12  4:45     ` Ian Kent
  2009-05-13  4:57       ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-12  4:45 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs, Scott Belnap

Matthew Jurgens wrote:
> I've had this same problem from time to time and since upgrading to
> Fedora 10 it has come back:
> Fedora 10 - kernel 2.6.27.21-170.2.56.fc10.i686.PAE
> autofs-5.0.3-41.i386
> 
> The correctly mounted manual entry:
> //xp0/C$ on /mnt type cifs (rw,mand)
> 
> The autofs entry:
> //xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)
> 
> If you need anymore debug info let me know

I have no idea what you are trying to say.
The above, //xp0/C/$, doesn't correspond to what autofs-5.0.3-41 passes
to mount(8) and I have no idea what has happened since you haven't
provided any log information.

> 
> Ian Kent wrote:
>> On Wed, 2008-12-10 at 12:49 -0700, Scott Belnap wrote:
>>  
>>> I'm trying to automount a windows machine.  I am able to automount any
>>> directory that doesn't have a $ in the mount name.  Looks like the
>>> parse_mount method is stripping out the $ from the mount name.  Any
>>> ideas on how to fix this?
>>>     
>>
>> I think you might need to escape the $ that gets clobbered. It is most
>> likely getting interpreted as a dollar macro expansion.
>>
>>  
>>> Dec  9 23:49:03 dc2 automount[19084]: handle_packet_missing_direct:
>>> token 122, name /cifs/laptop/C$, request pid 17857
>>> Dec  9 23:49:03 dc2 automount[19084]: attempting to mount
>>> entry /cifs/laptop/C$
>>> Dec  9 23:49:03 dc2 automount[19084]: lookup_mount:
>>> lookup(program): /cifs/laptop/C$ ->
>>> -fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>>> ://laptop/C$
>>> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun):
>>> expanded entry:
>>> -fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>>> ://laptop/C
>>> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun):
>>> gathered options:
>>> fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>>>
>>> Dec  9 23:49:03 dc2 automount[19084]: parse_mount: parse(sun): core of
>>> entry:
>>> options=fstype=cifs,file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop,
>>> loc=://laptop/C
>>> Dec  9 23:49:03 dc2 automount[19084]: sun_mount: parse(sun): mounting
>>> root /cifs, mountpoint /cifs/laptop/C$, what //laptop/C, fstype cifs,
>>> options file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>>> Dec  9 23:49:03 dc2 automount[19084]:
>>> do_mount: //laptop/C /cifs//cifs/laptop/C$ type cifs options
>>> file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop using
>>> module generic
>>> Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic):
>>> calling mkdir_path /cifs/laptop/C$
>>> Dec  9 23:49:03 dc2 automount[19084]: mount_mount: mount(generic):
>>> calling mount -t cifs -s -o
>>> file_mode=0644,dir_mode=0755,credentials=/etc/auto.smb.laptop
>>> //laptop/C /cifs/laptop/C$
>>> Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code
>>> = -6
>>> Dec  9 23:49:03 dc2 automount[19084]: >> retrying with upper case
>>> share name
>>> Dec  9 23:49:03 dc2 kernel:  CIFS VFS: cifs_mount failed w/return code
>>> = -6
>>> Dec  9 23:49:03 dc2 automount[19084]: >> mount error 6 = No such
>>> device or address
>>> Dec  9 23:49:03 dc2 automount[19084]: >> Refer to the mount.cifs(8)
>>> manual page (e.g.man mount.cifs)
>>> Dec  9 23:49:03 dc2 automount[19084]: spawn_mount: mount failed with
>>> error code 16, retrying with the -f option
>>> Dec  9 23:49:06 dc2 automount[19084]: >> unknown mount option f
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Usage:  /sbin/mount.cifs
>>> <remotetarget> <dir> -o <options>
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Mount the remote target,
>>> specified as a UNC name, to a local directory.
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Options:
>>> Dec  9 23:49:06 dc2 automount[19084]: >> #011user=<arg>
>>> Dec  9 23:49:06 dc2 automount[19084]: >> #011pass=<arg>
>>> Dec  9 23:49:06 dc2 automount[19084]: >> #011dom=<arg>
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Less commonly used options:
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011credentials=<filename>,guest,perm,noperm,setuids,nosetuids,rw,ro,
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011sep=<char>,iocharset=<codepage>,suid,nosuid,exec,noexec,serverino,
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011directio,mapchars,nomapchars,nolock,servernetbiosname=<SRV_RFC1001NAME>
>>>
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Options not needed for
>>> servers supporting CIFS Unix extensions
>>> Dec  9 23:49:06 dc2 automount[19084]: >> #011(e.g. unneeded for mounts
>>> to most Samba versions):
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011uid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>,sfu
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Rarely used options:
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011port=<tcpport>,rsize=<size>,wsize=<size>,unc=<unc_name>,ip=<ip_address>,
>>>
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011dev,nodev,nouser_xattr,netbiosname=<OUR_RFC1001NAME>,hard,soft,intr,
>>> Dec  9 23:49:06 dc2 automount[19084]: >>
>>> #011nointr,ignorecase,noposixpaths,noacl
>>> Dec  9 23:49:06 dc2 automount[19084]: >> Options are described in more
>>> detail in the manual page
>>> Dec  9 23:49:06 dc2 automount[19084]: >> #011man 8 mount.cifs
>>> Dec  9 23:49:06 dc2 automount[19084]: >> To display the version number
>>> of the mount helper:
>>> Dec  9 23:49:06 dc2 automount[19084]: >> #011/sbin/mount.cifs -V
>>> Dec  9 23:49:06 dc2 automount[19084]: mount(generic): failed to
>>> mount //laptop/C (type cifs) on /cifs/laptop/C$
>>> Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 122
>>> Dec  9 23:49:06 dc2 automount[19084]: handle_packet: type = 5
>>> Dec  9 23:49:06 dc2 automount[19084]: handle_packet_missing_direct:
>>> token 123, name /cifs/laptop/C$, request pid 17857
>>> Dec  9 23:49:06 dc2 automount[19084]: attempting to mount
>>> entry /cifs/laptop/C$
>>> Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
>>> Dec  9 23:49:06 dc2 automount[19084]: send_fail: token = 123
>>> Dec  9 23:49:06 dc2 automount[19084]: failed to mount /cifs/laptop/C$
>>>
>>> _______________________________________________
>>> autofs mailing list
>>> autofs@linux.kernel.org
>>> http://linux.kernel.org/mailman/listinfo/autofs
>>>     
>>
>> _______________________________________________
>> autofs mailing list
>> autofs@linux.kernel.org
>> http://linux.kernel.org/mailman/listinfo/autofs
>>
>>   
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-12  4:45     ` Ian Kent
@ 2009-05-13  4:57       ` Matthew Jurgens
  2009-05-13  5:05         ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-05-13  4:57 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 6431 bytes --]

Ian Kent wrote:
> Matthew Jurgens wrote:
>   
>> I've had this same problem from time to time and since upgrading to
>> Fedora 10 it has come back:
>> Fedora 10 - kernel 2.6.27.21-170.2.56.fc10.i686.PAE
>> autofs-5.0.3-41.i386
>>
>> The correctly mounted manual entry:
>> //xp0/C$ on /mnt type cifs (rw,mand)
>>
>> The autofs entry:
>> //xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)
>>
>> If you need anymore debug info let me know
>>     
>
> I have no idea what you are trying to say.
> The above, //xp0/C/$, doesn't correspond to what autofs-5.0.3-41 passes
> to mount(8) and I have no idea what has happened since you haven't
> provided any log information
Sorry, here is more information:

Windows machine called xp0.
cd /smb/xp0/C$ yields the following debug:

May 13 14:43:28 gw automount[15573]: handle_packet: type = 3
May 13 14:43:28 gw automount[15573]: handle_packet_missing_indirect: 
token 57, name xp0, request pid 15215
May 13 14:43:28 gw automount[15573]: attempting to mount entry /smb/xp0
May 13 14:43:28 gw automount[15573]: lookup_mount: lookup(program): 
looking up xp0
May 13 14:43:28 gw automount[15573]: lookup_mount: lookup(program): xp0 
-> -fstype=cifs,username=USERNAME,password=PASSWORD  #011 /C "://xp0/C"  
#011 /ADMIN\$ "://xp0/ADMIN\$"  #011 /C\$ "://xp0/C\$"
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): expanded 
entry: -fstype=cifs,username=USERNAME,password=PASSWORD  #011 /C 
"://xp0/C"  #011 /ADMIN\$ "://xp0/ADMIN\$"  #011 /C\$ "://xp0/C\$"
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): gathered 
options: fstype=cifs,username=USERNAME,password=PASSWORD
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): 
dequote("/C") -> /C
May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): gathered 
options: fstype=cifs,username=USERNAME,password=PASSWORD
May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): 
dequote(""://xp0/C"") -> ://xp0/C
May 13 14:43:28 gw automount[15573]: add_offset_entry: parse(sun): added 
multi-mount offset /C -> 
-fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): 
dequote("/ADMIN\$") -> /ADMIN$
May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): gathered 
options: fstype=cifs,username=USERNAME,password=PASSWORD
May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): 
dequote(""://xp0/ADMIN\$"") -> ://xp0/ADMIN\$
May 13 14:43:28 gw automount[15573]: add_offset_entry: parse(sun): added 
multi-mount offset /ADMIN$ -> 
-fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/ADMIN\$
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): 
dequote("/C\$") -> /C$
May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): gathered 
options: fstype=cifs,username=USERNAME,password=PASSWORD
May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): 
dequote(""://xp0/C\$"") -> ://xp0/C\$
May 13 14:43:28 gw automount[15573]: add_offset_entry: parse(sun): added 
multi-mount offset /C$ -> 
-fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C\$
May 13 14:43:28 gw automount[15573]: mount_multi_triggers: mount offset 
/smb/xp0/ADMIN$ at /smb/xp0
May 13 14:43:28 gw automount[15573]: mount_autofs_offset: calling mount 
-t autofs -s  -o fd=18,pgrp=15573,minproto=5,maxproto=5,offset automount 
/smb/xp0/ADMIN$
May 13 14:43:28 gw automount[15573]: mount_autofs_offset: mounted 
trigger /smb/xp0/ADMIN$ at /smb/xp0/ADMIN$
May 13 14:43:28 gw automount[15573]: mount_multi_triggers: mount offset 
/smb/xp0/C at /smb/xp0
May 13 14:43:28 gw automount[15573]: mount_autofs_offset: calling mount 
-t autofs -s  -o fd=18,pgrp=15573,minproto=5,maxproto=5,offset automount 
/smb/xp0/C
May 13 14:43:28 gw automount[15573]: mount_autofs_offset: mounted 
trigger /smb/xp0/C at /smb/xp0/C
May 13 14:43:28 gw automount[15573]: mount_multi_triggers: mount offset 
/smb/xp0/C$ at /smb/xp0
May 13 14:43:28 gw automount[15573]: mount_autofs_offset: calling mount 
-t autofs -s  -o fd=18,pgrp=15573,minproto=5,maxproto=5,offset automount 
/smb/xp0/C$
May 13 14:43:28 gw automount[15573]: mount_autofs_offset: mounted 
trigger /smb/xp0/C$ at /smb/xp0/C$
May 13 14:43:28 gw automount[15573]: send_ready: token = 57
May 13 14:43:28 gw automount[15573]: mounted /smb/xp0
May 13 14:43:28 gw automount[15573]: handle_packet: type = 5
May 13 14:43:28 gw automount[15573]: handle_packet_missing_direct: token 
58, name /smb/xp0/C$, request pid 15215
May 13 14:43:28 gw automount[15573]: attempting to mount entry /smb/xp0/C$
May 13 14:43:28 gw automount[15573]: lookup_mount: lookup(program): 
/smb/xp0/C$ -> -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C\$
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): expanded 
entry: -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C\$
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): gathered 
options: fstype=cifs,username=USERNAME,password=PASSWORD
May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): core of 
entry: options=fstype=cifs,username=USERNAME,password=PASSWORD, 
loc=://xp0/C\$
May 13 14:43:28 gw automount[15573]: sun_mount: parse(sun): mounting 
root /tmp/auto6t8L4W, mountpoint /smb/xp0/C$, what //xp0/C\$, fstype 
cifs, options username=USERNAME,password=PASSWORD
May 13 14:43:28 gw automount[15573]: do_mount: //xp0/C\$ 
/tmp/auto6t8L4W//smb/xp0/C$ type cifs options 
username=USERNAME,password=PASSWORD using module generic
May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic): 
calling mkdir_path /tmp/auto6t8L4W
May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic): 
calling mount -t cifs -s -o username=USERNAME,password=PASSWORD 
//xp0/C\$ /tmp/auto6t8L4W
May 13 14:43:28 gw automount[15573]: mount(generic): mounted //xp0/C\$ 
type cifs on /tmp/auto6t8L4W
May 13 14:43:28 gw automount[15573]: move_mount: moved mount tree from 
/tmp/auto6t8L4W to /smb/xp0/C$
May 13 14:43:28 gw automount[15573]: send_ready: token = 58
May 13 14:43:28 gw automount[15573]: mounted /smb/xp0/C$

The output of a mount command is:
//xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)

The incorrect target of //xp0/C/$ does not appear to be reflected in the 
debug output

The correct output of the mount command should be:
//xp0/C$ on /smb/xp0/C$ type cifs (rw,mand)

-------------------------------------------------------------------------------------------------------------------
http://www.smartmon.com.au

[-- Attachment #1.2: Type: text/html, Size: 7134 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  4:57       ` Matthew Jurgens
@ 2009-05-13  5:05         ` Ian Kent
  2009-05-13  5:30           ` Ian Kent
       [not found]           ` <4A0A59F5.1090308@edcint.co.nz>
  0 siblings, 2 replies; 30+ messages in thread
From: Ian Kent @ 2009-05-13  5:05 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> Ian Kent wrote:
>> Matthew Jurgens wrote:
>>  
>>> I've had this same problem from time to time and since upgrading to
>>> Fedora 10 it has come back:
>>> Fedora 10 - kernel 2.6.27.21-170.2.56.fc10.i686.PAE
>>> autofs-5.0.3-41.i386
>>>
>>> The correctly mounted manual entry:
>>> //xp0/C$ on /mnt type cifs (rw,mand)
>>>
>>> The autofs entry:
>>> //xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)
>>>
>>> If you need anymore debug info let me know
>>>     
>>
>> I have no idea what you are trying to say.
>> The above, //xp0/C/$, doesn't correspond to what autofs-5.0.3-41 passes
>> to mount(8) and I have no idea what has happened since you haven't
>> provided any log information
> Sorry, here is more information:
> 
> Windows machine called xp0.
> cd /smb/xp0/C$ yields the following debug:
> 
> May 13 14:43:28 gw automount[15573]: handle_packet: type = 3
> May 13 14:43:28 gw automount[15573]: handle_packet_missing_indirect:
> token 57, name xp0, request pid 15215
> May 13 14:43:28 gw automount[15573]: attempting to mount entry /smb/xp0
> May 13 14:43:28 gw automount[15573]: lookup_mount: lookup(program):
> looking up xp0
> May 13 14:43:28 gw automount[15573]: lookup_mount: lookup(program): xp0
> -> -fstype=cifs,username=USERNAME,password=PASSWORD  #011 /C "://xp0/C" 
> #011 /ADMIN\$ "://xp0/ADMIN\$"  #011 /C\$ "://xp0/C\$"
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): expanded
> entry: -fstype=cifs,username=USERNAME,password=PASSWORD  #011 /C
> "://xp0/C"  #011 /ADMIN\$ "://xp0/ADMIN\$"  #011 /C\$ "://xp0/C\$"
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): gathered
> options: fstype=cifs,username=USERNAME,password=PASSWORD
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun):
> dequote("/C") -> /C
> May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): gathered
> options: fstype=cifs,username=USERNAME,password=PASSWORD
> May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun):
> dequote(""://xp0/C"") -> ://xp0/C
> May 13 14:43:28 gw automount[15573]: add_offset_entry: parse(sun): added
> multi-mount offset /C ->
> -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun):
> dequote("/ADMIN\$") -> /ADMIN$
> May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): gathered
> options: fstype=cifs,username=USERNAME,password=PASSWORD
> May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun):
> dequote(""://xp0/ADMIN\$"") -> ://xp0/ADMIN\$
> May 13 14:43:28 gw automount[15573]: add_offset_entry: parse(sun): added
> multi-mount offset /ADMIN$ ->
> -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/ADMIN\$
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun):
> dequote("/C\$") -> /C$
> May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun): gathered
> options: fstype=cifs,username=USERNAME,password=PASSWORD
> May 13 14:43:28 gw automount[15573]: parse_mapent: parse(sun):
> dequote(""://xp0/C\$"") -> ://xp0/C\$
> May 13 14:43:28 gw automount[15573]: add_offset_entry: parse(sun): added
> multi-mount offset /C$ ->
> -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C\$
> May 13 14:43:28 gw automount[15573]: mount_multi_triggers: mount offset
> /smb/xp0/ADMIN$ at /smb/xp0
> May 13 14:43:28 gw automount[15573]: mount_autofs_offset: calling mount
> -t autofs -s  -o fd=18,pgrp=15573,minproto=5,maxproto=5,offset automount
> /smb/xp0/ADMIN$
> May 13 14:43:28 gw automount[15573]: mount_autofs_offset: mounted
> trigger /smb/xp0/ADMIN$ at /smb/xp0/ADMIN$
> May 13 14:43:28 gw automount[15573]: mount_multi_triggers: mount offset
> /smb/xp0/C at /smb/xp0
> May 13 14:43:28 gw automount[15573]: mount_autofs_offset: calling mount
> -t autofs -s  -o fd=18,pgrp=15573,minproto=5,maxproto=5,offset automount
> /smb/xp0/C
> May 13 14:43:28 gw automount[15573]: mount_autofs_offset: mounted
> trigger /smb/xp0/C at /smb/xp0/C
> May 13 14:43:28 gw automount[15573]: mount_multi_triggers: mount offset
> /smb/xp0/C$ at /smb/xp0
> May 13 14:43:28 gw automount[15573]: mount_autofs_offset: calling mount
> -t autofs -s  -o fd=18,pgrp=15573,minproto=5,maxproto=5,offset automount
> /smb/xp0/C$
> May 13 14:43:28 gw automount[15573]: mount_autofs_offset: mounted
> trigger /smb/xp0/C$ at /smb/xp0/C$
> May 13 14:43:28 gw automount[15573]: send_ready: token = 57
> May 13 14:43:28 gw automount[15573]: mounted /smb/xp0
> May 13 14:43:28 gw automount[15573]: handle_packet: type = 5
> May 13 14:43:28 gw automount[15573]: handle_packet_missing_direct: token
> 58, name /smb/xp0/C$, request pid 15215
> May 13 14:43:28 gw automount[15573]: attempting to mount entry /smb/xp0/C$
> May 13 14:43:28 gw automount[15573]: lookup_mount: lookup(program):
> /smb/xp0/C$ -> -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C\$
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): expanded
> entry: -fstype=cifs,username=USERNAME,password=PASSWORD ://xp0/C\$
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): gathered
> options: fstype=cifs,username=USERNAME,password=PASSWORD
> May 13 14:43:28 gw automount[15573]: parse_mount: parse(sun): core of
> entry: options=fstype=cifs,username=USERNAME,password=PASSWORD,
> loc=://xp0/C\$
> May 13 14:43:28 gw automount[15573]: sun_mount: parse(sun): mounting
> root /tmp/auto6t8L4W, mountpoint /smb/xp0/C$, what //xp0/C\$, fstype
> cifs, options username=USERNAME,password=PASSWORD
> May 13 14:43:28 gw automount[15573]: do_mount: //xp0/C\$
> /tmp/auto6t8L4W//smb/xp0/C$ type cifs options
> username=USERNAME,password=PASSWORD using module generic
> May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic):
> calling mkdir_path /tmp/auto6t8L4W
> May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic):
> calling mount -t cifs -s -o username=USERNAME,password=PASSWORD
> //xp0/C\$ /tmp/auto6t8L4W
> May 13 14:43:28 gw automount[15573]: mount(generic): mounted //xp0/C\$
> type cifs on /tmp/auto6t8L4W
> May 13 14:43:28 gw automount[15573]: move_mount: moved mount tree from
> /tmp/auto6t8L4W to /smb/xp0/C$
> May 13 14:43:28 gw automount[15573]: send_ready: token = 58
> May 13 14:43:28 gw automount[15573]: mounted /smb/xp0/C$
> 
> The output of a mount command is:
> //xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)
> 
> The incorrect target of //xp0/C/$ does not appear to be reflected in the
> debug output
> 
> The correct output of the mount command should be:
> //xp0/C$ on /smb/xp0/C$ type cifs (rw,mand)

Clearly it isn't an autofs problem.
It's a mount.cifs (or mount(8)) problem.

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  5:05         ` Ian Kent
@ 2009-05-13  5:30           ` Ian Kent
  2009-05-13 11:54             ` Jeff Layton
       [not found]           ` <4A0A59F5.1090308@edcint.co.nz>
  1 sibling, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-13  5:30 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs, Jeff Layton

Ian Kent wrote:
>> May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic):
>> calling mount -t cifs -s -o username=USERNAME,password=PASSWORD
>> //xp0/C\$ /tmp/auto6t8L4W

Ohh, I get it, the "\" is a path separator for mount.cifs and I think
the handling of it may have changed recently ish.

So catch 22, autofs must escaped the "$" to prevent it being interpreted
as a macro and the generic mount module has no special knowledge of cifs
so it can't do anything about it. Worse, since "\" is a valid path
separator for UNC paths we can't just check the fs type and translate
them all. For example, what if we get :\\\\<server>\\service as the
location?

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
       [not found]           ` <4A0A59F5.1090308@edcint.co.nz>
@ 2009-05-13  5:32             ` Ian Kent
  2009-05-13  5:47               ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-13  5:32 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> The output of a mount command is:
>>> //xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)
>>>
>>> The incorrect target of //xp0/C/$ does not appear to be reflected in the
>>> debug output
>>>
>>> The correct output of the mount command should be:
>>> //xp0/C$ on /smb/xp0/C$ type cifs (rw,mand)
>>>     
>>
>> Clearly it isn't an autofs problem.
>> It's a mount.cifs (or mount(8)) problem.
>>
>> Ian
>>   
> I'm not quite sure how it is a mount.cifs problem since I can manually
> mount the share.
> If I can manually mount it since I pass a correct mount target, couldn't
> autofs do the same?
> Am I missing something?

Yes, when you mount it manually you don't escape the "$".

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  5:32             ` Ian Kent
@ 2009-05-13  5:47               ` Matthew Jurgens
  2009-05-13  5:58                 ` Matthew Jurgens
  2009-05-13  8:03                 ` Ian Kent
  0 siblings, 2 replies; 30+ messages in thread
From: Matthew Jurgens @ 2009-05-13  5:47 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


> Yes, when you mount it manually you don't escape the "$"
If I manually mount it using:
mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C$ /mnt/C$
it works. If I also escape the $ then it also works
mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C\$ /mnt/C\$

Was that what you were talking about?

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  5:47               ` Matthew Jurgens
@ 2009-05-13  5:58                 ` Matthew Jurgens
  2009-05-13  8:09                   ` Ian Kent
  2009-05-13  8:03                 ` Ian Kent
  1 sibling, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-05-13  5:58 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

Yes, when you mount it manually you don't escape the "$"

> If I manually mount it using:
> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C$ /mnt/C$
> it works. If I also escape the $ then it also works
> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C\$ /mnt/C\$
>
> Was that what you were talking about?
>
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs
>   
When I was on Fedora 8 and autofs-5.0.2-16 
<http://koji.fedoraproject.org/koji/buildinfo?buildID=46891> 
<http://koji.fedoraproject.org/koji/buildinfo?buildID=46891> it worked
Then when I upgraded only autofs to 5.0.3 it was broken
Doesn't that suggest that it is something in the autofs code that can 
therefore be potentially fixed?

[-- Attachment #1.2: Type: text/html, Size: 1353 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  5:47               ` Matthew Jurgens
  2009-05-13  5:58                 ` Matthew Jurgens
@ 2009-05-13  8:03                 ` Ian Kent
  2009-05-13 23:55                   ` Matthew Jurgens
  1 sibling, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-13  8:03 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
>> Yes, when you mount it manually you don't escape the "$"
> If I manually mount it using:
> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C$ /mnt/C$
> it works. If I also escape the $ then it also works
> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C\$ /mnt/C\$
> 
> Was that what you were talking about?

So maybe I'm wrong and were back to were we started.
Unless the shell translates the escape!

I bet that:
mount -t cifs -o username=mjurgens,password=parallel12 \
	'//xp0/C\$' /mnt/C\$
fails.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  5:58                 ` Matthew Jurgens
@ 2009-05-13  8:09                   ` Ian Kent
  2009-05-13  8:16                     ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-13  8:09 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> Yes, when you mount it manually you don't escape the "$"
> 
>> If I manually mount it using:
>> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C$ /mnt/C$
>> it works. If I also escape the $ then it also works
>> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C\$ /mnt/C\$
>>
>> Was that what you were talking about?
>>
>> _______________________________________________
>> autofs mailing list
>> autofs@linux.kernel.org
>> http://linux.kernel.org/mailman/listinfo/autofs
>>   
> When I was on Fedora 8 and autofs-5.0.2-16
> <http://koji.fedoraproject.org/koji/buildinfo?buildID=46891>
> <http://koji.fedoraproject.org/koji/buildinfo?buildID=46891> it worked
> Then when I upgraded only autofs to 5.0.3 it was broken
> Doesn't that suggest that it is something in the autofs code that can
> therefore be potentially fixed?
> 

Maybe.

There is always the possibility of working around things like this.
But it may not be a simple matter to change this as lot of change has
taken place.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  8:09                   ` Ian Kent
@ 2009-05-13  8:16                     ` Ian Kent
  0 siblings, 0 replies; 30+ messages in thread
From: Ian Kent @ 2009-05-13  8:16 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Ian Kent wrote:
> Matthew Jurgens wrote:
>> Yes, when you mount it manually you don't escape the "$"
>>
>>> If I manually mount it using:
>>> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C$ /mnt/C$
>>> it works. If I also escape the $ then it also works
>>> mount -t cifs -o username=mjurgens,password=parallel12 //xp0/C\$ /mnt/C\$
>>>
>>> Was that what you were talking about?
>>>
>>> _______________________________________________
>>> autofs mailing list
>>> autofs@linux.kernel.org
>>> http://linux.kernel.org/mailman/listinfo/autofs
>>>   
>> When I was on Fedora 8 and autofs-5.0.2-16
>> <http://koji.fedoraproject.org/koji/buildinfo?buildID=46891>
>> <http://koji.fedoraproject.org/koji/buildinfo?buildID=46891> it worked
>> Then when I upgraded only autofs to 5.0.3 it was broken
>> Doesn't that suggest that it is something in the autofs code that can
>> therefore be potentially fixed?
>>
> 
> Maybe.
> 
> There is always the possibility of working around things like this.
> But it may not be a simple matter to change this as lot of change has
> taken place.

Maybe we should try a couple of things and see what we get. I don't have
a Windows environment I can use here so you will have to help.

I'm wondering why I need to double escape the $ after looking at your
debug log.

How about commenting out the line "gsub(/\$$/, "\\$", loc);" in
/etc/auto.smb and see what happens.

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  5:30           ` Ian Kent
@ 2009-05-13 11:54             ` Jeff Layton
  2009-05-13 14:08               ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Jeff Layton @ 2009-05-13 11:54 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs

On Wed, 13 May 2009 13:30:50 +0800
Ian Kent <raven@themaw.net> wrote:

> Ian Kent wrote:
> >> May 13 14:43:28 gw automount[15573]: mount_mount: mount(generic):
> >> calling mount -t cifs -s -o username=USERNAME,password=PASSWORD
> >> //xp0/C\$ /tmp/auto6t8L4W
> 
> Ohh, I get it, the "\" is a path separator for mount.cifs and I think
> the handling of it may have changed recently ish.

Around a year ago, yes.

> 
> So catch 22, autofs must escaped the "$" to prevent it being interpreted
> as a macro and the generic mount module has no special knowledge of cifs
> so it can't do anything about it. Worse, since "\" is a valid path
> separator for UNC paths we can't just check the fs type and translate
> them all. For example, what if we get :\\\\<server>\\service as the
> location?
> 

Right -- and it's even worse than that. '\' is a valid character in
posix path components. It's perfectly legitimate (though insane) to
have a file named:

/home/jlayton/crazy\file

'crazy\file' is a valid file/dir name.

I did a small writeup on this for the mount.cifs(8) manpage -- see the
section called 'SERVICE FORMATTING AND DELIMITERS'.

I think the only real way to solve this is to make sure that autofs
doesn't try to escape these characters before it calls mount. I don't
think mount does any variable interpolation, and I know mount.cifs
doesn't so there shouldn't be any need for escape chars before '$'
signs, assuming you're not handing these off to a shell of some sort.

-- 
Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13 11:54             ` Jeff Layton
@ 2009-05-13 14:08               ` Ian Kent
  0 siblings, 0 replies; 30+ messages in thread
From: Ian Kent @ 2009-05-13 14:08 UTC (permalink / raw)
  To: Jeff Layton; +Cc: autofs

Jeff Layton wrote:
> 
> I think the only real way to solve this is to make sure that autofs
> doesn't try to escape these characters before it calls mount. I don't
> think mount does any variable interpolation, and I know mount.cifs
> doesn't so there shouldn't be any need for escape chars before '$'
> signs, assuming you're not handing these off to a shell of some sort.
> 

Yes, I'm thinking I shouldn't be double escaping the $ as using quotes
around these should prevent the $ being interpreted as a macro introducer.

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13  8:03                 ` Ian Kent
@ 2009-05-13 23:55                   ` Matthew Jurgens
  2009-05-14  2:23                     ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-05-13 23:55 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


> I bet that:
> mount -t cifs -o username=USER,password=PASS \
> 	'//xp0/C\$' /mnt/C\$
> fails.
>
>   
Good bet.
It certainly does fail. The output of mount for that is now:

//xp0/C/$ on /mnt/C$ type cifs (rw,mand)

Reading ahead in the thread Jeff says "'\' is a valid character in posix 
path components" which does explain this behaviour

Do you really need the \ in front of the $ when it is already quoted?

Reading ahead again I comment out the gsub in /etc/auto.smb which 
changes the output from
-fstype=cifs,username=USER,password=PASS \
         /C "://xp0/C" \
         /ADMIN\$ "://xp0/ADMIN\$" \
         /C\$ "://xp0/C\$"

to

-fstype=cifs,username=USER,password=PASS \
         /C "://xp0/C" \
         /ADMIN$ "://xp0/ADMIN$" \
         /C$ "://xp0/C$"

So the
/C$ "://xp0/C$"
does look at little friendlier but does not actually work (does some 
autofs code need to change as well?).

When I
cd /smb/xp0/C$
I get
cd: no such file or directory: /smb/xp0/C$

I get the same result even trying to
cd /smb/xp0

The debug output from this is:

May 14 09:49:52 gw automount[9171]: handle_packet: type = 3
May 14 09:49:52 gw automount[9171]: handle_packet_missing_indirect: 
token 71, name xp0, request pid 15215
May 14 09:49:52 gw automount[9171]: attempting to mount entry /smb/xp0
May 14 09:49:52 gw automount[9171]: lookup_mount: lookup(program): 
looking up xp0
May 14 09:49:52 gw automount[9171]: lookup_mount: lookup(program): xp0 
-> -fstype=cifs,username=USER,password=PASS  #011 /C "://xp0/C"  #011 
/ADMIN$ "://xp0/ADMIN$"  #011 /C$ "://xp0/C$"
May 14 09:49:52 gw automount[9171]: parse_mount: parse(sun): expanded 
entry: -fstype=cifs,username=USER,password=PASS  #011 /C "://xp0/C"  
#011 /ADMIN "://xp0/ADMIN$"  #011 /C "://xp0/C$"
May 14 09:49:52 gw automount[9171]: parse_mount: parse(sun): gathered 
options: fstype=cifs,username=USER,password=PASS
May 14 09:49:52 gw automount[9171]: parse_mount: parse(sun): 
dequote("/C") -> /C
May 14 09:49:52 gw automount[9171]: parse_mapent: parse(sun): gathered 
options: fstype=cifs,username=USER,password=PASS
May 14 09:49:52 gw automount[9171]: parse_mapent: parse(sun): 
dequote(""://xp0/C"") -> ://xp0/C
May 14 09:49:52 gw automount[9171]: add_offset_entry: parse(sun): added 
multi-mount offset /C -> -fstype=cifs,username=USER,password=PASS ://xp0/C
May 14 09:49:52 gw automount[9171]: parse_mount: parse(sun): 
dequote("/ADMIN") -> /ADMIN
May 14 09:49:52 gw automount[9171]: parse_mapent: parse(sun): gathered 
options: fstype=cifs,username=USER,password=PASS
May 14 09:49:52 gw automount[9171]: parse_mapent: parse(sun): 
dequote(""://xp0/ADMIN$"") -> ://xp0/ADMIN$
May 14 09:49:52 gw automount[9171]: add_offset_entry: parse(sun): added 
multi-mount offset /ADMIN -> -fstype=cifs,username=USER,password=PASS 
://xp0/ADMIN$
May 14 09:49:52 gw automount[9171]: parse_mount: parse(sun): 
dequote("/C") -> /C
May 14 09:49:52 gw automount[9171]: parse_mapent: parse(sun): gathered 
options: fstype=cifs,username=USER,password=PASS
May 14 09:49:52 gw automount[9171]: parse_mapent: parse(sun): 
dequote(""://xp0/C$"") -> ://xp0/C$
May 14 09:49:52 gw automount[9171]: parse(sun): syntax error or 
duplicate offset /C -> ://xp0/C$
May 14 09:49:52 gw automount[9171]: parse(sun): error adding multi-mount
May 14 09:49:52 gw automount[9171]: cache_delete_offset_list: deleting 
offset key /smb/xp0/ADMIN
May 14 09:49:52 gw automount[9171]: cache_delete_offset_list: deleting 
offset key /smb/xp0/C
May 14 09:49:52 gw automount[9171]: send_fail: token = 71
May 14 09:49:52 gw automount[9171]: failed to mount /smb/xp0
May 14 09:49:52 gw automount[9171]: handle_packet: type = 3
May 14 09:49:52 gw automount[9171]: handle_packet_missing_indirect: 
token 72, name xp0, request pid 15215
May 14 09:49:52 gw automount[9171]: attempting to mount entry /smb/xp0
May 14 09:49:52 gw automount[9171]: lookup_nss_mount: key "xp0" not 
found in map.
May 14 09:49:52 gw automount[9171]: send_fail: token = 72
May 14 09:49:52 gw automount[9171]: failed to mount /smb/xp0

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-13 23:55                   ` Matthew Jurgens
@ 2009-05-14  2:23                     ` Ian Kent
       [not found]                       ` <4A0CC262.7020105@edcint.co.nz>
  2009-06-09  9:35                       ` Matthew Jurgens
  0 siblings, 2 replies; 30+ messages in thread
From: Ian Kent @ 2009-05-14  2:23 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

Matthew Jurgens wrote:
> 
>> I bet that:
>> mount -t cifs -o username=USER,password=PASS \
>>     '//xp0/C\$' /mnt/C\$
>> fails.
>>
>>   
> Good bet.
> It certainly does fail. The output of mount for that is now:
> 
> //xp0/C/$ on /mnt/C$ type cifs (rw,mand)
> 
> Reading ahead in the thread Jeff says "'\' is a valid character in posix
> path components" which does explain this behaviour
> 
> Do you really need the \ in front of the $ when it is already quoted?
> 
> Reading ahead again I comment out the gsub in /etc/auto.smb which
> changes the output from
> -fstype=cifs,username=USER,password=PASS \
>         /C "://xp0/C" \
>         /ADMIN\$ "://xp0/ADMIN\$" \
>         /C\$ "://xp0/C\$"
> 
> to
> 
> -fstype=cifs,username=USER,password=PASS \
>         /C "://xp0/C" \
>         /ADMIN$ "://xp0/ADMIN$" \
>         /C$ "://xp0/C$"

Of course, it then doesn't escape $ in the offsets.
But, it looks like your script isn't up to date.
I'm fairly sure the current script should output:
 -fstype=cifs,username=USER,password=PASS \
         "/C" "://xp0/C" \
         "/ADMIN$" "://xp0/ADMIN$" \
         "/C$" "://xp0/C$"

which is why I thought we shouldn't need the "\" escapes.
Can you check your auto.smb against the one attached please, in
particular the last line at the bottom of the "/Disk/" block should be:

print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""

Ian


[-- Attachment #2: auto.smb --]
[-- Type: text/plain, Size: 715 bytes --]

#!/bin/bash

# $Id: auto.smb,v 1.3 2005/04/05 13:02:09 raven Exp $

# This file must be executable to work! chmod 755!

key="$1"
opts="-fstype=cifs"

for P in /bin /sbin /usr/bin /usr/sbin
do
	if [ -x $P/smbclient ]
	then
		SMBCLIENT=$P/smbclient
		break
	fi
done

[ -x $SMBCLIENT ] || exit 1

$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
	BEGIN	{ ORS=""; first=1 }
	/Disk/	{
		  if (first)
			print opts; first=0
		  dir = $2
		  loc = $2
		  # Enclose mount dir and location in quotes
		  # Double quote "$" in location as it is special
		  gsub(/\$$/, "\\$", loc);
		  print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
		}
	END 	{ if (!first) print "\n"; else exit 1 }
	'


[-- Attachment #3: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
       [not found]                       ` <4A0CC262.7020105@edcint.co.nz>
@ 2009-05-15  7:13                         ` Ian Kent
  2009-05-17  7:48                           ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-15  7:13 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
>> Of course, it then doesn't escape $ in the offsets.
>> But, it looks like your script isn't up to date.
>> I'm fairly sure the current script should output:
>>  -fstype=cifs,username=USER,password=PASS \
>>          "/C" "://xp0/C" \
>>          "/ADMIN$" "://xp0/ADMIN$" \
>>          "/C$" "://xp0/C$"
>>
>> which is why I thought we shouldn't need the "\" escapes.
>> Can you check your auto.smb against the one attached please, in
>> particular the last line at the bottom of the "/Disk/" block should be:
>>
>> print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
>>
>> Ian
>>   
> Script updated and gsub commented out (like a message earlier in the
> thread):
> -fstype=cifs,username=USER,password=PASS \
>         "/C" "://xp0/C" \
>         "/ADMIN$" "://xp0/ADMIN$" \
>         "/C$" "://xp0/C$"
> 
> cd /smb/xp0/C$  gives
> cd: no such file or directory: /smb/xp0/C$
> 
> something is really busted now since I can't even cd /smb/xp0/C either.
> I don't understand why the debug log contains what looks like parts of
> the script as the output since running the script manually seems to have
> perfectly clean output

Because the script file is not executable now it is treating it as a
file map not a program map.

> 
> debug output is:
> May 15 11:09:01 gw automount[20964]: st_expire: state 1 path /smb
> May 15 11:09:01 gw automount[20964]: expire_proc: exp_proc = 3082091408
> path /smb
> May 15 11:09:01 gw automount[20964]: expire_cleanup: got thid 3082091408
> path /smb stat 0
> May 15 11:09:01 gw automount[20964]: expire_cleanup: sigchld: exp
> 3082091408 finished, switching from 2 to 1
> May 15 11:09:01 gw automount[20964]: st_ready: st_ready(): state = 2
> path /smb
> May 15 11:09:01 gw automount[20964]: handle_packet: type = 3
> May 15 11:09:01 gw automount[20964]: handle_packet_missing_indirect:
> token 101, name xp0, request pid 17443
> May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
> May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
> up xp0
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup_nss_mount: key "xp0" not
> found in map.
> May 15 11:09:01 gw automount[20964]: send_fail: token = 101
> May 15 11:09:01 gw automount[20964]: failed to mount /smb/xp0
> May 15 11:09:01 gw automount[20964]: handle_packet: type = 3
> May 15 11:09:01 gw automount[20964]: handle_packet_missing_indirect:
> token 102, name xp0, request pid 17443
> May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
> May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
> up xp0
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup_nss_mount: key "xp0" not
> found in map.
> May 15 11:09:01 gw automount[20964]: send_fail: token = 102
> May 15 11:09:01 gw automount[20964]: failed to mount /smb/xp0
> May 15 11:09:01 gw automount[20964]: handle_packet: type = 3
> May 15 11:09:01 gw automount[20964]: handle_packet_missing_indirect:
> token 103, name xp0, request pid 17443
> May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
> May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
> up xp0
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup_nss_mount: key "xp0" not
> found in map.
> May 15 11:09:01 gw automount[20964]: send_fail: token = 103
> May 15 11:09:01 gw automount[20964]: failed to mount /smb/xp0
> May 15 11:09:01 gw automount[20964]: handle_packet: type = 3
> May 15 11:09:01 gw automount[20964]: handle_packet_missing_indirect:
> token 104, name xp0, request pid 17443
> May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
> May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
> up xp0
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "[ -x
> $P/smbclient ]..." for key "if"
> May 15 11:09:01 gw automount[20964]: lookup(file): bad map entry "-A
> $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v opts="$opts"
> -F'|' -- '..." for key "$SMBCLIENT"
> May 15 11:09:01 gw automount[20964]: lookup_nss_mount: key "xp0" not
> found in map.
> May 15 11:09:01 gw automount[20964]: send_fail: token = 104
> May 15 11:09:01 gw automount[20964]: failed to mount /smb/xp0
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-15  7:13                         ` Ian Kent
@ 2009-05-17  7:48                           ` Matthew Jurgens
  2009-05-18  1:39                             ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-05-17  7:48 UTC (permalink / raw)
  To: Ian Kent, autofs


[-- Attachment #1.1: Type: text/plain, Size: 854 bytes --]

>
>> Script updated and gsub commented out (like a message earlier in the
>> thread):
>> -fstype=cifs,username=USER,password=PASS \
>>         "/C" "://xp0/C" \
>>         "/ADMIN$" "://xp0/ADMIN$" \
>>         "/C$" "://xp0/C$"
>>
>> cd /smb/xp0/C$  gives
>> cd: no such file or directory: /smb/xp0/C$
>>
>> something is really busted now since I can't even cd /smb/xp0/C either.
>> I don't understand why the debug log contains what looks like parts of
>> the script as the output since running the script manually seems to have
>> perfectly clean output
>>     
>
> Because the script file is not executable now it is treating it as a
> file map not a program map.

Not sure how you come to that conclusion since I ran it above to get the 
output and it is
-rwxr-xr-x



-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au

[-- Attachment #1.2: Type: text/html, Size: 1413 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-17  7:48                           ` Matthew Jurgens
@ 2009-05-18  1:39                             ` Ian Kent
  2009-06-02  5:45                               ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-05-18  1:39 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
>>
>>> Script updated and gsub commented out (like a message earlier in the
>>> thread):
>>> -fstype=cifs,username=USER,password=PASS \
>>>         "/C" "://xp0/C" \
>>>         "/ADMIN$" "://xp0/ADMIN$" \
>>>         "/C$" "://xp0/C$"
>>>
>>> cd /smb/xp0/C$  gives
>>> cd: no such file or directory: /smb/xp0/C$
>>>
>>> something is really busted now since I can't even cd /smb/xp0/C either.
>>> I don't understand why the debug log contains what looks like parts of
>>> the script as the output since running the script manually seems to have
>>> perfectly clean output
>>>     
>>
>> Because the script file is not executable now it is treating it as a
>> file map not a program map.
> 
> Not sure how you come to that conclusion since I ran it above to get the
> output and it is
> -rwxr-xr-x

Because of:
May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
up xp0

and since this is executed during the lookup:

static int lookup_name_file_source_instance(struct autofs_point
*ap, 				struct map_source *map, const char *name, int name_len)
        struct map_source *instance;
        char src_file[] = "file";
        char src_prog[] = "program";
        time_t age = time(NULL);
        struct stat st;
        char *type, *format;

        if (stat(map->argv[0], &st) == -1) {
                warn(ap->logopt, "file map not found");
                return NSS_STATUS_NOTFOUND;
        }

        if (!S_ISREG(st.st_mode))
                return NSS_STATUS_NOTFOUND;

        if (st.st_mode & __S_IEXEC)
                type = src_prog;
        else
                type = src_file;

        format = map->format;
....

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-18  1:39                             ` Ian Kent
@ 2009-06-02  5:45                               ` Matthew Jurgens
  2009-06-02 11:17                                 ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-06-02  5:45 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 2180 bytes --]


Ian Kent wrote:
> Matthew Jurgens wrote:
>   
>>>> Script updated and gsub commented out (like a message earlier in the
>>>> thread):
>>>> -fstype=cifs,username=USER,password=PASS \
>>>>         "/C" "://xp0/C" \
>>>>         "/ADMIN$" "://xp0/ADMIN$" \
>>>>         "/C$" "://xp0/C$"
>>>>
>>>> cd /smb/xp0/C$  gives
>>>> cd: no such file or directory: /smb/xp0/C$
>>>>
>>>> something is really busted now since I can't even cd /smb/xp0/C either.
>>>> I don't understand why the debug log contains what looks like parts of
>>>> the script as the output since running the script manually seems to have
>>>> perfectly clean output
>>>>     
>>>>         
>>> Because the script file is not executable now it is treating it as a
>>> file map not a program map.
>>>       
>> Not sure how you come to that conclusion since I ran it above to get the
>> output and it is
>> -rwxr-xr-x
>>     
>
> Because of:
> May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
> May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
> up xp0
>
> and since this is executed during the lookup:
>
> static int lookup_name_file_source_instance(struct autofs_point
> *ap, 				struct map_source *map, const char *name, int name_len)
>         struct map_source *instance;
>         char src_file[] = "file";
>         char src_prog[] = "program";
>         time_t age = time(NULL);
>         struct stat st;
>         char *type, *format;
>
>         if (stat(map->argv[0], &st) == -1) {
>                 warn(ap->logopt, "file map not found");
>                 return NSS_STATUS_NOTFOUND;
>         }
>
>         if (!S_ISREG(st.st_mode))
>                 return NSS_STATUS_NOTFOUND;
>
>         if (st.st_mode & __S_IEXEC)
>                 type = src_prog;
>         else
>                 type = src_file;
>
>         format = map->format;
> ....
>
>
>   
Sorry I must be missing something.
You say autofs is now treating the script as a file since it is not 
executable but it is executable.
I don't quite understand the "if (st.st_mode & __S_IEXEC)" part of the 
code above.

-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au


[-- Attachment #1.2: Type: text/html, Size: 2794 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-06-02  5:45                               ` Matthew Jurgens
@ 2009-06-02 11:17                                 ` Ian Kent
  2009-06-04  0:15                                   ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-06-02 11:17 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
> Ian Kent wrote:
>> Matthew Jurgens wrote:
>>  
>>>>> Script updated and gsub commented out (like a message earlier in the
>>>>> thread):
>>>>> -fstype=cifs,username=USER,password=PASS \
>>>>>         "/C" "://xp0/C" \
>>>>>         "/ADMIN$" "://xp0/ADMIN$" \
>>>>>         "/C$" "://xp0/C$"
>>>>>
>>>>> cd /smb/xp0/C$  gives
>>>>> cd: no such file or directory: /smb/xp0/C$
>>>>>
>>>>> something is really busted now since I can't even cd /smb/xp0/C
>>>>> either.
>>>>> I don't understand why the debug log contains what looks like parts of
>>>>> the script as the output since running the script manually seems to
>>>>> have
>>>>> perfectly clean output
>>>>>             
>>>> Because the script file is not executable now it is treating it as a
>>>> file map not a program map.
>>>>       
>>> Not sure how you come to that conclusion since I ran it above to get the
>>> output and it is
>>> -rwxr-xr-x
>>>     
>>
>> Because of:
>> May 15 11:09:01 gw automount[20964]: attempting to mount entry /smb/xp0
>> May 15 11:09:01 gw automount[20964]: lookup_mount: lookup(file): looking
>> up xp0
>>
>> and since this is executed during the lookup:
>>
>> static int lookup_name_file_source_instance(struct autofs_point
>> *ap,                 struct map_source *map, const char *name, int
>> name_len)
>>         struct map_source *instance;
>>         char src_file[] = "file";
>>         char src_prog[] = "program";
>>         time_t age = time(NULL);
>>         struct stat st;
>>         char *type, *format;
>>
>>         if (stat(map->argv[0], &st) == -1) {
>>                 warn(ap->logopt, "file map not found");
>>                 return NSS_STATUS_NOTFOUND;
>>         }
>>
>>         if (!S_ISREG(st.st_mode))
>>                 return NSS_STATUS_NOTFOUND;
>>
>>         if (st.st_mode & __S_IEXEC)
>>                 type = src_prog;
>>         else
>>                 type = src_file;
>>
>>         format = map->format;
>> ....
>>
>>
>>   
> Sorry I must be missing something.
> You say autofs is now treating the script as a file since it is not
> executable but it is executable.
> I don't quite understand the "if (st.st_mode & __S_IEXEC)" part of the
> code above.

All I'm saying is that, for whatever reason, autofs is treating your
program map as a file map. Why I don't know.

The check (st.st_mode & __S_IEXEC) checks if the mode returned by the
stat(2) of the path in ap->argv[0] is executable by the owner of the file.

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-06-02 11:17                                 ` Ian Kent
@ 2009-06-04  0:15                                   ` Matthew Jurgens
  2009-06-04  4:24                                     ` Ian Kent
  0 siblings, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-06-04  0:15 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 696 bytes --]


>> Sorry I must be missing something.
>> You say autofs is now treating the script as a file since it is not
>> executable but it is executable.
>> I don't quite understand the "if (st.st_mode & __S_IEXEC)" part of the
>> code above.
>>     
>
> All I'm saying is that, for whatever reason, autofs is treating your
> program map as a file map. Why I don't know.
>
> The check (st.st_mode & __S_IEXEC) checks if the mode returned by the
> stat(2) of the path in ap->argv[0] is executable by the owner of the file.
>
> Ian
>
>   
Can you please then just explain what

"if (st.st_mode & __S_IEXEC)" is testing for?


-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au

[-- Attachment #1.2: Type: text/html, Size: 1292 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-06-04  0:15                                   ` Matthew Jurgens
@ 2009-06-04  4:24                                     ` Ian Kent
       [not found]                                       ` <4A2DADEA.3010406@edcint.co.nz>
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-06-04  4:24 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
>>> Sorry I must be missing something.
>>> You say autofs is now treating the script as a file since it is not
>>> executable but it is executable.
>>> I don't quite understand the "if (st.st_mode & __S_IEXEC)" part of the
>>> code above.
>>>     
>>
>> All I'm saying is that, for whatever reason, autofs is treating your
>> program map as a file map. Why I don't know.
>>
>> The check (st.st_mode & __S_IEXEC) checks if the mode returned by the
>> stat(2) of the path in ap->argv[0] is executable by the owner of the
>> file.
>>
>> Ian
>>
>>   
> Can you please then just explain what
> 
> "if (st.st_mode & __S_IEXEC)" is testing for?

Ha, but I did!

It is checking if the map (path in ap->argv[0]) has the execute bit set
for the owner.

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
       [not found]                                       ` <4A2DADEA.3010406@edcint.co.nz>
@ 2009-06-09  3:05                                         ` Ian Kent
  2009-06-09  3:21                                         ` Ian Kent
  1 sibling, 0 replies; 30+ messages in thread
From: Ian Kent @ 2009-06-09  3:05 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
>>>> All I'm saying is that, for whatever reason, autofs is treating your
>>>> program map as a file map. Why I don't know.
>>>>
>>>>       
>> It is checking if the map (path in ap->argv[0]) has the execute bit set
>> for the owner.
>>
>> Ian
>>
>>   
> So my file looks like
> -rwxr-xr-x 1 root root   1193 2009-05-16 09:53 /opt/maj/auto.samba
> Which seems to meet all the criteria - owned by root, executable by root
> etc etc

Yes, it looks OK but I don't know of any problems with this, so I'm at a
loss as to what could be happening.

Does running this script using "/opt/maj/auto.samba <some server>" work?

> 
> This is only a side issue as to why we can not automount samba paths
> ending in $
> 

Sure, but we can't check changes to the script if we can't execute it.

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
       [not found]                                       ` <4A2DADEA.3010406@edcint.co.nz>
  2009-06-09  3:05                                         ` Ian Kent
@ 2009-06-09  3:21                                         ` Ian Kent
  2009-06-09  8:03                                           ` Matthew Jurgens
  1 sibling, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-06-09  3:21 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
>>>> All I'm saying is that, for whatever reason, autofs is treating your
>>>> program map as a file map. Why I don't know.
>>>>
>>>>       
>> It is checking if the map (path in ap->argv[0]) has the execute bit set
>> for the owner.
>>
>> Ian
>>
>>   
> So my file looks like
> -rwxr-xr-x 1 root root   1193 2009-05-16 09:53 /opt/maj/auto.samba
> Which seems to meet all the criteria - owned by root, executable by root
> etc etc

What does the master map entry for this look like?
If you have "file:" in front of the map path that will force autofs to
treat it as a file map.

Ian

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-06-09  3:21                                         ` Ian Kent
@ 2009-06-09  8:03                                           ` Matthew Jurgens
  0 siblings, 0 replies; 30+ messages in thread
From: Matthew Jurgens @ 2009-06-09  8:03 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 449 bytes --]


> What does the master map entry for this look like?
> If you have "file:" in front of the map path that will force autofs to
> treat it as a file map.
>
> Ian
>
>   
I found that the auto.master had a file: in front of the /smb entry - 
then I read this (would have saved me some time!)
Now lets stop this part of the thread and I will resume from an earlier 
point

-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au

[-- Attachment #1.2: Type: text/html, Size: 945 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-05-14  2:23                     ` Ian Kent
       [not found]                       ` <4A0CC262.7020105@edcint.co.nz>
@ 2009-06-09  9:35                       ` Matthew Jurgens
  2009-06-11  6:23                         ` Ian Kent
  1 sibling, 1 reply; 30+ messages in thread
From: Matthew Jurgens @ 2009-06-09  9:35 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 3525 bytes --]


>> Good bet.
>> It certainly does fail. The output of mount for that is now:
>>
>> //xp0/C/$ on /mnt/C$ type cifs (rw,mand)
>>
>> Reading ahead in the thread Jeff says "'\' is a valid character in posix
>> path components" which does explain this behaviour
>>
>> Do you really need the \ in front of the $ when it is already quoted?
>>
>> Reading ahead again I comment out the gsub in /etc/auto.smb which
>> changes the output from
>> -fstype=cifs,username=USER,password=PASS \
>>         /C "://xp0/C" \
>>         /ADMIN\$ "://xp0/ADMIN\$" \
>>         /C\$ "://xp0/C\$"
>>
>> to
>>
>> -fstype=cifs,username=USER,password=PASS \
>>         /C "://xp0/C" \
>>         /ADMIN$ "://xp0/ADMIN$" \
>>         /C$ "://xp0/C$"
>>     
>
> Of course, it then doesn't escape $ in the offsets.
> But, it looks like your script isn't up to date.
> I'm fairly sure the current script should output:
>  -fstype=cifs,username=USER,password=PASS \
>          "/C" "://xp0/C" \
>          "/ADMIN$" "://xp0/ADMIN$" \
>          "/C$" "://xp0/C$"
>
> which is why I thought we shouldn't need the "\" escapes.
> Can you check your auto.smb against the one attached please, in
> particular the last line at the bottom of the "/Disk/" block should be:
>
> print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
>
> Ian
>
>   
Ian you are brilliant. You know your product very well. Thank you very 
much for your help

I now submit my modified version of the auto.smb script. This auto.smb 
script optionally supports authentication of smb/cifs shares. Only 
tested under Fedora 10. Based on the original script as distributed, the 
work in this thread and my own script.

#!/bin/sh
# This file must be executable to work! chmod 755!
# autofs samba script by Matthew Jurgens June 2009
# based on the original script distributed with autofs
# optionally uses authentication for smb/cifs shares
# mounts shares ending in $ successfully (Thanks to Ian Kent)

# optional authentication information
# either set it here or pass it in via the environment
# SMB_USER=
# SMB_PASSWORD

key="$1" # key comes is as something like a hostname eg matthew

if [ "$SMB_USER" ]; then
   opts="-fstype=cifs,username=$SMB_USER,password=$SMB_PASSWORD"

   # setup up the authentication file for smbmount
   # Sept 2008
   # Going to Fedora 9 smbmount no longer worked properly with the 
username%password syntax
   # Had to implement the auth file using the -A parameter
   smbauthfile=/tmp/smbauth.tmp
   echo "username=$SMB_USER" > $smbauthfile
   echo "password=$SMB_PASSWORD" >> $smbauthfile

   # set up the optional parameter for smbmount for using authentication
   auth_part="-A $smbauthfile"

else
   # set up default options - no authentication
   opts="-fstype=cifs"
fi

for P in /bin /sbin /usr/bin /usr/sbin
do
    if [ -x $P/smbclient ]
    then
        SMBCLIENT=$P/smbclient
        break
    fi
done

[ -x $SMBCLIENT ] || exit 1

$SMBCLIENT $auth_part -gL $key 2>/dev/null| awk -v key="$key" -v 
opts="$opts" -F'|' -- '
    BEGIN    { ORS=""; first=1 }
    /Disk/    {
          if (first)
            print opts; first=0
          dir = $2
          loc = $2
          # Enclose mount dir and location in quotes
          # Double quote "$" in location as it is special
          # gsub(/\$$/, "\\$", loc);
          print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
        }
    END     { if (!first) print "\n"; else exit 1 }
    '
   
rm -f $smbauthfile


-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au

[-- Attachment #1.2: Type: text/html, Size: 4936 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-06-09  9:35                       ` Matthew Jurgens
@ 2009-06-11  6:23                         ` Ian Kent
  2009-06-11 12:13                           ` Matthew Jurgens
  0 siblings, 1 reply; 30+ messages in thread
From: Ian Kent @ 2009-06-11  6:23 UTC (permalink / raw)
  To: Matthew Jurgens; +Cc: autofs

Matthew Jurgens wrote:
> 
>>> Good bet.
>>> It certainly does fail. The output of mount for that is now:
>>>
>>> //xp0/C/$ on /mnt/C$ type cifs (rw,mand)
>>>
>>> Reading ahead in the thread Jeff says "'\' is a valid character in posix
>>> path components" which does explain this behaviour
>>>
>>> Do you really need the \ in front of the $ when it is already quoted?
>>>
>>> Reading ahead again I comment out the gsub in /etc/auto.smb which
>>> changes the output from
>>> -fstype=cifs,username=USER,password=PASS \
>>>         /C "://xp0/C" \
>>>         /ADMIN\$ "://xp0/ADMIN\$" \
>>>         /C\$ "://xp0/C\$"
>>>
>>> to
>>>
>>> -fstype=cifs,username=USER,password=PASS \
>>>         /C "://xp0/C" \
>>>         /ADMIN$ "://xp0/ADMIN$" \
>>>         /C$ "://xp0/C$"
>>>     
>>
>> Of course, it then doesn't escape $ in the offsets.
>> But, it looks like your script isn't up to date.
>> I'm fairly sure the current script should output:
>>  -fstype=cifs,username=USER,password=PASS \
>>          "/C" "://xp0/C" \
>>          "/ADMIN$" "://xp0/ADMIN$" \
>>          "/C$" "://xp0/C$"
>>
>> which is why I thought we shouldn't need the "\" escapes.
>> Can you check your auto.smb against the one attached please, in
>> particular the last line at the bottom of the "/Disk/" block should be:
>>
>> print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
>>
>> Ian
>>
>>   
> Ian you are brilliant. You know your product very well. Thank you very
> much for your help
> 
> I now submit my modified version of the auto.smb script. This auto.smb
> script optionally supports authentication of smb/cifs shares. Only
> tested under Fedora 10. Based on the original script as distributed, the
> work in this thread and my own script.

There are a couple of problems with this.

The first thing is that it isn't a patch, it's just a verbatim script.
While this isn't really an issue with this change this is the way it
needs to be done.

Patches should be used to request changes and should apply from the top
of the distribution tree when a "-p1" option is used with the patch
utility and the "-p" option should be used with the diff utility when
making them to give better context.

If you have a Fedora or rpm based distribution the gendiff utility, from
the rpm-build package is quite useful for this, although I seem to
remember needing to add the -p option for the diff to the script.

Also, patches should address one issue, where possible, and have an
accompanying description of what issue or enhancement the patch is
addressing and why you believe it works and any other pertinent information.

For some time now I've been trying to "always" include descriptions with
patches I add to autofs so I think anyone else requesting changes should
do the same.

In this example, I think, there are two distinct changes, the addition
of a couple of variables and the commenting out of the gsub() call.

But moving along ...

> 
> #!/bin/sh
> # This file must be executable to work! chmod 755!
> # autofs samba script by Matthew Jurgens June 2009
> # based on the original script distributed with autofs
> # optionally uses authentication for smb/cifs shares
> # mounts shares ending in $ successfully (Thanks to Ian Kent)
> 
> # optional authentication information
> # either set it here or pass it in via the environment
> # SMB_USER=
> # SMB_PASSWORD

I don't think that embedding password information in a distributed
example program map is the right thing to do. People need to work out
how they will access authentication information for themselves and
modify the example program map to suite.

Also, I don't understand how this can be set in the environment. If it
is set in the daemon environment, typically root, and used for every
mount then I don't think that is a good example of usage to distribute
either.

> 
> key="$1" # key comes is as something like a hostname eg matthew
> 
> if [ "$SMB_USER" ]; then
>   opts="-fstype=cifs,username=$SMB_USER,password=$SMB_PASSWORD"
> 
>   # setup up the authentication file for smbmount
>   # Sept 2008
>   # Going to Fedora 9 smbmount no longer worked properly with the
> username%password syntax
>   # Had to implement the auth file using the -A parameter
>   smbauthfile=/tmp/smbauth.tmp
>   echo "username=$SMB_USER" > $smbauthfile
>   echo "password=$SMB_PASSWORD" >> $smbauthfile
> 
>   # set up the optional parameter for smbmount for using authentication
>   auth_part="-A $smbauthfile"
> 
> else
>   # set up default options - no authentication
>   opts="-fstype=cifs"
> fi
> 
> for P in /bin /sbin /usr/bin /usr/sbin
> do
>    if [ -x $P/smbclient ]
>    then
>        SMBCLIENT=$P/smbclient
>        break
>    fi
> done
> 
> [ -x $SMBCLIENT ] || exit 1
> 
> $SMBCLIENT $auth_part -gL $key 2>/dev/null| awk -v key="$key" -v
> opts="$opts" -F'|' -- '
>    BEGIN    { ORS=""; first=1 }
>    /Disk/    {
>          if (first)
>            print opts; first=0
>          dir = $2
>          loc = $2
>          # Enclose mount dir and location in quotes
>          # Double quote "$" in location as it is special
>          # gsub(/\$$/, "\\$", loc);

OK, so this is probably the correction I need to apply, but a patch
would remove this line and add a brief description of the reasoning.

>          print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
>        }
>    END     { if (!first) print "\n"; else exit 1 }
>    '
>   rm -f $smbauthfile
> 
> 

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: unable to automount windows C$
  2009-06-11  6:23                         ` Ian Kent
@ 2009-06-11 12:13                           ` Matthew Jurgens
  0 siblings, 0 replies; 30+ messages in thread
From: Matthew Jurgens @ 2009-06-11 12:13 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs


[-- Attachment #1.1: Type: text/plain, Size: 1023 bytes --]


>> # optional authentication information
>> # either set it here or pass it in via the environment
>> # SMB_USER=
>> # SMB_PASSWORD
>>     
>
> I don't think that embedding password information in a distributed
> example program map is the right thing to do. People need to work out
> how they will access authentication information for themselves and
> modify the example program map to suite.
>
> Also, I don't understand how this can be set in the environment. If it
> is set in the daemon environment, typically root, and used for every
> mount then I don't think that is a good example of usage to distribute
> either.
>   
This is just how I do it and thought it might help others who are 
perhaps wondering how to do it
I did miss out one line - which is what you are puzzling over.
I include another script which contains SMB_USER and SMB_PASSWORD into 
the environment
I have the line
. /etc/my_user_info
in my version of the script
-- 
Smartmon System Monitoring <http://www.smartmon.com.au>
www.smartmon.com.au

[-- Attachment #1.2: Type: text/html, Size: 1582 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2009-06-11 12:13 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-10 19:49 unable to automount windows C$ Scott Belnap
2008-12-23  6:13 ` Ian Kent
2009-05-11  0:43   ` Matthew Jurgens
2009-05-12  4:45     ` Ian Kent
2009-05-13  4:57       ` Matthew Jurgens
2009-05-13  5:05         ` Ian Kent
2009-05-13  5:30           ` Ian Kent
2009-05-13 11:54             ` Jeff Layton
2009-05-13 14:08               ` Ian Kent
     [not found]           ` <4A0A59F5.1090308@edcint.co.nz>
2009-05-13  5:32             ` Ian Kent
2009-05-13  5:47               ` Matthew Jurgens
2009-05-13  5:58                 ` Matthew Jurgens
2009-05-13  8:09                   ` Ian Kent
2009-05-13  8:16                     ` Ian Kent
2009-05-13  8:03                 ` Ian Kent
2009-05-13 23:55                   ` Matthew Jurgens
2009-05-14  2:23                     ` Ian Kent
     [not found]                       ` <4A0CC262.7020105@edcint.co.nz>
2009-05-15  7:13                         ` Ian Kent
2009-05-17  7:48                           ` Matthew Jurgens
2009-05-18  1:39                             ` Ian Kent
2009-06-02  5:45                               ` Matthew Jurgens
2009-06-02 11:17                                 ` Ian Kent
2009-06-04  0:15                                   ` Matthew Jurgens
2009-06-04  4:24                                     ` Ian Kent
     [not found]                                       ` <4A2DADEA.3010406@edcint.co.nz>
2009-06-09  3:05                                         ` Ian Kent
2009-06-09  3:21                                         ` Ian Kent
2009-06-09  8:03                                           ` Matthew Jurgens
2009-06-09  9:35                       ` Matthew Jurgens
2009-06-11  6:23                         ` Ian Kent
2009-06-11 12:13                           ` Matthew Jurgens

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.