   {:pre [(keyword? os) (is-ambly-bonjour-name? bonjour-name)
          (string? endpoint-address) (number? endpoint-port)]}
   (let [webdav-endpoint (create-http-url endpoint-address endpoint-port)
-        shell-result (shell/sh "net" "use" "*" webdav-endpoint)]
+        shell-result (sh 30000 "" true "net" "use" "*" webdav-endpoint)]
    (or
-     (extract-drive-letter (subs (:out shell-result) 0 28))
-     (throw (IOException. (:err shell-result))))))
+     (extract-drive-letter (subs shell-result 0 (min 28 (count shell-result))))
+     (throw (IOException. shell-result)))))
 
 (defmethod mount-webdav :unknown
   [os bonjour-name endpoint-address endpoint-port]

  (or
    (not (mount-exists? webdav-mount-point))
    (or
      (zero? (sh 5000 -1 "umount" webdav-mount-point))
      (zero? (sh 5000 -1 "umount" "-f" webdav-mount-point))
      (zero? (sh 1000 -1 "rmdir" webdav-mount-point)))))

(defmethod umount-webdav :win
  [os webdav-mount-point]
  {:pre [(keyword? os) (string? webdav-mount-point)]}
  (zero? (sh 5000 -1 "net" "use" webdav-mount-point "/delete")))

(defmethod umount-webdav :unknown
  [os webdav-mount-point]


(defn sh
  "Executes a shell process. Allows up to timeout to complete, returning process
  exit code or process output. Otherwise forcibly terminates process and returns
  timeout-return-value."
  [timeout timeout-return-value return-output? & args]
  {:pre [(number? timeout) (every? string? args)]}
  (let [process (.exec (Runtime/getRuntime) (string/join " " args))]
    (loop [time-remaining timeout]
      (Thread/sleep 100)
      (or
        (try
          (let [exit-value (.exitValue process)]
            (if return-output?
              (let [input-stream (.getInputStream process)
                    output (slurp input-stream)]
                (.close input-stream)
                output)
              exit-value))
          (catch IllegalThreadStateException _
            nil))
        (if (pos? time-remaining)
          (recur (- time-remaining 100))
          (do
            (.destroy process)
            timeout-return-value))))))

(defn- ip-address->inet-addr
  "Take a string representation of an IP address and returns a Java InetAddress
