summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1999-02-19 22:30:34 +0000
committerMartin Baulig <martin@src.gnome.org>1999-02-19 22:30:34 +0000
commit35995577ca5f42fb8ee6d38501c34c9d5ad588f1 (patch)
treeafd1b93ca10ef58e67f80723d10587ad2872e11f /src
parenteaf527d66a295891440c2ff612f5a13503f514f5 (diff)
downloadlibgtop-35995577ca5f42fb8ee6d38501c34c9d5ad588f1.tar.gz
For suid/sgid servers the operating system version must match the one the
1999-02-19 Martin Baulig <martin@home-of-linux.org> * lib/open.c, src/daemon/version.c: For suid/sgid servers the operating system version must match the one the server was compiled on.
Diffstat (limited to 'src')
-rw-r--r--src/daemon/version.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/daemon/version.c b/src/daemon/version.c
index e6cdb7ff..5c95cad7 100644
--- a/src/daemon/version.c
+++ b/src/daemon/version.c
@@ -23,18 +23,25 @@
#include <glibtop/error.h>
#include <glibtop/version.h>
+#include <sys/utsname.h>
+
void
glibtop_send_version (glibtop *server, int fd)
{
- char buffer [BUFSIZ];
+ char buffer [BUFSIZ+10];
+ struct utsname uts;
size_t size;
- sprintf (buffer, LIBGTOP_VERSION_STRING,
- LIBGTOP_VERSION, LIBGTOP_SERVER_VERSION,
- sizeof (glibtop_command),
- sizeof (glibtop_response),
- sizeof (glibtop_union),
- sizeof (glibtop_sysdeps));
+ if (uname (&uts))
+ glibtop_error_io_r (server, "uname");
+
+ snprintf (buffer, BUFSIZ, LIBGTOP_VERSION_STRING,
+ LIBGTOP_VERSION, LIBGTOP_SERVER_VERSION,
+ sizeof (glibtop_command),
+ sizeof (glibtop_response),
+ sizeof (glibtop_union),
+ sizeof (glibtop_sysdeps),
+ uts.sysname, uts.release, uts.machine);
size = strlen (buffer) + 1;