diff options
-rw-r--r-- | debian/.git-dpm | 4 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/patches/fix-utimensat-test.patch | 58 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | openbsd-compat/regress/utimensattest.c | 20 |
5 files changed, 80 insertions, 5 deletions
diff --git a/debian/.git-dpm b/debian/.git-dpm index 46a4f4209..635786aca 100644 --- a/debian/.git-dpm +++ b/debian/.git-dpm | |||
@@ -1,6 +1,6 @@ | |||
1 | # see git-dpm(1) from git-dpm package | 1 | # see git-dpm(1) from git-dpm package |
2 | 7d50f9e5be88179325983a1f58c9d51bb58f025a | 2 | bbc5ff0a295797174b4ef3928f58969e43f5adfe |
3 | 7d50f9e5be88179325983a1f58c9d51bb58f025a | 3 | bbc5ff0a295797174b4ef3928f58969e43f5adfe |
4 | 102062f825fb26a74295a1c089c00c4c4c76b68a | 4 | 102062f825fb26a74295a1c089c00c4c4c76b68a |
5 | 102062f825fb26a74295a1c089c00c4c4c76b68a | 5 | 102062f825fb26a74295a1c089c00c4c4c76b68a |
6 | openssh_8.0p1.orig.tar.gz | 6 | openssh_8.0p1.orig.tar.gz |
diff --git a/debian/changelog b/debian/changelog index c272f8fc8..9b6a47ba2 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -121,6 +121,8 @@ openssh (1:8.0p1-1) UNRELEASED; urgency=medium | |||
121 | - Enable gssapi-keyex authentication without gssapi-with-mic. | 121 | - Enable gssapi-keyex authentication without gssapi-with-mic. |
122 | - Allow querying for GSSAPI key exchange algorithms from ssh (-Q | 122 | - Allow querying for GSSAPI key exchange algorithms from ssh (-Q |
123 | kex-gss). | 123 | kex-gss). |
124 | * Apply upstream patch to fix the utimensat regression tests when not | ||
125 | using the compatibility implementation. | ||
124 | 126 | ||
125 | -- Colin Watson <cjwatson@debian.org> Wed, 05 Jun 2019 07:09:47 +0100 | 127 | -- Colin Watson <cjwatson@debian.org> Wed, 05 Jun 2019 07:09:47 +0100 |
126 | 128 | ||
diff --git a/debian/patches/fix-utimensat-test.patch b/debian/patches/fix-utimensat-test.patch new file mode 100644 index 000000000..799337e64 --- /dev/null +++ b/debian/patches/fix-utimensat-test.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | From bbc5ff0a295797174b4ef3928f58969e43f5adfe Mon Sep 17 00:00:00 2001 | ||
2 | From: Darren Tucker <dtucker@dtucker.net> | ||
3 | Date: Fri, 7 Jun 2019 23:47:37 +1000 | ||
4 | Subject: Update utimensat test. | ||
5 | |||
6 | POSIX specifies that when given a symlink, AT_SYMLINK_NOFOLLOW should | ||
7 | update the symlink and not the destination. The compat code doesn't | ||
8 | have a way to do this, so where possible it fails instead of following a | ||
9 | symlink when explicitly asked not to. Instead of checking for an explicit | ||
10 | failure, check that it does not update the destination, which both the | ||
11 | real and compat implementations should honour. | ||
12 | |||
13 | Inspired by github pull req #125 from chutzpah at gentoo.org. | ||
14 | |||
15 | Origin: upstream, https://anongit.mindrot.org/openssh.git/commit/?id=182898192d4b720e4faeafd5b39c2cfb3b92aa21 | ||
16 | Last-Update: 2019-06-09 | ||
17 | |||
18 | Patch-Name: fix-utimensat-test.patch | ||
19 | --- | ||
20 | openbsd-compat/regress/utimensattest.c | 20 +++++++++++++++++--- | ||
21 | 1 file changed, 17 insertions(+), 3 deletions(-) | ||
22 | |||
23 | diff --git a/openbsd-compat/regress/utimensattest.c b/openbsd-compat/regress/utimensattest.c | ||
24 | index a7bc7634b..b29cef2f1 100644 | ||
25 | --- a/openbsd-compat/regress/utimensattest.c | ||
26 | +++ b/openbsd-compat/regress/utimensattest.c | ||
27 | @@ -83,14 +83,28 @@ main(void) | ||
28 | fail("mtim.tv_nsec", 45678000, sb.st_mtim.tv_nsec); | ||
29 | #endif | ||
30 | |||
31 | + /* | ||
32 | + * POSIX specifies that when given a symlink, AT_SYMLINK_NOFOLLOW | ||
33 | + * should update the symlink and not the destination. The compat | ||
34 | + * code doesn't have a way to do this, so where possible it fails | ||
35 | + * with ENOSYS instead of following a symlink when explicitly asked | ||
36 | + * not to. Here we just test that it does not update the destination. | ||
37 | + */ | ||
38 | if (rename(TMPFILE, TMPFILE2) == -1) | ||
39 | fail("rename", 0, 0); | ||
40 | if (symlink(TMPFILE2, TMPFILE) == -1) | ||
41 | fail("symlink", 0, 0); | ||
42 | + ts[0].tv_sec = 11223344; | ||
43 | + ts[1].tv_sec = 55667788; | ||
44 | + (void)utimensat(AT_FDCWD, TMPFILE, ts, AT_SYMLINK_NOFOLLOW); | ||
45 | + if (stat(TMPFILE2, &sb) == -1) | ||
46 | + fail("stat", 0, 0 ); | ||
47 | + if (sb.st_atime == 11223344) | ||
48 | + fail("utimensat symlink st_atime", 0, 0 ); | ||
49 | + if (sb.st_mtime == 55667788) | ||
50 | + fail("utimensat symlink st_mtime", 0, 0 ); | ||
51 | |||
52 | - if (utimensat(AT_FDCWD, TMPFILE, ts, AT_SYMLINK_NOFOLLOW) != -1) | ||
53 | - fail("utimensat followed symlink", 0, 0); | ||
54 | - | ||
55 | + /* Clean up */ | ||
56 | if (!(unlink(TMPFILE) == 0 && unlink(TMPFILE2) == 0)) | ||
57 | fail("unlink", 0, 0); | ||
58 | exit(0); | ||
diff --git a/debian/patches/series b/debian/patches/series index 6304f537a..ba5a5ad4b 100644 --- a/debian/patches/series +++ b/debian/patches/series | |||
@@ -25,3 +25,4 @@ seccomp-s390-flock-ipc.patch | |||
25 | seccomp-s390-ioctl-ep11-crypto.patch | 25 | seccomp-s390-ioctl-ep11-crypto.patch |
26 | conch-old-privkey-format.patch | 26 | conch-old-privkey-format.patch |
27 | revert-ipqos-defaults.patch | 27 | revert-ipqos-defaults.patch |
28 | fix-utimensat-test.patch | ||
diff --git a/openbsd-compat/regress/utimensattest.c b/openbsd-compat/regress/utimensattest.c index a7bc7634b..b29cef2f1 100644 --- a/openbsd-compat/regress/utimensattest.c +++ b/openbsd-compat/regress/utimensattest.c | |||
@@ -83,14 +83,28 @@ main(void) | |||
83 | fail("mtim.tv_nsec", 45678000, sb.st_mtim.tv_nsec); | 83 | fail("mtim.tv_nsec", 45678000, sb.st_mtim.tv_nsec); |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | /* | ||
87 | * POSIX specifies that when given a symlink, AT_SYMLINK_NOFOLLOW | ||
88 | * should update the symlink and not the destination. The compat | ||
89 | * code doesn't have a way to do this, so where possible it fails | ||
90 | * with ENOSYS instead of following a symlink when explicitly asked | ||
91 | * not to. Here we just test that it does not update the destination. | ||
92 | */ | ||
86 | if (rename(TMPFILE, TMPFILE2) == -1) | 93 | if (rename(TMPFILE, TMPFILE2) == -1) |
87 | fail("rename", 0, 0); | 94 | fail("rename", 0, 0); |
88 | if (symlink(TMPFILE2, TMPFILE) == -1) | 95 | if (symlink(TMPFILE2, TMPFILE) == -1) |
89 | fail("symlink", 0, 0); | 96 | fail("symlink", 0, 0); |
97 | ts[0].tv_sec = 11223344; | ||
98 | ts[1].tv_sec = 55667788; | ||
99 | (void)utimensat(AT_FDCWD, TMPFILE, ts, AT_SYMLINK_NOFOLLOW); | ||
100 | if (stat(TMPFILE2, &sb) == -1) | ||
101 | fail("stat", 0, 0 ); | ||
102 | if (sb.st_atime == 11223344) | ||
103 | fail("utimensat symlink st_atime", 0, 0 ); | ||
104 | if (sb.st_mtime == 55667788) | ||
105 | fail("utimensat symlink st_mtime", 0, 0 ); | ||
90 | 106 | ||
91 | if (utimensat(AT_FDCWD, TMPFILE, ts, AT_SYMLINK_NOFOLLOW) != -1) | 107 | /* Clean up */ |
92 | fail("utimensat followed symlink", 0, 0); | ||
93 | |||
94 | if (!(unlink(TMPFILE) == 0 && unlink(TMPFILE2) == 0)) | 108 | if (!(unlink(TMPFILE) == 0 && unlink(TMPFILE2) == 0)) |
95 | fail("unlink", 0, 0); | 109 | fail("unlink", 0, 0); |
96 | exit(0); | 110 | exit(0); |