Re: [PATCH] agetty: Reprompt and reprint /etc/issue if we receive SIGUSR1

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

 



On Mon, Jul 07, 2014 at 09:31:24AM +0200, Stef Walter wrote:
>  /* Get user name, establish parity, speed, erase, kill & eol. */
>  static char *get_logname(struct options *op, struct termios *tp, struct chardata *cp)
>  {
> @@ -1625,9 +1676,18 @@ static char *get_logname(struct options *op, struct termios *tp, struct chardata
>  
>  	while (*logname == '\0') {
>  
> +		reprompt_flag = 0;
> +
>  		/* Write issue file and prompt */
>  		do_prompt(op, tp);
>  
> +		/* If asked to reprompt *before* terminal input arrives, then do so */
> +		if (!wait_for_term_input(STDIN_FILENO) && reprompt_flag != 0) {
> +			if (op->flags & F_VCONSOLE)
> +				termio_clear(STDOUT_FILENO);
> +			continue;
> +		}

 Now when I think about it.. would be better to have this feature
 optional? I think it's overkill to have it enabled on all machines. 
 
 The another story is the signal usage (and possible race with login(1) as 
 discussed at https://bugzilla.redhat.com/show_bug.cgi?id=1110763). 
 
 What about  for example: 

   agetty --reload-trigger <file>

 and use inotify for the <file>. I guess this way also allows to avoid
 the ioctl() tty voodoo and you can use select() for the inotify and
 tty file descriptors.


  Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux