diff options
Diffstat (limited to 'net/9p')
-rw-r--r-- | net/9p/client.c | 10 | ||||
-rw-r--r-- | net/9p/conv.c | 32 |
2 files changed, 34 insertions, 8 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index e1610125a882..d83cc1247f1e 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -146,7 +146,7 @@ void p9_client_disconnect(struct p9_client *clnt) | |||
146 | EXPORT_SYMBOL(p9_client_disconnect); | 146 | EXPORT_SYMBOL(p9_client_disconnect); |
147 | 147 | ||
148 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 148 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
149 | char *uname, char *aname) | 149 | char *uname, u32 n_uname, char *aname) |
150 | { | 150 | { |
151 | int err; | 151 | int err; |
152 | struct p9_fcall *tc, *rc; | 152 | struct p9_fcall *tc, *rc; |
@@ -165,7 +165,8 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | |||
165 | goto error; | 165 | goto error; |
166 | } | 166 | } |
167 | 167 | ||
168 | tc = p9_create_tattach(fid->fid, afid?afid->fid:P9_NOFID, uname, aname); | 168 | tc = p9_create_tattach(fid->fid, afid?afid->fid:P9_NOFID, uname, aname, |
169 | n_uname, clnt->dotu); | ||
169 | if (IS_ERR(tc)) { | 170 | if (IS_ERR(tc)) { |
170 | err = PTR_ERR(tc); | 171 | err = PTR_ERR(tc); |
171 | tc = NULL; | 172 | tc = NULL; |
@@ -190,7 +191,8 @@ error: | |||
190 | } | 191 | } |
191 | EXPORT_SYMBOL(p9_client_attach); | 192 | EXPORT_SYMBOL(p9_client_attach); |
192 | 193 | ||
193 | struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, char *aname) | 194 | struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, |
195 | u32 n_uname, char *aname) | ||
194 | { | 196 | { |
195 | int err; | 197 | int err; |
196 | struct p9_fcall *tc, *rc; | 198 | struct p9_fcall *tc, *rc; |
@@ -209,7 +211,7 @@ struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, char *aname) | |||
209 | goto error; | 211 | goto error; |
210 | } | 212 | } |
211 | 213 | ||
212 | tc = p9_create_tauth(fid->fid, uname, aname); | 214 | tc = p9_create_tauth(fid->fid, uname, aname, n_uname, clnt->dotu); |
213 | if (IS_ERR(tc)) { | 215 | if (IS_ERR(tc)) { |
214 | err = PTR_ERR(tc); | 216 | err = PTR_ERR(tc); |
215 | tc = NULL; | 217 | tc = NULL; |
diff --git a/net/9p/conv.c b/net/9p/conv.c index d979d958ea19..aa2aa9884f95 100644 --- a/net/9p/conv.c +++ b/net/9p/conv.c | |||
@@ -547,7 +547,8 @@ error: | |||
547 | } | 547 | } |
548 | EXPORT_SYMBOL(p9_create_tversion); | 548 | EXPORT_SYMBOL(p9_create_tversion); |
549 | 549 | ||
550 | struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname) | 550 | struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname, |
551 | u32 n_uname, int dotu) | ||
551 | { | 552 | { |
552 | int size; | 553 | int size; |
553 | struct p9_fcall *fc; | 554 | struct p9_fcall *fc; |
@@ -555,7 +556,16 @@ struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname) | |||
555 | struct cbuf *bufp = &buffer; | 556 | struct cbuf *bufp = &buffer; |
556 | 557 | ||
557 | /* afid[4] uname[s] aname[s] */ | 558 | /* afid[4] uname[s] aname[s] */ |
558 | size = 4 + 2 + strlen(uname) + 2 + strlen(aname); | 559 | size = 4 + 2 + 2; |
560 | if (uname) | ||
561 | size += strlen(uname); | ||
562 | |||
563 | if (aname) | ||
564 | size += strlen(aname); | ||
565 | |||
566 | if (dotu) | ||
567 | size += 4; /* n_uname */ | ||
568 | |||
559 | fc = p9_create_common(bufp, size, P9_TAUTH); | 569 | fc = p9_create_common(bufp, size, P9_TAUTH); |
560 | if (IS_ERR(fc)) | 570 | if (IS_ERR(fc)) |
561 | goto error; | 571 | goto error; |
@@ -563,6 +573,8 @@ struct p9_fcall *p9_create_tauth(u32 afid, char *uname, char *aname) | |||
563 | p9_put_int32(bufp, afid, &fc->params.tauth.afid); | 573 | p9_put_int32(bufp, afid, &fc->params.tauth.afid); |
564 | p9_put_str(bufp, uname, &fc->params.tauth.uname); | 574 | p9_put_str(bufp, uname, &fc->params.tauth.uname); |
565 | p9_put_str(bufp, aname, &fc->params.tauth.aname); | 575 | p9_put_str(bufp, aname, &fc->params.tauth.aname); |
576 | if (dotu) | ||
577 | p9_put_int32(bufp, n_uname, &fc->params.tauth.n_uname); | ||
566 | 578 | ||
567 | if (buf_check_overflow(bufp)) { | 579 | if (buf_check_overflow(bufp)) { |
568 | kfree(fc); | 580 | kfree(fc); |
@@ -574,7 +586,8 @@ error: | |||
574 | EXPORT_SYMBOL(p9_create_tauth); | 586 | EXPORT_SYMBOL(p9_create_tauth); |
575 | 587 | ||
576 | struct p9_fcall * | 588 | struct p9_fcall * |
577 | p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname) | 589 | p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname, |
590 | u32 n_uname, int dotu) | ||
578 | { | 591 | { |
579 | int size; | 592 | int size; |
580 | struct p9_fcall *fc; | 593 | struct p9_fcall *fc; |
@@ -582,7 +595,16 @@ p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname) | |||
582 | struct cbuf *bufp = &buffer; | 595 | struct cbuf *bufp = &buffer; |
583 | 596 | ||
584 | /* fid[4] afid[4] uname[s] aname[s] */ | 597 | /* fid[4] afid[4] uname[s] aname[s] */ |
585 | size = 4 + 4 + 2 + strlen(uname) + 2 + strlen(aname); | 598 | size = 4 + 4 + 2 + 2; |
599 | if (uname) | ||
600 | size += strlen(uname); | ||
601 | |||
602 | if (aname) | ||
603 | size += strlen(aname); | ||
604 | |||
605 | if (dotu) | ||
606 | size += 4; /* n_uname */ | ||
607 | |||
586 | fc = p9_create_common(bufp, size, P9_TATTACH); | 608 | fc = p9_create_common(bufp, size, P9_TATTACH); |
587 | if (IS_ERR(fc)) | 609 | if (IS_ERR(fc)) |
588 | goto error; | 610 | goto error; |
@@ -591,6 +613,8 @@ p9_create_tattach(u32 fid, u32 afid, char *uname, char *aname) | |||
591 | p9_put_int32(bufp, afid, &fc->params.tattach.afid); | 613 | p9_put_int32(bufp, afid, &fc->params.tattach.afid); |
592 | p9_put_str(bufp, uname, &fc->params.tattach.uname); | 614 | p9_put_str(bufp, uname, &fc->params.tattach.uname); |
593 | p9_put_str(bufp, aname, &fc->params.tattach.aname); | 615 | p9_put_str(bufp, aname, &fc->params.tattach.aname); |
616 | if (dotu) | ||
617 | p9_put_int32(bufp, n_uname, &fc->params.tattach.n_uname); | ||
594 | 618 | ||
595 | error: | 619 | error: |
596 | return fc; | 620 | return fc; |