]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/02/22 21:59:44
authormouring <mouring>
Mon, 5 Mar 2001 05:56:40 +0000 (05:56 +0000)
committermouring <mouring>
Mon, 5 Mar 2001 05:56:40 +0000 (05:56 +0000)
     [auth.c auth.h auth1.c auth2.c misc.c misc.h ssh.c]
     use pwcopy in ssh.c, too

ChangeLog
auth.c
auth.h
auth1.c
auth2.c
misc.c
misc.h
ssh.c

index 945022ea8687450e4aecce240991c3f06cebd79e..29078944dc96a9867b42360825614db72cb7f417 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,9 @@
    - markus@cvs.openbsd.org 2001/02/22 21:57:27
      [ssh.1 sshd.8]
      typos/grammar from matt@anzen.com
+   - markus@cvs.openbsd.org 2001/02/22 21:59:44
+     [auth.c auth.h auth1.c auth2.c misc.c misc.h ssh.c]
+     use pwcopy in ssh.c, too
 
 20010304
  - (bal) Remove make-ssh-known-hosts.1 since it's no longer valid.
diff --git a/auth.c b/auth.c
index 61984a07653f9db51e1bbe131b68b424598577ae..edd22a8d213f4b0734e64a9d93d8390facef8209 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth.c,v 1.17 2001/02/12 16:16:23 markus Exp $");
+RCSID("$OpenBSD: auth.c,v 1.18 2001/02/22 21:59:43 markus Exp $");
 
 #ifdef HAVE_LOGIN_H
 #include <login.h>
@@ -170,26 +170,6 @@ authctxt_new(void)
        return authctxt;
 }
 
-struct passwd *
-pwcopy(struct passwd *pw)
-{
-       struct passwd *copy = xmalloc(sizeof(*copy));
-       memset(copy, 0, sizeof(*copy));
-       copy->pw_name = xstrdup(pw->pw_name);
-       copy->pw_passwd = xstrdup(pw->pw_passwd);
-       copy->pw_uid = pw->pw_uid;
-       copy->pw_gid = pw->pw_gid;
-#ifdef HAVE_PW_CLASS_IN_PASSWD
-       copy->pw_class = xstrdup(pw->pw_class);
-#endif
-#ifdef HAVE_CYGWIN
-       copy->pw_gecos = xstrdup(pw->pw_gecos);
-#endif
-       copy->pw_dir = xstrdup(pw->pw_dir);
-       copy->pw_shell = xstrdup(pw->pw_shell);
-       return copy;
-}
-
 void
 auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
 {
diff --git a/auth.h b/auth.h
index 45755339786188607f4d76573dd2551eabded61f..6afce6b3aa55bdbd86ca0d87fda471cb4bafcf93 100644 (file)
--- a/auth.h
+++ b/auth.h
@@ -21,7 +21,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $OpenBSD: auth.h,v 1.11 2001/02/12 16:16:23 markus Exp $
+ * $OpenBSD: auth.h,v 1.12 2001/02/22 21:59:43 markus Exp $
  */
 #ifndef AUTH_H
 #define AUTH_H
@@ -132,7 +132,6 @@ char        *get_challenge(Authctxt *authctxt, char *devs);
 int    verify_response(Authctxt *authctxt, char *response);
 
 struct passwd * auth_get_user(void);
-struct passwd * pwcopy(struct passwd *pw);
 
 #define AUTH_FAIL_MAX 6
 #define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2)
diff --git a/auth1.c b/auth1.c
index beccf2b45a33ed7f6450bc42d4c31c9b7483c1c3..4d623717f8badcb4e0bb182cea9f0216c16f6f8c 100644 (file)
--- a/auth1.c
+++ b/auth1.c
@@ -10,7 +10,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth1.c,v 1.17 2001/02/13 22:49:40 markus Exp $");
+RCSID("$OpenBSD: auth1.c,v 1.18 2001/02/22 21:59:43 markus Exp $");
 
 #include "xmalloc.h"
 #include "rsa.h"
@@ -23,6 +23,7 @@ RCSID("$OpenBSD: auth1.c,v 1.17 2001/02/13 22:49:40 markus Exp $");
 #include "compat.h"
 #include "auth.h"
 #include "session.h"
+#include "misc.h"
 
 /* import */
 extern ServerOptions options;
diff --git a/auth2.c b/auth2.c
index e9010506608f8e07c2e7d46de3aa3d29e80819a4..5d7de3a1c850e2ac1497dd885b9480c3fb679fee 100644 (file)
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2.c,v 1.42 2001/02/13 22:49:40 markus Exp $");
+RCSID("$OpenBSD: auth2.c,v 1.43 2001/02/22 21:59:44 markus Exp $");
 
 #include <openssl/evp.h>
 
@@ -47,6 +47,7 @@ RCSID("$OpenBSD: auth2.c,v 1.42 2001/02/13 22:49:40 markus Exp $");
 #include "pathnames.h"
 #include "uidswap.h"
 #include "auth-options.h"
+#include "misc.h"
 
 /* import */
 extern ServerOptions options;
@@ -75,7 +76,6 @@ void  protocol_error(int type, int plen, void *ctxt);
 
 /* helper */
 Authmethod     *authmethod_lookup(const char *name);
-struct passwd  *pwcopy(struct passwd *pw);
 int    user_key_allowed(struct passwd *pw, Key *key);
 char   *authmethods_get(void);
 
diff --git a/misc.c b/misc.c
index 7430116542d8f0798cbaaf2818b7f6bc492bec09..4a1213a298aa8e3500d1eed4d3c0ff51c83115cc 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/*     $OpenBSD: misc.c,v 1.1 2001/01/21 19:05:52 markus Exp $ */
+/*     $OpenBSD: misc.c,v 1.2 2001/02/22 21:59:44 markus Exp $ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: misc.c,v 1.1 2001/01/21 19:05:52 markus Exp $");
+RCSID("$OpenBSD: misc.c,v 1.2 2001/02/22 21:59:44 markus Exp $");
 
 #include "misc.h"
 #include "log.h"
@@ -96,6 +96,21 @@ strdelim(char **s)
        return (old);
 }
 
+struct passwd *
+pwcopy(struct passwd *pw)
+{
+       struct passwd *copy = xmalloc(sizeof(*copy));
+       memset(copy, 0, sizeof(*copy));
+       copy->pw_name = xstrdup(pw->pw_name);
+       copy->pw_passwd = xstrdup(pw->pw_passwd);
+       copy->pw_uid = pw->pw_uid;
+       copy->pw_gid = pw->pw_gid;
+       copy->pw_class = xstrdup(pw->pw_class);
+       copy->pw_dir = xstrdup(pw->pw_dir);
+       copy->pw_shell = xstrdup(pw->pw_shell);
+       return copy;
+}
+
 mysig_t
 mysignal(int sig, mysig_t act)
 {
diff --git a/misc.h b/misc.h
index 1dd038960f969de3cfddc347420d3c13402af13d..3204b626a3e83cd8905a57f2fb49566f596e08e3 100644 (file)
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
-/*     $OpenBSD: misc.h,v 1.2 2001/01/29 01:58:17 niklas Exp $ */
+/*     $OpenBSD: misc.h,v 1.3 2001/02/22 21:59:44 markus Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -20,6 +20,8 @@ char  *strdelim(char **s);
 /* set filedescriptor to non-blocking */
 void   set_nonblock(int fd);
 
+struct passwd * pwcopy(struct passwd *pw);
+
 /* wrapper for signal interface */
 typedef void (*mysig_t)(int);
 mysig_t mysignal(int sig, mysig_t act);
diff --git a/ssh.c b/ssh.c
index 7db19f3ba96a961e6e0236a06cb872c8b52c5727..ec6f30e54c5ceeae966e328e02ac18c4de9d44e6 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.97 2001/02/21 21:14:04 stevesk Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.98 2001/02/22 21:59:44 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -245,7 +245,7 @@ main(int ac, char **av)
        u_short fwd_port, fwd_host_port;
        char *optarg, *cp, buf[256];
        struct stat st;
-       struct passwd *pw, pwcopy;
+       struct passwd *pw;
        int dummy;
        uid_t original_effective_uid;
 
@@ -555,17 +555,7 @@ main(int ac, char **av)
                exit(1);
        }
        /* Take a copy of the returned structure. */
-       memset(&pwcopy, 0, sizeof(pwcopy));
-       pwcopy.pw_name = xstrdup(pw->pw_name);
-       pwcopy.pw_passwd = xstrdup(pw->pw_passwd);
-       pwcopy.pw_uid = pw->pw_uid;
-       pwcopy.pw_gid = pw->pw_gid;
-#ifdef HAVE_PW_CLASS_IN_PASSWD
-       pwcopy.pw_class = xstrdup(pw->pw_class);
-#endif
-       pwcopy.pw_dir = xstrdup(pw->pw_dir);
-       pwcopy.pw_shell = xstrdup(pw->pw_shell);
-       pw = &pwcopy;
+       pw = pwcopy(pw);
 
        /* Initialize "log" output.  Since we are the client all output
           actually goes to the terminal. */
This page took 0.318539 seconds and 5 git commands to generate.