Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Oskar Liljeblad <oskar-Y7VfMkPRzygsCylrc8G9yg@public.gmane.org>
To: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] allow cifs passwords with utf8 characters
Date: Sun, 27 Mar 2011 09:54:38 +0200	[thread overview]
Message-ID: <20110327075438.GA7174@osk.mine.nu> (raw)
In-Reply-To: <20110327070144.GA3772-Y7VfMkPRzygsCylrc8G9yg@public.gmane.org>

On Sunday, March 27, 2011 at 09:44, Oskar Liljeblad wrote:
> I noticed that I could not mount cifs shares when the password contained
> utf8-encoded latin1 characters. (But somehow it worked when those latin1
> characters were encoded with ISO-8859-1.) So I made some modifications to
> assume utf8 passwords rather than raw 8-bit.
[..]
> +		len = utf8s_to_ucs2(passwd, 128, (wchar_t *) wpwd);

Looking at the code again, I wonder if not cifs_strtoUCS in cifs_unicode.c
should've been used instead?

  int
  cifs_strtoUCS(__le16 *to, const char *from, int len,
              const struct nls_table *codepage)

(I suspect people don't look so happily on exporting more symbols either
(utf8s_to_ucs2).)

The problem with cifs_strtoUCS is the codepage parameter though. Can one
assume that the "iocharset" codepage is used for the password as well?

Regards,

Oskar

  parent reply	other threads:[~2011-03-27  7:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-27  7:01 [PATCH] allow cifs passwords with utf8 characters Oskar Liljeblad
     [not found] ` <20110327070144.GA3772-Y7VfMkPRzygsCylrc8G9yg@public.gmane.org>
2011-03-27  7:54   ` Oskar Liljeblad [this message]
     [not found]     ` <20110327075438.GA7174-Y7VfMkPRzygsCylrc8G9yg@public.gmane.org>
2011-03-27  8:18       ` Oskar Liljeblad
     [not found]         ` <20110327081834.GA22851-Y7VfMkPRzygsCylrc8G9yg@public.gmane.org>
2011-03-27 10:54           ` Jeff Layton

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=20110327075438.GA7174@osk.mine.nu \
    --to=oskar-y7vfmkprzygscylrc8g9yg@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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