3

There is a patch fix for perl module net::ssh2 it fixes a seg fault error that happens on some machines.

It's located here: https://rt.cpan.org/Public/Bug/Display.html?id=36614

I downloaded the patch but i'm not sure how to apply it. I removed the module i previously installed, went to the build folder and did

patch ssh2.xs < p1

it asked me if the patch was in reverse. I wasn't sure so i hit yes. IT says patch succeed then tells me ok. modules installed. I don't think either the patch worked or i'm moving my patched version in correctly. I feel that way because i still get the seg fault and everyone say this fixes it.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Arian
  • 339
  • 3
  • 12

2 Answers2

3

Proper patch invocation will looks like:

patch -p1 < net-ssh2-0.18-perl5.10.patch

You have do this in the directory, where is file SSH2.xs.

Jan Marek
  • 3,837
  • 1
  • 14
  • 12
  • can you explain the "p1" parameter? – Arian Dec 29 '11 at 17:14
  • I checked man patch but it still doesn't make sense to me. – Arian Dec 29 '11 at 17:55
  • @Arian Regarding `-p1`, see [When patching what's the difference between arguments -p0 and -p1?](http://unix.stackexchange.com/q/26501) – Gilles 'SO- stop being evil' Dec 30 '11 at 21:52
  • @Arian It's about a directory part in diff header. In this case you can see in diff header this string: `Net-SSH-0.18.orig/SSH2.xs`. If you use -p1 parametr, patch utility will strip from this string leading directory and you will get a `/SSH2.xs`, which you want patch. With -p0 parameter will patch don't strip from this string nothing. – Jan Marek Jan 02 '12 at 07:58
0

Direct excerpt from gnu patch manpage:

   -p<num>  or  --strip=num
      Strip the smallest prefix containing num leading slashes from each file name found in the patch file.  A sequence of  one  or  more  adjacent
      slashes  is  counted  as  a single slash.  This controls how file names found in the patch file are treated, in case you keep your files in a
      different directory than the person who sent out the patch.  For example, supposing the file name in the patch file was

         /u/howard/src/blurfl/blurfl.c

      setting -p0 gives the entire file name unmodified, -p1 gives

         u/howard/src/blurfl/blurfl.c

      without the leading slash, -p4 gives

         blurfl/blurfl.c

      and not specifying -p at all just gives you blurfl.c.  Whatever you end up with is looked for either in the current directory, or the  direc-
      tory specified by the -d option.
Nikhil Mulley
  • 8,145
  • 32
  • 49