--- embedaddon/rsync/support/lsh 2013/10/14 07:51:15 1.1.1.2 +++ embedaddon/rsync/support/lsh 2021/03/17 00:32:36 1.1.1.3 @@ -1,10 +1,6 @@ -#!/usr/bin/perl -# This script can be used as a "remote shell" command that is only -# capable of pretending to connect to "localhost". This is useful -# for testing or for running a local copy where the sender and the -# receiver needs to use different options (e.g. --fake-super). If -# we get -l USER, we try to become the USER, either directly (must -# be root) or by using "sudo -H -u USER" (requires --sudo option). +#!/usr/bin/env perl +# This is a "local shell" command that works like a remote shell but only for +# the local host. See the usage message for more details. use strict; use warnings; @@ -26,7 +22,9 @@ my $host = shift; if ($host =~ s/^([^@]+)\@//) { $login_name = $1; } -if ($host ne 'localhost') { +if ($host eq 'lh') { + $no_chdir = 1; +} elsif ($host ne 'localhost') { die "lsh: unable to connect to host $host\n"; } @@ -76,6 +74,15 @@ die "Failed to exec: $!\n"; sub usage { die <