Date: Sun, 5 Mar 2006 18:37:59 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 92803 for review Message-ID: <200603051837.k25IbxZg074620@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92803 Change 92803 by rwatson@rwatson_peppercorn on 2006/03/05 18:37:45 Always read and write process32/subject32 addr/machine fields in network byte order, as they are interpreted as IP addresses. Affected files ... .. //depot/projects/trustedbsd/openbsm/HISTORY#6 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#36 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#46 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/HISTORY#6 (text+ko) ==== @@ -20,6 +20,8 @@ definition. Don't try to retrieve time zone information using gettimeofday(), as it's not needed, and introduces possible failure modes. +- Always read and write process32 and subject32 machine/addr fields in + network byte order. OpenBSM 1.0 alpha 5 @@ -147,4 +149,4 @@ to support reloading of kernel event table. - Allow comments in /etc/security configuration files. -$P4: //depot/projects/trustedbsd/openbsm/HISTORY#5 $ +$P4: //depot/projects/trustedbsd/openbsm/HISTORY#6 $ ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#36 (text+ko) ==== @@ -31,7 +31,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#35 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#36 $ */ #include <sys/types.h> @@ -1732,7 +1732,8 @@ if (err) return (-1); - READ_TOKEN_U_INT32(buf, len, tok->tt.proc32.tid.addr, tok->len, err); + READ_TOKEN_BYTES(buf, len, &tok->tt.proc32.tid.addr, + sizeof(tok->tt.proc32.tid.addr), tok->len, err); if (err) return (-1); ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#46 (text+ko) ==== @@ -30,7 +30,7 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#45 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#46 $ */ #include <sys/types.h> @@ -645,7 +645,7 @@ ADD_U_INT32(dptr, pid); ADD_U_INT32(dptr, sid); ADD_U_INT32(dptr, tid->port); - ADD_U_INT32(dptr, tid->machine); + ADD_MEM(dptr, &tid->machine, sizeof(u_int32_t)); return (t); } @@ -918,7 +918,7 @@ ADD_U_INT32(dptr, pid); ADD_U_INT32(dptr, sid); ADD_U_INT32(dptr, tid->port); - ADD_U_INT32(dptr, tid->machine); + ADD_MEM(dptr, &tid->machine, sizeof(u_int32_t)); return (t); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603051837.k25IbxZg074620>