diff options
author | 2005-03-05 07:59:38 +0000 | |
---|---|---|
committer | 2005-03-05 07:59:38 +0000 | |
commit | cdbf7239f3895e5dbd832984f898291a45db8690 (patch) | |
tree | d2c0fe27ce77be6f95b074bb9f999ba6a7a1ba6d /net-analyzer/nbtscan/files | |
parent | Cleaning up old versions (diff) | |
download | historical-cdbf7239f3895e5dbd832984f898291a45db8690.tar.gz historical-cdbf7239f3895e5dbd832984f898291a45db8690.tar.bz2 historical-cdbf7239f3895e5dbd832984f898291a45db8690.zip |
Revision bump; add patch that fixes -s output (bug 84139). Thanks to Josh Nichols <nichoj@rpi.edu> for the patch.
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'net-analyzer/nbtscan/files')
-rw-r--r-- | net-analyzer/nbtscan/files/digest-nbtscan-1.5.1-r1 | 1 | ||||
-rw-r--r-- | net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch | 122 |
2 files changed, 123 insertions, 0 deletions
diff --git a/net-analyzer/nbtscan/files/digest-nbtscan-1.5.1-r1 b/net-analyzer/nbtscan/files/digest-nbtscan-1.5.1-r1 new file mode 100644 index 000000000000..651f8a7c4c2c --- /dev/null +++ b/net-analyzer/nbtscan/files/digest-nbtscan-1.5.1-r1 @@ -0,0 +1 @@ +MD5 85bb085077c380b82a6ff73e0de0c154 nbtscan-1.5.1.tar.gz 82107 diff --git a/net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch b/net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch new file mode 100644 index 000000000000..51c823882576 --- /dev/null +++ b/net-analyzer/nbtscan/files/nbtscan-1.5.1-script-whitespace.patch @@ -0,0 +1,122 @@ +Only in nbtscan-1.5.1a: config.log +Only in nbtscan-1.5.1a: config.status +diff -u nbtscan-1.5.1a/nbtscan.c nbtscan-1.5.1a-work/nbtscan.c +--- nbtscan-1.5.1a/nbtscan.c 2003-06-06 08:14:00.000000000 -0400 ++++ nbtscan-1.5.1a-work/nbtscan.c 2003-06-30 13:20:22.000000000 -0400 +@@ -86,7 +86,7 @@ + int d_print_hostinfo(struct in_addr addr, const struct nb_host_info* hostinfo) { + int i; + unsigned char service; /* 16th byte of NetBIOS name */ +- char name[16]; ++ char comp_name[16]; + + printf("\nPacket dump for Host %s:\n\n", inet_ntoa(addr)); + if(hostinfo->is_broken) printf("Incomplete packet, %d bytes long.\n", hostinfo->is_broken); +@@ -110,9 +110,9 @@ + 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; +- printf("%-17s Service: 0x%02x Flags: 0x%04x\n", name, service, hostinfo->names[i].rr_flags); ++ strncpy(comp_name, hostinfo->names[i].ascii_name, 15); ++ comp_name[16]=0; ++ printf("%-17s Service: 0x%02x Flags: 0x%04x\n", comp_name, service, hostinfo->names[i].rr_flags); + } + }; + +@@ -147,9 +147,9 @@ + + + int v_print_hostinfo(struct in_addr addr, const struct nb_host_info* hostinfo, char* sf, int hr) { +- int i, unique; ++ int i, j, unique; + my_uint8_t service; /* 16th byte of NetBIOS name */ +- char name[16]; ++ char comp_name[16]; + char* sname; + + if(!sf) { +@@ -163,20 +163,27 @@ + 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; ++ strncpy(comp_name, hostinfo->names[i].ascii_name, 15); ++ ++ // Eliminate trailing spaces ++ for(j=0; j < 15; j++) { ++ if (comp_name[j] == ' ') ++ break; ++ } ++ comp_name[j] = 0; ++ + unique = !(hostinfo->names[i].rr_flags & 0x0080); + if(sf) { +- printf("%s%s%s%s", inet_ntoa(addr), sf, name, sf); +- if(hr) printf("%s\n", (char*)getnbservicename(service, unique, name)); ++ printf("%s%s%s%s", inet_ntoa(addr), sf, comp_name, sf); ++ if(hr) printf("%s\n", (char*)getnbservicename(service, unique, comp_name)); + else { + printf("%02x", service); + if(unique) printf("U\n"); + else printf("G\n"); + } + } else { +- printf("%-17s", name); +- if(hr) printf("%s\n", (char*)getnbservicename(service, unique, name)); ++ printf("%-17s", comp_name); ++ if(hr) printf("%s\n", (char*)getnbservicename(service, unique, comp_name)); + else { + printf("<%02x>", service); + if(unique) printf(" UNIQUE\n"); +@@ -199,7 +206,7 @@ + }; + + int print_hostinfo(struct in_addr addr, struct nb_host_info* hostinfo, char* sf) { +- int i; ++ int i,j; + unsigned char service; /* 16th byte of NetBIOS name */ + char comp_name[16], user_name[16]; + int is_server=0; +@@ -215,7 +222,13 @@ + if(service == 0 && unique && first_name) { + /* Unique name, workstation service - this is computer name */ + strncpy(comp_name, hostinfo->names[i].ascii_name, 15); +- comp_name[15] = 0; ++ ++ // Eliminate trailing spaces ++ for(j=0; j < 15; j++) { ++ if (comp_name[j] == ' ') ++ break; ++ } ++ comp_name[j] = 0; + first_name = 0; + }; + if(service == 0x20 && unique) { +@@ -252,7 +265,7 @@ + /* If l is true adds #PRE to each line of output (for lmhosts) */ + + int l_print_hostinfo(struct in_addr addr, struct nb_host_info* hostinfo, int l) { +- int i; ++ int i,j; + unsigned char service; /* 16th byte of NetBIOS name */ + char comp_name[16]; + int is_server=0; +@@ -268,7 +281,13 @@ + if(service == 0 && unique && first_name) { + /* Unique name, workstation service - this is computer name */ + strncpy(comp_name, hostinfo->names[i].ascii_name, 15); +- comp_name[15]=0; ++ ++ // Eliminate trailing spaces ++ for(j=0; j < 15; j++) { ++ if (comp_name[j] == ' ') ++ break; ++ } ++ comp_name[j] = 0; + first_name = 0; + }; + }; + |