Date: Wed, 20 Jun 2007 04:04:10 GMT From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 122005 for review Message-ID: <200706200404.l5K44AAG004908@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122005 Change 122005 by csjp@push on 2007/06/20 04:03:21 Teach id(1) about extended auditinfo data. This un-breaks id -A for subjects who have ip6 addresses associated with them. Affected files ... .. //depot/projects/trustedbsd/audit3/usr.bin/id/id.c#7 edit Differences ... ==== //depot/projects/trustedbsd/audit3/usr.bin/id/id.c#7 (text+ko) ==== @@ -313,14 +313,42 @@ auditid(void) { auditinfo_t auditinfo; + auditinfo_addr_t ainfo_addr; + int ret, extended; - if (getaudit(&auditinfo) < 0) + extended = 0; + ret = getaudit(&auditinfo); + if (ret < 0 && errno == E2BIG) { + if (getaudit_addr(&ainfo_addr, sizeof(ainfo_addr)) < 0) + err(1, "getaudit_addr"); + extended = 1; + } else if (ret < 0) err(1, "getaudit"); - printf("auid=%d\n", auditinfo.ai_auid); - printf("mask.success=0x%08x\n", auditinfo.ai_mask.am_success); - printf("mask.failure=0x%08x\n", auditinfo.ai_mask.am_failure); - printf("termid.port=0x%08x\n", auditinfo.ai_termid.port); - printf("asid=%d\n", auditinfo.ai_asid); + if (extended != 0) { + printf("auid=%d\n", ainfo_addr.ai_auid); + printf("mask.success=0x%08x\n", ainfo_addr.ai_mask.am_success); + printf("mask.failure=0x%08x\n", ainfo_addr.ai_mask.am_failure); + printf("asid=%d\n", ainfo_addr.ai_asid); + printf("termid_addr.port=0x%08x\n", + ainfo_addr.ai_termid.at_port); + printf("termid_addr.addr[0]=0x%08x\n" + "termid_addr.addr[1]=0x%08x\n" + "termid_addr.addr[2]=0x%08x\n" + "termid_addr.addr[3]=0x%08x\n", + ainfo_addr.ai_termid.at_addr[0], + ainfo_addr.ai_termid.at_addr[1], + ainfo_addr.ai_termid.at_addr[2], + ainfo_addr.ai_termid.at_addr[3]); + } else { + printf("auid=%d\n", auditinfo.ai_auid); + printf("mask.success=0x%08x\n", auditinfo.ai_mask.am_success); + printf("mask.failure=0x%08x\n", auditinfo.ai_mask.am_failure); + printf("asid=%d\n", auditinfo.ai_asid); + printf("termid.port=0x%08x\n", + auditinfo.ai_termid.port); + printf("termid.machine=0x%08x\n", + auditinfo.ai_termid.machine); + } } #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706200404.l5K44AAG004908>