Print this page
2989 Eliminate use of LOGNAME_MAX in ON
1166 useradd have warning with name more 8 chars
*** 17,26 ****
--- 17,28 ----
* 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,71 ****
#define UNKNOWN_USER (2)
#define EXCLUDED_USER (3)
#define NO_ANONYMOUS (4)
#define MISC_FAILURE (5)
! static char luser[LOGNAME_MAX + 1];
static void generate_record(char *, int, char *);
static int selected(uid_t, char *, au_event_t, int);
void
audit_ftpd_bad_pw(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX);
generate_record(luser, BAD_PASSWD, dgettext(bsm_dom, "bad password"));
}
void
--- 52,79 ----
#define UNKNOWN_USER (2)
#define EXCLUDED_USER (3)
#define NO_ANONYMOUS (4)
#define MISC_FAILURE (5)
! #ifdef LOGNAME_MAX_ILLUMOS
! #define _LOGNAME_MAX LOGNAME_MAX_ILLUMOS
! #else /* LOGNAME_MAX_ILLUMOS */
! #define _LOGNAME_MAX LOGNAME_MAX
! #endif /* LOGNAME_MAX_ILLUMOS */
+ static char luser[_LOGNAME_MAX + 1];
+
static void generate_record(char *, int, char *);
static int selected(uid_t, char *, au_event_t, int);
void
audit_ftpd_bad_pw(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, _LOGNAME_MAX);
generate_record(luser, BAD_PASSWD, dgettext(bsm_dom, "bad password"));
}
void
*** 72,82 ****
audit_ftpd_unknown(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX);
generate_record(luser, UNKNOWN_USER, dgettext(bsm_dom, "unknown user"));
}
void
--- 80,90 ----
audit_ftpd_unknown(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, _LOGNAME_MAX);
generate_record(luser, UNKNOWN_USER, dgettext(bsm_dom, "unknown user"));
}
void
*** 83,93 ****
audit_ftpd_excluded(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX);
generate_record(luser, EXCLUDED_USER, dgettext(bsm_dom,
"excluded user"));
}
--- 91,101 ----
audit_ftpd_excluded(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, _LOGNAME_MAX);
generate_record(luser, EXCLUDED_USER, dgettext(bsm_dom,
"excluded user"));
}
*** 113,123 ****
audit_ftpd_success(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX);
generate_record(luser, 0, "");
}
--- 121,131 ----
audit_ftpd_success(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, _LOGNAME_MAX);
generate_record(luser, 0, "");
}