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>
|
2005-07-24 Benoît Dejean <TazForEver@dlfp.org>
|
||||||
|
|
||||||
* NEWS:
|
* NEWS:
|
||||||
|
@@ -8,7 +8,7 @@ AC_CANONICAL_SYSTEM
|
|||||||
|
|
||||||
LIBGTOP_MAJOR_VERSION=2
|
LIBGTOP_MAJOR_VERSION=2
|
||||||
LIBGTOP_MINOR_VERSION=11
|
LIBGTOP_MINOR_VERSION=11
|
||||||
LIBGTOP_MICRO_VERSION=90
|
LIBGTOP_MICRO_VERSION=91
|
||||||
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
|
LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VERSION
|
||||||
AM_INIT_AUTOMAKE(libgtop, $LIBGTOP_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 \
|
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
|
||||||
netlist.h procopenfiles.h open.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 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
|
struct _glibtop_server_info
|
||||||
{
|
{
|
||||||
int ncpu; /* Number of CPUs, zero if single-processor */
|
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)
|
#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;
|
typedef struct _glibtop_sysdeps glibtop_sysdeps;
|
||||||
|
|
||||||
struct _glibtop_sysdeps
|
struct _glibtop_sysdeps
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#include <glibtop/sysdeps.h>
|
#include <glibtop/sysdeps.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
#include <glibtop/parameter.h>
|
#include <glibtop/parameter.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
|
|
||||||
#ifndef DEFAULT_PORT
|
#ifndef DEFAULT_PORT
|
||||||
#define DEFAULT_PORT 42800
|
#define DEFAULT_PORT 42800
|
||||||
@@ -219,7 +220,7 @@ glibtop *
|
|||||||
glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags)
|
glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags)
|
||||||
{
|
{
|
||||||
glibtop *server;
|
glibtop *server;
|
||||||
glibtop_init_func_t *init_fkt;
|
const glibtop_init_func_t *init_fkt;
|
||||||
|
|
||||||
if (server_ptr == NULL)
|
if (server_ptr == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/union.h>
|
#include <glibtop/union.h>
|
||||||
#include <glibtop/sysdeps.h>
|
#include <glibtop/sysdeps.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
|
|
||||||
const unsigned long glibtop_server_features =
|
const unsigned long glibtop_server_features =
|
||||||
GLIBTOP_SUID_CPU +
|
GLIBTOP_SUID_CPU +
|
||||||
@@ -43,9 +44,10 @@ GLIBTOP_SUID_PROC_SEGMENT +
|
|||||||
GLIBTOP_SUID_PROC_ARGS +
|
GLIBTOP_SUID_PROC_ARGS +
|
||||||
GLIBTOP_SUID_PROC_MAP +
|
GLIBTOP_SUID_PROC_MAP +
|
||||||
GLIBTOP_SUID_NETLOAD +
|
GLIBTOP_SUID_NETLOAD +
|
||||||
|
GLIBTOP_SUID_NETLIST +
|
||||||
GLIBTOP_SUID_PPP;
|
GLIBTOP_SUID_PPP;
|
||||||
|
|
||||||
glibtop_init_func_t _glibtop_init_hook_s [] = {
|
const glibtop_init_func_t _glibtop_init_hook_s [] = {
|
||||||
#if !GLIBTOP_SUID_CPU
|
#if !GLIBTOP_SUID_CPU
|
||||||
glibtop_init_cpu_s,
|
glibtop_init_cpu_s,
|
||||||
#endif
|
#endif
|
||||||
@@ -103,13 +105,16 @@ glibtop_init_func_t _glibtop_init_hook_s [] = {
|
|||||||
#if !GLIBTOP_SUID_NETLOAD
|
#if !GLIBTOP_SUID_NETLOAD
|
||||||
glibtop_init_netload_s,
|
glibtop_init_netload_s,
|
||||||
#endif
|
#endif
|
||||||
|
#if !GLIBTOP_SUID_NETLIST
|
||||||
|
glibtop_init_netlist_s,
|
||||||
|
#endif
|
||||||
#if !GLIBTOP_SUID_PPP
|
#if !GLIBTOP_SUID_PPP
|
||||||
glibtop_init_ppp_s,
|
glibtop_init_ppp_s,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
glibtop_init_func_t _glibtop_init_hook_p [] = {
|
const glibtop_init_func_t _glibtop_init_hook_p [] = {
|
||||||
#if GLIBTOP_SUID_CPU
|
#if GLIBTOP_SUID_CPU
|
||||||
glibtop_init_cpu_p,
|
glibtop_init_cpu_p,
|
||||||
#endif
|
#endif
|
||||||
@@ -167,6 +172,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
|
|||||||
#if GLIBTOP_SUID_NETLOAD
|
#if GLIBTOP_SUID_NETLOAD
|
||||||
glibtop_init_netload_p,
|
glibtop_init_netload_p,
|
||||||
#endif
|
#endif
|
||||||
|
#if GLIBTOP_SUID_NETLIST
|
||||||
|
glibtop_init_netlist_p,
|
||||||
|
#endif
|
||||||
#if GLIBTOP_SUID_PPP
|
#if GLIBTOP_SUID_PPP
|
||||||
glibtop_init_ppp_p,
|
glibtop_init_ppp_p,
|
||||||
#endif
|
#endif
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/error.h>
|
#include <glibtop/error.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
#include "glibtop_suid.h"
|
#include "glibtop_suid.h"
|
||||||
|
|
||||||
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
||||||
@@ -35,7 +35,7 @@ void
|
|||||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
glibtop_init_func_t *init_fkt;
|
const glibtop_init_func_t *init_fkt;
|
||||||
|
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||||
|
@@ -25,8 +25,9 @@
|
|||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
#include <glibtop/union.h>
|
#include <glibtop/union.h>
|
||||||
#include <glibtop/sysdeps.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
|
#if GLIBTOP_SUID_CPU
|
||||||
glibtop_init_cpu_p,
|
glibtop_init_cpu_p,
|
||||||
#endif
|
#endif
|
||||||
@@ -84,6 +85,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
|
|||||||
#if GLIBTOP_SUID_NETLOAD
|
#if GLIBTOP_SUID_NETLOAD
|
||||||
glibtop_init_netload_p,
|
glibtop_init_netload_p,
|
||||||
#endif
|
#endif
|
||||||
|
#if GLIBTOP_SUID_NETLIST
|
||||||
|
glibtop_init_netlist_p,
|
||||||
|
#endif
|
||||||
#if GLIBTOP_SUID_PPP
|
#if GLIBTOP_SUID_PPP
|
||||||
glibtop_init_ppp_p,
|
glibtop_init_ppp_p,
|
||||||
#endif
|
#endif
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
|
|
||||||
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ void
|
|||||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
glibtop_init_func_t *init_fkt;
|
const glibtop_init_func_t *init_fkt;
|
||||||
|
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -35,7 +35,7 @@ void
|
|||||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
glibtop_init_func_t *init_fkt;
|
const glibtop_init_func_t *init_fkt;
|
||||||
|
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
#include <glibtop_suid.h>
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -35,7 +35,7 @@ void
|
|||||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
glibtop_init_func_t *init_fkt;
|
const glibtop_init_func_t *init_fkt;
|
||||||
|
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <glibtop.h>
|
#include <glibtop.h>
|
||||||
#include <glibtop/open.h>
|
#include <glibtop/open.h>
|
||||||
|
#include <glibtop/init_hooks.h>
|
||||||
|
|
||||||
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ void
|
|||||||
glibtop_init_p (glibtop *server, const unsigned long features,
|
glibtop_init_p (glibtop *server, const unsigned long features,
|
||||||
const unsigned flags)
|
const unsigned flags)
|
||||||
{
|
{
|
||||||
glibtop_init_func_t *init_fkt;
|
const glibtop_init_func_t *init_fkt;
|
||||||
|
|
||||||
if (server == NULL)
|
if (server == NULL)
|
||||||
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
glibtop_error_r (NULL, "glibtop_init_p (server == NULL)");
|
||||||
|
Reference in New Issue
Block a user