linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suresh Jayaraman <sjayaraman@suse.com>
To: bfields@fieldses.org, steved@redhat.com,
	Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Subject: idmapd doesn't map if the name (user or group) contains UTF8 characters
Date: Thu, 13 Dec 2012 15:59:34 +0530	[thread overview]
Message-ID: <50C9AE0E.9070404@suse.com> (raw)

Hi all,

While investigating a bug report from our customer where NFSv4 name to
id mapping fails on the NFSv4 client (and maps to 'nobody') if a user or
group name contains non-ASCII characters (in this case it was Umlaut
characters) figured out we limit the characters to ASCII.

We seem to do this intentionally in utils/idmapd/idmapd.c: imconv()

...
        case IDMAP_CONV_NAMETOID:
                if (validateascii(im->im_name, sizeof(im->im_name)) == -1) {
                        im->im_status |= IDMAP_STATUS_INVALIDMSG;
                        return;
                }
...

with the validateacsii() function. I'm not sure why we had to limit the
characters in the NFSv4 domain name to ASCII only. If I have to guess:

   - perhaps it is risky because the shell might expand some characters?
   - Non-ASCII characters might have trouble between sharing systems
     that may use different encodings
   - to remain consistent with the tools like `groupadd' which considers
     a name with these characters as Invalid names (not sure why
     `groupadd' does so)


However, there seems to be a valid use case for allowing such
characters. For e.g. If Active Directory or LDAP is being used for
authentication, both of them seem to allow Umlaut characters. When used
together with such directory services, idmapd would end up mapping those
users or groups to 'nobody'.

So my questions are:

1) What is the reason behind not allowing non-ASCII characters?
2) Is the limitation historical and is not relevant now? In such case
   can we remove this check?
3) Would it make sense to allow atleast some UTF-8 characters that may
   be non-risky?

Thanks

-- 
Suresh Jayaraman

             reply	other threads:[~2012-12-13 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13 10:29 Suresh Jayaraman [this message]
2012-12-13 14:34 ` idmapd doesn't map if the name (user or group) contains UTF8 characters J. Bruce Fields

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=50C9AE0E.9070404@suse.com \
    --to=sjayaraman@suse.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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 NNTP newsgroup(s).