nagios-plug-1.4.16 Compile on ubuntu 13.04 error

Bug #1176277 reported by jack-dong
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
nagios (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

jack@ubuntu:~/nagios-plugins-1.4.16$ sudo make
make all-recursive
make[1]: Entering directory `/home/jack/nagios-plugins-1.4.16'
Making all in gl
make[2]: Entering directory `/home/jack/nagios-plugins-1.4.16/gl'
rm -f configmake.h-t && \
 { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
   echo '#define PREFIX "/usr/local/nagios"'; \
   echo '#define EXEC_PREFIX "/usr/local/nagios"'; \
   echo '#define BINDIR "/usr/local/nagios/bin"'; \
   echo '#define SBINDIR "/usr/local/nagios/sbin"'; \
   echo '#define LIBEXECDIR "/usr/local/nagios/libexec"'; \
   echo '#define DATAROOTDIR "/usr/local/nagios/share"'; \
   echo '#define DATADIR "/usr/local/nagios/share"'; \
   echo '#define SYSCONFDIR "/usr/local/nagios/etc"'; \
   echo '#define SHAREDSTATEDIR "/usr/local/nagios/com"'; \
   echo '#define LOCALSTATEDIR "/usr/local/nagios/var"'; \
   echo '#define INCLUDEDIR "/usr/local/nagios/include"'; \
   echo '#define OLDINCLUDEDIR "/usr/include"'; \
   echo '#define DOCDIR "/usr/local/nagios/share/doc/nagios-plugins"'; \
   echo '#define INFODIR "/usr/local/nagios/share/info"'; \
   echo '#define HTMLDIR "/usr/local/nagios/share/doc/nagios-plugins"'; \
   echo '#define DVIDIR "/usr/local/nagios/share/doc/nagios-plugins"'; \
   echo '#define PDFDIR "/usr/local/nagios/share/doc/nagios-plugins"'; \
   echo '#define PSDIR "/usr/local/nagios/share/doc/nagios-plugins"'; \
   echo '#define LIBDIR "/usr/local/nagios/lib"'; \
   echo '#define LISPDIR ""'; \
   echo '#define LOCALEDIR "/usr/local/nagios/share/locale"'; \
   echo '#define MANDIR "/usr/local/nagios/share/man"'; \
   echo '#define MANEXT ""'; \
   echo '#define PKGDATADIR "/usr/local/nagios/share/nagios-plugins"'; \
   echo '#define PKGINCLUDEDIR "/usr/local/nagios/include/nagios-plugins"'; \
   echo '#define PKGLIBDIR "/usr/local/nagios/lib/nagios-plugins"'; \
   echo '#define PKGLIBEXECDIR "/usr/local/nagios/libexec/nagios-plugins"'; \
 } | sed '/""/d' > configmake.h-t && \
 if test -f configmake.h && cmp configmake.h-t configmake.h > /dev/null; then \
   rm -f configmake.h-t; \
 else \
   rm -f configmake.h; mv configmake.h-t configmake.h; \
 fi
make all-recursive
make[3]: Entering directory `/home/jack/nagios-plugins-1.4.16/gl'
make[4]: Entering directory `/home/jack/nagios-plugins-1.4.16/gl'
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT base64.o -MD -MP -MF .deps/base64.Tpo -c -o base64.o base64.c
mv -f .deps/base64.Tpo .deps/base64.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT close-hook.o -MD -MP -MF .deps/close-hook.Tpo -c -o close-hook.o close-hook.c
mv -f .deps/close-hook.Tpo .deps/close-hook.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT exitfail.o -MD -MP -MF .deps/exitfail.Tpo -c -o exitfail.o exitfail.c
mv -f .deps/exitfail.Tpo .deps/exitfail.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT full-read.o -MD -MP -MF .deps/full-read.Tpo -c -o full-read.o full-read.c
mv -f .deps/full-read.Tpo .deps/full-read.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT full-write.o -MD -MP -MF .deps/full-write.Tpo -c -o full-write.o full-write.c
mv -f .deps/full-write.Tpo .deps/full-write.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -g -O2 -MT localcharset.o -MD -MP -MF .deps/localcharset.Tpo -c -o localcharset.o localcharset.c
In file included from localcharset.c:28:0:
./stdio.h:456:1: error: ‘gets’ undeclared here (not in a function)
make[4]: *** [localcharset.o] Error 1
make[4]: Leaving directory `/home/jack/nagios-plugins-1.4.16/gl'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/jack/nagios-plugins-1.4.16/gl'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/jack/nagios-plugins-1.4.16/gl'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jack/nagios-plugins-1.4.16'
make: *** [all] Error 2

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-control-center (Ubuntu):
status: New → Confirmed
affects: gnome-control-center (Ubuntu) → nagios (Ubuntu)
Revision history for this message
edward francisco (edward-francisco) wrote :

any solution for this ?

Revision history for this message
Denzil Villarico (dvillarico) wrote :

Would love to see a fix soon! :)

Revision history for this message
edward francisco (edward-francisco) wrote :

does anyone care to fix this issue ?

Revision history for this message
Aaron (clonemeagain) wrote :

I just changed (gets,...) to (fgets,...) worked!

/* It is very rare that the developer ever has full control of stdin,
   so any use of gets warrants an unconditional warning. Assume it is
   always declared, since it is required by C89. */
#undef gets
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+_GL_WARN_ON_USE (gets, "fgets is a security hole - use fgets instead");

Of course.. don't know why this worked.. seemed like a good idea at the time.

Revision history for this message
Aaron (clonemeagain) wrote :

Bah, I meant:

_GL_WARN_ON_USE (fgets, "gets is a security hole - use fgets instead");

Revision history for this message
Eliezer Croitoru (eliezer) wrote :

in RH they fixed the bug in another way with the next patch:

Patch applied:
----------
--- nagios-plugins-1.4.15-orig/gl/stdio.in.h 2010-07-27 21:47:15.000000000 +0100
+++ nagios-plugins-1.4.15/gl/stdio.in.h 2012-06-26 21:12:47.000000000 +0100
@@ -140,8 +140,10 @@
 /* It is very rare that the developer ever has full control of stdin,
    so any use of gets warrants an unconditional warning. Assume it is
    always declared, since it is required by C89. */
+#if defined gets
 #undef gets
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif

 #if @GNULIB_FOPEN@
 # if @REPLACE_FOPEN@
----------

https://bugzilla.redhat.com/show_bug.cgi?id=835621#c6

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.