summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1999-12-23 13:08:51 +0000
committerMartin Baulig <martin@src.gnome.org>1999-12-23 13:08:51 +0000
commit595553ae0b921cf749563d9c61a83d5d16703c94 (patch)
treece2242f012bc5c069d4a4bafc21ebff38b524d7a /src
parente03b665dd1e3fe9c711e92fd8e5a3480495c82a7 (diff)
downloadlibgtop-595553ae0b921cf749563d9c61a83d5d16703c94.tar.gz
Removed all remote communication support from LibGTop.
1999-12-23 Martin Baulig <martin@home-of-linux.org> Removed all remote communication support from LibGTop. * include/glibtop/gnuserv.h: Removed. * sysdeps/common/gnuslib.c: Removed. * src/daemon/Makefile.am: Don't build the `libgtop_daemon' binary any longer. * src/daemon/server_config.pl: Removed. * src/daemon/server_config.h.in: Removed. * src/daemon/server_config.h: Removed.
Diffstat (limited to 'src')
-rw-r--r--src/daemon/Makefile.am18
-rw-r--r--src/daemon/server_config.h11
-rw-r--r--src/daemon/server_config.h.in44
-rwxr-xr-xsrc/daemon/server_config.pl111
-rw-r--r--src/daemon/slave.c2
5 files changed, 2 insertions, 184 deletions
diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am
index 50c7a7fb..da581fa0 100644
--- a/src/daemon/Makefile.am
+++ b/src/daemon/Makefile.am
@@ -27,24 +27,10 @@ suid_sysdeps =
suid_common =
endif
-bin_PROGRAMS = libgtop_daemon @server_programs@
+bin_PROGRAMS = @server_programs@
EXTRA_PROGRAMS = libgtop_server
-libgtop_daemon_SOURCES = gnuserv.c slave.c main.c io.c version.c \
- daemon.h server_config.h
-libgtop_daemon_LDADD = $(top_builddir)/lib/libgtop.la \
- $(top_builddir)/sysdeps/common/libgtop_common.la \
- $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps.la \
- @sysdeps_suid_lib@ \
- $(suid_sysdeps) $(suid_common)\
- $(GLIB_LIBS)\
- @LIBSUPPORT@ @INTLLIBS@ @libs_xauth@
-
-if ENABLE_STATIC
-libgtop_daemon_LDFLAGS = -static
-endif
-
libgtop_server_SOURCES = server.c slave.c io.c version.c daemon.h
libgtop_server_LDADD = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid.la \
$(top_builddir)/sysdeps/common/libgtop_suid_common.la \
@@ -54,8 +40,6 @@ if ENABLE_STATIC
libgtop_server_LDFLAGS = -static
endif
-EXTRA_DIST = server_config.h.in server_config.pl
-
install-exec-hook:
-@libgtop_postinstall@
diff --git a/src/daemon/server_config.h b/src/daemon/server_config.h
deleted file mode 100644
index 09ae9ae8..00000000
--- a/src/daemon/server_config.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#define SERVER_PORT 42800
-
-#define SERVER_UID 99
-#define SERVER_GID 99
-
-#define HOST_TABLE_ENTRIES 1
-
-const char *permitted_host_names [HOST_TABLE_ENTRIES] =
-{ NULL };
-
-unsigned long permitted_hosts [HOST_TABLE_ENTRIES];
diff --git a/src/daemon/server_config.h.in b/src/daemon/server_config.h.in
deleted file mode 100644
index f7884c8d..00000000
--- a/src/daemon/server_config.h.in
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*-c-*- */
-
-/* This is a sample config file.
- *
- * Copy this file to 'server_config.h' and edit it to fix your needs !
- *
- * You can also use the 'server_config.pl' script to create 'server_config.h'.
- *
- */
-
-#define SERVER_PORT 42800 /* Port the server should listen on. */
-
-/* NOTE: On RedHat 5.1 nobody is UID 99 and GID 99.
- *
- * The 'server_config.pl' script will use the real UID and GID of 'nobody'
- * on your system as default.
- *
- * NOTE: This only works if the server is started as root or SUID to root.
- */
-
-#define SERVER_UID 99 /* User ID the server should run as. */
-#define SERVER_GID 99 /* Group ID the server should run as. */
-
-#define HOST_TABLE_ENTRIES 1 /* Number of entries in the host table. */
-
-/* List of hosts that should be authorized to connect to the server.
- *
- * SECURITY WARNING:
- * Enabling access for a particular hosts means the ALL USERS on this host
- * will be allowed to connect to the server !
- *
- * If you want security, let this table empty and use the 'xauth' method
- * instead.
- *
- * Look at the manpage of gnuserv (1) as shipped with GNU Emacs for more
- * details about security. The server uses the same security mechanisms
- * like gnuserv from XEmacs 20.3.
- */
-
-const char *permitted_host_names [HOST_TABLE_ENTRIES] =
-{ NULL };
-
-unsigned long permitted_hosts [HOST_TABLE_ENTRIES];
-
diff --git a/src/daemon/server_config.pl b/src/daemon/server_config.pl
deleted file mode 100755
index 3e78ca8f..00000000
--- a/src/daemon/server_config.pl
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/perl -w
-
-require 5.004;
-use strict;
-
-print "Enter port the server should listen on [42800]: ";
-
-my $port = <stdin>; chop $port;
-$port = 42800 unless $port =~ /^\d+$/;
-
-print "\nUser name or UID to run as [nobody]: ";
-
-my $user = <stdin>; chop $user; $user = 'nobody' if $user eq '';
-
-my ($login, $pass, $uid, $gid);
-
-unless ($user =~ /^\d+$/) {
- ($login, $pass, $uid, $gid) = getpwnam ($user) or
- die "User '$user' not in passwd file.";
-}
-
-my $g_default = (defined $gid) ? $gid : 'nogroup';
-
-print "Group name or GID to run as [$g_default]: ";
-
-my $group = <stdin>; chop $group; $group = $g_default if $group eq '';
-
-unless ($group =~ /^\d+$/) {
- $gid = getgrnam ($group) or
- die "Group '$group' not in group file.";
-}
-
-print "\nEnter list of hosts which should be authorized to";
-print "\nconnect to the server (terminate with a blank line):\n\n";
-
-print "SECURITY WARNING:\n";
-print " Enabling access for a particular hosts means the ALL USERS on this host will\n";
-print " be allowed to connect to the server !\n\n";
-
-print " If you want security, let this table empty and use the 'xauth' method instead.\n";
-print " Look at the manpage of gnuserv (1) as shipped with GNU Emacs for more details\n";
-print " about security. The server uses the same security mechanisms like gnuserv from\n";
-print " XEmacs 20.3\n\n";
-
-my @hosts = ();
-my @host_addrs = ();
-my @host_names = ();
-
-while (1) {
- print "Host: ";
-
- my $host = <stdin>; chop $host;
- last if $host eq '';
-
- my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyname ($host) or
- die "gethostbyname (): Can't resolve '$host'";
-
- my ($a,$b,$c,$d) = unpack('C4',$addrs[0]);
-
- push @hosts, sprintf ("0x%02X%02X%02X%02X", $d, $c, $b, $a);
- push @host_addrs, sprintf ("%d.%d.%d.%d", $a, $b, $c, $d);
- push @host_names, $name;
-};
-
-print "\n";
-print "This is your config:\n";
-print "====================\n\n";
-
-printf qq[%-30s: %d\n\n], 'Port', $port;
-printf qq[%-30s: %d\n], 'UID', $uid;
-printf qq[%-30s: %d\n\n], 'GID', $gid;
-
-foreach (0..$#hosts) {
- printf qq[%-30s (%s - %s)\n], $host_names[$_], $hosts[$_], $host_addrs [$_];
-}
-
-print "\n";
-
-print "Accept? (yes/no) ";
-
-my $accept = <stdin>; chop $accept;
-
-exit unless $accept eq 'yes';
-
-print "\n";
-
-open CONFIG, "> server_config.h" or
- die "open (server_config.h): $!";
-select CONFIG;
-
-printf qq[\#define SERVER_PORT\t\t%d\n\n], $port;
-
-printf qq[\#define SERVER_UID\t\t%d\n], $uid;
-printf qq[\#define SERVER_GID\t\t%d\n\n], $gid;
-
-printf qq[\#define HOST_TABLE_ENTRIES\t%d\n\n], $#hosts + 1;
-
-foreach (@host_names) {
- $_ = qq["$_"];
-}
-
-printf qq[const char *permitted_host_names [HOST_TABLE_ENTRIES] = \n];
-printf qq[{ %s };\n\n], join (', ', @host_names);
-
-printf qq[unsigned long permitted_hosts [HOST_TABLE_ENTRIES];\n];
-
-close CONFIG;
-
-select STDOUT;
-
-print "Your config has successfully been written to 'server_config.h'.\n";
diff --git a/src/daemon/slave.c b/src/daemon/slave.c
index 3682c5d1..9b471b7c 100644
--- a/src/daemon/slave.c
+++ b/src/daemon/slave.c
@@ -97,7 +97,7 @@ handle_slave_connection (int input, int output)
sizeof (max_len));
ptr = glibtop_get_proc_args_p (server,
&resp->u.data.proc_args,
- pid, max_len);
+ pid);
do_output (output, resp, _offset_data (proc_args),
ptr ? resp->u.data.proc_args.size+1 : 0,
ptr, (ptr != NULL) ? 0 : -1);