Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 684459 Details for
Bug 815908
NFSv4 server support for numeric IDs
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Backport of upstream commit "nfsd4: allow numeric idmapping"
idmap_server_numeric_id-rhel6.patch (text/plain), 2.55 KB, created by
IBM Bug Proxy
on 2013-01-21 16:48:03 UTC
(
hide
)
Description:
Backport of upstream commit "nfsd4: allow numeric idmapping"
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2013-01-21 16:48:03 UTC
Size:
2.55 KB
patch
obsolete
>--- a/fs/nfsd/nfs4idmap.c >+++ b/fs/nfsd/nfs4idmap.c >@@ -37,6 +37,16 @@ > #include <linux/seq_file.h> > #include <linux/sched.h> > >+ >+ >+/* >+ * Turn off idmapping when using AUTH_SYS. >+ */ >+static bool nfs4_disable_idmapping = true; >+module_param(nfs4_disable_idmapping, bool, 0644); >+MODULE_PARM_DESC(nfs4_disable_idmapping, >+ "Turn off server's NFSv4 idmapping when using 'sec=sys'"); >+ > /* > * Cache entry > */ >@@ -559,28 +569,65 @@ idmap_id_to_name(struct svc_rqst *rqstp, > return ret; > } > >+static bool >+numeric_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, uid_t *id) >+{ >+ int ret; >+ char buf[11]; >+ >+ if (namelen + 1 > sizeof(buf)) >+ /* too long to represent a 32-bit id: */ >+ return false; >+ /* Just to make sure it's null-terminated: */ >+ memcpy(buf, name, namelen); >+ buf[namelen] = '\0'; >+ ret = strict_strtoul(name, 10, (unsigned long *)id); >+ return ret == 0; >+} >+ >+static __be32 >+do_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen, uid_t *id) >+{ >+ if (nfs4_disable_idmapping && rqstp->rq_flavor < RPC_AUTH_GSS) >+ if (numeric_name_to_id(rqstp, type, name, namelen, id)) >+ return 0; >+ /* >+ * otherwise, fall through and try idmapping, for >+ * backwards compatibility with clients sending names: >+ */ >+ return idmap_name_to_id(rqstp, type, name, namelen, id); >+} >+ >+static int >+do_id_to_name(struct svc_rqst *rqstp, int type, uid_t id, char *name) >+{ >+ if (nfs4_disable_idmapping && rqstp->rq_flavor < RPC_AUTH_GSS) >+ return sprintf(name, "%u", id); >+ return idmap_id_to_name(rqstp, type, id, name); >+} >+ > int > nfsd_map_name_to_uid(struct svc_rqst *rqstp, const char *name, size_t namelen, > __u32 *id) > { >- return idmap_name_to_id(rqstp, IDMAP_TYPE_USER, name, namelen, id); >+ return do_name_to_id(rqstp, IDMAP_TYPE_USER, name, namelen, id); > } > > int > nfsd_map_name_to_gid(struct svc_rqst *rqstp, const char *name, size_t namelen, > __u32 *id) > { >- return idmap_name_to_id(rqstp, IDMAP_TYPE_GROUP, name, namelen, id); >+ return do_name_to_id(rqstp, IDMAP_TYPE_GROUP, name, namelen, id); > } > > int > nfsd_map_uid_to_name(struct svc_rqst *rqstp, __u32 id, char *name) > { >- return idmap_id_to_name(rqstp, IDMAP_TYPE_USER, id, name); >+ return do_id_to_name(rqstp, IDMAP_TYPE_USER, id, name); > } > > int > nfsd_map_gid_to_name(struct svc_rqst *rqstp, __u32 id, char *name) > { >- return idmap_id_to_name(rqstp, IDMAP_TYPE_GROUP, id, name); >+ return do_id_to_name(rqstp, IDMAP_TYPE_GROUP, id, name); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 815908
:
684458
| 684459