|
|
@@ -1,3 +1,11 @@
|
|
|
+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-04-16 14:47:55.000000000 +0200
|
|
|
+++ session.c 2004-05-05 10:10:08.000000000 +0200
|
|
|
@@ -22,29 +30,30 @@ Index: session.c
|
|
|
{
|
|
|
int fdout, ptyfd, ttyfd, ptymaster;
|
|
|
pid_t pid;
|
|
|
-@@ -650,8 +650,25 @@
|
|
|
+@@ -650,8 +650,26 @@
|
|
|
* to be forced, execute that instead.
|
|
|
*/
|
|
|
void
|
|
|
-do_exec(Session *s, const char *command)
|
|
|
+do_exec(Session *s, char *command)
|
|
|
{
|
|
|
-+#ifdef OPENPKG_SCP_BINDIR
|
|
|
++#ifndef SCPBINDIR
|
|
|
++#define SCPBINDIR "@l_prefix@/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(OPENPKG_SCP_BINDIR);
|
|
|
++ l = strlen(SCPBINDIR);
|
|
|
+ k = strlen(command);
|
|
|
+ cp = xmalloc(l+1+k+1);
|
|
|
-+ snprintf(cp, l+1+k+1, "%s/%s", OPENPKG_SCP_BINDIR, command);
|
|
|
++ snprintf(cp, l+1+k+1, "%s/%s", SCPBINDIR, command);
|
|
|
+ xfree(command);
|
|
|
+ command = cp;
|
|
|
+ debug("Forced SCP command '%.900s'", command);
|
|
|
+ }
|
|
|
-+#endif
|
|
|
+
|
|
|
if (forced_command) {
|
|
|
original_command = command;
|