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:   17-May-2004 14:14:09
  Branch: OPENPKG_2_0_SOLID                Handle: 2004051713140800

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

  Log:
    MFC: add workaround for scp(1) issue on server side: scp(1) was not
    found if the user environment had <prefix>/bin not in $PATH

  Summary:
    Revision    Changes     Path
    1.2.2.1     +60 -0      openpkg-src/openssh/openssh.patch.scpbindir
    1.123.2.2   +3  -1      openpkg-src/openssh/openssh.spec
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openssh/openssh.patch.scpbindir
  ============================================================================
  $ cvs diff -u -r0 -r1.2.2.1 openssh.patch.scpbindir
  --- /dev/null 2004-05-17 14:14:08.000000000 +0200
  +++ openssh.patch.scpbindir   2004-05-17 14:14:08.000000000 +0200
  @@ -0,0 +1,60 @@
  +This patch provides a workaround for the nasty issue that scp(1) is
  +found on the server side only if it is in $PATH (due to a ~/.bashrc,
  +/etc/profile, etc). The default $PATH is out of scope for OpenPKG and is
  +different across platforms anyway. Nevertheless we want to ensure that
  +with OpenPKG on the server side, scp(1) is always usable (on the client
  +side) without having to adjust the system and/or user environment (on
  +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)
  + {
  ++#ifndef SCPBINDIR
  ++#define SCPBINDIR "/openpkg-dev/bin"
  ++#endif
  ++    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;
  ++            debug("Forced SCP command '%.900s'", command);
  ++    }
  ++
  +     if (forced_command) {
  +             original_command = command;
  +             command = forced_command;
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openssh/openssh.spec
  ============================================================================
  $ cvs diff -u -r1.123.2.1 -r1.123.2.2 openssh.spec
  --- openpkg-src/openssh/openssh.spec  18 Feb 2004 14:50:38 -0000      1.123.2.1
  +++ openpkg-src/openssh/openssh.spec  17 May 2004 12:14:08 -0000      1.123.2.2
  @@ -42,7 +42,7 @@
   Group:        Security
   License:      BSD
   Version:      %{V_base}%{V_portable}
  -Release:      2.0.0
  +Release:      2.0.1
   
   #   package options
   %option       with_fsl      yes
  @@ -67,6 +67,7 @@
   Patch0:       openssh.patch
   Patch1:       
http://www.sc.isc.tohoku.ac.jp/~hgot/sources/openssh-%{V_watchdog}-watchdog.patch.tgz
   Patch2:       
http://ldappubkey.gcu-squad.org/%{V_ldap_vers1}/ldappubkey-ossh%{V_ldap_base}-%{V_ldap_vers2}.patch
  +Patch3:       openssh.patch.scpbindir
   
   #   build information
   Prefix:       %{l_prefix}
  @@ -139,6 +140,7 @@
   %if "%{with_ldap}" == "yes"
       %{l_gzip} -d -c %{SOURCE ldappubkey-ossh%{V_ldap_base}-%{V_ldap_vers2}.patch} | 
%{l_patch} -p0
   %endif
  +    sed -e 's;@l_prefix@;%{l_prefix};g' %{SOURCE openssh.patch.scpbindir} | 
%{l_patch} -p0
   
   %build
       #   configure package
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to