diff options
-rw-r--r-- | usr/src/lib/libbsm/common/au_preselect.c | 14 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/au_usermask.c | 18 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/audit_class.c | 51 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/audit_user.c | 17 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/getacinfo.c | 61 |
5 files changed, 35 insertions, 126 deletions
diff --git a/usr/src/lib/libbsm/common/au_preselect.c b/usr/src/lib/libbsm/common/au_preselect.c index 5d64b7a0e2..67512a6212 100644 --- a/usr/src/lib/libbsm/common/au_preselect.c +++ b/usr/src/lib/libbsm/common/au_preselect.c @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * au_preselect.c */ @@ -59,7 +57,7 @@ static mutex_t mutex_au_preselect = DEFAULTMUTEX; * au_preselect: * * Keep a dynamic array of event<-->class mappings. - * Refresh the map when the value of flag is non-zero. + * Refresh the map when the value of flag is AU_PRS_REREAD. * Return: * 1: The event is preselected. * 0: The event is not preselected. @@ -68,15 +66,7 @@ static mutex_t mutex_au_preselect = DEFAULTMUTEX; * Couldn't find event. */ int -#ifdef __STDC__ au_preselect(au_event_t au_event, au_mask_t *au_mask_p, int sorf, int flag) -#else -au_preselect(au_event, au_mask_p, sorf, flag) - au_event_t au_event; /* event */ - au_mask_t *au_mask_p; /* preselection mask */ - int sorf; /* success or failure */ - int flag; /* re-read flag */ -#endif /* __STDC__ */ { static char been_here_before; /* we cache the map */ register int i; diff --git a/usr/src/lib/libbsm/common/au_usermask.c b/usr/src/lib/libbsm/common/au_usermask.c index 28a0032916..4ab8313fe4 100644 --- a/usr/src/lib/libbsm/common/au_usermask.c +++ b/usr/src/lib/libbsm/common/au_usermask.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,14 +18,10 @@ * * CDDL HEADER END */ -#pragma ident "%Z%%M% %I% %E% SMI" -#ifndef lint -static char sccsid[] = "@(#)au_usermask.c 1.9 01/06/26 SMI"; -#endif /* - * Copyright (c) 1988, 2001 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #include <sys/types.h> @@ -59,12 +54,7 @@ static char sccsid[] = "@(#)au_usermask.c 1.9 01/06/26 SMI"; * continues. */ int -#ifdef __STDC__ au_user_mask(char *username, au_mask_t *p_mask) -#else -char *username; -au_mask_t *p_mask; -#endif /* __STDC__ */ { char auditstring[AUDITSTRING_LEN]; au_user_ent_t *p_user = NULL; diff --git a/usr/src/lib/libbsm/common/audit_class.c b/usr/src/lib/libbsm/common/audit_class.c index 5212b4b7ed..eee8a35ad1 100644 --- a/usr/src/lib/libbsm/common/audit_class.c +++ b/usr/src/lib/libbsm/common/audit_class.c @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Interfaces to audit_class(5) (/etc/security/audit_class) */ @@ -91,17 +89,16 @@ getauclassent() * in the au_class_ent structure. */ au_class_ent_t * -getauclassent_r(au_class_entry) - au_class_ent_t *au_class_entry; +getauclassent_r(au_class_ent_t *au_class_entry) { int i, error = 0, found = 0; char *s, input[256]; unsigned long v; if (au_class_entry == (au_class_ent_t *)NULL || - au_class_entry->ac_name == (char *)NULL || - au_class_entry->ac_desc == (char *)NULL) { - return ((au_class_ent_t *)NULL); + au_class_entry->ac_name == (char *)NULL || + au_class_entry->ac_desc == (char *)NULL) { + return ((au_class_ent_t *)NULL); } /* open audit class file if it isn't already */ @@ -161,12 +158,7 @@ getauclassent_r(au_class_entry) au_class_ent_t * -#ifdef __STDC__ getauclassnam(char *name) -#else -getauclassnam(name) - char *name; -#endif { static au_class_ent_t e; static char cname[AU_CLASS_NAME_MAX]; @@ -179,13 +171,7 @@ getauclassnam(name) } au_class_ent_t * -#ifdef __STDC__ getauclassnam_r(au_class_ent_t *e, char *name) -#else -getauclassnam_r() - au_class_ent_t *e; - char *name; -#endif { while (getauclassent_r(e) != NULL) { if (strcmp(e->ac_name, name) == 0) { @@ -208,11 +194,8 @@ getauclassnam_r() * Return 1, set result pointer to a valid entry, if class is in cache. */ static int -xcacheauclass(result, class_name, class_no, flags) - au_class_ent_t **result; /* set this pointer to an entry in the cache */ - char *class_name; /* name of class to look up */ - au_class_t class_no; - int flags; +xcacheauclass(au_class_ent_t **result, char *class_name, au_class_t class_no, + int flags) { static int invalid; static au_class_ent_t **class_tbl; @@ -243,7 +226,7 @@ xcacheauclass(result, class_name, class_no, flags) } (void) fclose(fp); class_tbl = (au_class_ent_t **)calloc((size_t)lines + 1, - sizeof (au_class_ent_t)); + sizeof (au_class_ent_t)); if (class_tbl == NULL) { (void) mutex_unlock(&mutex_classcache); return (-2); @@ -258,7 +241,7 @@ xcacheauclass(result, class_name, class_no, flags) */ while ((p_class = getauclassent()) != NULL) { class_tbl[lines] = (au_class_ent_t *) - malloc(sizeof (au_class_ent_t)); + malloc(sizeof (au_class_ent_t)); if (class_tbl[lines] == NULL) { (void) mutex_unlock(&mutex_classcache); return (-3); @@ -274,7 +257,7 @@ xcacheauclass(result, class_name, class_no, flags) endauclass(); invalid = lines; class_tbl[invalid] = (au_class_ent_t *) - malloc(sizeof (au_class_ent_t)); + malloc(sizeof (au_class_ent_t)); if (class_tbl[invalid] == NULL) { (void) mutex_unlock(&mutex_classcache); return (-4); @@ -316,29 +299,17 @@ xcacheauclass(result, class_name, class_no, flags) int -#ifdef __STDC__ cacheauclass(au_class_ent_t **result, au_class_t class_no) -#else -cacheauclass(result, class_no) - au_class_ent_t **result; /* set this pointer to an entry in the cache */ - au_class_t class_no; -#endif { return (xcacheauclass(result, "", class_no, AU_CACHE_NUMBER)); } int -#ifdef __STDC__ cacheauclassnam(au_class_ent_t **result, char *class_name) -#else -cacheauclassnam(result, class_name) - au_class_ent_t **result; /* set this pointer to an entry in the cache */ - char *class_name; -#endif { return (xcacheauclass(result, class_name, (au_class_t)0, - AU_CACHE_NAME)); + AU_CACHE_NAME)); } diff --git a/usr/src/lib/libbsm/common/audit_user.c b/usr/src/lib/libbsm/common/audit_user.c index 49c1282879..4c94052137 100644 --- a/usr/src/lib/libbsm/common/audit_user.c +++ b/usr/src/lib/libbsm/common/audit_user.c @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Interfaces to audit_user(4) (/etc/security/audit_user) */ @@ -177,14 +175,8 @@ getauuserent_r(au_user_ent_t *au_user_entry) } -#ifdef __STDC__ au_user_ent_t * getauusernam(char *name) -#else -au_user_ent_t * -getauusernam(name) - char *name; -#endif { static au_user_ent_t u; static char logname[MAX_USERNAME+1]; @@ -195,15 +187,8 @@ getauusernam(name) return (getauusernam_r(&u, name)); } -#ifdef __STDC__ au_user_ent_t * getauusernam_r(au_user_ent_t *u, char *name) -#else -au_user_ent_t * -getauusernam_r(u, name) - au_user_ent_t *u; - char *name; -#endif { if (use_nsswitch) { diff --git a/usr/src/lib/libbsm/common/getacinfo.c b/usr/src/lib/libbsm/common/getacinfo.c index 27f2904e29..4766b873cb 100644 --- a/usr/src/lib/libbsm/common/getacinfo.c +++ b/usr/src/lib/libbsm/common/getacinfo.c @@ -20,12 +20,10 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* getacinfo.c - get audit control info */ #include <stdio.h> @@ -88,13 +86,7 @@ static mutex_t mutex_acf = DEFAULTMUTEX; */ int -#ifdef __STDC__ getacdir(char *dir, int len) -#else -getacdir(dir, len) - char *dir; - int len; -#endif { int retstat = SUCCESS, gotone = 0, dirlen, dirst; char entry[LEN]; @@ -186,12 +178,7 @@ getacdir(dir, len) */ int -#ifdef __STDC__ getacmin(int *min_val) -#else -getacmin(min_val) - int *min_val; -#endif { int retstat = SUCCESS, gotone = 0; char entry[LEN]; @@ -213,10 +200,10 @@ getacmin(min_val) break; case 'm': if (strncmp(entry, MINLABEL, - strlen(MINLABEL)) == 0) { - (void) - sscanf(entry + strlen(MINLABEL), - "%d", min_val); + strlen(MINLABEL)) == 0) { + (void) sscanf(entry + + strlen(MINLABEL), + "%d", min_val); gotone = 1; } else retstat = FORMAT_ERR; @@ -261,15 +248,8 @@ getacmin(min_val) * -3 - error - directory entry format error */ -#ifdef __STDC__ int getacflg(char *auditstring, int len) -#else -int -getacflg(auditstring, len) - char *auditstring; - int len; -#endif { int retstat = SUCCESS, gotone = 0, minst, minlen; char entry[LEN]; @@ -293,23 +273,23 @@ getacflg(auditstring, len) case 'f': if ((strncmp(entry, DEFFLGLABEL, - strlen(DEFFLGLABEL))) == 0) { + strlen(DEFFLGLABEL))) == 0) { if (entry[strlen(DEFFLGLABEL)] == ' ') { minst = strlen(DEFFLGLABEL) + 1; minlen = strlen(entry) - - (strlen(DEFFLGLABEL) + 2); + (strlen(DEFFLGLABEL) + 2); } else { minst = strlen(DEFFLGLABEL); minlen = strlen(entry) - - (strlen(DEFFLGLABEL) + 1); + (strlen(DEFFLGLABEL) + 1); } if (minlen > len) retstat = FORMAT_ERR; else { (void) strcpy(auditstring, - entry + minst); + entry + minst); (void) strcpy(auditstring + minlen, - "\0"); + "\0"); gotone = 1; } } else @@ -354,15 +334,8 @@ getacflg(auditstring, len) * -3 - error - directory entry format error */ -#ifdef __STDC__ int getacna(char *auditstring, int len) -#else -int -getacna(auditstring, len) - char *auditstring; - int len; -#endif { int retstat = SUCCESS, gotone = 0, minst, minlen; char entry[LEN]; @@ -377,7 +350,7 @@ getacna(auditstring, len) if (retstat == SUCCESS) do { if (fgets(entry, LEN, acf) != NULL) - switch (*entry) { + switch (*entry) { case '#': break; case 'd': @@ -388,24 +361,24 @@ getacna(auditstring, len) break; case 'n': - if ((strncmp(entry, NAFLGLABEL, strlen(NAFLGLABEL))) == - 0) { + if ((strncmp(entry, NAFLGLABEL, + strlen(NAFLGLABEL))) == 0) { if (entry[strlen(NAFLGLABEL)] == ' ') { minst = strlen(NAFLGLABEL) + 1; minlen = strlen(entry) - - (strlen(NAFLGLABEL) + 2); + (strlen(NAFLGLABEL) + 2); } else { minst = strlen(NAFLGLABEL); minlen = strlen(entry) - - (strlen(NAFLGLABEL) + 1); + (strlen(NAFLGLABEL) + 1); } if (minlen > len) retstat = FORMAT_ERR; else { (void) strcpy(auditstring, - entry + minst); + entry + minst); (void) strcpy(auditstring + minlen, - "\0"); + "\0"); gotone = 1; } } else |