X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=rpc%2Fdial.go;h=d8a63386333d2c76c27affca33418d3378bcc4dc;hb=3840c3fe7fab425ef7d20d2f686884b404bb5e62;hp=f300370aba3f75eb7ff55b7fc9eb0be2c15d9871;hpb=583a2695a3ddc9c98e0a03d9f1bad8df30afe887;p=safcm%2Fsafcm.git diff --git a/rpc/dial.go b/rpc/dial.go index f300370..d8a6338 100644 --- a/rpc/dial.go +++ b/rpc/dial.go @@ -113,7 +113,7 @@ compat_sha512sum() { sha512sum "$1" } ` - case "freebsd": + case "freebsd", "openbsd": compat = ` dir_stat='41777 0 0' file_stat="100700 $(id -u) $(id -g)" @@ -181,6 +181,8 @@ f() { rm "$tmp" # Make file executable chmod 0700 "$x" + # Some BSD create files with group wheel in /tmp + chgrp "$(id -g)" "$x" fi exec "$x" sync @@ -274,7 +276,7 @@ f } func connGetGoos(stdin io.Writer, stdout *bufio.Reader) (string, error) { - _, err := fmt.Fprintln(stdin, "uname -o") + _, err := fmt.Fprintln(stdin, "uname") if err != nil { return "", err } @@ -287,12 +289,14 @@ func connGetGoos(stdin io.Writer, stdout *bufio.Reader) (string, error) { // NOTE: Adapt helper uploading in dialSSH() when adding new systems var goos string switch x { - case "GNU/Linux": + case "Linux": goos = "linux" case "FreeBSD": goos = "freebsd" + case "OpenBSD": + goos = "openbsd" default: - return "", fmt.Errorf("unsupported OS %q (`uname -o`)", x) + return "", fmt.Errorf("unsupported OS %q (`uname`)", x) } return goos, nil }