Moved _glibtop_init_hook_[sp] declaration to private glibtop/init_hooks.h.
* configure.in: * include/glibtop/Makefile.am: * include/glibtop/glibtop-server.h: * include/glibtop/init_hooks.h: * include/glibtop/sysdeps.h: * lib/init.c: (glibtop_init_s): * lib/sysdeps.c: * sysdeps/aix/open.c: (glibtop_init_p): * sysdeps/common/sysdeps_suid.c: * sysdeps/freebsd/open.c: (glibtop_init_p): * sysdeps/osf1/open_suid.c: (glibtop_init_p): * sysdeps/solaris/open_suid.c: (glibtop_init_p): * sysdeps/stub_suid/open.c: (glibtop_init_p): Moved _glibtop_init_hook_[sp] declaration to private glibtop/init_hooks.h. Marked them const. Fixed GLIBTOP_SUID_NETLIST issues.
This commit is contained in:
21
ChangeLog
21
ChangeLog
@@ -1,3 +1,24 @@
|
||||
2005-08-02 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* configure.in:
|
||||
* include/glibtop/Makefile.am:
|
||||
* include/glibtop/glibtop-server.h:
|
||||
* include/glibtop/init_hooks.h:
|
||||
* include/glibtop/sysdeps.h:
|
||||
* lib/init.c: (glibtop_init_s):
|
||||
* lib/sysdeps.c:
|
||||
* sysdeps/aix/open.c: (glibtop_init_p):
|
||||
* sysdeps/common/sysdeps_suid.c:
|
||||
* sysdeps/freebsd/open.c: (glibtop_init_p):
|
||||
* sysdeps/osf1/open_suid.c: (glibtop_init_p):
|
||||
* sysdeps/solaris/open_suid.c: (glibtop_init_p):
|
||||
* sysdeps/stub_suid/open.c: (glibtop_init_p):
|
||||
|
||||
Moved _glibtop_init_hook_[sp] declaration to private
|
||||
glibtop/init_hooks.h. Marked them const.
|
||||
|
||||
Fixed GLIBTOP_SUID_NETLIST issues.
|
||||
|
||||
2005-07-24 Benoît Dejean <TazForEver@dlfp.org>
|
||||
|
||||
* NEWS:
|
||||
|
@@ -8,7 +8,7 @@ AC_CANONICAL_SYSTEM
|
||||
|
||||
LIBGTOP_MAJOR_VERSION=2
|
||||
LIBGTOP_MINOR_VERSION=11
|
||||
LIBGTOP_MICRO_VERSION=90
|
||||
LIBGTOP_MICRO_VERSION=91
|
||||
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
|
||||
AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_VERSION)
|
||||
|
||||
|
@@ -10,4 +10,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
|
||||
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
|
||||
netlist.h procopenfiles.h open.h
|
||||
|
||||
noinst_HEADERS = error.h write.h read_data.h read.h
|
||||
noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h
|
||||
|
@@ -36,11 +36,6 @@ typedef struct _glibtop_server_info glibtop_server_info;
|
||||
|
||||
typedef struct _glibtop_closure glibtop_closure;
|
||||
|
||||
typedef int (*glibtop_init_func_t) (glibtop_server *, glibtop_closure *);
|
||||
|
||||
extern glibtop_init_func_t _glibtop_init_hook_s [];
|
||||
extern glibtop_init_func_t _glibtop_init_hook_p [];
|
||||
|
||||
struct _glibtop_server_info
|
||||
{
|
||||
int ncpu; /* Number of CPUs, zero if single-processor */
|
||||
|
11
include/glibtop/init_hooks.h
Normal file
11
include/glibtop/init_hooks.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef H_LIBGTOP_INIT_HOOKS_1122955666
|
||||
#define H_LIBGTOP_INIT_HOOKS_1122955666
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
typedef void (*glibtop_init_func_t)(glibtop *);
|
||||
|
||||
extern const glibtop_init_func_t _glibtop_init_hook_s[];
|
||||
extern const glibtop_init_func_t _glibtop_init_hook_p[];
|
||||
|
||||
#endif /* H_LIBGTOP_INIT_HOOKS_1122955666 */
|
@@ -58,10 +58,6 @@ G_BEGIN_DECLS
|
||||
|
||||
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
||||
|
||||
typedef void (*glibtop_init_func_t) (glibtop *);
|
||||
extern glibtop_init_func_t _glibtop_init_hook_s [];
|
||||
extern glibtop_init_func_t _glibtop_init_hook_p [];
|
||||
|
||||
typedef struct _glibtop_sysdeps glibtop_sysdeps;
|
||||
|
||||
struct _glibtop_sysdeps
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <glibtop/sysdeps.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/parameter.h>
|
||||
#include <glibtop/init_hooks.h>
|
||||
|
||||
#ifndef DEFAULT_PORT
|
||||
#define DEFAULT_PORT 42800
|
||||
@@ -219,7 +220,7 @@ glibtop *
|
||||
glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags)
|
||||
{
|
||||
glibtop *server;
|
||||
glibtop_init_func_t *init_fkt;
|
||||
const glibtop_init_func_t *init_fkt;
|
||||
|
||||
if (server_ptr == NULL)
|
||||
return NULL;
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
#include <glibtop/init_hooks.h>
|
||||
|
||||
const unsigned long glibtop_server_features =
|
||||
GLIBTOP_SUID_CPU +
|
||||
@@ -43,9 +44,10 @@ GLIBTOP_SUID_PROC_SEGMENT +
|
||||
GLIBTOP_SUID_PROC_ARGS +
|
||||
GLIBTOP_SUID_PROC_MAP +
|
||||
GLIBTOP_SUID_NETLOAD +
|
||||
GLIBTOP_SUID_NETLIST +
|
||||
GLIBTOP_SUID_PPP;
|
||||
|
||||
glibtop_init_func_t _glibtop_init_hook_s [] = {
|
||||
const glibtop_init_func_t _glibtop_init_hook_s [] = {
|
||||
#if !GLIBTOP_SUID_CPU
|
||||
glibtop_init_cpu_s,
|
||||
#endif
|
||||
@@ -103,13 +105,16 @@ glibtop_init_func_t _glibtop_init_hook_s [] = {
|
||||
#if !GLIBTOP_SUID_NETLOAD
|
||||
glibtop_init_netload_s,
|
||||
#endif
|
||||
#if !GLIBTOP_SUID_NETLIST
|
||||
glibtop_init_netlist_s,
|
||||
#endif
|
||||
#if !GLIBTOP_SUID_PPP
|
||||
glibtop_init_ppp_s,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
|
||||
glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||
const glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||
#if GLIBTOP_SUID_CPU
|
||||
glibtop_init_cpu_p,
|
||||
#endif
|
||||
@@ -167,6 +172,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||
#if GLIBTOP_SUID_NETLOAD
|
||||
glibtop_init_netload_p,
|
||||
#endif
|
||||
#if GLIBTOP_SUID_NETLIST
|
||||
glibtop_init_netlist_p,
|
||||
#endif
|
||||
#if GLIBTOP_SUID_PPP
|
||||
glibtop_init_ppp_p,
|
||||
#endif
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/error.h>
|
||||
#include <glibtop/open.h>
|
||||
|
||||
#include <glibtop/init_hooks.h>
|
||||
#include "glibtop_suid.h"
|
||||
|
||||
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
||||
@@ -35,7 +35,7 @@ void
|
||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
const unsigned flags)
|
||||
{
|
||||
glibtop_init_func_t *init_fkt;
|
||||
const glibtop_init_func_t *init_fkt;
|
||||
|
||||
if (server == NULL)
|
||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||
|
@@ -25,8 +25,9 @@
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/union.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
#include <glibtop/init_hooks.h>
|
||||
|
||||
glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||
const glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||
#if GLIBTOP_SUID_CPU
|
||||
glibtop_init_cpu_p,
|
||||
#endif
|
||||
@@ -84,6 +85,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||
#if GLIBTOP_SUID_NETLOAD
|
||||
glibtop_init_netload_p,
|
||||
#endif
|
||||
#if GLIBTOP_SUID_NETLIST
|
||||
glibtop_init_netlist_p,
|
||||
#endif
|
||||
#if GLIBTOP_SUID_PPP
|
||||
glibtop_init_ppp_p,
|
||||
#endif
|
||||
|
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/init_hooks.h>
|
||||
|
||||
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
||||
|
||||
@@ -30,7 +31,7 @@ void
|
||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
const unsigned flags)
|
||||
{
|
||||
glibtop_init_func_t *init_fkt;
|
||||
const glibtop_init_func_t *init_fkt;
|
||||
|
||||
if (server == NULL)
|
||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
|
||||
#include <glibtop/init_hooks.h>
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -35,7 +35,7 @@ void
|
||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
const unsigned flags)
|
||||
{
|
||||
glibtop_init_func_t *init_fkt;
|
||||
const glibtop_init_func_t *init_fkt;
|
||||
|
||||
if (server == NULL)
|
||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||
|
@@ -23,7 +23,7 @@
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
|
||||
#include <glibtop/init_hooks.h>
|
||||
#include <glibtop_suid.h>
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -35,7 +35,7 @@ void
|
||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
const unsigned flags)
|
||||
{
|
||||
glibtop_init_func_t *init_fkt;
|
||||
const glibtop_init_func_t *init_fkt;
|
||||
|
||||
if (server == NULL)
|
||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||
|
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/open.h>
|
||||
#include <glibtop/init_hooks.h>
|
||||
|
||||
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
||||
|
||||
@@ -30,7 +31,7 @@ void
|
||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
const unsigned flags)
|
||||
{
|
||||
glibtop_init_func_t *init_fkt;
|
||||
const glibtop_init_func_t *init_fkt;
|
||||
|
||||
if (server == NULL)
|
||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||
|
Reference in New Issue
Block a user