diff options
Diffstat (limited to 'usr/src/lib/libbsm/common')
-rw-r--r-- | usr/src/lib/libbsm/common/audit_class.c | 11 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/audit_event.c | 11 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/audit_plugin.c | 9 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/audit_user.c | 9 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/devalloc.c | 10 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/getacinfo.c | 17 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/getacval.c | 9 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/getdadefs.c | 2 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/getdaent.c | 2 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/getdment.c | 4 |
10 files changed, 38 insertions, 46 deletions
diff --git a/usr/src/lib/libbsm/common/audit_class.c b/usr/src/lib/libbsm/common/audit_class.c index f7c10f46a5..d727a6b033 100644 --- a/usr/src/lib/libbsm/common/audit_class.c +++ b/usr/src/lib/libbsm/common/audit_class.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -127,7 +126,7 @@ getauclassent_r(au_class_entry) /* open audit class file if it isn't already */ _mutex_lock(&mutex_classfile); if (!au_class_file) { - if (!(au_class_file = fopen(au_class_fname, "r"))) { + if (!(au_class_file = fopen(au_class_fname, "rF"))) { _mutex_unlock(&mutex_classfile); return ((au_class_ent_t *)0); } @@ -250,7 +249,7 @@ xcacheauclass(result, class_name, class_no, flags) if (called_once == 0) { /* Count number of lines in the class file */ - if ((fp = fopen(au_class_fname, "r")) == NULL) { + if ((fp = fopen(au_class_fname, "rF")) == NULL) { _mutex_unlock(&mutex_classcache); return (-1); } diff --git a/usr/src/lib/libbsm/common/audit_event.c b/usr/src/lib/libbsm/common/audit_event.c index 1964c5f0fe..7f66ecb803 100644 --- a/usr/src/lib/libbsm/common/audit_event.c +++ b/usr/src/lib/libbsm/common/audit_event.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -26,7 +25,7 @@ static char sccsid[] = "%Z%%M% %I% %E% SMI"; #endif /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -132,7 +131,7 @@ getauevent_r(au_event_entry) /* open audit event file if it isn't already */ _mutex_lock(&mutex_eventfile); if (!au_event_file) - if (!(au_event_file = fopen(au_event_fname, "r"))) { + if (!(au_event_file = fopen(au_event_fname, "rF"))) { _mutex_unlock(&mutex_eventfile); return ((au_event_ent_t *)0); } @@ -328,7 +327,7 @@ cacheauevent(result, event_number) if (called_once == 0) { /* Count number of lines in the events file */ - if ((fp = fopen(au_event_fname, "r")) == NULL) { + if ((fp = fopen(au_event_fname, "rF")) == NULL) { _mutex_unlock(&mutex_eventcache); return (-1); } diff --git a/usr/src/lib/libbsm/common/audit_plugin.c b/usr/src/lib/libbsm/common/audit_plugin.c index 3bac9b0279..6cdeb70587 100644 --- a/usr/src/lib/libbsm/common/audit_plugin.c +++ b/usr/src/lib/libbsm/common/audit_plugin.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * private interfaces for auditd plugins and auditd. @@ -272,7 +271,7 @@ __auditd_debug_file_open() { if (fp != NULL) return (fp); - if ((fp = fopen("/var/audit/dump", "a")) == NULL) + if ((fp = fopen("/var/audit/dump", "aF")) == NULL) (void) fprintf(stderr, "failed to open debug file: %s\n", strerror(errno)); diff --git a/usr/src/lib/libbsm/common/audit_user.c b/usr/src/lib/libbsm/common/audit_user.c index a8f55d82e6..27c8967162 100644 --- a/usr/src/lib/libbsm/common/audit_user.c +++ b/usr/src/lib/libbsm/common/audit_user.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -142,7 +141,7 @@ getauuserent_r(au_user_ent_t *au_user_entry) /* open audit user file if it isn't already */ if (!au_user_file) - if (!(au_user_file = fopen(au_user_fname, "r"))) { + if (!(au_user_file = fopen(au_user_fname, "rF"))) { _mutex_unlock(&mutex_userfile); return (NULL); } diff --git a/usr/src/lib/libbsm/common/devalloc.c b/usr/src/lib/libbsm/common/devalloc.c index 4541191349..08db0f0325 100644 --- a/usr/src/lib/libbsm/common/devalloc.c +++ b/usr/src/lib/libbsm/common/devalloc.c @@ -97,7 +97,7 @@ da_check_logindevperm(char *devname) (void) close(fd); return (0); } - if ((fp = fdopen(fd, "r")) == NULL) { + if ((fp = fdopen(fd, "rF")) == NULL) { free(fbuf); (void) close(fd); return (0); @@ -179,7 +179,6 @@ _da_read_file(char *fname, char **fbuf, time_t *ftime, rwlock_t *flock, int fd = -1; int fsize = 0; time_t newtime; - FILE *fp = NULL; struct stat f_stat; if (flag & DA_FORCE) @@ -204,11 +203,10 @@ _da_read_file(char *fname, char **fbuf, time_t *ftime, rwlock_t *flock, */ if (rw_wrlock(flock) != 0) return (-1); - if ((fp = fopen(fname, "r")) == NULL) { + if ((fd = open(fname, O_RDONLY)) == -1) { (void) rw_unlock(flock); return (-1); } - fd = fileno(fp); if (*fbuf != NULL) { free(*fbuf); *fbuf = NULL; @@ -913,10 +911,10 @@ da_open_devdb(char *rootdir, FILE **dafp, FILE **dmfp, int flag) if (flag & DA_RDWR) { oflag = DA_RDWR; - fmode = "r+"; + fmode = "r+F"; } else if (flag & DA_RDONLY) { oflag = DA_RDONLY; - fmode = "r"; + fmode = "rF"; } if ((lockfd = _da_lock_devdb(rootdir)) == -1) diff --git a/usr/src/lib/libbsm/common/getacinfo.c b/usr/src/lib/libbsm/common/getacinfo.c index a79ffd7ca2..1a117301b1 100644 --- a/usr/src/lib/libbsm/common/getacinfo.c +++ b/usr/src/lib/libbsm/common/getacinfo.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -109,7 +108,7 @@ getacdir(dir, len) /* open file if it is not already opened */ _mutex_lock(&mutex_acf); - if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL) + if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL) retstat = ERROR; else if (LASTOP != DIROP && DIRINIT == 1) { retstat = REW_WARN; @@ -205,7 +204,7 @@ getacmin(min_val) /* open file if it is not already opened */ _mutex_lock(&mutex_acf); - if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL) + if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL) retstat = ERROR; else rewind(acf); @@ -283,7 +282,7 @@ getacflg(auditstring, len) /* open file if it is not already opened */ _mutex_lock(&mutex_acf); - if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL) + if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL) retstat = ERROR; else rewind(acf); @@ -376,7 +375,7 @@ getacna(auditstring, len) /* open file if it is not already opened */ _mutex_lock(&mutex_acf); - if (acf == NULL && (acf = fopen(AUDIT_CTRL, "r")) == NULL) { + if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL) { retstat = ERROR; } else { rewind(acf); @@ -455,7 +454,7 @@ setac() { _mutex_lock(&mutex_acf); if (acf == NULL) - acf = fopen(AUDIT_CTRL, "r"); + acf = fopen(AUDIT_CTRL, "rF"); else rewind(acf); LASTOP = DIROP; diff --git a/usr/src/lib/libbsm/common/getacval.c b/usr/src/lib/libbsm/common/getacval.c index 6feeaf813f..6372ee6291 100644 --- a/usr/src/lib/libbsm/common/getacval.c +++ b/usr/src/lib/libbsm/common/getacval.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -482,7 +481,7 @@ _openac(char *filepath) free(context); return (NULL); } - context->fp = fopen(filepath, "r"); + context->fp = fopen(filepath, "rF"); if (context->fp == NULL) { free(context->file); free(context); diff --git a/usr/src/lib/libbsm/common/getdadefs.c b/usr/src/lib/libbsm/common/getdadefs.c index 3f62566293..537713f6fd 100644 --- a/usr/src/lib/libbsm/common/getdadefs.c +++ b/usr/src/lib/libbsm/common/getdadefs.c @@ -91,7 +91,7 @@ setdadefent(void) if (_df == NULL) return; if (dadeff == NULL) - dadeff = fopen(DADEFS_FILE, "r"); + dadeff = fopen(DADEFS_FILE, "rF"); else rewind(dadeff); } diff --git a/usr/src/lib/libbsm/common/getdaent.c b/usr/src/lib/libbsm/common/getdaent.c index 2deb5a65d6..fe83e7b1b2 100644 --- a/usr/src/lib/libbsm/common/getdaent.c +++ b/usr/src/lib/libbsm/common/getdaent.c @@ -238,7 +238,7 @@ setdaent(void) if (_da == NULL) return; if (daf == NULL) - daf = fopen(DEVALLOC_FILE, "r"); + daf = fopen(DEVALLOC_FILE, "rF"); else rewind(daf); } diff --git a/usr/src/lib/libbsm/common/getdment.c b/usr/src/lib/libbsm/common/getdment.c index 2b13f5bc6e..0bf82e86e3 100644 --- a/usr/src/lib/libbsm/common/getdment.c +++ b/usr/src/lib/libbsm/common/getdment.c @@ -93,7 +93,7 @@ setdmapent(void) if (_dmap == NULL) return; if (dmapf == NULL) - dmapf = fopen(DEVMAPS_FILE, "r"); + dmapf = fopen(DEVMAPS_FILE, "rF"); else rewind(dmapf); } @@ -401,7 +401,7 @@ dmap_dlexpand(devmap_t *dmp) (void) strcpy(tmplist, dmp->dmap_devlist + 1); if ((cp = strchr(tmplist, '`')) != NULL) *cp = '\0'; - if ((expansion = popen(tmplist, "r")) == NULL) + if ((expansion = popen(tmplist, "rF")) == NULL) return (NULL); count = fread(tmplist, 1, sizeof (tmplist) - 1, expansion); (void) pclose(expansion); |