[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

question about /bin/login with devfs (/dev/vc/x)



Hello,

Is util-linux a mailing list? Are there archives?

I'm seeing a problem with pam_securetty in which it get's a
truncated PAM_TTY

the pam_securetty.c code doesn't mind the prefixed "/dev/"
so I change on line 546 of login.c:
from 
    retcode = pam_set_item(pamh, PAM_TTY, tty);
to
    retcode = pam_set_item(pamh, PAM_TTY, ttyn);

it seems that the you could replace the rindex truncate code 
(~line 523) with:


#define TTY_PREFIX     "/dev/"
   
 if (strncmp(TTY_PREFIX, ttyn, sizeof(TTY_PREFIX)-1) == 0) {
      tty = (char *) malloc(sizeof(ttyn) - sizeof(TTY_PREFIX) + 2 );
      strncpy(tty,ttyn+sizeof(TTY_PREFIX)-1,sizeof(tty));
 }


I have, but don't know if "/" in tty will screw up anything.
I've also still switched the PAM_TTY like above because I feel
safer pam getting the full tty path ;)

Kenneth



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []