summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-03-29 13:09:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-03-29 13:09:30 -0400
commit846642da916800f2ea42dc2e1b97da32a11fc1bf (patch)
treeda8a455f45c3e14d7e822c9ab4875d351f734d3a
parent987b11fdf42b58a92d817131c416edbdbcb94297 (diff)
webapp: Run ssh server probes in a way that will work when the login shell is a monstrosity that should have died 25 years ago, such as csh.
-rw-r--r--Utility/SafeCommand.hs10
-rw-r--r--debian/changelog3
-rw-r--r--doc/bugs/Detection_assumes_that_shell_is_bash.mdwn4
-rw-r--r--doc/bugs/host_with_rysnc_installed__44___not_recognized.mdwn4
4 files changed, 20 insertions, 1 deletions
diff --git a/Utility/SafeCommand.hs b/Utility/SafeCommand.hs
index e6075e888..785aec578 100644
--- a/Utility/SafeCommand.hs
+++ b/Utility/SafeCommand.hs
@@ -55,8 +55,16 @@ safeSystemEnv command params environ = do
{ env = environ }
waitForProcess pid
+{- Wraps a shell command line inside sh -c, allowing it to be run in a
+ - login shell that may not support POSIX shell, eg csh. -}
+shellWrap :: String -> String
+shellWrap cmdline = "sh -c " ++ shellEscape cmdline
+
{- Escapes a filename or other parameter to be safely able to be exposed to
- - the shell. -}
+ - the shell.
+ -
+ - This method works for POSIX shells, as well as other shells like csh.
+ -}
shellEscape :: String -> String
shellEscape f = "'" ++ escaped ++ "'"
where
diff --git a/debian/changelog b/debian/changelog
index b8dbc7b2b..e7b79f34b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,9 @@ git-annex (4.20130324) UNRELEASED; urgency=low
* webapp: Progess bar fixes for many types of special remotes.
* Build debian package without using cabal, which writes to HOME.
Closes: #704205
+ * webapp: Run ssh server probes in a way that will work when the
+ login shell is a monstrosity that should have died 25 years ago,
+ such as csh.
-- Joey Hess <joeyh@debian.org> Mon, 25 Mar 2013 10:21:46 -0400
diff --git a/doc/bugs/Detection_assumes_that_shell_is_bash.mdwn b/doc/bugs/Detection_assumes_that_shell_is_bash.mdwn
index 46b159e80..9bb0629d3 100644
--- a/doc/bugs/Detection_assumes_that_shell_is_bash.mdwn
+++ b/doc/bugs/Detection_assumes_that_shell_is_bash.mdwn
@@ -18,3 +18,7 @@ git-annex version: 3.20121017
Not everyone has bash as there login-shell.
[[!tag /design/assistant]]
+
+> [[done]]; assistant now uses sh -c "sane shell stuff here" to work
+> around csh. (There are systems without bash, but probably fewer without sh)
+> --[[Joey]]
diff --git a/doc/bugs/host_with_rysnc_installed__44___not_recognized.mdwn b/doc/bugs/host_with_rysnc_installed__44___not_recognized.mdwn
index e411eaf9c..4513ad9db 100644
--- a/doc/bugs/host_with_rysnc_installed__44___not_recognized.mdwn
+++ b/doc/bugs/host_with_rysnc_installed__44___not_recognized.mdwn
@@ -13,3 +13,7 @@ ssh keys were installed to allow login, when ssh-askpass was not found on osx ve
[[!meta title="webapp rsync probe command failed on FreeNAS box"]]
[[!tag /design/assistant]]
+
+> [[done]]; based on the error message it's using csh and
+> the assistant will now wrap its shell commands to work with csh.
+> --[[Joey]]