New upstream version 2.39.90

This commit is contained in:
Jeremy Bicha
2019-02-07 21:52:40 -05:00
133 changed files with 7365 additions and 4292 deletions

View File

@@ -1,6 +1,6 @@
AM_CPPFLAGS = @AM_CPPFLAGS@
noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la
noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la
EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c
@@ -17,7 +17,9 @@ libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@
# libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h
libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c
libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h glibtop_suid.h
libgtopincludedir = $(includedir)/libgtop-2.0
noinst_HEADERS = glibtop_private.h

View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,6 +124,10 @@ AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
libgtop_sysdeps_suid_2_0_la_LIBADD =
am_libgtop_sysdeps_suid_2_0_la_OBJECTS = suid_open.lo
libgtop_sysdeps_suid_2_0_la_OBJECTS = \
$(am_libgtop_sysdeps_suid_2_0_la_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
@@ -138,7 +142,24 @@ am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/close.Plo ./$(DEPDIR)/cpu.Plo \
./$(DEPDIR)/fsusage.Plo ./$(DEPDIR)/glibtop_private.Plo \
./$(DEPDIR)/loadavg.Plo ./$(DEPDIR)/mem.Plo \
./$(DEPDIR)/mountlist.Plo ./$(DEPDIR)/msg_limits.Plo \
./$(DEPDIR)/netlist.Plo ./$(DEPDIR)/netload.Plo \
./$(DEPDIR)/open.Plo ./$(DEPDIR)/ppp.Plo \
./$(DEPDIR)/procaffinity.Plo ./$(DEPDIR)/procargs.Plo \
./$(DEPDIR)/procio.Plo ./$(DEPDIR)/prockernel.Plo \
./$(DEPDIR)/proclist.Plo ./$(DEPDIR)/procmap.Plo \
./$(DEPDIR)/procmem.Plo ./$(DEPDIR)/procopenfiles.Plo \
./$(DEPDIR)/procsegment.Plo ./$(DEPDIR)/procsignal.Plo \
./$(DEPDIR)/procstate.Plo ./$(DEPDIR)/proctime.Plo \
./$(DEPDIR)/procuid.Plo ./$(DEPDIR)/procwd.Plo \
./$(DEPDIR)/sem_limits.Plo ./$(DEPDIR)/shm_limits.Plo \
./$(DEPDIR)/siglist.Plo ./$(DEPDIR)/suid_open.Plo \
./$(DEPDIR)/swap.Plo ./$(DEPDIR)/sysinfo.Plo \
./$(DEPDIR)/uptime.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -158,8 +179,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES)
DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES)
SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \
$(libgtop_sysdeps_suid_2_0_la_SOURCES)
DIST_SOURCES = $(libgtop_sysdeps_2_0_la_SOURCES) \
$(libgtop_sysdeps_suid_2_0_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -402,7 +425,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la
noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la
EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c
libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
uptime.c loadavg.c shm_limits.c msg_limits.c \
@@ -416,7 +439,8 @@ libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@
# libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO)
libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h
libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c
libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h glibtop_suid.h
libgtopincludedir = $(includedir)/libgtop-2.0
noinst_HEADERS = glibtop_private.h
all: all-am
@@ -440,8 +464,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -467,44 +491,54 @@ clean-noinstLTLIBRARIES:
libgtop_sysdeps-2.0.la: $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_2_0_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libgtop_sysdeps_2_0_la_OBJECTS) $(libgtop_sysdeps_2_0_la_LIBADD) $(LIBS)
libgtop_sysdeps_suid-2.0.la: $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_DEPENDENCIES) $(EXTRA_libgtop_sysdeps_suid_2_0_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) $(libgtop_sysdeps_suid_2_0_la_OBJECTS) $(libgtop_sysdeps_suid_2_0_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsusage.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glibtop_private.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadavg.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mem.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mountlist.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_limits.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlist.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netload.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppp.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procaffinity.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procargs.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procio.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prockernel.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proclist.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmap.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procmem.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procopenfiles.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsegment.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procsignal.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procstate.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proctime.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procuid.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procwd.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sem_limits.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm_limits.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siglist.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suid_open.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uptime.Plo@am__quote@ # am--include-marker
$(am__depfiles_remade):
@$(MKDIR_P) $(@D)
@echo '# dummy' >$@-t && $(am__mv) $@-t $@
am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -606,7 +640,10 @@ cscopelist-am: $(am__tagged_files)
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
@@ -679,7 +716,39 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/close.Plo
-rm -f ./$(DEPDIR)/cpu.Plo
-rm -f ./$(DEPDIR)/fsusage.Plo
-rm -f ./$(DEPDIR)/glibtop_private.Plo
-rm -f ./$(DEPDIR)/loadavg.Plo
-rm -f ./$(DEPDIR)/mem.Plo
-rm -f ./$(DEPDIR)/mountlist.Plo
-rm -f ./$(DEPDIR)/msg_limits.Plo
-rm -f ./$(DEPDIR)/netlist.Plo
-rm -f ./$(DEPDIR)/netload.Plo
-rm -f ./$(DEPDIR)/open.Plo
-rm -f ./$(DEPDIR)/ppp.Plo
-rm -f ./$(DEPDIR)/procaffinity.Plo
-rm -f ./$(DEPDIR)/procargs.Plo
-rm -f ./$(DEPDIR)/procio.Plo
-rm -f ./$(DEPDIR)/prockernel.Plo
-rm -f ./$(DEPDIR)/proclist.Plo
-rm -f ./$(DEPDIR)/procmap.Plo
-rm -f ./$(DEPDIR)/procmem.Plo
-rm -f ./$(DEPDIR)/procopenfiles.Plo
-rm -f ./$(DEPDIR)/procsegment.Plo
-rm -f ./$(DEPDIR)/procsignal.Plo
-rm -f ./$(DEPDIR)/procstate.Plo
-rm -f ./$(DEPDIR)/proctime.Plo
-rm -f ./$(DEPDIR)/procuid.Plo
-rm -f ./$(DEPDIR)/procwd.Plo
-rm -f ./$(DEPDIR)/sem_limits.Plo
-rm -f ./$(DEPDIR)/shm_limits.Plo
-rm -f ./$(DEPDIR)/siglist.Plo
-rm -f ./$(DEPDIR)/suid_open.Plo
-rm -f ./$(DEPDIR)/swap.Plo
-rm -f ./$(DEPDIR)/sysinfo.Plo
-rm -f ./$(DEPDIR)/uptime.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -725,7 +794,39 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f ./$(DEPDIR)/close.Plo
-rm -f ./$(DEPDIR)/cpu.Plo
-rm -f ./$(DEPDIR)/fsusage.Plo
-rm -f ./$(DEPDIR)/glibtop_private.Plo
-rm -f ./$(DEPDIR)/loadavg.Plo
-rm -f ./$(DEPDIR)/mem.Plo
-rm -f ./$(DEPDIR)/mountlist.Plo
-rm -f ./$(DEPDIR)/msg_limits.Plo
-rm -f ./$(DEPDIR)/netlist.Plo
-rm -f ./$(DEPDIR)/netload.Plo
-rm -f ./$(DEPDIR)/open.Plo
-rm -f ./$(DEPDIR)/ppp.Plo
-rm -f ./$(DEPDIR)/procaffinity.Plo
-rm -f ./$(DEPDIR)/procargs.Plo
-rm -f ./$(DEPDIR)/procio.Plo
-rm -f ./$(DEPDIR)/prockernel.Plo
-rm -f ./$(DEPDIR)/proclist.Plo
-rm -f ./$(DEPDIR)/procmap.Plo
-rm -f ./$(DEPDIR)/procmem.Plo
-rm -f ./$(DEPDIR)/procopenfiles.Plo
-rm -f ./$(DEPDIR)/procsegment.Plo
-rm -f ./$(DEPDIR)/procsignal.Plo
-rm -f ./$(DEPDIR)/procstate.Plo
-rm -f ./$(DEPDIR)/proctime.Plo
-rm -f ./$(DEPDIR)/procuid.Plo
-rm -f ./$(DEPDIR)/procwd.Plo
-rm -f ./$(DEPDIR)/sem_limits.Plo
-rm -f ./$(DEPDIR)/shm_limits.Plo
-rm -f ./$(DEPDIR)/siglist.Plo
-rm -f ./$(DEPDIR)/suid_open.Plo
-rm -f ./$(DEPDIR)/swap.Plo
-rm -f ./$(DEPDIR)/sysinfo.Plo
-rm -f ./$(DEPDIR)/uptime.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -746,20 +847,20 @@ uninstall-am: uninstall-libgtopincludeHEADERS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES 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-html install-html-am install-info \
install-info-am install-libgtopincludeHEADERS 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-libgtopincludeHEADERS
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-libtool clean-noinstLTLIBRARIES \
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-html install-html-am \
install-info install-info-am install-libgtopincludeHEADERS \
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-libgtopincludeHEADERS
.PRECIOUS: Makefile

View File

@@ -28,6 +28,10 @@ G_BEGIN_DECLS
struct _glibtop_machine
{
uid_t uid;
uid_t euid;
gid_t gid;
gid_t egid;
};
G_END_DECLS

View File

@@ -45,7 +45,7 @@
#define GLIBTOP_SUID_PROC_WD 0
#define GLIBTOP_SUID_PROC_AFFINITY 0
#define GLIBTOP_SUID_PPP 0
#define GLIBTOP_SUID_PROC_FILE 0
#define GLIBTOP_SUID_PROC_OPEN_FILES 0
#define GLIBTOP_SUID_PROC_IO 0
#endif /* __LINUX__GLIBTOP_SERVER_H__ */

View File

@@ -0,0 +1,49 @@
/* Copyright (C) 2018 Benoît Dejean
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __GLIBTOP_SUID_H__
#define __GLIBTOP_SUID_H__
G_BEGIN_DECLS
#include <glibtop_machine.h>
static inline void glibtop_suid_enter (glibtop *server) {
glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid());
setreuid (server->machine->uid, server->machine->euid);
glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid());
};
static inline void glibtop_suid_leave (glibtop *server) {
glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid());
if (setreuid (server->machine->euid, server->machine->uid))
_exit (1);
glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid());
};
void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags);
void
glibtop_open_p (glibtop *server, const char *program_name,
const unsigned long features,
const unsigned flags);
G_END_DECLS
#endif

View File

@@ -136,7 +136,7 @@ parse_line(char* line,
{
/* %16llx-%16llx %4c %16llx %02hx:%02hx %llu%*[ ]%n */
char *p, *next;
char *p;
p = line;

View File

@@ -35,7 +35,7 @@ static const unsigned long _glibtop_sysdeps_proc_mem_pss =
static unsigned long
get_pss(glibtop* server, pid_t pid)
G_GNUC_UNUSED get_pss(glibtop* server, pid_t pid)
{
char filepath[128];
FILE* smaps;
@@ -86,7 +86,7 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
memset (buf, 0, sizeof (glibtop_proc_mem));
/* As of 2.6.24 in fs/proc/*.c
/* As of 2.6.24 in fs/proc/ *.c
== rss vs. resident ==

80
sysdeps/linux/suid_open.c Normal file
View File

@@ -0,0 +1,80 @@
/* Copyright (C) 2018 Benoît Dejean
LibGTop is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
LibGTop is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with LibGTop; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <config.h>
#include <glibtop.h>
#include <glibtop/error.h>
#include <glibtop/cpu.h>
#include <glibtop/open.h>
#include <glibtop/init_hooks.h>
#include <glibtop/machine.h>
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
void
glibtop_init_p (glibtop *server, const unsigned long features,
const unsigned flags)
{
const _glibtop_init_func_t *init_fkt;
if (server == NULL)
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
/* Do the initialization, but only if not already initialized. */
if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) {
glibtop_open_p (server, "glibtop", features, flags);
for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++)
(*init_fkt) (server);
server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS;
}
}
void
glibtop_open_p (glibtop *server, const char *program_name,
const unsigned long features,
const unsigned flags)
{
glibtop_debug ("glibtop_open_p ()");
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
server->machine->uid = getuid ();
server->machine->euid = geteuid ();
server->machine->gid = getgid ();
server->machine->egid = getegid ();
/* Drop priviledges. */
glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid());
if (setreuid (server->machine->euid, server->machine->uid))
_exit (1);
if (setregid (server->machine->egid, server->machine->gid))
_exit (1);
glibtop_debug ("uid=%d euid=%d gid=%d egid=%d", getuid(), geteuid(), getgid(), getegid());
/* !!! END OF SUID ROOT PART !!! */
/* Our effective uid is now those of the user invoking the server,
* so we do no longer have any priviledges. */
}