- /* XXX: should use same mapping as idmapd? Or something; for now
- * I'm just chopping off the domain. */
- /* XXX: note that idmapd also does this! It doesn't check the domain
- * name. */
- if ((c = strchr(sname, '@')) != NULL)
- *c = '\0';
- /* XXX? mapping unknown users (including machine creds) to nobody: */
- if ( !(pw = getpwnam(sname)) && !(pw = getpwnam("nobody")) )
+
+ res = -EINVAL;
+ if ((secname = mech2file(mech)) == NULL)
+ goto out_free;
+ nfs4_init_name_mapping(NULL); /* XXX: should only do this once */
+ res = nfs4_gss_princ_to_ids(secname, sname, &uid, &gid);
+ if (res < 0)