[Nagiosplug-checkins] CVS: nagiosplug/plugins check_mysql.c,1.6,1.7
Karl DeBisschop
karl at debisschop.net
Mon Feb 10 21:25:08 CET 2003
On Mon, 2003-02-10 at 19:47, Ton Voon wrote:
> Update of /cvsroot/nagiosplug/nagiosplug/plugins
> In directory sc8-pr-cvs1:/tmp/cvs-serv22448
>
> Modified Files:
> check_mysql.c
> Log Message:
> Patch by Dave Viner for seg fault on RH 7.3 (655903)
I'm backing this out -- I had applied a patch to do what Dave Viner
requested, but also noted that segfaults were possible for arguments
that Dvae did not address. You've reversed those checks of argc.
>
> Index: check_mysql.c
> ===================================================================
> RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mysql.c,v
> retrieving revision 1.6
> retrieving revision 1.7
> diff -C2 -r1.6 -r1.7
> *** check_mysql.c 29 Jan 2003 06:38:00 -0000 1.6
> --- check_mysql.c 11 Feb 2003 00:47:47 -0000 1.7
> ***************
> *** 190,212 ****
> c = optind;
>
> ! if (strlen(db_host) == 0 && argc > c)
> ! if (is_host (argv[c])) {
> ! db_host = argv[c++];
> ! }
> ! else {
> ! usage ("Invalid host name");
> ! }
>
> ! if (strlen(db_user) == 0 && argc > c)
> ! db_user = argv[c++];
> !
> ! if (strlen(db_pass) == 0 && argc > c)
> ! db_pass = argv[c++];
> !
> ! if (strlen(db) == 0 && argc > c)
> ! db = argv[c++];
> !
> ! if (is_intnonneg (argv[c]) && argc > c)
> ! db_port = atoi (argv[c++]);
>
> return validate_arguments ();
> --- 190,213 ----
> c = optind;
>
> ! while ( argc > c ) {
>
> ! if (strlen(db_host) == 0)
> ! if (is_host (argv[c])) {
> ! db_host = argv[c++];
> ! }
> ! else {
> ! usage ("Invalid host name");
> ! }
> ! else if (strlen(db_user) == 0)
> ! db_user = argv[c++];
> ! else if (strlen(db_pass) == 0)
> ! db_pass = argv[c++];
> ! else if (strlen(db) == 0)
> ! db = argv[c++];
> ! else if (is_intnonneg (argv[c]))
> ! db_port = atoi (argv[c++]);
> ! else
> ! break;
> ! }
>
> return validate_arguments ();
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Nagiosplug-checkins mailing list
> Nagiosplug-checkins at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-checkins
More information about the Commits
mailing list