* Try to make utmpdump IPv6 valid, change based on suggestion from
Navdeep Bhatia (see local bug #32429)
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
sysvinit (2.89dsf) UNRELEASED; urgency=low
|
sysvinit (2.89dsf) UNRELEASED; urgency=low
|
||||||
|
|
||||||
[ Werner Fink ]
|
[ Werner Fink ]
|
||||||
|
* Try to make utmpdump IPv6 valid, change based on suggestion from
|
||||||
|
Navdeep Bhatia (see local bug #32429)
|
||||||
* Fix signal and alarm handling based on the patch from Florent Viard.
|
* Fix signal and alarm handling based on the patch from Florent Viard.
|
||||||
(was local bug #32304)
|
(was local bug #32304)
|
||||||
* Add fix for Redhat bug #573346: last incorrectly displays IPv6
|
* Add fix for Redhat bug #573346: last incorrectly displays IPv6
|
||||||
|
@@ -128,11 +128,21 @@ unspace(char *s, int len)
|
|||||||
void
|
void
|
||||||
print_utline(struct utmp ut)
|
print_utline(struct utmp ut)
|
||||||
{
|
{
|
||||||
char *addr_string, *time_string;
|
char addr_buf[INET6_ADDRSTRLEN+1];
|
||||||
struct in_addr in;
|
const char *addr_string, *time_string;
|
||||||
|
void *in_addr = &ut.ut_addr_v6;
|
||||||
|
size_t addr_length = INET6_ADDRSTRLEN;
|
||||||
|
int addr_family = AF_INET6;
|
||||||
|
|
||||||
in.s_addr = ut.ut_addr;
|
if (!ut.ut_addr_v6[1] && !ut.ut_addr_v6[2] && !ut.ut_addr_v6[3]) {
|
||||||
addr_string = inet_ntoa(in);
|
addr_family = AF_INET;
|
||||||
|
addr_length = INET_ADDRSTRLEN;
|
||||||
|
in_addr = &ut.ut_addr;
|
||||||
|
}
|
||||||
|
if ((addr_string = inet_ntop(addr_family, in_addr, addr_buf, addr_length)) == 0) {
|
||||||
|
addr_buf[0] = '\0';
|
||||||
|
addr_string = &addr_buf[0];
|
||||||
|
}
|
||||||
time_string = timetostr(ut.ut_time);
|
time_string = timetostr(ut.ut_time);
|
||||||
cleanse(ut.ut_id);
|
cleanse(ut.ut_id);
|
||||||
cleanse(ut.ut_user);
|
cleanse(ut.ut_user);
|
||||||
|
Reference in New Issue
Block a user