New upstream version 2.41.2
This commit is contained in:
+15
-8
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -89,8 +89,9 @@ build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/build-to-host.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \
|
||||
$(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
@@ -159,8 +160,6 @@ am__define_uniq_tagged_files = \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
am__relativize = \
|
||||
@@ -205,6 +204,8 @@ CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
@@ -216,8 +217,10 @@ ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
@@ -268,6 +271,7 @@ LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LSBLK = @LSBLK@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
@@ -277,8 +281,8 @@ MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
@@ -303,6 +307,7 @@ SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TR = @TR@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
@@ -355,6 +360,8 @@ libgtop_sysdeps_dir = @libgtop_sysdeps_dir@
|
||||
libgtop_top_builddir = @libgtop_top_builddir@
|
||||
libs_xauth = @libs_xauth@
|
||||
localedir = @localedir@
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
@@ -363,6 +370,7 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
server_programs = @server_programs@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
@@ -515,7 +523,6 @@ cscopelist-am: $(am__tagged_files)
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ suid_sysdeps =
|
||||
suid_common =
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = libgtop_daemon2 @server_programs@
|
||||
libexec_PROGRAMS = libgtop_daemon2 @server_programs@
|
||||
|
||||
EXTRA_PROGRAMS = libgtop_server2
|
||||
|
||||
@@ -52,5 +52,5 @@ libgtop_server2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \
|
||||
EXTRA_DIST = server_config.h.in server_config.pl
|
||||
|
||||
install-exec-hook:
|
||||
-@libgtop_postinstall@
|
||||
-test -n "$(DESTDIR)" || @libgtop_postinstall@
|
||||
|
||||
|
||||
+47
-39
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -88,12 +88,13 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
bin_PROGRAMS = libgtop_daemon2$(EXEEXT) @server_programs@
|
||||
libexec_PROGRAMS = libgtop_daemon2$(EXEEXT) @server_programs@
|
||||
EXTRA_PROGRAMS = libgtop_server2$(EXEEXT)
|
||||
subdir = src/daemon
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/build-to-host.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \
|
||||
$(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
@@ -110,8 +111,8 @@ mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am__installdirs = "$(DESTDIR)$(libexecdir)"
|
||||
PROGRAMS = $(libexec_PROGRAMS)
|
||||
am_libgtop_daemon2_OBJECTS = gnuserv.$(OBJEXT) slave.$(OBJEXT) \
|
||||
main.$(OBJEXT) io.$(OBJEXT) version.$(OBJEXT)
|
||||
libgtop_daemon2_OBJECTS = $(am_libgtop_daemon2_OBJECTS)
|
||||
@@ -196,8 +197,6 @@ am__define_uniq_tagged_files = \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
|
||||
ChangeLog
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -223,6 +222,8 @@ CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
@@ -234,8 +235,10 @@ ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
@@ -286,6 +289,7 @@ LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LSBLK = @LSBLK@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
@@ -295,8 +299,8 @@ MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
@@ -321,6 +325,7 @@ SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TR = @TR@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
@@ -373,6 +378,8 @@ libgtop_sysdeps_dir = @libgtop_sysdeps_dir@
|
||||
libgtop_top_builddir = @libgtop_top_builddir@
|
||||
libs_xauth = @libs_xauth@
|
||||
localedir = @localedir@
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
@@ -381,6 +388,7 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
server_programs = @server_programs@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
@@ -450,12 +458,12 @@ $(top_srcdir)/configure: $(am__configure_deps)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
install-libexecPROGRAMS: $(libexec_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
@list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
|
||||
if test -n "$$list"; then \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
|
||||
echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \
|
||||
$(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \
|
||||
fi; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
@@ -475,24 +483,24 @@ install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
uninstall-libexecPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
@list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' \
|
||||
`; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(bindir)" && rm -f $$files
|
||||
echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
clean-libexecPROGRAMS:
|
||||
@list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
@@ -605,7 +613,6 @@ cscopelist-am: $(am__tagged_files)
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
@@ -643,7 +650,7 @@ check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
for dir in "$(DESTDIR)$(libexecdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
@@ -678,7 +685,8 @@ maintainer-clean-generic:
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/gnuserv.Po
|
||||
@@ -709,7 +717,7 @@ install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
install-exec-am: install-libexecPROGRAMS
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
|
||||
install-html: install-html-am
|
||||
@@ -755,30 +763,30 @@ ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
uninstall-am: uninstall-libexecPROGRAMS
|
||||
|
||||
.MAKE: install-am install-exec-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
|
||||
clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
|
||||
ctags ctags-am distclean distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-binPROGRAMS \
|
||||
clean-generic clean-libexecPROGRAMS clean-libtool \
|
||||
cscopelist-am ctags ctags-am distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-dvi install-dvi-am \
|
||||
install-exec install-exec-am install-exec-hook install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
|
||||
uninstall-binPROGRAMS
|
||||
install-html-am install-info install-info-am \
|
||||
install-libexecPROGRAMS install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags tags-am uninstall uninstall-am uninstall-libexecPROGRAMS
|
||||
|
||||
.PRECIOUS: Makefile
|
||||
|
||||
|
||||
install-exec-hook:
|
||||
-@libgtop_postinstall@
|
||||
-test -n "$(DESTDIR)" || @libgtop_postinstall@
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
||||
+14
-6
@@ -392,6 +392,7 @@ handle_internet_request (int ls)
|
||||
int s;
|
||||
size_t addrlen = sizeof (struct sockaddr_in);
|
||||
struct sockaddr_in peer; /* for peer socket address */
|
||||
char addrstr[addrlen];
|
||||
pid_t pid;
|
||||
|
||||
memset ((char *) &peer, 0, sizeof (struct sockaddr_in));
|
||||
@@ -401,21 +402,24 @@ handle_internet_request (int ls)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* TODO: Check errno. */
|
||||
inet_ntop (AF_INET, &peer, addrstr, addrlen);
|
||||
|
||||
if (verbose_output)
|
||||
syslog_message (LOG_INFO, "Connection was made from %s port %u.",
|
||||
inet_ntoa (peer.sin_addr), ntohs (peer.sin_port));
|
||||
addrstr, ntohs (peer.sin_port));
|
||||
|
||||
/* Check that access is allowed - if not return crud to the client */
|
||||
if (!permitted (peer.sin_addr.s_addr, s)) {
|
||||
close (s);
|
||||
syslog_message (LOG_CRIT, "Refused connection from %s.",
|
||||
inet_ntoa (peer.sin_addr));
|
||||
addrstr);
|
||||
return;
|
||||
} /* if */
|
||||
|
||||
if (verbose_output)
|
||||
syslog_message (LOG_INFO, "Accepted connection from %s port %u.",
|
||||
inet_ntoa (peer.sin_addr), ntohs (peer.sin_port));
|
||||
addrstr, ntohs (peer.sin_port));
|
||||
|
||||
pid = fork ();
|
||||
|
||||
@@ -436,7 +440,7 @@ handle_internet_request (int ls)
|
||||
|
||||
if (verbose_output)
|
||||
syslog_message (LOG_INFO, "Closed connection to %s port %u.",
|
||||
inet_ntoa (peer.sin_addr), ntohs (peer.sin_port));
|
||||
addrstr, ntohs (peer.sin_port));
|
||||
|
||||
_exit (0);
|
||||
} /* handle_internet_request */
|
||||
@@ -560,6 +564,7 @@ main (int argc, char **argv)
|
||||
if (invoked_from_inetd) {
|
||||
size_t addrlen = sizeof (struct sockaddr_in);
|
||||
struct sockaddr_in peer;
|
||||
char addrstr[addrlen];
|
||||
|
||||
memset ((char *) &peer, 0, sizeof (struct sockaddr_in));
|
||||
|
||||
@@ -568,15 +573,18 @@ main (int argc, char **argv)
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/* TODO: Check errno. */
|
||||
inet_ntop (AF_INET, &peer, addrstr, addrlen);
|
||||
|
||||
if (verbose_output)
|
||||
syslog_message (LOG_INFO, "Connection was made from %s port %u.",
|
||||
inet_ntoa (peer.sin_addr), ntohs (peer.sin_port));
|
||||
addrstr, ntohs (peer.sin_port));
|
||||
|
||||
/* Check that access is allowed - if not return crud to the client */
|
||||
if (!permitted (peer.sin_addr.s_addr, 0)) {
|
||||
close (0);
|
||||
syslog_message (LOG_CRIT, "Refused connection from %s.",
|
||||
inet_ntoa (peer.sin_addr));
|
||||
addrstr);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -27,7 +27,7 @@ void
|
||||
do_output (int s, glibtop_response *resp, off_t offset,
|
||||
size_t data_size, const void *data)
|
||||
{
|
||||
glibtop_debug ("Really writing %d bytes at offset %lu.",
|
||||
glibtop_debug ("Really writing %zu bytes at offset %lu.",
|
||||
sizeof (glibtop_response), offset);
|
||||
|
||||
resp->offset = offset;
|
||||
@@ -42,7 +42,7 @@ do_output (int s, glibtop_response *resp, off_t offset,
|
||||
}
|
||||
|
||||
if (resp->data_size) {
|
||||
glibtop_debug ("Writing %d bytes of data.", resp->data_size);
|
||||
glibtop_debug ("Writing %lu bytes of data.", resp->data_size);
|
||||
|
||||
if (s == 0) {
|
||||
if (write (1, data, resp->data_size) < 0)
|
||||
@@ -84,7 +84,7 @@ do_read (int s, void *ptr, size_t total_size)
|
||||
tmp_ptr += nread;
|
||||
ptr = tmp_ptr;
|
||||
|
||||
glibtop_debug ("READ (%d): %d - %d - %d",
|
||||
glibtop_debug ("READ (%d): %zu - %zu - %zu",
|
||||
nread, already_read, remaining, total_size);
|
||||
}
|
||||
|
||||
|
||||
+11
-6
@@ -49,7 +49,7 @@ handle_parent_connection (int s)
|
||||
glibtop_server_features);
|
||||
|
||||
if (enable_debug)
|
||||
syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u",
|
||||
syslog_message (LOG_DEBUG, "SIZEOF: %zu - %zu - %zu - %zu - %zu - %zu",
|
||||
sizeof (glibtop_command), sizeof (glibtop_response),
|
||||
sizeof (glibtop_mountentry), sizeof (glibtop_union),
|
||||
sizeof (glibtop_sysdeps),
|
||||
@@ -58,12 +58,12 @@ handle_parent_connection (int s)
|
||||
while (do_read (s, cmnd, sizeof (glibtop_command))) {
|
||||
if (enable_debug)
|
||||
syslog_message (LOG_DEBUG,
|
||||
"Parent (%d) received command %llu from client.",
|
||||
"Parent (%d) received command %lu from client.",
|
||||
getpid (), cmnd->command);
|
||||
|
||||
if (cmnd->data_size >= BUFSIZ) {
|
||||
syslog_message (LOG_WARNING,
|
||||
"Client sent %llu bytes, but buffer is %lu",
|
||||
"Client sent %lu bytes, but buffer is %lu",
|
||||
cmnd->data_size, (unsigned long)BUFSIZ);
|
||||
return;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ handle_parent_connection (int s)
|
||||
|
||||
if (cmnd->data_size) {
|
||||
if (enable_debug)
|
||||
syslog_message (LOG_DEBUG, "Client has %llu bytes of data.",
|
||||
syslog_message (LOG_DEBUG, "Client has %lu bytes of data.",
|
||||
cmnd->data_size);
|
||||
|
||||
do_read (s, parameter, cmnd->data_size);
|
||||
@@ -97,6 +97,10 @@ handle_parent_connection (int s)
|
||||
glibtop_get_cpu_l (server, &resp->u.data.cpu);
|
||||
do_output (s, resp, _offset_data (cpu), 0, NULL);
|
||||
break;
|
||||
case GLIBTOP_CMND_DISK:
|
||||
glibtop_get_disk_l (server, &resp->u.data.disk);
|
||||
do_output (s, resp, _offset_data (disk), 0, NULL);
|
||||
break;
|
||||
case GLIBTOP_CMND_MEM:
|
||||
glibtop_get_mem_l (server, &resp->u.data.mem);
|
||||
do_output (s, resp, _offset_data (mem), 0, NULL);
|
||||
@@ -222,8 +226,9 @@ handle_parent_connection (int s)
|
||||
0, NULL);
|
||||
break;
|
||||
case GLIBTOP_CMND_PROC_IO:
|
||||
memcpy (&pid, parameter, sizeof (pid_t));
|
||||
glibtop_get_proc_io_l
|
||||
(server, &resp->u.data.proc_io, parameter);
|
||||
(server, &resp->u.data.proc_io, pid);
|
||||
do_output (s, resp, _offset_data (proc_io),
|
||||
0, NULL);
|
||||
break;
|
||||
@@ -240,7 +245,7 @@ handle_parent_connection (int s)
|
||||
0, NULL);
|
||||
break;
|
||||
default:
|
||||
syslog_message (LOG_ERR, "Parent received unknown command %llu.",
|
||||
syslog_message (LOG_ERR, "Parent received unknown command %lu.",
|
||||
cmnd->command);
|
||||
break;
|
||||
}
|
||||
|
||||
+10
-4
@@ -42,10 +42,10 @@ handle_slave_connection (int input, int output)
|
||||
|
||||
while (do_read (input, cmnd, sizeof (glibtop_command))) {
|
||||
glibtop_debug ("Slave %d received command "
|
||||
"%llu from client.", getpid (), cmnd->command);
|
||||
"%lu from client.", getpid (), cmnd->command);
|
||||
|
||||
if (cmnd->data_size >= BUFSIZ)
|
||||
glibtop_error ("Client sent %llu bytes, "
|
||||
glibtop_error ("Client sent %lu bytes, "
|
||||
"but buffer is %lu",
|
||||
cmnd->size, (unsigned long)BUFSIZ);
|
||||
|
||||
@@ -54,7 +54,7 @@ handle_slave_connection (int input, int output)
|
||||
memset (parameter, 0, sizeof (parameter));
|
||||
|
||||
if (cmnd->data_size) {
|
||||
glibtop_debug ("Client has %llu bytes of data.",
|
||||
glibtop_debug ("Client has %lu bytes of data.",
|
||||
cmnd->data_size);
|
||||
|
||||
do_read (input, parameter, cmnd->data_size);
|
||||
@@ -135,6 +135,12 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
||||
resp->offset = _offset_data (cpu);
|
||||
break;
|
||||
#endif
|
||||
#if GLIBTOP_SUID_DISK
|
||||
case GLIBTOP_CMND_DISK:
|
||||
glibtop_get_disk_p (server, &resp->u.data.disk);
|
||||
resp->offset = _offset_data (disk);
|
||||
break;
|
||||
#endif
|
||||
#if GLIBTOP_SUID_MEM
|
||||
case GLIBTOP_CMND_MEM:
|
||||
glibtop_get_mem_p (server, &resp->u.data.mem);
|
||||
@@ -255,7 +261,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
glibtop_error ("Child received unknown command %llu",
|
||||
glibtop_error ("Child received unknown command %lu",
|
||||
cmnd->command);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user