]> andersk Git - gssapi-openssh.git/blobdiff - openssh/monitor_wrap.c
Import of OpenSSH 4.9p1
[gssapi-openssh.git] / openssh / monitor_wrap.c
index 27cc1c5f1f91b59432d250e6d222abf4c27a4d73..e895f19240ae6971bcee8346d5d35d1f5ef2a986 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_wrap.c,v 1.55 2007/02/19 10:45:58 dtucker Exp $ */
+/* $OpenBSD: monitor_wrap.c,v 1.60 2007/10/29 04:08:08 dtucker Exp $ */
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
  * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -222,8 +222,8 @@ mm_getpwnamallow(const char *username)
        mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PWNAM, &m);
 
        if (buffer_get_char(&m) == 0) {
-               buffer_free(&m);
-               return (NULL);
+               pw = NULL;
+               goto out;
        }
        pw = buffer_get_string(&m, &len);
        if (len != sizeof(struct passwd))
@@ -237,6 +237,7 @@ mm_getpwnamallow(const char *username)
        pw->pw_dir = buffer_get_string(&m, NULL);
        pw->pw_shell = buffer_get_string(&m, NULL);
 
+out:
        /* copy options block as a Match directive may have changed some */
        newopts = buffer_get_string(&m, &len);
        if (len != sizeof(*newopts))
@@ -476,8 +477,8 @@ mm_newkeys_from_blob(u_char *blob, int blen)
 
        /* Mac structure */
        mac->name = buffer_get_string(&b, NULL);
-       if (mac->name == NULL || mac_init(mac, mac->name) == -1)
-               fatal("%s: can not init mac %s", __func__, mac->name);
+       if (mac->name == NULL || mac_setup(mac, mac->name) == -1)
+               fatal("%s: can not setup mac %s", __func__, mac->name);
        mac->enabled = buffer_get_int(&b);
        mac->key = buffer_get_string(&b, &len);
        if (len > mac->key_len)
@@ -688,8 +689,9 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
        buffer_append(&loginmsg, msg, strlen(msg));
        xfree(msg);
 
-       *ptyfd = mm_receive_fd(pmonitor->m_recvfd);
-       *ttyfd = mm_receive_fd(pmonitor->m_recvfd);
+       if ((*ptyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1 ||
+           (*ttyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1)
+               fatal("%s: receive fds failed", __func__);
 
        /* Success */
        return (1);
This page took 0.035641 seconds and 4 git commands to generate.