summaryrefslogtreecommitdiff
path: root/usr/src/lib/libbsm/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libbsm/common')
-rw-r--r--usr/src/lib/libbsm/common/adt.c8
-rw-r--r--usr/src/lib/libbsm/common/au_open.c39
-rw-r--r--usr/src/lib/libbsm/common/au_preselect.c22
-rw-r--r--usr/src/lib/libbsm/common/audit_class.c32
-rw-r--r--usr/src/lib/libbsm/common/audit_event.c36
-rw-r--r--usr/src/lib/libbsm/common/audit_mountd.c19
-rw-r--r--usr/src/lib/libbsm/common/audit_user.c23
-rw-r--r--usr/src/lib/libbsm/common/getacinfo.c32
8 files changed, 97 insertions, 114 deletions
diff --git a/usr/src/lib/libbsm/common/adt.c b/usr/src/lib/libbsm/common/adt.c
index 1f3c8b61ed..fa5d816ea5 100644
--- a/usr/src/lib/libbsm/common/adt.c
+++ b/usr/src/lib/libbsm/common/adt.c
@@ -18,6 +18,7 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
@@ -65,9 +66,6 @@ static void adt_setto_unaudited(adt_internal_state_t *);
#define DFLUSH
#endif
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
static int auditstate = AUC_DISABLED; /* default state */
/*
@@ -1913,12 +1911,12 @@ adt_generate_event(const adt_event_data_t *p_extdata,
* as subject are set to -1 by adt_calcOffset()
*/
if (p_xlate->tx_offsetsCalculated == 0) {
- (void) _mutex_lock(&lock);
+ (void) mutex_lock(&lock);
p_xlate->tx_offsetsCalculated = 1;
adt_calcOffsets(p_xlate->tx_top_entry, p_xlate->tx_entries,
(void *)p_extdata);
- (void) _mutex_unlock(&lock);
+ (void) mutex_unlock(&lock);
}
while (p_entry != NULL) {
adt_generate_token(p_entry, (char *)p_extdata,
diff --git a/usr/src/lib/libbsm/common/au_open.c b/usr/src/lib/libbsm/common/au_open.c
index abd76fa75d..d1058ab3a4 100644
--- a/usr/src/lib/libbsm/common/au_open.c
+++ b/usr/src/lib/libbsm/common/au_open.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.
@@ -19,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -53,9 +53,6 @@
#define AU_TABLE_LENGTH 16
#define AU_TABLE_MAX 256
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
static token_t **au_d;
static int au_d_length = 0; /* current table length */
static int au_d_required_length = AU_TABLE_LENGTH; /* new table length */
@@ -71,7 +68,7 @@ au_open()
int d; /* descriptor */
token_t **au_d_new;
- _mutex_lock(&mutex_au_d);
+ (void) mutex_lock(&mutex_au_d);
if (au_d_required_length > au_d_length) {
au_d_new = (token_t **)calloc(au_d_required_length,
@@ -79,7 +76,7 @@ au_open()
if (au_d_new == NULL) {
au_d_required_length = au_d_length;
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (-1);
}
if (au_d_length > 0) {
@@ -93,7 +90,7 @@ au_open()
for (d = 0; d < au_d_length; d++) {
if (au_d[d] == (token_t *)0) {
au_d[d] = (token_t *)&au_d;
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (d);
}
}
@@ -103,11 +100,11 @@ au_open()
* Logic here expects AU_TABLE_MAX to be multiple of AU_TABLE_LENGTH
*/
if (au_d_length >= AU_TABLE_MAX) {
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (-1);
}
au_d_required_length += AU_TABLE_LENGTH;
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (au_open());
}
@@ -132,19 +129,19 @@ au_write(d, m)
return (-1);
if (m == (token_t *)0)
return (-1);
- _mutex_lock(&mutex_au_d);
+ (void) mutex_lock(&mutex_au_d);
if ((d >= au_d_length) || (au_d[d] == (token_t *)0)) {
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (-1);
} else if (au_d[d] == (token_t *)&au_d) {
au_d[d] = m;
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (0);
}
for (mp = au_d[d]; mp->tt_next != (token_t *)0; mp = mp->tt_next)
;
mp->tt_next = m;
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (0);
}
@@ -175,17 +172,17 @@ au_close(d, right, e_type)
int byte_count; /* bytes in the record */
int v;
- _mutex_lock(&mutex_au_d);
+ (void) mutex_lock(&mutex_au_d);
if (d < 0 || d >= au_d_length ||
((dchain = au_d[d]) == (token_t *)0)) {
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (-1);
}
au_d[d] = (token_t *)0;
if (dchain == (token_t *)&au_d) {
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (0);
}
/*
@@ -198,7 +195,7 @@ au_close(d, right, e_type)
free(record->tt_data);
free(record);
}
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (0);
}
@@ -281,6 +278,6 @@ au_close(d, right, e_type)
*/
v = audit((caddr_t)buffer, byte_count);
free(buffer);
- _mutex_unlock(&mutex_au_d);
+ (void) mutex_unlock(&mutex_au_d);
return (v);
}
diff --git a/usr/src/lib/libbsm/common/au_preselect.c b/usr/src/lib/libbsm/common/au_preselect.c
index 3478311257..5d64b7a0e2 100644
--- a/usr/src/lib/libbsm/common/au_preselect.c
+++ b/usr/src/lib/libbsm/common/au_preselect.c
@@ -18,13 +18,14 @@
*
* CDDL HEADER END
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
/*
* au_preselect.c
*/
@@ -54,9 +55,6 @@ static uint_t alloc_count; /* number of entries currently allocated */
static uint_t event_count; /* number of entries in map */
static mutex_t mutex_au_preselect = DEFAULTMUTEX;
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
/*
* au_preselect:
*
@@ -84,15 +82,15 @@ au_preselect(au_event, au_mask_p, sorf, flag)
register int i;
register au_class_t comp_class;
- _mutex_lock(&mutex_au_preselect);
+ (void) mutex_lock(&mutex_au_preselect);
if (!been_here_before) {
if (alloc_map() == -1) {
- _mutex_unlock(&mutex_au_preselect);
+ (void) mutex_unlock(&mutex_au_preselect);
return (-1);
}
if (load_map() == -1) {
- _mutex_unlock(&mutex_au_preselect);
+ (void) mutex_unlock(&mutex_au_preselect);
return (-1);
}
@@ -104,7 +102,7 @@ au_preselect(au_event, au_mask_p, sorf, flag)
*/
if (flag == AU_PRS_REREAD) {
if (load_map() == -1) {
- _mutex_unlock(&mutex_au_preselect);
+ (void) mutex_unlock(&mutex_au_preselect);
return (-1);
}
}
@@ -120,16 +118,16 @@ au_preselect(au_event, au_mask_p, sorf, flag)
for (i = 0; i < event_count; i++) {
if (event_map[i].event == au_event) {
if (event_map[i].class & comp_class) {
- _mutex_unlock(&mutex_au_preselect);
+ (void) mutex_unlock(&mutex_au_preselect);
return (1);
} else {
- _mutex_unlock(&mutex_au_preselect);
+ (void) mutex_unlock(&mutex_au_preselect);
return (0);
}
}
}
- _mutex_unlock(&mutex_au_preselect);
+ (void) mutex_unlock(&mutex_au_preselect);
return (-1); /* could not find event in the table */
}
diff --git a/usr/src/lib/libbsm/common/audit_class.c b/usr/src/lib/libbsm/common/audit_class.c
index 94f2a6d2a7..5212b4b7ed 100644
--- a/usr/src/lib/libbsm/common/audit_class.c
+++ b/usr/src/lib/libbsm/common/audit_class.c
@@ -18,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -43,29 +44,26 @@ static FILE *au_class_file = NULL;
static mutex_t mutex_classfile = DEFAULTMUTEX;
static mutex_t mutex_classcache = DEFAULTMUTEX;
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
void
setauclass()
{
- _mutex_lock(&mutex_classfile);
+ (void) mutex_lock(&mutex_classfile);
if (au_class_file) {
(void) fseek(au_class_file, 0L, 0);
}
- _mutex_unlock(&mutex_classfile);
+ (void) mutex_unlock(&mutex_classfile);
}
void
endauclass()
{
- _mutex_lock(&mutex_classfile);
+ (void) mutex_lock(&mutex_classfile);
if (au_class_file) {
(void) fclose(au_class_file);
au_class_file = NULL;
}
- _mutex_unlock(&mutex_classfile);
+ (void) mutex_unlock(&mutex_classfile);
}
/*
@@ -107,10 +105,10 @@ getauclassent_r(au_class_entry)
}
/* open audit class file if it isn't already */
- _mutex_lock(&mutex_classfile);
+ (void) mutex_lock(&mutex_classfile);
if (!au_class_file) {
if (!(au_class_file = fopen(au_class_fname, "rF"))) {
- _mutex_unlock(&mutex_classfile);
+ (void) mutex_unlock(&mutex_classfile);
return ((au_class_ent_t *)0);
}
}
@@ -152,7 +150,7 @@ getauclassent_r(au_class_entry)
}
}
- _mutex_unlock(&mutex_classfile);
+ (void) mutex_unlock(&mutex_classfile);
if (!error && found) {
return (au_class_entry);
@@ -228,12 +226,12 @@ xcacheauclass(result, class_name, class_no, flags)
int hit = 0;
char *s;
- _mutex_lock(&mutex_classcache);
+ (void) mutex_lock(&mutex_classcache);
if (called_once == 0) {
/* Count number of lines in the class file */
if ((fp = fopen(au_class_fname, "rF")) == NULL) {
- _mutex_unlock(&mutex_classcache);
+ (void) mutex_unlock(&mutex_classcache);
return (-1);
}
while (fgets(line, 256, fp) != NULL) {
@@ -247,7 +245,7 @@ xcacheauclass(result, class_name, class_no, flags)
class_tbl = (au_class_ent_t **)calloc((size_t)lines + 1,
sizeof (au_class_ent_t));
if (class_tbl == NULL) {
- _mutex_unlock(&mutex_classcache);
+ (void) mutex_unlock(&mutex_classcache);
return (-2);
}
@@ -262,7 +260,7 @@ xcacheauclass(result, class_name, class_no, flags)
class_tbl[lines] = (au_class_ent_t *)
malloc(sizeof (au_class_ent_t));
if (class_tbl[lines] == NULL) {
- _mutex_unlock(&mutex_classcache);
+ (void) mutex_unlock(&mutex_classcache);
return (-3);
}
class_tbl[lines]->ac_name = strdup(p_class->ac_name);
@@ -278,7 +276,7 @@ xcacheauclass(result, class_name, class_no, flags)
class_tbl[invalid] = (au_class_ent_t *)
malloc(sizeof (au_class_ent_t));
if (class_tbl[invalid] == NULL) {
- _mutex_unlock(&mutex_classcache);
+ (void) mutex_unlock(&mutex_classcache);
return (-4);
}
class_tbl[invalid]->ac_name = "invalid class";
@@ -312,7 +310,7 @@ xcacheauclass(result, class_name, class_no, flags)
}
}
}
- _mutex_unlock(&mutex_classcache);
+ (void) mutex_unlock(&mutex_classcache);
return (hit);
}
diff --git a/usr/src/lib/libbsm/common/audit_event.c b/usr/src/lib/libbsm/common/audit_event.c
index ad4a5b033a..f35d4c939b 100644
--- a/usr/src/lib/libbsm/common/audit_event.c
+++ b/usr/src/lib/libbsm/common/audit_event.c
@@ -18,13 +18,14 @@
*
* CDDL HEADER END
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+#pragma ident "%Z%%M% %I% %E% SMI"
+
/*
* Interfaces to audit_event(5) (/etc/security/audit_event)
*/
@@ -67,30 +68,27 @@ static mutex_t mutex_eventcache = DEFAULTMUTEX;
*/
static int cacheauclass_failure = 0;
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
void
setauevent()
{
- _mutex_lock(&mutex_eventfile);
+ (void) mutex_lock(&mutex_eventfile);
if (au_event_file) {
(void) fseek(au_event_file, 0L, 0);
}
- _mutex_unlock(&mutex_eventfile);
+ (void) mutex_unlock(&mutex_eventfile);
}
void
endauevent()
{
- _mutex_lock(&mutex_eventfile);
+ (void) mutex_lock(&mutex_eventfile);
if (au_event_file) {
(void) fclose(au_event_file);
au_event_file = (FILE *)0;
}
- _mutex_unlock(&mutex_eventfile);
+ (void) mutex_unlock(&mutex_eventfile);
}
au_event_ent_t *
@@ -116,10 +114,10 @@ getauevent_r(au_event_entry)
char trim_buf[AU_EVENT_NAME_MAX+1];
/* open audit event file if it isn't already */
- _mutex_lock(&mutex_eventfile);
+ (void) mutex_lock(&mutex_eventfile);
if (!au_event_file)
if (!(au_event_file = fopen(au_event_fname, "rF"))) {
- _mutex_unlock(&mutex_eventfile);
+ (void) mutex_unlock(&mutex_eventfile);
return ((au_event_ent_t *)0);
}
@@ -168,7 +166,7 @@ getauevent_r(au_event_entry)
break;
}
}
- _mutex_unlock(&mutex_eventfile);
+ (void) mutex_unlock(&mutex_eventfile);
if (!error && found) {
return (au_event_entry);
@@ -314,12 +312,12 @@ cacheauevent(result, event_number)
int hit = 0;
char *s;
- _mutex_lock(&mutex_eventcache);
+ (void) mutex_lock(&mutex_eventcache);
if (called_once == 0) {
/* Count number of lines in the events file */
if ((fp = fopen(au_event_fname, "rF")) == NULL) {
- _mutex_unlock(&mutex_eventcache);
+ (void) mutex_unlock(&mutex_eventcache);
return (-1);
}
while (fgets(line, AU_EVENT_LINE_MAX, fp) != NULL) {
@@ -340,7 +338,7 @@ cacheauevent(result, event_number)
p_tbl = calloc(lines + 1, sizeof (au_event_ent_t));
if (p_tbl == NULL) {
- _mutex_unlock(&mutex_eventcache);
+ (void) mutex_unlock(&mutex_eventcache);
return (-2);
}
lines = 0;
@@ -351,7 +349,7 @@ cacheauevent(result, event_number)
p_tbl[lines] = (au_event_ent_t *)
malloc(sizeof (au_event_ent_t));
if (p_tbl[lines] == NULL) {
- _mutex_unlock(&mutex_eventcache);
+ (void) mutex_unlock(&mutex_eventcache);
return (-3);
}
p_tbl[lines]->ae_number = p_event->ae_number;
@@ -374,7 +372,7 @@ cacheauevent(result, event_number)
p_tbl[invalid] = (au_event_ent_t *)
malloc(sizeof (au_event_ent_t));
if (p_tbl[invalid] == NULL) {
- _mutex_unlock(&mutex_eventcache);
+ (void) mutex_unlock(&mutex_eventcache);
return (-4);
}
p_tbl[invalid]->ae_number = -1;
@@ -393,7 +391,7 @@ cacheauevent(result, event_number)
/* get space for the index_tbl */
index_tbl = calloc(max+1, sizeof (au_event_ent_t *));
if (index_tbl == NULL) {
- _mutex_unlock(&mutex_eventcache);
+ (void) mutex_unlock(&mutex_eventcache);
return (-5);
}
@@ -417,7 +415,7 @@ cacheauevent(result, event_number)
*result = index_tbl[(ushort_t)event_number];
hit = 1;
}
- _mutex_unlock(&mutex_eventcache);
+ (void) mutex_unlock(&mutex_eventcache);
return (hit);
}
diff --git a/usr/src/lib/libbsm/common/audit_mountd.c b/usr/src/lib/libbsm/common/audit_mountd.c
index 177b792d46..81385288e8 100644
--- a/usr/src/lib/libbsm/common/audit_mountd.c
+++ b/usr/src/lib/libbsm/common/audit_mountd.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.
@@ -19,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -51,9 +51,6 @@
static mutex_t audit_mountd_lock = DEFAULTMUTEX;
static int cannotaudit = 0;
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
/*
* This setup call is made only once at the start of mountd.
* The call sets the auditing state off if appropriate, and is
@@ -81,7 +78,7 @@ int sorf; /* flag for success or failure */
if (cannotaudit)
return;
- (void) _mutex_lock(&audit_mountd_lock);
+ (void) mutex_lock(&audit_mountd_lock);
(void) aug_save_namask();
@@ -93,7 +90,7 @@ int sorf; /* flag for success or failure */
(void) aug_get_machine(clname, buf, &type);
aug_save_tid_ex(aug_get_port(), buf, type);
(void) aug_audit();
- (void) _mutex_unlock(&audit_mountd_lock);
+ (void) mutex_unlock(&audit_mountd_lock);
}
void
@@ -108,7 +105,7 @@ char *path; /* mount path */
if (cannotaudit)
return;
- (void) _mutex_lock(&audit_mountd_lock);
+ (void) mutex_lock(&audit_mountd_lock);
(void) aug_save_namask();
@@ -120,5 +117,5 @@ char *path; /* mount path */
(void) aug_get_machine(clname, buf, &type);
aug_save_tid_ex(aug_get_port(), buf, type);
(void) aug_audit();
- (void) _mutex_unlock(&audit_mountd_lock);
+ (void) mutex_unlock(&audit_mountd_lock);
}
diff --git a/usr/src/lib/libbsm/common/audit_user.c b/usr/src/lib/libbsm/common/audit_user.c
index 19d68b1dc5..49c1282879 100644
--- a/usr/src/lib/libbsm/common/audit_user.c
+++ b/usr/src/lib/libbsm/common/audit_user.c
@@ -18,10 +18,12 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+
#pragma ident "%Z%%M% %I% %E% SMI"
/*
@@ -48,9 +50,6 @@ static mutex_t mutex_userfile = DEFAULTMUTEX;
static int use_nsswitch = 1;
static au_user_ent_t *auuserstr2ent(au_user_ent_t *, au_user_str_t *);
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
/*
* Externs from libnsl
*/
@@ -64,27 +63,27 @@ extern au_user_str_t *_getauusernam(char *, au_user_str_t *, char *, int,
void
setauuser()
{
- _mutex_lock(&mutex_userfile);
+ (void) mutex_lock(&mutex_userfile);
if (use_nsswitch)
_setauuser();
else if (au_user_file) {
(void) fseek(au_user_file, 0L, 0);
}
- _mutex_unlock(&mutex_userfile);
+ (void) mutex_unlock(&mutex_userfile);
}
void
endauuser()
{
- _mutex_lock(&mutex_userfile);
+ (void) mutex_lock(&mutex_userfile);
if (use_nsswitch)
_endauuser();
else if (au_user_file) {
(void) fclose(au_user_file);
au_user_file = NULL;
}
- _mutex_unlock(&mutex_userfile);
+ (void) mutex_unlock(&mutex_userfile);
}
au_user_ent_t *
@@ -107,7 +106,7 @@ getauuserent_r(au_user_ent_t *au_user_entry)
char *s, input[256];
- _mutex_lock(&mutex_userfile);
+ (void) mutex_lock(&mutex_userfile);
if (use_nsswitch) {
au_user_str_t us;
@@ -117,14 +116,14 @@ getauuserent_r(au_user_ent_t *au_user_entry)
(void) memset(buf, NULL, NSS_BUFLEN_AUDITUSER);
tmp = _getauuserent(&us, buf, NSS_BUFLEN_AUDITUSER, &errp);
- _mutex_unlock(&mutex_userfile);
+ (void) mutex_unlock(&mutex_userfile);
return (auuserstr2ent(au_user_entry, tmp));
}
/* open audit user file if it isn't already */
if (!au_user_file)
if (!(au_user_file = fopen(au_user_fname, "rF"))) {
- _mutex_unlock(&mutex_userfile);
+ (void) mutex_unlock(&mutex_userfile);
return (NULL);
}
@@ -168,7 +167,7 @@ getauuserent_r(au_user_ent_t *au_user_entry)
}
}
- _mutex_unlock(&mutex_userfile);
+ (void) mutex_unlock(&mutex_userfile);
if (!error && found) {
return (au_user_entry);
diff --git a/usr/src/lib/libbsm/common/getacinfo.c b/usr/src/lib/libbsm/common/getacinfo.c
index 65f98d2488..27f2904e29 100644
--- a/usr/src/lib/libbsm/common/getacinfo.c
+++ b/usr/src/lib/libbsm/common/getacinfo.c
@@ -18,8 +18,9 @@
*
* CDDL HEADER END
*/
+
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -56,9 +57,6 @@ static int DIRINIT;
static FILE *acf; /* pointer into audit control file */
static mutex_t mutex_acf = DEFAULTMUTEX;
-extern int _mutex_lock(mutex_t *);
-extern int _mutex_unlock(mutex_t *);
-
/*
* getacinfo.c - get audit control info
*
@@ -103,12 +101,12 @@ getacdir(dir, len)
/* void setac(); */
/* open file if it is not already opened */
- _mutex_lock(&mutex_acf);
+ (void) mutex_lock(&mutex_acf);
if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL)
retstat = ERROR;
else if (LASTOP != DIROP && DIRINIT == 1) {
retstat = REW_WARN;
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
setac();
} else {
DIRINIT = 1;
@@ -171,7 +169,7 @@ getacdir(dir, len)
}
} while (gotone == 0 && retstat >= SUCCESS);
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
return (retstat);
}
@@ -199,7 +197,7 @@ getacmin(min_val)
char entry[LEN];
/* open file if it is not already opened */
- _mutex_lock(&mutex_acf);
+ (void) mutex_lock(&mutex_acf);
if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL)
retstat = ERROR;
else
@@ -247,7 +245,7 @@ getacmin(min_val)
DIRINIT = 0;
}
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
return (retstat);
}
@@ -277,7 +275,7 @@ getacflg(auditstring, len)
char entry[LEN];
/* open file if it is not already opened */
- _mutex_lock(&mutex_acf);
+ (void) mutex_lock(&mutex_acf);
if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL)
retstat = ERROR;
else
@@ -340,7 +338,7 @@ getacflg(auditstring, len)
DIRINIT = 0;
}
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
return (retstat);
}
@@ -370,7 +368,7 @@ getacna(auditstring, len)
char entry[LEN];
/* open file if it is not already opened */
- _mutex_lock(&mutex_acf);
+ (void) mutex_lock(&mutex_acf);
if (acf == NULL && (acf = fopen(AUDIT_CTRL, "rF")) == NULL) {
retstat = ERROR;
} else {
@@ -439,7 +437,7 @@ getacna(auditstring, len)
DIRINIT = 0;
}
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
return (retstat);
}
@@ -448,14 +446,14 @@ getacna(auditstring, len)
void
setac()
{
- _mutex_lock(&mutex_acf);
+ (void) mutex_lock(&mutex_acf);
if (acf == NULL)
acf = fopen(AUDIT_CTRL, "rF");
else
rewind(acf);
LASTOP = DIROP;
DIRINIT = 0;
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
}
@@ -463,12 +461,12 @@ setac()
void
endac()
{
- _mutex_lock(&mutex_acf);
+ (void) mutex_lock(&mutex_acf);
if (acf != NULL) {
(void) fclose(acf);
acf = NULL;
}
LASTOP = DIROP;
DIRINIT = 0;
- _mutex_unlock(&mutex_acf);
+ (void) mutex_unlock(&mutex_acf);
}