Ver código fonte

cleanup patch and avoid having to pass a string over the command line (which is nasty because of escaping)

Ralf S. Engelschall 21 anos atrás
pai
commit
66e46aceee
2 arquivos alterados com 16 adições e 8 exclusões
  1. 14 5
      openssh/openssh.patch.scpbindir
  2. 2 3
      openssh/openssh.spec

+ 14 - 5
openssh/openssh.patch.scpbindir

@@ -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;

+ 2 - 3
openssh/openssh.spec

@@ -42,7 +42,7 @@ Class:        CORE
 Group:        Security
 License:      BSD
 Version:      %{V_base}%{V_portable}
-Release:      20040505
+Release:      20040506
 
 #   package options
 %option       with_fsl          yes
@@ -154,13 +154,12 @@ AutoReqProv:  no
 %if "%{with_sftplogging}" == "yes"
     %patch -p1 -P 5
 %endif
-    %patch -p0 -P 6
+    sed -e 's;@l_prefix@;%{l_prefix};g' %{SOURCE openssh.patch.scpbindir} | %{l_patch} -p0
 
 %build
     #   configure package
     cflags=""
     ldflags=""
-    cflags="$cflags -DOPENPKG_SCP_BINDIR=\\\"%{l_prefix}/bin\\\""
 %if "%{with_chroot}" == "yes"
     cflags="$cflags -DUSE_CHROOT"
 %endif