diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2013-01-29 19:09:41 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2013-02-12 06:19:30 -0500 |
commit | f791f7c5e354870eaa5e31c4038c6723683283f1 (patch) | |
tree | c87d24cc220734f65ef7f54e0ed404f74dcfeea1 /net | |
parent | 97fc8b1ebf6a0fe4bb9c71a8e91a822c22c09bc5 (diff) |
9p: Transmit kuid and kgid values
Modify the p9_client_rpc format specifiers of every function that
directly transmits a uid or a gid from 'd' to 'u' or 'g' as
appropriate.
Modify those same functions to take kuid_t and kgid_t parameters
instead of uid_t and gid_t parameters.
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/9p/client.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 34d417670935..17855f080acd 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1100,7 +1100,7 @@ void p9_client_begin_disconnect(struct p9_client *clnt) | |||
1100 | EXPORT_SYMBOL(p9_client_begin_disconnect); | 1100 | EXPORT_SYMBOL(p9_client_begin_disconnect); |
1101 | 1101 | ||
1102 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 1102 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
1103 | char *uname, u32 n_uname, char *aname) | 1103 | char *uname, kuid_t n_uname, char *aname) |
1104 | { | 1104 | { |
1105 | int err = 0; | 1105 | int err = 0; |
1106 | struct p9_req_t *req; | 1106 | struct p9_req_t *req; |
@@ -1117,7 +1117,7 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | |||
1117 | goto error; | 1117 | goto error; |
1118 | } | 1118 | } |
1119 | 1119 | ||
1120 | req = p9_client_rpc(clnt, P9_TATTACH, "ddss?d", fid->fid, | 1120 | req = p9_client_rpc(clnt, P9_TATTACH, "ddss?u", fid->fid, |
1121 | afid ? afid->fid : P9_NOFID, uname, aname, n_uname); | 1121 | afid ? afid->fid : P9_NOFID, uname, aname, n_uname); |
1122 | if (IS_ERR(req)) { | 1122 | if (IS_ERR(req)) { |
1123 | err = PTR_ERR(req); | 1123 | err = PTR_ERR(req); |
@@ -1270,7 +1270,7 @@ error: | |||
1270 | EXPORT_SYMBOL(p9_client_open); | 1270 | EXPORT_SYMBOL(p9_client_open); |
1271 | 1271 | ||
1272 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | 1272 | int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, |
1273 | gid_t gid, struct p9_qid *qid) | 1273 | kgid_t gid, struct p9_qid *qid) |
1274 | { | 1274 | { |
1275 | int err = 0; | 1275 | int err = 0; |
1276 | struct p9_client *clnt; | 1276 | struct p9_client *clnt; |
@@ -1279,13 +1279,14 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, | |||
1279 | 1279 | ||
1280 | p9_debug(P9_DEBUG_9P, | 1280 | p9_debug(P9_DEBUG_9P, |
1281 | ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n", | 1281 | ">>> TLCREATE fid %d name %s flags %d mode %d gid %d\n", |
1282 | ofid->fid, name, flags, mode, gid); | 1282 | ofid->fid, name, flags, mode, |
1283 | from_kgid(&init_user_ns, gid)); | ||
1283 | clnt = ofid->clnt; | 1284 | clnt = ofid->clnt; |
1284 | 1285 | ||
1285 | if (ofid->mode != -1) | 1286 | if (ofid->mode != -1) |
1286 | return -EINVAL; | 1287 | return -EINVAL; |
1287 | 1288 | ||
1288 | req = p9_client_rpc(clnt, P9_TLCREATE, "dsddd", ofid->fid, name, flags, | 1289 | req = p9_client_rpc(clnt, P9_TLCREATE, "dsddg", ofid->fid, name, flags, |
1289 | mode, gid); | 1290 | mode, gid); |
1290 | if (IS_ERR(req)) { | 1291 | if (IS_ERR(req)) { |
1291 | err = PTR_ERR(req); | 1292 | err = PTR_ERR(req); |
@@ -1358,7 +1359,7 @@ error: | |||
1358 | } | 1359 | } |
1359 | EXPORT_SYMBOL(p9_client_fcreate); | 1360 | EXPORT_SYMBOL(p9_client_fcreate); |
1360 | 1361 | ||
1361 | int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid, | 1362 | int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, kgid_t gid, |
1362 | struct p9_qid *qid) | 1363 | struct p9_qid *qid) |
1363 | { | 1364 | { |
1364 | int err = 0; | 1365 | int err = 0; |
@@ -1369,7 +1370,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, gid_t gid, | |||
1369 | dfid->fid, name, symtgt); | 1370 | dfid->fid, name, symtgt); |
1370 | clnt = dfid->clnt; | 1371 | clnt = dfid->clnt; |
1371 | 1372 | ||
1372 | req = p9_client_rpc(clnt, P9_TSYMLINK, "dssd", dfid->fid, name, symtgt, | 1373 | req = p9_client_rpc(clnt, P9_TSYMLINK, "dssg", dfid->fid, name, symtgt, |
1373 | gid); | 1374 | gid); |
1374 | if (IS_ERR(req)) { | 1375 | if (IS_ERR(req)) { |
1375 | err = PTR_ERR(req); | 1376 | err = PTR_ERR(req); |
@@ -2106,7 +2107,7 @@ error: | |||
2106 | EXPORT_SYMBOL(p9_client_readdir); | 2107 | EXPORT_SYMBOL(p9_client_readdir); |
2107 | 2108 | ||
2108 | int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode, | 2109 | int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode, |
2109 | dev_t rdev, gid_t gid, struct p9_qid *qid) | 2110 | dev_t rdev, kgid_t gid, struct p9_qid *qid) |
2110 | { | 2111 | { |
2111 | int err; | 2112 | int err; |
2112 | struct p9_client *clnt; | 2113 | struct p9_client *clnt; |
@@ -2116,7 +2117,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode, | |||
2116 | clnt = fid->clnt; | 2117 | clnt = fid->clnt; |
2117 | p9_debug(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d " | 2118 | p9_debug(P9_DEBUG_9P, ">>> TMKNOD fid %d name %s mode %d major %d " |
2118 | "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev)); | 2119 | "minor %d\n", fid->fid, name, mode, MAJOR(rdev), MINOR(rdev)); |
2119 | req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddd", fid->fid, name, mode, | 2120 | req = p9_client_rpc(clnt, P9_TMKNOD, "dsdddg", fid->fid, name, mode, |
2120 | MAJOR(rdev), MINOR(rdev), gid); | 2121 | MAJOR(rdev), MINOR(rdev), gid); |
2121 | if (IS_ERR(req)) | 2122 | if (IS_ERR(req)) |
2122 | return PTR_ERR(req); | 2123 | return PTR_ERR(req); |
@@ -2137,7 +2138,7 @@ error: | |||
2137 | EXPORT_SYMBOL(p9_client_mknod_dotl); | 2138 | EXPORT_SYMBOL(p9_client_mknod_dotl); |
2138 | 2139 | ||
2139 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, | 2140 | int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, |
2140 | gid_t gid, struct p9_qid *qid) | 2141 | kgid_t gid, struct p9_qid *qid) |
2141 | { | 2142 | { |
2142 | int err; | 2143 | int err; |
2143 | struct p9_client *clnt; | 2144 | struct p9_client *clnt; |
@@ -2146,8 +2147,8 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, | |||
2146 | err = 0; | 2147 | err = 0; |
2147 | clnt = fid->clnt; | 2148 | clnt = fid->clnt; |
2148 | p9_debug(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n", | 2149 | p9_debug(P9_DEBUG_9P, ">>> TMKDIR fid %d name %s mode %d gid %d\n", |
2149 | fid->fid, name, mode, gid); | 2150 | fid->fid, name, mode, from_kgid(&init_user_ns, gid)); |
2150 | req = p9_client_rpc(clnt, P9_TMKDIR, "dsdd", fid->fid, name, mode, | 2151 | req = p9_client_rpc(clnt, P9_TMKDIR, "dsdg", fid->fid, name, mode, |
2151 | gid); | 2152 | gid); |
2152 | if (IS_ERR(req)) | 2153 | if (IS_ERR(req)) |
2153 | return PTR_ERR(req); | 2154 | return PTR_ERR(req); |