On 2008/01/14 22:04, Lewandowski Robert wrote: > NBTSCAN is a great program and it would be nice if it works from the package.
here's a diff against -current ports to test, it didn't blow up on amd64/i386/sparc64, but I only tested it quickly. N.B. mkdir patches before applying. Index: Makefile =================================================================== RCS file: /cvs/ports/net/nbtscan/Makefile,v retrieving revision 1.9 diff -u -p -r1.9 Makefile --- Makefile 15 Sep 2007 22:36:55 -0000 1.9 +++ Makefile 14 Jan 2008 22:07:31 -0000 @@ -2,8 +2,7 @@ COMMENT= NetBIOS name network scanner -DISTNAME= nbtscan-1.5 -PKGNAME= ${DISTNAME}p0 +DISTNAME= nbtscan-1.5.1 CATEGORIES= net MASTER_SITES= http://www.inetcat.net/software/ @@ -15,6 +14,8 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes WANTLIB= c + +WRKDIST= ${WRKDIR}/${DISTNAME}a NO_REGRESS= Yes Index: distinfo =================================================================== RCS file: /cvs/ports/net/nbtscan/distinfo,v retrieving revision 1.4 diff -u -p -r1.4 distinfo --- distinfo 5 Apr 2007 16:20:11 -0000 1.4 +++ distinfo 14 Jan 2008 22:07:31 -0000 @@ -1,5 +1,5 @@ -MD5 (nbtscan-1.5.tar.gz) = G+VehD/xCv1B6ZgJKGbxlA== -RMD160 (nbtscan-1.5.tar.gz) = haA8dao/5Hn0Lt5zerXVitisy9o= -SHA1 (nbtscan-1.5.tar.gz) = Ly922MgYH9SVKuo7zD0wwl3798w= -SHA256 (nbtscan-1.5.tar.gz) = Vj7eZAMPNGuYhhiENmjl0whfKdNBPNyThHp04Kn9P5w= -SIZE (nbtscan-1.5.tar.gz) = 76791 +MD5 (nbtscan-1.5.1.tar.gz) = hbsIUHfDgLgqb/c+DeDBVA== +RMD160 (nbtscan-1.5.1.tar.gz) = UTDZ5t7NM0aFkoH0X4oXmqAoakI= +SHA1 (nbtscan-1.5.1.tar.gz) = QEHY9rWS+jELjTx5xWotMmPbqC8= +SHA256 (nbtscan-1.5.1.tar.gz) = +fldVVU1bI1GelduadnTSL8qgh3tmoX4lbXm0h4qp+s= +SIZE (nbtscan-1.5.1.tar.gz) = 82107 Index: patches/patch-nbtscan_c =================================================================== RCS file: patches/patch-nbtscan_c diff -N patches/patch-nbtscan_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-nbtscan_c 14 Jan 2008 22:07:31 -0000 @@ -0,0 +1,23 @@ +$OpenBSD$ +--- nbtscan.c.orig Mon Jan 14 22:01:40 2008 ++++ nbtscan.c Mon Jan 14 22:02:34 2008 +@@ -110,8 +110,7 @@ int d_print_hostinfo(struct in_addr addr, const struct + printf("Names received:\n"); + for(i=0; i< hostinfo->header->number_of_names; i++) { + service = hostinfo->names[i].ascii_name[15]; +- strncpy(name, hostinfo->names[i].ascii_name, 15); +- name[16]=0; ++ strlcpy(name, hostinfo->names[i].ascii_name, 16); + printf("%-17s Service: 0x%02x Flags: 0x%04x\n", name, service, hostinfo->names[i].rr_flags); + } + }; +@@ -163,8 +162,7 @@ int v_print_hostinfo(struct in_addr addr, const struct + if(hostinfo->header && hostinfo->names) { + for(i=0; i< hostinfo->header->number_of_names; i++) { + service = hostinfo->names[i].ascii_name[15]; +- strncpy(name, hostinfo->names[i].ascii_name, 15); +- name[16]=0; ++ strlcpy(name, hostinfo->names[i].ascii_name, 16); + unique = !(hostinfo->names[i].rr_flags & 0x0080); + if(sf) { + printf("%s%s%s%s", inet_ntoa(addr), sf, name, sf);