-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade openssh #26
Merged
Merged
Upgrade openssh #26
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9aa72bf
refactor(openssh): update version
alebabai cc73e0c
refactor(openssh): update own patches
alebabai 6e13556
refactor(openssh): update alpine patches
alebabai 9202915
refactor(openssh): fix realpath function
alebabai 7ce3fa7
refactor(openssh): split patches by vendor
alebabai e752530
Merge branch 'master' into feature/upgrade-openssh
osterman 698472f
Merge branch 'master' of github.com:cloudposse/bastion into feature/u…
alebabai ea9aef9
docs(patches): document used patches
alebabai 434aa15
Merge branch 'feature/upgrade-openssh' of github.com:cloudposse/basti…
alebabai cfdef33
fix typo
alebabai File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- openssh-7.7p1/sshd_config.old 2018-04-02 00:38:28.000000000 -0500 | ||
+++ openssh-7.7p1/sshd_config 2018-07-29 03:08:16.340000000 -0500 | ||
@@ -82,9 +82,10 @@ | ||
#UsePAM no | ||
|
||
#AllowAgentForwarding yes | ||
-#AllowTcpForwarding yes | ||
-#GatewayPorts no | ||
-#X11Forwarding no | ||
+# Feel free to re-enable these if your use case requires them. | ||
+AllowTcpForwarding no | ||
+GatewayPorts no | ||
+X11Forwarding no | ||
#X11DisplayOffset 10 | ||
#X11UseLocalhost yes | ||
#PermitTTY yes |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
197 changes: 197 additions & 0 deletions
197
patches/openssh/cloudposse/bsd-compatible-realpath.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h | ||
index f5c833bf..e2ccf20e 100644 | ||
--- a/openbsd-compat/openbsd-compat.h | ||
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h | ||
index f5c833bf..e2ccf20e 100644 | ||
--- a/openbsd-compat/openbsd-compat.h | ||
+++ b/openbsd-compat/openbsd-compat.h | ||
@@ -80,17 +80,7 @@ void *reallocarray(void *, size_t, size_t); | ||
void *recallocarray(void *, size_t, size_t, size_t); | ||
#endif | ||
|
||
-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) | ||
-/* | ||
- * glibc's FORTIFY_SOURCE can redefine this and prevent us picking up the | ||
- * compat version. | ||
- */ | ||
-# ifdef BROKEN_REALPATH | ||
-# define realpath(x, y) _ssh_compat_realpath(x, y) | ||
-# endif | ||
- | ||
-char *realpath(const char *path, char *resolved); | ||
-#endif | ||
+char *ssh_realpath(const char *path, char *resolved); | ||
|
||
#ifndef HAVE_RRESVPORT_AF | ||
int rresvport_af(int *alport, sa_family_t af); | ||
diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c | ||
index a2f090e5..979e3a8e 100644 | ||
--- a/openbsd-compat/realpath.c | ||
+++ b/openbsd-compat/realpath.c | ||
@@ -31,7 +31,7 @@ | ||
|
||
#include "includes.h" | ||
|
||
-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) | ||
+#if 1 | ||
|
||
#include <sys/types.h> | ||
#include <sys/param.h> | ||
@@ -58,7 +58,7 @@ | ||
* in which case the path which caused trouble is left in (resolved). | ||
*/ | ||
char * | ||
-realpath(const char *path, char *resolved) | ||
+ssh_realpath(const char *path, char *resolved) | ||
{ | ||
struct stat sb; | ||
char *p, *q, *s; | ||
diff --git a/sftp-server.c b/sftp-server.c | ||
index ab1b063f..2e06b384 100644 | ||
--- a/sftp-server.c | ||
+++ b/sftp-server.c | ||
@@ -1158,7 +1158,7 @@ process_realpath(u_int32_t id) | ||
} | ||
debug3("request %u: realpath", id); | ||
verbose("realpath \"%s\"", path); | ||
- if (realpath(path, resolvedname) == NULL) { | ||
+ if (ssh_realpath(path, resolvedname) == NULL) { | ||
|
||
Aliaksandr_Babai@EPBYGROW0276 MINGW64 ~/workspace/openssh-portable (master) | ||
$ git diff | ||
diff --git a/configure.ac b/configure.ac | ||
index 83e53075..80e71183 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -2029,7 +2029,7 @@ AC_CHECK_FUNCS([setresgid], [ | ||
) | ||
]) | ||
|
||
-AC_CHECK_FUNCS([realpath], [ | ||
+AC_CHECK_FUNCS([ssh_realpath], [ | ||
dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given | ||
dnl path name", however some implementations of realpath (and some | ||
dnl versions of the POSIX spec) do not work on non-existent files, | ||
@@ -2042,7 +2042,7 @@ AC_CHECK_FUNCS([realpath], [ | ||
#include <errno.h> | ||
]], [[ | ||
char buf[PATH_MAX]; | ||
- if (realpath("/opensshnonexistentfilename1234", buf) == NULL) | ||
+ if (ssh_realpath("/opensshnonexistentfilename1234", buf) == NULL) | ||
if (errno == ENOENT) | ||
exit(1); | ||
exit(0); | ||
diff --git a/misc.c b/misc.c | ||
index ae4d29b8..edd4226a 100644 | ||
--- a/misc.c | ||
+++ b/misc.c | ||
@@ -1770,7 +1770,7 @@ safe_path(const char *name, struct stat *stp, const char *pw_dir, | ||
int comparehome = 0; | ||
struct stat st; | ||
|
||
- if (realpath(name, buf) == NULL) { | ||
+ if (ssh_realpath(name, buf) == NULL) { | ||
snprintf(err, errlen, "realpath %s failed: %s", name, | ||
strerror(errno)); | ||
return -1; | ||
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h | ||
index f5c833bf..e2ccf20e 100644 | ||
--- a/openbsd-compat/openbsd-compat.h | ||
+++ b/openbsd-compat/openbsd-compat.h | ||
@@ -80,17 +80,7 @@ void *reallocarray(void *, size_t, size_t); | ||
void *recallocarray(void *, size_t, size_t, size_t); | ||
#endif | ||
|
||
-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) | ||
-/* | ||
- * glibc's FORTIFY_SOURCE can redefine this and prevent us picking up the | ||
- * compat version. | ||
- */ | ||
-# ifdef BROKEN_REALPATH | ||
-# define realpath(x, y) _ssh_compat_realpath(x, y) | ||
-# endif | ||
- | ||
-char *realpath(const char *path, char *resolved); | ||
-#endif | ||
+char *ssh_realpath(const char *path, char *resolved); | ||
|
||
#ifndef HAVE_RRESVPORT_AF | ||
int rresvport_af(int *alport, sa_family_t af); | ||
diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c | ||
index a2f090e5..453540a5 100644 | ||
--- a/openbsd-compat/realpath.c | ||
+++ b/openbsd-compat/realpath.c | ||
@@ -31,7 +31,7 @@ | ||
|
||
#include "includes.h" | ||
|
||
-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) | ||
+#if 1 | ||
|
||
#include <sys/types.h> | ||
#include <sys/param.h> | ||
@@ -51,14 +51,14 @@ | ||
/* A slightly modified copy of this file exists in libexec/ld.so */ | ||
|
||
/* | ||
- * char *realpath(const char *path, char resolved[PATH_MAX]); | ||
+ * char *ssh_realpath(const char *path, char resolved[PATH_MAX]); | ||
* | ||
* Find the real name of path, by removing all ".", ".." and symlink | ||
* components. Returns (resolved) on success, or (NULL) on failure, | ||
* in which case the path which caused trouble is left in (resolved). | ||
*/ | ||
char * | ||
-realpath(const char *path, char *resolved) | ||
+ssh_realpath(const char *path, char *resolved) | ||
{ | ||
struct stat sb; | ||
char *p, *q, *s; | ||
diff --git a/regress/check-perm.c b/regress/check-perm.c | ||
index dac307d2..eb6a006e 100644 | ||
--- a/regress/check-perm.c | ||
+++ b/regress/check-perm.c | ||
@@ -99,7 +99,7 @@ auth_secure_path(const char *name, struct stat *stp, const char *pw_dir, | ||
int comparehome = 0; | ||
struct stat st; | ||
|
||
- if (realpath(name, buf) == NULL) { | ||
+ if (ssh_realpath(name, buf) == NULL) { | ||
snprintf(err, errlen, "realpath %s failed: %s", name, | ||
strerror(errno)); | ||
return -1; | ||
diff --git a/sftp-server.c b/sftp-server.c | ||
index ab1b063f..2e06b384 100644 | ||
--- a/sftp-server.c | ||
+++ b/sftp-server.c | ||
@@ -1158,7 +1158,7 @@ process_realpath(u_int32_t id) | ||
} | ||
debug3("request %u: realpath", id); | ||
verbose("realpath \"%s\"", path); | ||
- if (realpath(path, resolvedname) == NULL) { | ||
+ if (ssh_realpath(path, resolvedname) == NULL) { | ||
send_status(id, errno_to_portable(errno)); | ||
} else { | ||
Stat s; | ||
diff --git a/ssh-agent.c b/ssh-agent.c | ||
index d8a8260f..6050ff1a 100644 | ||
--- a/ssh-agent.c | ||
+++ b/ssh-agent.c | ||
@@ -585,7 +585,7 @@ process_add_smartcard_key(SocketEntry *e) | ||
goto send; | ||
} | ||
} | ||
- if (realpath(provider, canonical_provider) == NULL) { | ||
+ if (ssh_realpath(provider, canonical_provider) == NULL) { | ||
verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", | ||
provider, strerror(errno)); | ||
goto send; | ||
@@ -638,7 +638,7 @@ process_remove_smartcard_key(SocketEntry *e) | ||
} | ||
free(pin); | ||
|
||
- if (realpath(provider, canonical_provider) == NULL) { | ||
+ if (ssh_realpath(provider, canonical_provider) == NULL) { | ||
verbose("failed PKCS#11 add of \"%.100s\": realpath: %s", | ||
provider, strerror(errno)); | ||
goto send; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/version.h b/version.h | ||
index f1bbf00f..502661dc 100644 | ||
--- a/version.h | ||
+++ b/version.h | ||
@@ -1,6 +1,6 @@ | ||
/* $OpenBSD: version.h,v 1.82 2018/07/03 11:42:12 djm Exp $ */ | ||
|
||
-#define SSH_VERSION "OpenSSH_7.8" | ||
+#define SSH_VERSION "SERVER" | ||
|
||
#define SSH_PORTABLE "p1" | ||
#define SSH_RELEASE SSH_VERSION SSH_PORTABLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/session.c b/session.c | ||
index f2cf5200..78901a0f 100644 | ||
--- a/session.c | ||
+++ b/session.c | ||
@@ -696,12 +696,11 @@ do_exec(struct ssh *ssh, Session *s, const char *command) | ||
const char *forced = NULL, *tty = NULL; | ||
char session_type[1024]; | ||
|
||
+ original_command = command; | ||
if (options.adm_forced_command) { | ||
- original_command = command; | ||
command = options.adm_forced_command; | ||
forced = "(config)"; | ||
} else if (auth_opts->force_command != NULL) { | ||
- original_command = command; | ||
command = auth_opts->force_command; | ||
forced = "(key-option)"; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an
alpine
patch https://git.alpinelinux.org/cgit/aports/tree/main/opensshThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to appropriate vendor folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap, but i modified it - now it differs significantly from alpine one