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,60 ****
#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
--- 52,62 ----
#define UNKNOWN_USER (2)
#define EXCLUDED_USER (3)
#define NO_ANONYMOUS (4)
#define MISC_FAILURE (5)
! 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,71 ****
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
--- 63,73 ----
audit_ftpd_bad_pw(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
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
--- 74,84 ----
audit_ftpd_unknown(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
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"));
}
--- 85,95 ----
audit_ftpd_excluded(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
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, "");
}
--- 115,125 ----
audit_ftpd_success(char *uname)
{
if (cannot_audit(0)) {
return;
}
! (void) strncpy(luser, uname, LOGNAME_MAX_ILLUMOS);
generate_record(luser, 0, "");
}