Browse Source

Reverted to r41

master
Andrea Luzzardi 17 years ago
parent
commit
6a814ac7ee
4 changed files with 7 additions and 17 deletions
  1. +4
    -11
      pam_usb/src/local.c
  2. +1
    -2
      pam_usb/src/local.h
  3. +1
    -3
      pam_usb/src/pam.c
  4. +1
    -1
      pam_usb/src/pusb_check.c

+ 4
- 11
pam_usb/src/local.c View File

@ -22,24 +22,17 @@
#include "log.h"
#include "conf.h"
int pusb_local_login(t_pusb_options *opts, const char *user,
const char *tty)
int pusb_local_login(t_pusb_options *opts, const char *user)
{
char *from;
struct utmp utsearch;
struct utmp *utent;
const char *from;
int i;
log_debug("Checking whether the caller is local or not...\n");
if (tty && *tty)
from = tty;
else
from = ttyname(STDIN_FILENO);
if (!from || !(*from))
{
log_debug("Couldn't retrive the tty name, aborting...");
from = ttyname(STDIN_FILENO);
if (!from)
return (1);
}
log_debug("Authentication request from tty %s\n", from);
if (!strncmp(from, "/dev/", strlen("/dev/")))
from += strlen("/dev/");


+ 1
- 2
pam_usb/src/local.h View File

@ -18,7 +18,6 @@
#ifndef PUSB_LOCAL_H_
# define PUSB_LOCAL_H_
int pusb_local_login(t_pusb_options *opts, const char *user,
const char *tty);
int pusb_local_login(t_pusb_options *opts, const char *user);
#endif /* !PUSB_LOCAL_H_ */

+ 1
- 3
pam_usb/src/pam.c View File

@ -32,7 +32,6 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
t_pusb_options opts;
const char *service;
const char *user;
char *tty;
char *conf_file = PUSB_CONF_FILE;
int retval;
@ -66,8 +65,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
log_info("pam_usb v.%s\n", PUSB_VERSION);
log_info("Authentication request for user \"%s\" (%s)\n",
user, service);
pam_get_item(pamh, PAM_TTY, (const void**)&tty);
if (!pusb_local_login(&opts, user, tty))
if (!pusb_local_login(&opts, user))
{
log_error("Access denied.\n");
return (PAM_AUTH_ERR);


+ 1
- 1
pam_usb/src/pusb_check.c View File

@ -52,7 +52,7 @@ static int pusb_check_perform_authentication(t_pusb_options *opts,
}
log_info("Authentication request for user \"%s\" (%s)\n",
user, service);
if (!pusb_local_login(opts, user, NULL))
if (!pusb_local_login(opts, user))
{
log_error("Access denied.\n");
return (0);


Loading…
Cancel
Save