diff options
author | Colin Watson <cjwatson@debian.org> | 2011-03-18 16:38:30 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2011-03-18 16:38:30 +0000 |
commit | 8d0030f3d2ffcbbf27e475e0b9032e74dede5b8f (patch) | |
tree | 5b122355b76bb124231848927dc20db21093b88a /debian | |
parent | bcbcf62473fff7d01ab78d9706484818ddcfe524 (diff) |
Allow ssh-add to read from FIFOs (thanks, Daniel Kahn Gillmor; closes:
#614897).
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/ssh-add-fifo.patch | 37 |
3 files changed, 40 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index b79607514..c75c3f031 100644 --- a/debian/changelog +++ b/debian/changelog | |||
@@ -2,6 +2,8 @@ openssh (1:5.8p1-3) UNRELEASED; urgency=low | |||
2 | 2 | ||
3 | * Correct ssh-keygen instruction in the changelog for 1:5.7p1-1 (thanks, | 3 | * Correct ssh-keygen instruction in the changelog for 1:5.7p1-1 (thanks, |
4 | Joel Stanley). | 4 | Joel Stanley). |
5 | * Allow ssh-add to read from FIFOs (thanks, Daniel Kahn Gillmor; closes: | ||
6 | #614897). | ||
5 | 7 | ||
6 | -- Colin Watson <cjwatson@debian.org> Wed, 09 Feb 2011 03:02:45 +0000 | 8 | -- Colin Watson <cjwatson@debian.org> Wed, 09 Feb 2011 03:02:45 +0000 |
7 | 9 | ||
diff --git a/debian/patches/series b/debian/patches/series index a243174dd..0a21f8ead 100644 --- a/debian/patches/series +++ b/debian/patches/series | |||
@@ -38,6 +38,7 @@ doc-hash-tab-completion.patch | |||
38 | 38 | ||
39 | # Miscellaneous bug fixes | 39 | # Miscellaneous bug fixes |
40 | selinux-build-failure.patch | 40 | selinux-build-failure.patch |
41 | ssh-add-fifo.patch | ||
41 | 42 | ||
42 | # Debian-specific configuration | 43 | # Debian-specific configuration |
43 | gnome-ssh-askpass2-icon.patch | 44 | gnome-ssh-askpass2-icon.patch |
diff --git a/debian/patches/ssh-add-fifo.patch b/debian/patches/ssh-add-fifo.patch new file mode 100644 index 000000000..deac58e75 --- /dev/null +++ b/debian/patches/ssh-add-fifo.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Description: Allow ssh-add to read from FIFOs | ||
2 | Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net> | ||
3 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1869 | ||
4 | Bug-Debian: http://bugs.debian.org/614897 | ||
5 | Origin: other, https://bugzilla.mindrot.org/attachment.cgi?id=2002&action=diff | ||
6 | Forwarded: yes | ||
7 | Last-Update: 2011-03-18 | ||
8 | |||
9 | Index: b/authfile.c | ||
10 | =================================================================== | ||
11 | --- a/authfile.c | ||
12 | +++ b/authfile.c | ||
13 | @@ -317,7 +317,7 @@ | ||
14 | static int | ||
15 | key_load_file(int fd, const char *filename, Buffer *blob) | ||
16 | { | ||
17 | - size_t len; | ||
18 | + size_t len, readcount; | ||
19 | u_char *cp; | ||
20 | struct stat st; | ||
21 | |||
22 | @@ -337,11 +337,14 @@ | ||
23 | return 0; | ||
24 | } | ||
25 | len = (size_t)st.st_size; /* truncated */ | ||
26 | + if (0 == len && S_ISFIFO(st.st_mode)) | ||
27 | + len = 8192; /* we will try reading up to 8KiB from a FIFO */ | ||
28 | |||
29 | buffer_init(blob); | ||
30 | cp = buffer_append_space(blob, len); | ||
31 | |||
32 | - if (atomicio(read, fd, cp, len) != len) { | ||
33 | + readcount = atomicio(read, fd, cp, len); | ||
34 | + if (readcount != len && !(readcount > 0 && S_ISFIFO(st.st_mode))) { | ||
35 | debug("%s: read from key file %.200s%sfailed: %.100s", __func__, | ||
36 | filename == NULL ? "" : filename, | ||
37 | filename == NULL ? "" : " ", | ||