Print this page
2989 Eliminate use of LOGNAME_MAX in ON
1166 useradd have warning with name more 8 chars
@@ -17,10 +17,12 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
+ * Copyright (c) 2013 Gary Mills
+ *
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
*/
#include <sys/types.h>
#include <sys/param.h>
@@ -50,11 +52,11 @@
#define UNKNOWN_USER (2)
#define EXCLUDED_USER (3)
#define NO_ANONYMOUS (4)
#define MISC_FAILURE (5)
-static char luser[LOGNAME_MAX + 1];
+static char luser[LOGNAME_MAX_ILLUMOS + 1];
static void generate_record(char *, int, char *);
static int selected(uid_t, char *, au_event_t, int);
void
@@ -61,11 +63,11 @@
audit_ftpd_bad_pw(char *uname)
{
if (cannot_audit(0)) {
return;
}
- (void) strncpy(luser, uname, LOGNAME_MAX);
+ (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
generate_record(luser, BAD_PASSWD, dgettext(bsm_dom, "bad password"));
}
void
@@ -72,11 +74,11 @@
audit_ftpd_unknown(char *uname)
{
if (cannot_audit(0)) {
return;
}
- (void) strncpy(luser, uname, LOGNAME_MAX);
+ (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
generate_record(luser, UNKNOWN_USER, dgettext(bsm_dom, "unknown user"));
}
void
@@ -83,11 +85,11 @@
audit_ftpd_excluded(char *uname)
{
if (cannot_audit(0)) {
return;
}
- (void) strncpy(luser, uname, LOGNAME_MAX);
+ (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
generate_record(luser, EXCLUDED_USER, dgettext(bsm_dom,
"excluded user"));
}
@@ -113,11 +115,11 @@
audit_ftpd_success(char *uname)
{
if (cannot_audit(0)) {
return;
}
- (void) strncpy(luser, uname, LOGNAME_MAX);
+ (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
generate_record(luser, 0, "");
}