use strvis on login name when logging debug information it since it

may contain control characters. And remove an extra logging of the same.
This commit is contained in:
matthieu 2018-07-11 16:20:20 +00:00
parent 8f540c071b
commit bf265b5bbc
2 changed files with 6 additions and 3 deletions

View File

@ -97,8 +97,6 @@ GreetDone (
LoginData *data, LoginData *data,
int status) int status)
{ {
Debug ("GreetDone: %s, (password is %lu long)\n",
data->name, strlen (data->passwd));
switch (status) { switch (status) {
case NOTIFY_OK: case NOTIFY_OK:
strlcpy (name, data->name, sizeof(name)); strlcpy (name, data->name, sizeof(name));

View File

@ -37,12 +37,14 @@ from The Open Group.
#include "dm.h" #include "dm.h"
#include "dm_error.h" #include "dm_error.h"
#include "Login.h"
#include <pwd.h> #include <pwd.h>
#include <login_cap.h> #include <login_cap.h>
#include <stdarg.h> #include <stdarg.h>
#include <bsd_auth.h> #include <bsd_auth.h>
#include <vis.h>
#include "greet.h" #include "greet.h"
@ -85,13 +87,16 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
char path[MAXPATHLEN]; char path[MAXPATHLEN];
int authok; int authok;
size_t passwd_len; size_t passwd_len;
char visname[NAME_LEN*4];
/* User may have specified an authentication style. */ /* User may have specified an authentication style. */
if ((style = strchr(greet->name, ':')) != NULL) if ((style = strchr(greet->name, ':')) != NULL)
*style++ = '\0'; *style++ = '\0';
Debug ("Verify %s, style %s ...\n", greet->name, strvis(visname, greet->name, 0);
Debug ("Verify %s, style %s ...\n", visname,
style ? style : "default"); style ? style : "default");
explicit_bzero(visname, NAME_LEN*4);
p = getpwnam (greet->name); p = getpwnam (greet->name);
if (!p || strlen (greet->name) == 0) { if (!p || strlen (greet->name) == 0) {