Date: Mon, 25 Jan 2010 18:35:58 +0000 (UTC) From: Pyun YongHyeon <yongari@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r202980 - head/contrib/smbfs/smbutil Message-ID: <201001251835.o0PIZwOS044479@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yongari Date: Mon Jan 25 18:35:58 2010 New Revision: 202980 URL: http://svn.freebsd.org/changeset/base/202980 Log: shi1_remark is in little endian format, convert it to host ordering. Also remove upper 16bits which always seem to be 0xFFFF. We don't allocate more than 64KB buffer anyway. This change make smbutil work on sparc64. Reviewed by: marius, bp Approved by: bp Modified: head/contrib/smbfs/smbutil/view.c Modified: head/contrib/smbfs/smbutil/view.c ============================================================================== --- head/contrib/smbfs/smbutil/view.c Mon Jan 25 18:15:10 2010 (r202979) +++ head/contrib/smbfs/smbutil/view.c Mon Jan 25 18:35:58 2010 (r202980) @@ -69,6 +69,7 @@ cmd_view(int argc, char *argv[]) struct smb_ctx sctx, *ctx = &sctx; struct smb_share_info_1 *rpbuf, *ep; char *cp; + u_int32_t remark; u_int16_t type; int error, opt, bufsize, i, entries, total; @@ -117,11 +118,13 @@ cmd_view(int argc, char *argv[]) } for (ep = rpbuf, i = 0; i < entries; i++, ep++) { type = le16toh(ep->shi1_type); + remark = le32toh(ep->shi1_remark); + remark &= 0xFFFF; - cp = (char*)rpbuf + ep->shi1_remark; + cp = (char*)rpbuf + remark; printf("%-12s %-10s %s\n", ep->shi1_netname, shtype[min(type, sizeof shtype / sizeof(char *) - 1)], - ep->shi1_remark ? nls_str_toloc(cp, cp) : ""); + remark ? nls_str_toloc(cp, cp) : ""); } printf("\n%d shares listed from %d available\n", entries, total); free(rpbuf);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001251835.o0PIZwOS044479>