Comment 19 for bug 501956

Revision history for this message
In , Ashok-kovai (ashok-kovai) wrote :

Created attachment 785
Modified BTMP PATCH attached

> if(!authenticated && !authctxt->postponed && (!strcmp(method,
"gssapi-with-mic") || !strcmp(method, "publickey") || !strcmp(method,
"hostbased"))){
> debug("=== calling log_btmp uid %d ===\n", getuid());
>
PRIVSEP(log_btmp(authctxt->user,get_canonical_hostname(options.use_dns)));
> }
>
>
> if(!authenticated && !authctxt->postponed && (!strcmp(method,
"password") || !strcmp(method, " keyboard-interactive") ||
!strcmp(method,"challenge-response") ||
!strcmp(method,"keyboard-interactive/pam"))){
> if ( getuid() == 0) {
> debug("=== calling log_btmp uid %d ===\n", getuid());

> These two blocks can be merged. The logging is inconsistent with other debug
calls. The long list of strcmp looks fragile, > if we add more auth methods.

THese two bloacks were merged as given below.

if (!authenticated && !authctxt->postponed && strcmp(method, "none")) {
      debug("Entering log_btmp uid %d ", getuid());
      if((!strcmp(method, "gssapi-with-mic") || !strcmp(method, "publickey") ||
!strcmp(method, "hostbased")))

PRIVSEP(log_btmp(authctxt->user,get_canonical_hostname(options.use_dns)));
      else if ( getuid()==0)

log_btmp(authctxt->user,get_canonical_hostname(options.use_dns));
}

>void
>log_btmp(const char *username, const char *hostname) {

These coding convention were corrected based on the source file style guide .