- 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.
*/
#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>
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)
{
* (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
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)
*/
#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"
#include "compat.h"
#include "auth.h"
#include "session.h"
+#include "misc.h"
/* import */
extern ServerOptions options;
*/
#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>
#include "pathnames.h"
#include "uidswap.h"
#include "auth-options.h"
+#include "misc.h"
/* import */
extern ServerOptions options;
/* 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);
-/* $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.
*/
#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"
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)
{
-/* $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>
/* 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);
*/
#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>
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;
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. */