- (djm) OpenBSD CVS Sync

- tobias@cvs.openbsd.org 2009/02/21 19:32:04
     [misc.c sftp-server-main.c ssh-keygen.c]
     Added missing newlines in error messages.
     ok dtucker
This commit is contained in:
Damien Miller 2009-02-22 08:47:02 +11:00
parent 7691e5fa44
commit 9eab9564d5
4 changed files with 23 additions and 14 deletions

View File

@ -1,3 +1,10 @@
20090222
- (djm) OpenBSD CVS Sync
- tobias@cvs.openbsd.org 2009/02/21 19:32:04
[misc.c sftp-server-main.c ssh-keygen.c]
Added missing newlines in error messages.
ok dtucker
20090221 20090221
- (djm) OpenBSD CVS Sync - (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2009/02/17 01:28:32 - djm@cvs.openbsd.org 2009/02/17 01:28:32
@ -5183,5 +5190,5 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@ passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.5200 2009/02/21 07:03:04 djm Exp $ $Id: ChangeLog,v 1.5201 2009/02/21 21:47:02 djm Exp $

7
misc.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: misc.c,v 1.70 2009/01/22 10:02:34 djm Exp $ */ /* $OpenBSD: misc.c,v 1.71 2009/02/21 19:32:04 tobias Exp $ */
/* /*
* Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005,2006 Damien Miller. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@ -714,7 +714,8 @@ sanitise_stdfd(void)
int nullfd, dupfd; int nullfd, dupfd;
if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) { if ((nullfd = dupfd = open(_PATH_DEVNULL, O_RDWR)) == -1) {
fprintf(stderr, "Couldn't open /dev/null: %s", strerror(errno)); fprintf(stderr, "Couldn't open /dev/null: %s\n",
strerror(errno));
exit(1); exit(1);
} }
while (++dupfd <= 2) { while (++dupfd <= 2) {
@ -722,7 +723,7 @@ sanitise_stdfd(void)
if (fcntl(dupfd, F_GETFL, 0) >= 0) if (fcntl(dupfd, F_GETFL, 0) >= 0)
continue; continue;
if (dup2(nullfd, dupfd) == -1) { if (dup2(nullfd, dupfd) == -1) {
fprintf(stderr, "dup2: %s", strerror(errno)); fprintf(stderr, "dup2: %s\n", strerror(errno));
exit(1); exit(1);
} }
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: sftp-server-main.c,v 1.3 2008/03/26 23:44:41 djm Exp $ */ /* $OpenBSD: sftp-server-main.c,v 1.4 2009/02/21 19:32:04 tobias Exp $ */
/* /*
* Copyright (c) 2008 Markus Friedl. All rights reserved. * Copyright (c) 2008 Markus Friedl. All rights reserved.
* *
@ -42,7 +42,8 @@ main(int argc, char **argv)
sanitise_stdfd(); sanitise_stdfd();
if ((user_pw = getpwuid(getuid())) == NULL) { if ((user_pw = getpwuid(getuid())) == NULL) {
fprintf(stderr, "No user found for uid %lu", (u_long)getuid()); fprintf(stderr, "No user found for uid %lu\n",
(u_long)getuid());
return 1; return 1;
} }

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh-keygen.c,v 1.172 2008/11/07 00:42:12 stevesk Exp $ */ /* $OpenBSD: ssh-keygen.c,v 1.173 2009/02/21 19:32:04 tobias Exp $ */
/* /*
* Author: Tatu Ylonen <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -135,7 +135,7 @@ ask_filename(struct passwd *pw, const char *prompt)
name = _PATH_SSH_CLIENT_ID_RSA; name = _PATH_SSH_CLIENT_ID_RSA;
break; break;
default: default:
fprintf(stderr, "bad key type"); fprintf(stderr, "bad key type\n");
exit(1); exit(1);
break; break;
} }
@ -421,7 +421,7 @@ do_convert_from_ssh2(struct passwd *pw)
PEM_write_RSAPrivateKey(stdout, k->rsa, NULL, NULL, 0, NULL, NULL)) : PEM_write_RSAPrivateKey(stdout, k->rsa, NULL, NULL, 0, NULL, NULL)) :
key_write(k, stdout); key_write(k, stdout);
if (!ok) { if (!ok) {
fprintf(stderr, "key write failed"); fprintf(stderr, "key write failed\n");
exit(1); exit(1);
} }
key_free(k); key_free(k);
@ -1015,11 +1015,11 @@ do_change_comment(struct passwd *pw)
} }
f = fdopen(fd, "w"); f = fdopen(fd, "w");
if (f == NULL) { if (f == NULL) {
printf("fdopen %s failed", identity_file); printf("fdopen %s failed\n", identity_file);
exit(1); exit(1);
} }
if (!key_write(public, f)) if (!key_write(public, f))
fprintf(stderr, "write key failed"); fprintf(stderr, "write key failed\n");
key_free(public); key_free(public);
fprintf(f, " %s\n", new_comment); fprintf(f, " %s\n", new_comment);
fclose(f); fclose(f);
@ -1366,7 +1366,7 @@ main(int argc, char **argv)
printf("Generating public/private %s key pair.\n", key_type_name); printf("Generating public/private %s key pair.\n", key_type_name);
private = key_generate(type, bits); private = key_generate(type, bits);
if (private == NULL) { if (private == NULL) {
fprintf(stderr, "key_generate failed"); fprintf(stderr, "key_generate failed\n");
exit(1); exit(1);
} }
public = key_from_private(private); public = key_from_private(private);
@ -1456,11 +1456,11 @@ passphrase_again:
} }
f = fdopen(fd, "w"); f = fdopen(fd, "w");
if (f == NULL) { if (f == NULL) {
printf("fdopen %s failed", identity_file); printf("fdopen %s failed\n", identity_file);
exit(1); exit(1);
} }
if (!key_write(public, f)) if (!key_write(public, f))
fprintf(stderr, "write key failed"); fprintf(stderr, "write key failed\n");
fprintf(f, " %s\n", comment); fprintf(f, " %s\n", comment);
fclose(f); fclose(f);