Remove dead code for unused IMSG_CTL_NOTIFY messages.
authordv <dv@openbsd.org>
Sun, 11 Apr 2021 18:53:23 +0000 (18:53 +0000)
committerdv <dv@openbsd.org>
Sun, 11 Apr 2021 18:53:23 +0000 (18:53 +0000)
Some vestigial code left over from when priv-sep was implemented.

ok mlarkin@

usr.sbin/vmd/control.c
usr.sbin/vmd/proc.h

index e5fe3b8..50139da 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: control.c,v 1.32 2020/09/23 19:18:18 martijn Exp $    */
+/*     $OpenBSD: control.c,v 1.33 2021/04/11 18:53:23 dv Exp $ */
 
 /*
  * Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org>
@@ -48,7 +48,6 @@ struct ctl_conn
 void    control_close(int, struct control_sock *);
 void    control_dispatch_imsg(int, short, void *);
 int     control_dispatch_vmd(int, struct privsep_proc *, struct imsg *);
-void    control_imsg_forward(struct imsg *);
 void    control_run(struct privsep *, struct privsep_proc *, void *);
 
 static struct privsep_proc procs[] = {
@@ -357,19 +356,7 @@ control_dispatch_imsg(int fd, short event, void *arg)
                        break;
                }
 
-               control_imsg_forward(&imsg);
-
                switch (imsg.hdr.type) {
-               case IMSG_CTL_NOTIFY:
-                       if (c->flags & CTL_CONN_NOTIFY) {
-                               log_debug("%s: "
-                                   "client requested notify more than once",
-                                   __func__);
-                               ret = EINVAL;
-                               goto fail;
-                       }
-                       c->flags |= CTL_CONN_NOTIFY;
-                       break;
                case IMSG_CTL_VERBOSE:
                        if (IMSG_DATA_SIZE(&imsg) < sizeof(v))
                                goto fail;
@@ -459,15 +446,3 @@ control_dispatch_imsg(int fd, short event, void *arg)
        imsg_flush(&c->iev.ibuf);
        control_close(fd, cs);
 }
-
-void
-control_imsg_forward(struct imsg *imsg)
-{
-       struct ctl_conn *c;
-
-       TAILQ_FOREACH(c, &ctl_conns, entry)
-               if (c->flags & CTL_CONN_NOTIFY)
-                       imsg_compose_event(&c->iev, imsg->hdr.type,
-                           imsg->hdr.peerid, imsg->hdr.pid, -1, imsg->data,
-                           imsg->hdr.len - IMSG_HEADER_SIZE);
-}
index b14ca9f..454d5b0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: proc.h,v 1.17 2021/01/27 07:21:54 deraadt Exp $       */
+/*     $OpenBSD: proc.h,v 1.18 2021/04/11 18:53:23 dv Exp $    */
 
 /*
  * Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org>
@@ -32,7 +32,6 @@ enum {
        IMSG_CTL_FAIL,
        IMSG_CTL_VERBOSE,
        IMSG_CTL_END,
-       IMSG_CTL_NOTIFY,
        IMSG_CTL_RESET,
        IMSG_CTL_PROCFD,
        IMSG_PROC_MAX
@@ -71,12 +70,8 @@ TAILQ_HEAD(control_socks, control_sock);
 
 struct ctl_conn {
        TAILQ_ENTRY(ctl_conn)    entry;
-       uint8_t                  flags;
-       unsigned int             waiting;
-#define CTL_CONN_NOTIFY                 0x01
        struct imsgev            iev;
        struct sockpeercred      peercred;
-
 };
 TAILQ_HEAD(ctl_connlist, ctl_conn);
 extern  struct ctl_connlist ctl_conns;