diff options
Diffstat (limited to 'libbsm/bsm_class.c')
-rw-r--r-- | libbsm/bsm_class.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libbsm/bsm_class.c b/libbsm/bsm_class.c index 5982d7e..0acfed4 100644 --- a/libbsm/bsm_class.c +++ b/libbsm/bsm_class.c @@ -1,5 +1,5 @@ -/* - * Copyright (c) 2004 Apple Computer, Inc. +/*- + * Copyright (c) 2004 Apple Inc. * Copyright (c) 2006 Robert N. M. Watson * All rights reserved. * @@ -27,9 +27,11 @@ * 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_class.c#11 $ + * $P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_class.c#14 $ */ +#include <config/config.h> + #include <bsm/libbsm.h> #include <string.h> @@ -37,6 +39,10 @@ #include <stdio.h> #include <stdlib.h> +#ifndef HAVE_STRLCPY +#include <compat/strlcpy.h> +#endif + /* * Parse the contents of the audit_class file to return struct au_class_ent * entries. @@ -70,15 +76,14 @@ classfromstr(char *str, struct au_class_ent *c) */ if (strlen(classname) >= AU_CLASS_NAME_MAX) return (NULL); - - strcpy(c->ac_name, classname); + strlcpy(c->ac_name, classname, AU_CLASS_NAME_MAX); /* * Check for very large class description. */ if (strlen(classdesc) >= AU_CLASS_DESC_MAX) return (NULL); - strcpy(c->ac_desc, classdesc); + strlcpy(c->ac_desc, classdesc, AU_CLASS_DESC_MAX); c->ac_class = strtoul(classflag, (char **) NULL, 0); return (c); |