| |
@@ -1,28 +1,28 @@
|
| |
- diff -up openssh-8.7p1/scp.c.scp-sftpdirs openssh-8.7p1/scp.c
|
| |
- --- openssh-8.7p1/scp.c.scp-sftpdirs 2022-02-07 12:31:07.407740407 +0100
|
| |
- +++ openssh-8.7p1/scp.c 2022-02-07 12:31:07.409740424 +0100
|
| |
- @@ -1324,7 +1324,7 @@ source_sftp(int argc, char *src, char *t
|
| |
-
|
| |
+ diff --git a/scp.c b/scp.c
|
| |
+ --- a/scp.c (revision 8241b9c0529228b4b86d88b1a6076fb9f97e4a99)
|
| |
+ +++ b/scp.c (date 1703111453316)
|
| |
+ @@ -1372,7 +1372,7 @@
|
| |
+
|
| |
if (src_is_dir && iamrecursive) {
|
| |
- if (upload_dir(conn, src, abs_dst, pflag,
|
| |
+ if (sftp_upload_dir(conn, src, abs_dst, pflag,
|
| |
- SFTP_PROGRESS_ONLY, 0, 0, 1, 1) != 0) {
|
| |
+ SFTP_PROGRESS_ONLY, 0, 0, 1, 1, 1) != 0) {
|
| |
- error("failed to upload directory %s to %s", src, targ);
|
| |
- errs = 1;
|
| |
- }
|
| |
- diff -up openssh-8.7p1/sftp-client.c.scp-sftpdirs openssh-8.7p1/sftp-client.c
|
| |
- --- openssh-8.7p1/sftp-client.c.scp-sftpdirs 2021-08-20 06:03:49.000000000 +0200
|
| |
- +++ openssh-8.7p1/sftp-client.c 2022-02-07 12:47:59.117516131 +0100
|
| |
- @@ -971,7 +971,7 @@ do_fsetstat(struct sftp_conn *conn, cons
|
| |
-
|
| |
+ error("failed to upload directory %s to %s", src, targ);
|
| |
+ errs = 1;
|
| |
+ }
|
| |
+ diff --git a/sftp-client.c b/sftp-client.c
|
| |
+ --- a/sftp-client.c (revision 8241b9c0529228b4b86d88b1a6076fb9f97e4a99)
|
| |
+ +++ b/sftp-client.c (date 1703169614263)
|
| |
+ @@ -1003,7 +1003,7 @@
|
| |
+
|
| |
/* Implements both the realpath and expand-path operations */
|
| |
static char *
|
| |
- -do_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
|
| |
- +do_realpath_expand(struct sftp_conn *conn, const char *path, int expand, int create_dir)
|
| |
+ -sftp_realpath_expand(struct sftp_conn *conn, const char *path, int expand)
|
| |
+ +sftp_realpath_expand(struct sftp_conn *conn, const char *path, int expand, int create_dir)
|
| |
{
|
| |
struct sshbuf *msg;
|
| |
u_int expected_id, count, id;
|
| |
- @@ -1033,11 +1033,43 @@ do_realpath_expand(struct sftp_conn *con
|
| |
+ @@ -1049,11 +1049,43 @@
|
| |
if ((r = sshbuf_get_u32(msg, &status)) != 0 ||
|
| |
(r = sshbuf_get_cstring(msg, &errmsg, NULL)) != 0)
|
| |
fatal_fr(r, "parse status");
|
| |
@@ -33,7 +33,7 @@
|
| |
- return NULL;
|
| |
+ if ((status == SSH2_FX_NO_SUCH_FILE) && create_dir) {
|
| |
+ memset(&a, '\0', sizeof(a));
|
| |
- + if ((r = do_mkdir(conn, path, &a, 0)) != 0) {
|
| |
+ + if ((r = sftp_mkdir(conn, path, &a, 0)) != 0) {
|
| |
+ sshbuf_free(msg);
|
| |
+ return NULL;
|
| |
+ }
|
| |
@@ -71,111 +71,112 @@
|
| |
} else if (type != SSH2_FXP_NAME)
|
| |
fatal("Expected SSH2_FXP_NAME(%u) packet, got %u",
|
| |
SSH2_FXP_NAME, type);
|
| |
- @@ -1039,9 +1067,9 @@ do_realpath_expand(struct sftp_conn *con
|
| |
+ @@ -1078,9 +1110,9 @@
|
| |
}
|
| |
-
|
| |
+
|
| |
char *
|
| |
- -do_realpath(struct sftp_conn *conn, const char *path)
|
| |
- +do_realpath(struct sftp_conn *conn, const char *path, int create_dir)
|
| |
+ -sftp_realpath(struct sftp_conn *conn, const char *path)
|
| |
+ +sftp_realpath(struct sftp_conn *conn, const char *path, int create_dir)
|
| |
{
|
| |
- - return do_realpath_expand(conn, path, 0);
|
| |
- + return do_realpath_expand(conn, path, 0, create_dir);
|
| |
+ - return sftp_realpath_expand(conn, path, 0);
|
| |
+ + return sftp_realpath_expand(conn, path, 0, create_dir);
|
| |
}
|
| |
-
|
| |
+
|
| |
int
|
| |
- @@ -1055,9 +1083,9 @@ do_expand_path(struct sftp_conn *conn, c
|
| |
+ @@ -1094,9 +1126,9 @@
|
| |
{
|
| |
- if (!can_expand_path(conn)) {
|
| |
+ if (!sftp_can_expand_path(conn)) {
|
| |
debug3_f("no server support, fallback to realpath");
|
| |
- - return do_realpath_expand(conn, path, 0);
|
| |
- + return do_realpath_expand(conn, path, 0, 0);
|
| |
+ - return sftp_realpath_expand(conn, path, 0);
|
| |
+ + return sftp_realpath_expand(conn, path, 0, 0);
|
| |
}
|
| |
- - return do_realpath_expand(conn, path, 1);
|
| |
- + return do_realpath_expand(conn, path, 1, 0);
|
| |
+ - return sftp_realpath_expand(conn, path, 1);
|
| |
+ + return sftp_realpath_expand(conn, path, 1, 0);
|
| |
}
|
| |
-
|
| |
+
|
| |
int
|
| |
- @@ -1807,7 +1835,7 @@ download_dir(struct sftp_conn *conn, con
|
| |
+ @@ -2016,7 +2048,7 @@
|
| |
char *src_canon;
|
| |
int ret;
|
| |
-
|
| |
- - if ((src_canon = do_realpath(conn, src)) == NULL) {
|
| |
- + if ((src_canon = do_realpath(conn, src, 0)) == NULL) {
|
| |
- error("download \"%s\": path canonicalization failed", src);
|
| |
- return -1;
|
| |
- }
|
| |
- @@ -2115,12 +2143,12 @@ upload_dir_internal(struct sftp_conn *co
|
| |
+
|
| |
+ - if ((src_canon = sftp_realpath(conn, src)) == NULL) {
|
| |
+ + if ((src_canon = sftp_realpath(conn, src, 0)) == NULL) {
|
| |
+ error("download \"%s\": path canonicalization failed", src);
|
| |
+ return -1;
|
| |
+ }
|
| |
+ @@ -2365,12 +2397,12 @@
|
| |
int
|
| |
- upload_dir(struct sftp_conn *conn, const char *src, const char *dst,
|
| |
+ sftp_upload_dir(struct sftp_conn *conn, const char *src, const char *dst,
|
| |
int preserve_flag, int print_flag, int resume, int fsync_flag,
|
| |
- int follow_link_flag, int inplace_flag)
|
| |
+ int follow_link_flag, int inplace_flag, int create_dir)
|
| |
{
|
| |
char *dst_canon;
|
| |
int ret;
|
| |
-
|
| |
- - if ((dst_canon = do_realpath(conn, dst)) == NULL) {
|
| |
- + if ((dst_canon = do_realpath(conn, dst, create_dir)) == NULL) {
|
| |
- error("upload \"%s\": path canonicalization failed", dst);
|
| |
- return -1;
|
| |
- }
|
| |
- @@ -2557,7 +2585,7 @@ crossload_dir(struct sftp_conn *from, st
|
| |
+
|
| |
+ - if ((dst_canon = sftp_realpath(conn, dst)) == NULL) {
|
| |
+ + if ((dst_canon = sftp_realpath(conn, dst, create_dir)) == NULL) {
|
| |
+ error("upload \"%s\": path canonicalization failed", dst);
|
| |
+ return -1;
|
| |
+ }
|
| |
+ @@ -2825,7 +2857,7 @@
|
| |
char *from_path_canon;
|
| |
int ret;
|
| |
-
|
| |
- - if ((from_path_canon = do_realpath(from, from_path)) == NULL) {
|
| |
- + if ((from_path_canon = do_realpath(from, from_path, 0)) == NULL) {
|
| |
- error("crossload \"%s\": path canonicalization failed",
|
| |
- from_path);
|
| |
- return -1;
|
| |
- diff -up openssh-8.7p1/sftp-client.h.scp-sftpdirs openssh-8.7p1/sftp-client.h
|
| |
- --- openssh-8.7p1/sftp-client.h.scp-sftpdirs 2021-08-20 06:03:49.000000000 +0200
|
| |
- +++ openssh-8.7p1/sftp-client.h 2022-02-07 12:31:07.410740433 +0100
|
| |
- @@ -111,7 +111,7 @@ int do_fsetstat(struct sftp_conn *, cons
|
| |
- int do_lsetstat(struct sftp_conn *conn, const char *path, Attrib *a);
|
| |
-
|
| |
+
|
| |
+ - if ((from_path_canon = sftp_realpath(from, from_path)) == NULL) {
|
| |
+ + if ((from_path_canon = sftp_realpath(from, from_path, 0)) == NULL) {
|
| |
+ error("crossload \"%s\": path canonicalization failed",
|
| |
+ from_path);
|
| |
+ return -1;
|
| |
+ diff --git a/sftp-client.h b/sftp-client.h
|
| |
+ --- a/sftp-client.h (revision 8241b9c0529228b4b86d88b1a6076fb9f97e4a99)
|
| |
+ +++ b/sftp-client.h (date 1703111691284)
|
| |
+ @@ -111,7 +111,7 @@
|
| |
+ int sftp_lsetstat(struct sftp_conn *conn, const char *path, Attrib *a);
|
| |
+
|
| |
/* Canonicalise 'path' - caller must free result */
|
| |
- -char *do_realpath(struct sftp_conn *, const char *);
|
| |
- +char *do_realpath(struct sftp_conn *, const char *, int);
|
| |
-
|
| |
+ -char *sftp_realpath(struct sftp_conn *, const char *);
|
| |
+ +char *sftp_realpath(struct sftp_conn *, const char *, int);
|
| |
+
|
| |
/* Canonicalisation with tilde expansion (requires server extension) */
|
| |
- char *do_expand_path(struct sftp_conn *, const char *);
|
| |
- @@ -159,7 +159,7 @@ int do_upload(struct sftp_conn *, const
|
| |
+ char *sftp_expand_path(struct sftp_conn *, const char *);
|
| |
+ @@ -163,7 +163,7 @@
|
| |
* times if 'pflag' is set
|
| |
*/
|
| |
- int upload_dir(struct sftp_conn *, const char *, const char *,
|
| |
+ int sftp_upload_dir(struct sftp_conn *, const char *, const char *,
|
| |
- int, int, int, int, int, int);
|
| |
+ int, int, int, int, int, int, int);
|
| |
-
|
| |
+
|
| |
/*
|
| |
* Download a 'from_path' from the 'from' connection and upload it to
|
| |
- diff -up openssh-8.7p1/sftp.c.scp-sftpdirs openssh-8.7p1/sftp.c
|
| |
- --- openssh-8.7p1/sftp.c.scp-sftpdirs 2021-08-20 06:03:49.000000000 +0200
|
| |
- +++ openssh-8.7p1/sftp.c 2022-02-07 12:31:07.411740442 +0100
|
| |
- @@ -760,7 +760,7 @@ process_put(struct sftp_conn *conn, cons
|
| |
- if (globpath_is_dir(g.gl_pathv[i]) && (rflag || global_rflag)) {
|
| |
- if (upload_dir(conn, g.gl_pathv[i], abs_dst,
|
| |
+
|
| |
+ diff --git a/sftp.c b/sftp.c
|
| |
+ --- a/sftp.c (revision 8241b9c0529228b4b86d88b1a6076fb9f97e4a99)
|
| |
+ +++ b/sftp.c (date 1703168795365)
|
| |
+ @@ -807,7 +807,7 @@
|
| |
+ (rflag || global_rflag)) {
|
| |
+ if (sftp_upload_dir(conn, g.gl_pathv[i], abs_dst,
|
| |
pflag || global_pflag, 1, resume,
|
| |
- fflag || global_fflag, 0, 0) == -1)
|
| |
+ fflag || global_fflag, 0, 0, 0) == -1)
|
| |
err = -1;
|
| |
} else {
|
| |
- if (do_upload(conn, g.gl_pathv[i], abs_dst,
|
| |
- @@ -1577,7 +1577,7 @@ parse_dispatch_command(struct sftp_conn
|
| |
+ if (sftp_upload(conn, g.gl_pathv[i], abs_dst,
|
| |
+ @@ -1642,7 +1642,7 @@
|
| |
if (path1 == NULL || *path1 == '\0')
|
| |
path1 = xstrdup(startdir);
|
| |
- path1 = make_absolute(path1, *pwd);
|
| |
- - if ((tmp = do_realpath(conn, path1)) == NULL) {
|
| |
- + if ((tmp = do_realpath(conn, path1, 0)) == NULL) {
|
| |
+ path1 = sftp_make_absolute(path1, *pwd);
|
| |
+ - if ((tmp = sftp_realpath(conn, path1)) == NULL) {
|
| |
+ + if ((tmp = sftp_realpath(conn, path1, 0)) == NULL) {
|
| |
err = 1;
|
| |
break;
|
| |
}
|
| |
- @@ -2160,7 +2160,7 @@ interactive_loop(struct sftp_conn *conn,
|
| |
+ @@ -2247,7 +2247,7 @@
|
| |
}
|
| |
#endif /* USE_LIBEDIT */
|
| |
-
|
| |
- - remote_path = do_realpath(conn, ".");
|
| |
- + remote_path = do_realpath(conn, ".", 0);
|
| |
- if (remote_path == NULL)
|
| |
+
|
| |
+ - if ((remote_path = sftp_realpath(conn, ".")) == NULL)
|
| |
+ + if ((remote_path = sftp_realpath(conn, ".", 0)) == NULL)
|
| |
fatal("Need cwd");
|
| |
startdir = xstrdup(remote_path);
|
| |
+
|
| |
Start the process of updating OpenSSH to 9.6. This is a best attempt, and it's not yet ready for merging.
Whilst I have been able to rebase most of the patches, I'm not confident enough in my rebase of
openssh-8.0p1-pkcs11-uri.patch
to include it here. This has also required me to disableopenssh-6.7p1-coverity.patch
as it builds on the first patch. If they've got the time, I'd appreciate @jjelen giving that a go that as the original author please.Whilst the STI system tests appear to pass with this patchset, upstream's tests fail in the same place they did before (after the main tests, during the regression tests).
- Tests on
rawhide
: https://koji.fedoraproject.org/koji/taskinfo?taskID=110890575- Tests on this branch (without the PKCS11 patch): https://koji.fedoraproject.org/koji/taskinfo?taskID=110895918
Scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=110896733
Resolves:
- rhbz#2230781
- rhbz#2255851
- rhbz#2255125
- rhbz#2255272
- rhbz#2255273
If it's easier, I'm happy for this branch to be discarded and the package team to begin the 9.6 update from scratch.