autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yury Krivopalov <ykrivopalov@yandex.ru>
To: autofs@vger.kernel.org
Subject: Automounting of smb shares with dollar sign
Date: Thu, 30 Jun 2016 13:21:04 +0300	[thread overview]
Message-ID: <974581467282064@web15m.yandex.ru> (raw)

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

Hello,
I found a problem, that started to reproduce on my new environment (archlinux), before that I used Debian Wheezy and everything worked fine.
The point is that I can't automount smb shares with dollar sign (Ex.: //hostname/C$).
 
It happend because two facts:
1. Autofs reads '$' as a special symbol
2. mount.cifs reads '\\' as a delimiter
 
So in my case if I returns "//hostname/C$" from auto.smb, then automount daemon replace '$' to '' and if I returns "//hostname/C\\$" then mount.cifs crops "\\$" and uses '$' as a prefixpath mount option.
 
I attached simple fix for autofs-5.1.2, that drops back slash after arguments parsing. It works in my case, 
 
-- 
Regards,
Yury Krivopalov

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: drop_back_slash_after_parsing.patch --]
[-- Type: text/x-diff; name="drop_back_slash_after_parsing.patch", Size: 299 bytes --]

--- modules/parse_sun.c.orig	2016-06-30 12:25:24.303171405 +0300
+++ modules/parse_sun.c	2016-06-30 12:27:17.269833151 +0300
@@ -177,13 +177,10 @@
 			}
 			break;
 
 		case '\\':
 			len++;
-			if (dst)
-				*dst++ = ch;
-
 			if (*src) {
 				len++;
 				if (dst)
 					*dst++ = *src;
 				src++;

             reply	other threads:[~2016-06-30 10:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 10:21 Yury Krivopalov [this message]
2016-07-01  3:15 ` Automounting of smb shares with dollar sign Ian Kent
2016-07-01  3:44   ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=974581467282064@web15m.yandex.ru \
    --to=ykrivopalov@yandex.ru \
    --cc=autofs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).