[MacPorts] #63407: ssh-copy-id @8.4p1_0: installkeys_sh() is broken (badly placed ')' of '$(..)'). Simple fix + openssh source reference included.

MacPorts noreply at macports.org
Thu Aug 26 15:02:47 UTC 2021


#63407: ssh-copy-id @8.4p1_0: installkeys_sh()  is broken (badly placed ')' of
'$(..)'). Simple fix + openssh source reference included.
---------------------+----------------------------------
 Reporter:  balanco  |      Owner:  l2dy
     Type:  defect   |     Status:  assigned
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.7.1
 Keywords:           |       Port:  ssh-copy-id @8.4p1_0
---------------------+----------------------------------
 Description:

 in version @8.4p1_0 of ssh-copy-id,\\
 line 250 of function installkeys_sh() reads:

 {{{
 INSTALLKEYS_SH=$(tr '\t\n' ' ' <<-EOF)
 }}}

 The final closing ')' on this line is misplaced, it should be moved to
 ''after'' the **EOF** ending the ''here code'' on the following lines;
 i.e.:

 * the closing parenthesis ')' should be removed from line 250
 * a new line consisting of just a closing parenthesis ')' should be added
 as line 261 (= immediately after the EOF closing the ''here code'')

 The corrected code fragment (lines 250-261 of ssh-copy-id) should read
 (changes at the end of the first and the added last line):\\

 {{{
    INSTALLKEYS_SH=$(tr '\t\n' ' ' <<-EOF
           cd;
           umask 077;
           mkdir -p $(dirname "${AUTH_KEY_FILE}") &&
             { [ -z \`tail -1c ${AUTH_KEY_FILE} 2>/dev/null\` ] || echo >>
 ${AUTH_KEY_FILE}; } &&
             cat >> ${AUTH_KEY_FILE} ||
             exit 1;
           if type restorecon >/dev/null 2>&1; then
             restorecon -F .ssh ${AUTH_KEY_FILE};
           fi
   EOF
   )
 }}}



 ''For validation:''\\
 At the time of writing (2021-08-26T16:41CEST), this can be verified
 against the authoritative openssh source code at
 [https://github.com/openssh/openssh-portable/blob/master/contrib/ssh-copy-
 id]; here is a direct permalink to the start of the code block in question
 (lines 251..262):\\
 [https://github.com/openssh/openssh-
 portable/blob/95401eea8503943449f712e5f3de52fc0bc612c5/contrib/ssh-copy-
 id#L251].

-- 
Ticket URL: <https://trac.macports.org/ticket/63407>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list