$OpenBSD: patch-snmp_c,v 1.1 2002/03/24 07:55:53 jsyn Exp $ --- snmp.c.orig Wed Feb 17 01:20:05 1999 +++ snmp.c Sun Mar 24 00:12:22 2002 @@ -33,6 +33,8 @@ #include #include #include +#include +#include struct snmpchex @@ -239,8 +241,9 @@ return (i + 2); } - else + else { return (-1); + } } } } @@ -300,7 +303,7 @@ memset (buf, 0, sizeofbuf); i = getreq (buf, namez, GETREQ_SYSDEC, id, set_req); memcpy ((buf + i), sysdec, GETREQ_SYSDEC); - return (sendto (sock, buf, i + GETREQ_SYSDEC, 0, sin, sizeof (struct sockaddr_in))); + return (sendto (sock, buf, i + GETREQ_SYSDEC, 0, (const struct sockaddr *)sin, sizeof (struct sockaddr_in))); } /** getreq paket **/ @@ -460,7 +463,7 @@ i = 0; /** we get an answer !!!! */ - if ((i = recvfrom (sock, (char *) &buf, sizeof (buf), 0, &sin, &x)) > 0) + if ((i = recvfrom (sock, (char *) &buf, sizeof (buf), 0, (struct sockaddr *)&sin, &x)) > 0) { nd = 0; /** extract the ID the return code and the community name **/ @@ -536,15 +539,15 @@ usage (char *name) { printf ("ADMsnmp v %s (c) The ADM crew\n", "0.1"); - printf ("%s: [-g,-wordf,-out , [-waitf,-sleep, -manysend,-inter <#>] ] \n", name); - printf (" : host to scan \n" - "[-guessname] : guess password with hostname \n" + printf ("%s: [-g,-wordf,-out , [-waitf,-sleep, -manysend,-inter <#>] ]\n", name); + printf (" : host to scan\n" + "[-guessname] : guess password with hostname\n" "[-wordfile] : wordlist of password to try\n" "[-outputfile] : output file\n" - "[-waitfor] : time in milisecond in each send of snmprequest\n" - "[-sleep] : time in second of the scan process life\n" - "[-manysend] : how many paket to send by request \n" - "[-inter] : time to wait in milisecond after each request"); + "[-waitfor] : time in milisecond in each send of snmprequest\n" + "[-sleep] : time in second of the scan process life\n" + "[-manysend] : how many paket to send by request\n" + "[-inter] : time to wait in milisecond after each request\n"); } int @@ -581,7 +584,7 @@ printf ("cant resolve hostname!\n"); exit (-1); } - opz.wordfile = strdup ("snmp.passwd"); + opz.wordfile = strdup ("PORTSHAREDIR/snmp.passwd"); opz.outputfile = NULL; opz.guess = -1; opz.manysend = 2;