summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-14 04:21:42 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-06-14 04:21:42 +0000
commit278c249736e125ed08f93f1be0db30a7109404fb (patch)
tree446810cf8c4f7fbd31deb21cb937c2eebef95bcd
parentfa52af93425ee1979f354db4cad05c64b4ebd0ae (diff)
this group operator stuff is completely wrong
-rw-r--r--usr.sbin/apmd/apmd.84
-rw-r--r--usr.sbin/apmd/apmd.c13
2 files changed, 5 insertions, 12 deletions
diff --git a/usr.sbin/apmd/apmd.8 b/usr.sbin/apmd/apmd.8
index 5318c4ef59f..3f2d4be6bc3 100644
--- a/usr.sbin/apmd/apmd.8
+++ b/usr.sbin/apmd/apmd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: apmd.8,v 1.22 2002/05/16 08:47:50 mpech Exp $
+.\" $OpenBSD: apmd.8,v 1.23 2002/06/14 04:21:41 deraadt Exp $
.\"
.\" Copyright (c) 1995 John T. Kohl
.\" All rights reserved.
@@ -199,7 +199,7 @@ is the default UNIX-domain socket used for communication with
The
.Fl S
flag may be used to specify an alternate socket name.
-The socket is protected to mode 0660, UID 0, GID 5; this protects access
+The socket is protected to mode 0660, UID 0, GID 0; this protects access
to suspend requests to authorized users only.
.Pp
.Pa /dev/apmctl
diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c
index 739c287cc82..124764e66cd 100644
--- a/usr.sbin/apmd/apmd.c
+++ b/usr.sbin/apmd/apmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apmd.c,v 1.24 2002/05/16 08:47:50 mpech Exp $ */
+/* $OpenBSD: apmd.c,v 1.25 2002/06/14 04:21:41 deraadt Exp $ */
/*
* Copyright (c) 1995, 1996 John T. Kohl
@@ -46,7 +46,6 @@
#include <signal.h>
#include <errno.h>
#include <err.h>
-#include <grp.h>
#include <machine/apmvar.h>
#include "pathnames.h"
#include "apm-proto.h"
@@ -180,13 +179,8 @@ int
bind_socket(const char *sockname)
{
struct sockaddr_un s_un;
- struct group *gr;
int sock;
- gr = getgrnam("operator");
- if (!gr)
- syslog(LOG_ERR, "no operator");
-
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock == -1)
error("cannot create local socket", NULL);
@@ -201,9 +195,8 @@ bind_socket(const char *sockname)
if (bind(sock, (struct sockaddr *)&s_un, s_un.sun_len) == -1)
error("cannot connect to APM socket", NULL);
- if (chmod(sockname, 0660) == -1 || chown(sockname, 0,
- gr ? gr->gr_gid : 0) == -1)
- error("cannot set socket chmod/chown", NULL);
+ if (chmod(sockname, 0660) == -1 || chown(sockname, 0, 0) == -1)
+ error("cannot set socket mode/owner/group to 660/0/0", NULL);
listen(sock, 1);
socketname = strdup(sockname);