diff options
Diffstat (limited to 'sysdeps/stub_suid')
31 files changed, 0 insertions, 1511 deletions
diff --git a/sysdeps/stub_suid/ChangeLog b/sysdeps/stub_suid/ChangeLog deleted file mode 100644 index 2c4199eb..00000000 --- a/sysdeps/stub_suid/ChangeLog +++ /dev/null @@ -1,32 +0,0 @@ -2003-10-21 Bastien Nocera <hadess@hadess.net> - - * Makefile.am: install only one library, libgtop-2.0 - Fix build-time warnings due to the redefinition of guint64 - -2003-10-20 Bastien Nocera <hadess@hadess.net> - - * glibtop_machine.h: - * glibtop_server.h: - * glibtop_suid.h: - * open.c: - * procargs.c: - * procmap.c: fixed compilation - -2001-10-17 Abel Cheung <maddog@linux.org.hk> - - * Makefile.am: move header to $(includedir)/libgtop-1.0/glibtop. - -1998-10-26 Martin Baulig <martin@home-of-linux.org> - - * netload.c: New file. - -1998-10-26 Martin Baulig <martin@home-of-linux.org> - - * procargs.c: New file. - * procmap.c: New file. - -1998-10-25 Martin Baulig <martin@home-of-linux.org> - - * ChangeLog: New file. - * ppp.c: New file. - diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am deleted file mode 100644 index e0bb1629..00000000 --- a/sysdeps/stub_suid/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ - -INCLUDES = @INCLUDES@ - -noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la - -libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c - -libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) - -libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ - uptime.c loadavg.c shm_limits.c msg_limits.c \ - sem_limits.c proclist.c procstate.c procuid.c \ - proctime.c procmem.c procsignal.c prockernel.c \ - procsegment.c procargs.c procmap.c netload.c \ - ppp.c - -libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) - -libgtopinclude_HEADERS = glibtop_server.h glibtop_machine.h -libgtopincludedir = $(includedir)/libgtop-2.0 - -noinst_HEADERS = glibtop_suid.h diff --git a/sysdeps/stub_suid/close.c b/sysdeps/stub_suid/close.c deleted file mode 100644 index 03057967..00000000 --- a/sysdeps/stub_suid/close.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop/close.h> - -/* Closes pipe to gtop server. */ - -void -glibtop_close_s (glibtop *server) -{ } diff --git a/sysdeps/stub_suid/cpu.c b/sysdeps/stub_suid/cpu.c deleted file mode 100644 index 9b307622..00000000 --- a/sysdeps/stub_suid/cpu.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/cpu.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_cpu = 0; - -/* Init function. */ - -void -_glibtop_init_cpu_p (glibtop *server) -{ - server->sysdeps.cpu = _glibtop_sysdeps_cpu; -} - -/* Provides information about cpu usage. */ - -void -glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_CPU, 0); - - memset (buf, 0, sizeof (glibtop_cpu)); -} diff --git a/sysdeps/stub_suid/glibtop_machine.h b/sysdeps/stub_suid/glibtop_machine.h deleted file mode 100644 index d9d3da6f..00000000 --- a/sysdeps/stub_suid/glibtop_machine.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __GLIBTOP_MACHINE_H__ -#define __GLIBTOP_MACHINE_H__ - -G_BEGIN_DECLS - -typedef struct _glibtop_machine glibtop_machine; - -struct _glibtop_machine -{ - uid_t uid, euid; /* Real and effective user id */ - gid_t gid, egid; /* Real and effective group id */ -}; - -G_END_DECLS - -#endif diff --git a/sysdeps/stub_suid/glibtop_server.h b/sysdeps/stub_suid/glibtop_server.h deleted file mode 100644 index 8a7a5028..00000000 --- a/sysdeps/stub_suid/glibtop_server.h +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __GLIBTOP_SERVER_H__ -#define __GLIBTOP_SERVER_H__ - -G_BEGIN_DECLS - -#define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) -#define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) -#define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) -#define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) -#define GLIBTOP_SUID_LOADAVG (1 << GLIBTOP_SYSDEPS_LOADAVG) -#define GLIBTOP_SUID_SHM_LIMITS (1 << GLIBTOP_SYSDEPS_SHM_LIMITS) -#define GLIBTOP_SUID_MSG_LIMITS (1 << GLIBTOP_SYSDEPS_MSG_LIMITS) -#define GLIBTOP_SUID_SEM_LIMITS (1 << GLIBTOP_SYSDEPS_SEM_LIMITS) -#define GLIBTOP_SUID_PROCLIST (1 << GLIBTOP_SYSDEPS_PROCLIST) -#define GLIBTOP_SUID_PROC_STATE (1 << GLIBTOP_SYSDEPS_PROC_STATE) -#define GLIBTOP_SUID_PROC_UID (1 << GLIBTOP_SYSDEPS_PROC_UID) -#define GLIBTOP_SUID_PROC_MEM (1 << GLIBTOP_SYSDEPS_PROC_MEM) -#define GLIBTOP_SUID_PROC_TIME (1 << GLIBTOP_SYSDEPS_PROC_TIME) -#define GLIBTOP_SUID_PROC_SIGNAL (1 << GLIBTOP_SYSDEPS_PROC_SIGNAL) -#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL) -#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT) -#define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) -#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) -#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) -#define GLIBTOP_SUID_NETLIST 0 -#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) - -G_END_DECLS - -#endif diff --git a/sysdeps/stub_suid/glibtop_suid.h b/sysdeps/stub_suid/glibtop_suid.h deleted file mode 100644 index d11c64cf..00000000 --- a/sysdeps/stub_suid/glibtop_suid.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#ifndef __GLIBTOP_SUID_H__ -#define __GLIBTOP_SUID_H__ - -G_BEGIN_DECLS - -static inline void glibtop_suid_enter (glibtop *server) { - setreuid (server->machine.uid, server->machine.euid); -}; - -static inline void glibtop_suid_leave (glibtop *server) { - if (setreuid (server->machine.euid, server->machine.uid)) - _exit (1); -}; - -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 diff --git a/sysdeps/stub_suid/init.c b/sysdeps/stub_suid/init.c deleted file mode 100644 index 5f0f7ea8..00000000 --- a/sysdeps/stub_suid/init.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/open.h> - -static glibtop _glibtop_global_server; -glibtop *glibtop_global_server = NULL; - -glibtop * -glibtop_init_r (glibtop **server, - const unsigned long features, - const unsigned flags) -{ - if (*server != NULL) - return *server; - - if (glibtop_global_server == NULL) { - glibtop_global_server = &_glibtop_global_server; - glibtop_open (glibtop_global_server, "glibtop", - features, flags); - } - - return *server = glibtop_global_server; -} diff --git a/sysdeps/stub_suid/loadavg.c b/sysdeps/stub_suid/loadavg.c deleted file mode 100644 index d01ffcf0..00000000 --- a/sysdeps/stub_suid/loadavg.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/loadavg.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_loadavg = 0; - -/* Init function. */ - -void -_glibtop_init_loadavg_p (glibtop *server) -{ - server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; -} - -/* Provides load averange. */ - -void -glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_LOADAVG, 0); - - memset (buf, 0, sizeof (glibtop_loadavg)); -} diff --git a/sysdeps/stub_suid/mem.c b/sysdeps/stub_suid/mem.c deleted file mode 100644 index 1ce54b26..00000000 --- a/sysdeps/stub_suid/mem.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/mem.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_mem = 0; - -/* Init function. */ - -void -_glibtop_init_mem_p (glibtop *server) -{ - server->sysdeps.mem = _glibtop_sysdeps_mem; -} - -/* Provides information about memory usage. */ - -void -glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_MEM, 0); - - memset (buf, 0, sizeof (glibtop_mem)); -} diff --git a/sysdeps/stub_suid/msg_limits.c b/sysdeps/stub_suid/msg_limits.c deleted file mode 100644 index 53e41957..00000000 --- a/sysdeps/stub_suid/msg_limits.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/msg_limits.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_msg_limits = 0; - -/* Init function. */ - -void -_glibtop_init_msg_limits_p (glibtop *server) -{ - server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; -} - -/* Provides information about sysv ipc limits. */ - -void -glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0); - - memset (buf, 0, sizeof (glibtop_msg_limits)); -} diff --git a/sysdeps/stub_suid/netload.c b/sysdeps/stub_suid/netload.c deleted file mode 100644 index eefacf51..00000000 --- a/sysdeps/stub_suid/netload.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/netload.h> - -static const unsigned long _glibtop_sysdeps_netload = 0; - -/* Init function. */ - -void -_glibtop_init_netload_p (glibtop *server) -{ - server->sysdeps.netload = _glibtop_sysdeps_netload; -} - -/* Provides Network statistics. */ - -void -glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, - const char *interface) -{ - memset (buf, 0, sizeof (glibtop_netload)); -} diff --git a/sysdeps/stub_suid/nosuid.c b/sysdeps/stub_suid/nosuid.c deleted file mode 100644 index cce50933..00000000 --- a/sysdeps/stub_suid/nosuid.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/open.h> - -void -glibtop_open_s (glibtop *server, const char *program_name, - const unsigned long features, const unsigned flags) -{ } - -void -glibtop_close_s (glibtop *server) -{ } diff --git a/sysdeps/stub_suid/open.c b/sysdeps/stub_suid/open.c deleted file mode 100644 index 6a829b08..00000000 --- a/sysdeps/stub_suid/open.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/open.h> -#include <glibtop/init_hooks.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_INIT) == 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_INIT; - } -} - -void -glibtop_open_p (glibtop *server, const char *program_name, - const unsigned long features, const unsigned flags) -{ - /* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */ - - server->name = program_name; - - server->machine.uid = getuid (); - server->machine.euid = geteuid (); - server->machine.gid = getgid (); - server->machine.egid = getegid (); - - /* Drop priviledges. */ - - if (setreuid (server->machine.euid, server->machine.uid)) - _exit (1); - - if (setregid (server->machine.egid, server->machine.gid)) - _exit (1); - - /* !!! 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. */ -} - diff --git a/sysdeps/stub_suid/ppp.c b/sysdeps/stub_suid/ppp.c deleted file mode 100644 index 7e7ee1a7..00000000 --- a/sysdeps/stub_suid/ppp.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/ppp.h> - -static const unsigned long _glibtop_sysdeps_ppp = 0; - -/* Init function. */ - -void -_glibtop_init_ppp_p (glibtop *server) -{ - server->sysdeps.ppp = _glibtop_sysdeps_ppp; -} - -/* Provides PPP/ISDN information. */ - -void -glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) -{ - memset (buf, 0, sizeof (glibtop_ppp)); -} diff --git a/sysdeps/stub_suid/procargs.c b/sysdeps/stub_suid/procargs.c deleted file mode 100644 index 42029eb5..00000000 --- a/sysdeps/stub_suid/procargs.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procargs.h> - -static const unsigned long _glibtop_sysdeps_proc_args = 0; - -/* Init function. */ - -void -_glibtop_init_proc_args_p (glibtop *server) -{ - server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; -} - -/* Provides detailed information about a process. */ - -char * -glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, - pid_t pid, unsigned max_len) -{ - memset (buf, 0, sizeof (glibtop_proc_args)); - return NULL; -} diff --git a/sysdeps/stub_suid/procdata.c b/sysdeps/stub_suid/procdata.c deleted file mode 100644 index a9f81400..00000000 --- a/sysdeps/stub_suid/procdata.c +++ /dev/null @@ -1,178 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop/procdata.h> - -#include <sys/stat.h> - -#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z) - -#define BIT_SHIFT(x) (1 << (x % 32)) - -static const unsigned long _glibtop_sysdeps_procdata_0 = -BIT_SHIFT(GLIBTOP_PROCDATA_CMD) + -BIT_SHIFT(GLIBTOP_PROCDATA_STATE) + -BIT_SHIFT(GLIBTOP_PROCDATA_UID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PPID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PGRP) + -BIT_SHIFT(GLIBTOP_PROCDATA_SESSION) + -BIT_SHIFT(GLIBTOP_PROCDATA_TTY) + -BIT_SHIFT(GLIBTOP_PROCDATA_TPGID) + -BIT_SHIFT(GLIBTOP_PROCDATA_PRIORITY) + -BIT_SHIFT(GLIBTOP_PROCDATA_NICE) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIGNAL) + -BIT_SHIFT(GLIBTOP_PROCDATA_BLOCKED) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIGIGNORE) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIGCATCH) + -BIT_SHIFT(GLIBTOP_PROCDATA_START_TIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_UTIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_STIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_CUTIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_CSTIME) + -BIT_SHIFT(GLIBTOP_PROCDATA_SIZE) + -BIT_SHIFT(GLIBTOP_PROCDATA_RESIDENT) + -BIT_SHIFT(GLIBTOP_PROCDATA_SHARE) + -BIT_SHIFT(GLIBTOP_PROCDATA_TRS) + -BIT_SHIFT(GLIBTOP_PROCDATA_LRS) + -BIT_SHIFT(GLIBTOP_PROCDATA_DRS) + -BIT_SHIFT(GLIBTOP_PROCDATA_DT) + -BIT_SHIFT(GLIBTOP_PROCDATA_VSIZE) + -BIT_SHIFT(GLIBTOP_PROCDATA_RSS) + -BIT_SHIFT(GLIBTOP_PROCDATA_RSS_RLIM) + -BIT_SHIFT(GLIBTOP_PROCDATA_TIMEOUT) + -BIT_SHIFT(GLIBTOP_PROCDATA_IT_REAL_VALUE); - -static const unsigned long _glibtop_sysdeps_procdata_1 = -BIT_SHIFT(GLIBTOP_PROCDATA_K_FLAGS) + -BIT_SHIFT(GLIBTOP_PROCDATA_MIN_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_MAJ_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_CMIN_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_CMAJ_FLT) + -BIT_SHIFT(GLIBTOP_PROCDATA_START_CODE) + -BIT_SHIFT(GLIBTOP_PROCDATA_END_CODE) + -BIT_SHIFT(GLIBTOP_PROCDATA_START_STACK) + -BIT_SHIFT(GLIBTOP_PROCDATA_KSTK_ESP) + -BIT_SHIFT(GLIBTOP_PROCDATA_KSTK_EIP) + -BIT_SHIFT(GLIBTOP_PROCDATA_WCHAN); - -/* Provides detailed information about a process. */ - -void -glibtop_get_procdata_s (glibtop *server, glibtop_procdata *buf, pid_t pid) -{ - char input [BUFSIZ], *tmp; - struct stat statb; - int nread; - FILE *f; - - glibtop_init_r (&server, 0, 0); - - memset (buf, 0, sizeof (glibtop_procdata)); - - if (pid == 0) { - /* Client is only interested in the flags. */ - buf->flags [0] = _glibtop_sysdeps_procdata_0; - buf->flags [1] = _glibtop_sysdeps_procdata_1; - return; - } - - - sprintf (input, "/proc/%d/stat", pid); - - if (stat (input, &statb)) return; - - buf->uid = statb.st_uid; - - f = fopen (input, "r"); - if (!f) return; - - nread = fread (input, 1, BUFSIZ, f); - - if (nread < 0) { - fclose (f); - return; - } - - input [nread] = 0; - - /* This is from guile-utils/gtop/proc/readproc.c */ - - /* split into "PID (cmd" and "<rest>" */ - tmp = strrchr (input, ')'); - *tmp = '\0'; /* replace trailing ')' with NUL */ - /* parse these two strings separately, skipping the leading "(". */ - memset (buf->cmd, 0, sizeof (buf->cmd)); - sscanf (input, "%d (%39c", &buf->pid, buf->cmd); - sscanf(tmp + 2, /* skip space after ')' too */ - "%c %d %d %d %d %d %lu %lu %lu %lu %lu " - "%ld %ld %ld %ld %d %d %lu %lu %ld %lu " - "%lu %lu %lu %lu %lu %lu %lu %d %d %d %d %lu", - &buf->state, &buf->ppid, &buf->pgrp, &buf->session, - &buf->tty, &buf->tpgid, &buf->k_flags, &buf->min_flt, - &buf->cmin_flt, &buf->maj_flt, &buf->cmaj_flt, - &buf->utime, &buf->stime, &buf->cutime, &buf->cstime, - &buf->priority, &buf->nice, &buf->timeout, - &buf->it_real_value, &buf->start_time, &buf->vsize, - &buf->rss, &buf->rss_rlim, &buf->start_code, - &buf->end_code, &buf->start_stack, &buf->kstk_esp, - &buf->kstk_eip, &buf->signal, &buf->blocked, - &buf->sigignore, &buf->sigcatch, &buf->wchan); - - if (buf->tty == 0) - /* the old notty val, update elsewhere bef. moving to 0 */ - buf->tty = -1; - - if (server->os_version_code < LINUX_VERSION(1,3,39)) { - /* map old meanings to new */ - buf->priority = 2*15 - buf->priority; - buf->nice = 15 - buf->nice; - } - if (server->os_version_code < LINUX_VERSION(1,1,30) && buf->tty != -1) - /* when tty wasn't full devno */ - buf->tty = 4*0x100 + buf->tty; - - fclose (f); - - sprintf (input, "/proc/%d/statm", pid); - - f = fopen (input, "r"); - if (!f) return; - - nread = fread (input, 1, BUFSIZ, f); - - if (nread < 0) { - fclose (f); - return; - } - - input [nread] = 0; - - sscanf (input, "%ld %ld %ld %ld %ld %ld %ld", - &buf->size, &buf->resident, &buf->share, - &buf->trs, &buf->lrs, &buf->drs, &buf->dt); - - fclose (f); - - buf->flags [0] = _glibtop_sysdeps_procdata_0; - buf->flags [1] = _glibtop_sysdeps_procdata_1; -} diff --git a/sysdeps/stub_suid/prockernel.c b/sysdeps/stub_suid/prockernel.c deleted file mode 100644 index 77f867ab..00000000 --- a/sysdeps/stub_suid/prockernel.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/prockernel.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_kernel = 0; - -/* Init function. */ - -void -_glibtop_init_proc_kernel_p (glibtop *server) -{ - server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0); - - memset (buf, 0, sizeof (glibtop_proc_kernel)); -} diff --git a/sysdeps/stub_suid/proclist.c b/sysdeps/stub_suid/proclist.c deleted file mode 100644 index a633f2c6..00000000 --- a/sysdeps/stub_suid/proclist.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/proclist.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proclist = 0; - -/* Init function. */ - -void -_glibtop_init_proclist_p (glibtop *server) -{ - server->sysdeps.proclist = _glibtop_sysdeps_proclist; -} - -unsigned * -glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf, - gint64 which, gint64 arg) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROCLIST, 0); - - memset (buf, 0, sizeof (glibtop_proclist)); - - return NULL; -} diff --git a/sysdeps/stub_suid/procmap.c b/sysdeps/stub_suid/procmap.c deleted file mode 100644 index 490eeab4..00000000 --- a/sysdeps/stub_suid/procmap.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procmap.h> - -static const unsigned long _glibtop_sysdeps_proc_map = 0; - -/* Init function. */ - -void -_glibtop_init_proc_map_p (glibtop *server) -{ - server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; -} - -/* Provides detailed information about a process. */ - -glibtop_map_entry * -glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pid_t pid) -{ - memset (buf, 0, sizeof (glibtop_proc_map)); - return NULL; -} diff --git a/sysdeps/stub_suid/procmem.c b/sysdeps/stub_suid/procmem.c deleted file mode 100644 index 4d5d5ea8..00000000 --- a/sysdeps/stub_suid/procmem.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procmem.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_mem = 0; - -/* Init function. */ - -void -_glibtop_init_proc_mem_p (glibtop *server) -{ - server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_MEM, 0); - - memset (buf, 0, sizeof (glibtop_proc_mem)); -} diff --git a/sysdeps/stub_suid/procsegment.c b/sysdeps/stub_suid/procsegment.c deleted file mode 100644 index 5bbbd686..00000000 --- a/sysdeps/stub_suid/procsegment.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procsegment.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_segment = 0; - -/* Init function. */ - -void -_glibtop_init_proc_segment_p (glibtop *server) -{ - server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0); - - memset (buf, 0, sizeof (glibtop_proc_segment)); -} diff --git a/sysdeps/stub_suid/procsignal.c b/sysdeps/stub_suid/procsignal.c deleted file mode 100644 index 07cf53bc..00000000 --- a/sysdeps/stub_suid/procsignal.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procsignal.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_signal = 0; - -/* Init function. */ - -void -_glibtop_init_proc_signal_p (glibtop *server) -{ - server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0); - - memset (buf, 0, sizeof (glibtop_proc_signal)); -} diff --git a/sysdeps/stub_suid/procstate.c b/sysdeps/stub_suid/procstate.c deleted file mode 100644 index 892a760f..00000000 --- a/sysdeps/stub_suid/procstate.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procstate.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_state = 0; - -/* Init function. */ - -void -_glibtop_init_proc_state_p (glibtop *server) -{ - server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_STATE, 0); - - memset (buf, 0, sizeof (glibtop_proc_state)); -} diff --git a/sysdeps/stub_suid/proctime.c b/sysdeps/stub_suid/proctime.c deleted file mode 100644 index 9b674197..00000000 --- a/sysdeps/stub_suid/proctime.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/proctime.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_time = 0; - -/* Init function. */ - -void -_glibtop_init_proc_time_p (glibtop *server) -{ - server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_TIME, 0); - - memset (buf, 0, sizeof (glibtop_proc_time)); -} diff --git a/sysdeps/stub_suid/procuid.c b/sysdeps/stub_suid/procuid.c deleted file mode 100644 index f5499d4a..00000000 --- a/sysdeps/stub_suid/procuid.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/procuid.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_proc_uid = 0; - -/* Init function. */ - -void -_glibtop_init_proc_uid_p (glibtop *server) -{ - server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; -} - -/* Provides detailed information about a process. */ - -void -glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, - pid_t pid) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_UID, 0); - - memset (buf, 0, sizeof (glibtop_proc_uid)); -} diff --git a/sysdeps/stub_suid/sem_limits.c b/sysdeps/stub_suid/sem_limits.c deleted file mode 100644 index f3864d50..00000000 --- a/sysdeps/stub_suid/sem_limits.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/sem_limits.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_sem_limits = 0; - -/* Init function. */ - -void -_glibtop_init_sem_limits_p (glibtop *server) -{ - server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; -} - -/* Provides information about sysv sem limits. */ - -void -glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0); - - memset (buf, 0, sizeof (glibtop_sem_limits)); -} diff --git a/sysdeps/stub_suid/shm_limits.c b/sysdeps/stub_suid/shm_limits.c deleted file mode 100644 index 71c2130b..00000000 --- a/sysdeps/stub_suid/shm_limits.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/shm_limits.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_shm_limits = 0; - -/* Init function. */ - -void -_glibtop_init_shm_limits_p (glibtop *server) -{ - server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; -} - -/* Provides information about sysv ipc limits. */ - -void -glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0); - - memset (buf, 0, sizeof (glibtop_shm_limits)); -} diff --git a/sysdeps/stub_suid/siglist.c b/sysdeps/stub_suid/siglist.c deleted file mode 100644 index 4fbe84b2..00000000 --- a/sysdeps/stub_suid/siglist.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/signal.h> - -const glibtop_signame glibtop_sys_siglist [] = -{ { 0, NULL, NULL } }; diff --git a/sysdeps/stub_suid/swap.c b/sysdeps/stub_suid/swap.c deleted file mode 100644 index 2f6d4366..00000000 --- a/sysdeps/stub_suid/swap.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/swap.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_swap = 0; - -/* Init function. */ - -void -_glibtop_init_swap_p (glibtop *server) -{ - server->sysdeps.swap = _glibtop_sysdeps_swap; -} - -/* Provides information about swap usage. */ - -void -glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_SWAP, 0); - - memset (buf, 0, sizeof (glibtop_swap)); -} diff --git a/sysdeps/stub_suid/uptime.c b/sysdeps/stub_suid/uptime.c deleted file mode 100644 index ba6156c8..00000000 --- a/sysdeps/stub_suid/uptime.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. - - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. -*/ - -#include <config.h> -#include <glibtop.h> -#include <glibtop/error.h> -#include <glibtop/uptime.h> - -#include <glibtop_suid.h> - -static const unsigned long _glibtop_sysdeps_uptime = 0; - -/* Init function. */ - -void -_glibtop_init_uptime_p (glibtop *server) -{ - server->sysdeps.uptime = _glibtop_sysdeps_uptime; -} - -/* Provides uptime and idle time. */ - -void -glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_UPTIME, 0); - - memset (buf, 0, sizeof (glibtop_uptime)); -} |