Hi, I'm trying to use lastlog(8) to get the full hostname of each user last<br>connection, but because up to only 16 characters are printed from<br>this string sometimes the domain part is truncated.<br><br>(code taken from lastlog.c, shadow-4.1.4)<br>
<br>#ifdef HAVE_LL_HOST<br> printf ("%-16s %-8.8s %-16.16s %s\n",<br> pw->pw_name, ll.ll_line, ll.ll_host, cp);<br>#else<br> printf ("%-16s\t%-8.8s %s\n",<br> pw->pw_name, ll.ll_line, cp);<br>
#endif<br><br>I think a configuration switch or alternative method (e.g. support for<br>current terminal width setting, detect if output goes to the terminal or a<br>file, etc.) should be introduced to allow an administrator to either see the<br>
full name or show numerical addresses only (a sort of -n option).<br><br>How do you think will be the best way to achieve this? I am willing to help<br>with implementation it once we decide what to do.<br><br>Thanks,<br>--<br>
Antonio Bonifati (programmer, sysadmin), Italy<br><a href="http://monitor.deis.unical.it/ant">http://monitor.deis.unical.it/ant</a><br>