OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   19-May-2004 17:11:29
  Branch: OPENPKG_2_0_SOLID                Handle: 2004051916112900

  Modified files:           (Branch: OPENPKG_2_0_SOLID)
    openpkg-src/openssh     openssh.patch.scpbindir openssh.spec

  Log:
    MFC: fix scp(1) hack once again

  Summary:
    Revision    Changes     Path
    1.2.2.3     +28 -35     openpkg-src/openssh/openssh.patch.scpbindir
    1.123.2.4   +1  -1      openpkg-src/openssh/openssh.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openssh/openssh.patch.scpbindir
  ============================================================================
  $ cvs diff -u -r1.2.2.2 -r1.2.2.3 openssh.patch.scpbindir
  --- openpkg-src/openssh/openssh.patch.scpbindir       19 May 2004 07:14:57 -0000     
 1.2.2.2
  +++ openpkg-src/openssh/openssh.patch.scpbindir       19 May 2004 15:11:29 -0000     
 1.2.2.3
  @@ -7,54 +7,47 @@
   the server side).
   
   Index: session.c
  ---- session.c.orig   2004-05-17 14:10:57.000000000 +0200
  -+++ session.c        2004-05-17 14:10:57.000000000 +0200
  -@@ -69,9 +69,9 @@
  - void        session_pty_cleanup(void *);
  - void        session_proctitle(Session *);
  - int session_setup_x11fwd(Session *);
  --void        do_exec_pty(Session *, const char *);
  -+void        do_exec_pty(Session *, char *);
  - void        do_exec_no_pty(Session *, const char *);
  --void        do_exec(Session *, const char *);
  -+void        do_exec(Session *, char *);
  - void        do_login(Session *, const char *);
  - #ifdef LOGIN_NEEDS_UTMPX
  - static void do_pre_login(Session *s);
  -@@ -512,7 +512,7 @@
  -  * lastlog, and other such operations.
  -  */
  - void
  --do_exec_pty(Session *s, const char *command)
  -+do_exec_pty(Session *s, char *command)
  - {
  -     int fdout, ptyfd, ttyfd, ptymaster;
  -     pid_t pid;
  -@@ -642,8 +642,26 @@
  -  * to be forced, execute that instead.
  -  */
  - void
  --do_exec(Session *s, const char *command)
  -+do_exec(Session *s, char *command)
  - {
  +--- session.c.orig   2004-05-19 17:05:41.000000000 +0200
  ++++ session.c        2004-05-19 17:05:50.000000000 +0200
  +@@ -62,6 +62,10 @@
  + #include "ssh-gss.h"
  + #endif
  + 
   +#ifndef SCPBINDIR
   +#define SCPBINDIR "@l_prefix@/bin"
   +#endif
  ++
  + /* func */
  + 
  + Session *session_new(void);
  +@@ -644,6 +648,21 @@
  + void
  + do_exec(Session *s, const char *command)
  + {
  ++    char *scp_command = NULL;
  ++
   +    if (   command != NULL
   +            && strlen(command) >= 3
   +            && strncmp(command, "scp", 3) == 0
   +            && (command[3] == ' ' || command[3] == '\0')) {
   +            size_t l, k;
  -+            char *cp;
   +            l = strlen(SCPBINDIR);
   +            k = strlen(command);
  -+            cp = xmalloc(l+1+k+1);
  -+            snprintf(cp, l+1+k+1, "%s/%s", SCPBINDIR, command);
  -+            xfree(command);
  -+            command = cp;
  ++            scp_command = xmalloc(l+1+k+1);
  ++            snprintf(scp_command, l+1+k+1, "%s/%s", SCPBINDIR, command);
  ++            command = (const char *)scp_command;
   +            debug("Forced SCP command '%.900s'", command);
   +    }
   +
        if (forced_command) {
                original_command = command;
                command = forced_command;
  +@@ -664,6 +683,8 @@
  +             do_exec_no_pty(s, command);
  + 
  +     original_command = NULL;
  ++    if (scp_command != NULL)
  ++            xfree(scp_command);
  + }
  + 
  + 
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openssh/openssh.spec
  ============================================================================
  $ cvs diff -u -r1.123.2.3 -r1.123.2.4 openssh.spec
  --- openpkg-src/openssh/openssh.spec  19 May 2004 07:14:57 -0000      1.123.2.3
  +++ openpkg-src/openssh/openssh.spec  19 May 2004 15:11:29 -0000      1.123.2.4
  @@ -42,7 +42,7 @@
   Group:        Security
   License:      BSD
   Version:      %{V_base}%{V_portable}
  -Release:      2.0.2
  +Release:      2.0.3
   
   #   package options
   %option       with_fsl      yes
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to