tags 653993 + patch
thanks
2012-01-12 19:41 Don Armstrong <d...@debian.org>:
> 
>        "Unsuccessful stat on filename containing newline at
>        /usr/share/gitolite/sshkeys-lint line 142, <> line 29. file not
>        found:"
>
| If you disagree with the maintainer, then your choices are to either
| attempt to:
|
| 1) convince the maintainer that your viewpoint is correct, preferably
| by submitting a patch which fixes the perceived problem, along with
| rationale as to why the patch is correct.

As I did. Unfortunately the maintainer closed the bug report without trying
to analyze the issue first. Perhaps the maintainer didn't understand either
the problem or the cause of the error. Reopen would have not been needed if
the bug had been left open for further input and discussion.

| 2) attempt to convince the technical committee that the maintainer is
| incorrect, and should be overridden. This necessitates a patch as
| required for #1.

Here is the fix. Rationale is included in the patch. FWIW.

>From 8be4a35cac086f7aac020e72bc16e7e9512e2e47 Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Fri, 13 Jan 2012 00:05:32 +0200
Subject: [PATCH] sshkeys-lint: Teach fill_authkeys() about other type of SSH
 keys.
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

The program knew only about keys of type:

  [commadn] ssh-dss <key string>
  [command] ssh-rsa <key string>

But there are also keys that are in format:

  [command] <number, keysize in bits> <2 digit number> <digit string>

An example:

  command="/users/foo/test.sh",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty,from="*tpu.fi" 1024 37 7635...

Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 src/sshkeys-lint |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/sshkeys-lint b/src/sshkeys-lint
index 96c027f..56d239d 100755
--- a/src/sshkeys-lint
+++ b/src/sshkeys-lint
@@ -124,11 +124,12 @@ sub ak_comment {
 
 sub fprint {
     local $_ = shift;
+    chomp $_;
     my ($fh, $tempfn, $in);
-    if (/ssh-(dss|rsa) /) {
+    if (/^.*(ssh-(dss|rsa).*|\b\d{3,}\s+\d+\d\s+\d+)/) {
         # an actual key was passed.  Since ssh-keygen requires an actual file,
         # make a temp file to take the data and pass on to ssh-keygen
-        s/^.* (ssh-dss|ssh-rsa)/$1/;
+        $_  = $1;
         use File::Temp qw(tempfile);
         ($fh, $tempfn) = tempfile();
         $in = $tempfn;
-- 
1.7.7.3

Reply via email to