Deleted Added
full compact
35c35
< __FBSDID("$FreeBSD: head/sys/fs/nfs/nfs_commonsubs.c 229802 2012-01-08 01:54:46Z rmacklem $");
---
> __FBSDID("$FreeBSD: head/sys/fs/nfs/nfs_commonsubs.c 240720 2012-09-20 02:49:25Z rmacklem $");
1404c1404
< if (nfsv4_strtouid(cp, j, &uid, p) ||
---
> if (nfsv4_strtouid(nd, cp, j, &uid, p) ||
1409c1409
< if (nfsv4_strtouid(cp, j, &uid, p))
---
> if (nfsv4_strtouid(nd, cp, j, &uid, p))
1437c1437
< if (nfsv4_strtogid(cp, j, &gid, p) ||
---
> if (nfsv4_strtogid(nd, cp, j, &gid, p) ||
1442c1442
< if (nfsv4_strtogid(cp, j, &gid, p))
---
> if (nfsv4_strtogid(nd, cp, j, &gid, p))
2596a2597,2599
> * If this is called from a client side mount using AUTH_SYS and the
> * string is made up entirely of digits, just convert the string to
> * a number.
2599c2602,2603
< nfsv4_strtouid(u_char *str, int len, uid_t *uidp, NFSPROC_T *p)
---
> nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp,
> NFSPROC_T *p)
2602c2606
< u_char *cp;
---
> char *cp, *endstr, *str0;
2605a2610
> uid_t tuid;
2610a2616,2623
> /* If a string of digits and an AUTH_SYS mount, just convert it. */
> str0 = str;
> tuid = (uid_t)strtoul(str0, &endstr, 10);
> if ((endstr - str0) == len &&
> (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) {
> *uidp = tuid;
> goto out;
> }
2614,2617c2627,2631
< cp = str;
< for (i = 0; i < len; i++)
< if (*cp++ == '@')
< break;
---
> cp = strchr(str0, '@');
> if (cp != NULL)
> i = (int)(cp++ - str0);
> else
> i = len;
2785a2800,2804
> * If no conversion is possible return NFSERR_BADOWNER, otherwise
> * return 0.
> * If this is called from a client side mount using AUTH_SYS and the
> * string is made up entirely of digits, just convert the string to
> * a number.
2788c2807,2808
< nfsv4_strtogid(u_char *str, int len, gid_t *gidp, NFSPROC_T *p)
---
> nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp,
> NFSPROC_T *p)
2791c2811
< u_char *cp;
---
> char *cp, *endstr, *str0;
2794a2815
> gid_t tgid;
2799a2821,2828
> /* If a string of digits and an AUTH_SYS mount, just convert it. */
> str0 = str;
> tgid = (gid_t)strtoul(str0, &endstr, 10);
> if ((endstr - str0) == len &&
> (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) {
> *gidp = tgid;
> goto out;
> }
2803,2806c2832,2836
< cp = str;
< for (i = 0; i < len; i++)
< if (*cp++ == '@')
< break;
---
> cp = strchr(str0, '@');
> if (cp != NULL)
> i = (int)(cp++ - str0);
> else
> i = len;