bsm_io.c (161630) | bsm_io.c (162503) |
---|---|
1/* 2 * Copyright (c) 2004 Apple Computer, Inc. 3 * Copyright (c) 2005 SPARTA, Inc. 4 * Copyright (c) 2006 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * This code was developed in part by Robert N. M. Watson, Senior Principal 8 * Scientist, SPARTA, Inc. --- 17 unchanged lines hidden (view full) --- 26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 31 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 * POSSIBILITY OF SUCH DAMAGE. 33 * | 1/* 2 * Copyright (c) 2004 Apple Computer, Inc. 3 * Copyright (c) 2005 SPARTA, Inc. 4 * Copyright (c) 2006 Robert N. M. Watson 5 * All rights reserved. 6 * 7 * This code was developed in part by Robert N. M. Watson, Senior Principal 8 * Scientist, SPARTA, Inc. --- 17 unchanged lines hidden (view full) --- 26 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 31 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 * POSSIBILITY OF SUCH DAMAGE. 33 * |
34 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#40 $ | 34 * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_io.c#41 $ |
35 */ 36 37#include <sys/types.h> 38 39#include <config/config.h> 40#ifdef HAVE_SYS_ENDIAN_H 41#include <sys/endian.h> 42#else /* !HAVE_SYS_ENDIAN_H */ --- 1142 unchanged lines hidden (view full) --- 1185 char *bptr; 1186 1187 READ_TOKEN_U_INT32(buf, len, tok->tt.execarg.count, tok->len, err); 1188 if (err) 1189 return (-1); 1190 1191 for (i = 0; i < tok->tt.execarg.count; i++) { 1192 bptr = buf + tok->len; | 35 */ 36 37#include <sys/types.h> 38 39#include <config/config.h> 40#ifdef HAVE_SYS_ENDIAN_H 41#include <sys/endian.h> 42#else /* !HAVE_SYS_ENDIAN_H */ --- 1142 unchanged lines hidden (view full) --- 1185 char *bptr; 1186 1187 READ_TOKEN_U_INT32(buf, len, tok->tt.execarg.count, tok->len, err); 1188 if (err) 1189 return (-1); 1190 1191 for (i = 0; i < tok->tt.execarg.count; i++) { 1192 bptr = buf + tok->len; |
1193 tok->tt.execarg.text[i] = bptr; | 1193 if (i < AUDIT_MAX_ARGS) 1194 tok->tt.execarg.text[i] = bptr; |
1194 1195 /* Look for a null terminated string. */ 1196 while (bptr && (*bptr != '\0')) { 1197 if (++tok->len >=len) 1198 return (-1); 1199 bptr = buf + tok->len; 1200 } 1201 if (!bptr) 1202 return (-1); 1203 tok->len++; /* \0 character */ 1204 } | 1195 1196 /* Look for a null terminated string. */ 1197 while (bptr && (*bptr != '\0')) { 1198 if (++tok->len >=len) 1199 return (-1); 1200 bptr = buf + tok->len; 1201 } 1202 if (!bptr) 1203 return (-1); 1204 tok->len++; /* \0 character */ 1205 } |
1206 if (tok->tt.execarg.count > AUDIT_MAX_ARGS) 1207 tok->tt.execarg.count = AUDIT_MAX_ARGS; |
|
1205 1206 return (0); 1207} 1208 1209static void 1210print_execarg_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, 1211 __unused char sfrm) 1212{ --- 17 unchanged lines hidden (view full) --- 1230 int err = 0; 1231 int i; 1232 char *bptr; 1233 1234 READ_TOKEN_U_INT32(buf, len, tok->tt.execenv.count, tok->len, err); 1235 if (err) 1236 return (-1); 1237 | 1208 1209 return (0); 1210} 1211 1212static void 1213print_execarg_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, 1214 __unused char sfrm) 1215{ --- 17 unchanged lines hidden (view full) --- 1233 int err = 0; 1234 int i; 1235 char *bptr; 1236 1237 READ_TOKEN_U_INT32(buf, len, tok->tt.execenv.count, tok->len, err); 1238 if (err) 1239 return (-1); 1240 |
1238 for (i = 0; i< tok->tt.execenv.count; i++) { | 1241 for (i = 0; i < tok->tt.execenv.count; i++) { |
1239 bptr = buf + tok->len; | 1242 bptr = buf + tok->len; |
1240 tok->tt.execenv.text[i] = bptr; | 1243 if (i < AUDIT_MAX_ENV) 1244 tok->tt.execenv.text[i] = bptr; |
1241 1242 /* Look for a null terminated string. */ 1243 while (bptr && (*bptr != '\0')) { 1244 if (++tok->len >=len) 1245 return (-1); 1246 bptr = buf + tok->len; 1247 } 1248 if (!bptr) 1249 return (-1); 1250 tok->len++; /* \0 character */ 1251 } | 1245 1246 /* Look for a null terminated string. */ 1247 while (bptr && (*bptr != '\0')) { 1248 if (++tok->len >=len) 1249 return (-1); 1250 bptr = buf + tok->len; 1251 } 1252 if (!bptr) 1253 return (-1); 1254 tok->len++; /* \0 character */ 1255 } |
1256 if (tok->tt.execenv.count > AUDIT_MAX_ENV) 1257 tok->tt.execenv.count = AUDIT_MAX_ENV; |
|
1252 1253 return (0); 1254} 1255 1256static void 1257print_execenv_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, 1258 __unused char sfrm) 1259{ --- 1618 unchanged lines hidden --- | 1258 1259 return (0); 1260} 1261 1262static void 1263print_execenv_tok(FILE *fp, tokenstr_t *tok, char *del, char raw, 1264 __unused char sfrm) 1265{ --- 1618 unchanged lines hidden --- |