diff --git a/src/bin/urlwrapper.cpp b/src/bin/urlwrapper.cpp index 57f9806d7f..ef2918645c 100644 --- a/src/bin/urlwrapper.cpp +++ b/src/bin/urlwrapper.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -466,6 +467,41 @@ UrlWrapper::ArgvReceived(int32 argc, char** argv) return; } + if (proto == "nfs") { + BString parameter(host); + _DecodeUrlString(path); + if (url.HasPort()) + parameter << ":" << port; + //XXX: should not always be absolute! FIXME + parameter << ":/" << path; + BString prettyPath(path); + prettyPath.Remove(0, prettyPath.FindLast("/") + 1); + if (path == "" || path == "/") + prettyPath = "root"; + prettyPath << " on " << host; + prettyPath.Prepend("/"); + if (mkdir(prettyPath.String(), 0755) < 0) { + perror("mkdir"); + return; + } + dev_t volume; + uint32 flags = 0; + fprintf(stderr, "parms:'%s'\n", parameter.String()); + volume = fs_mount_volume(prettyPath.String(), NULL, "nfs4", flags, + parameter.String()); + if (volume < B_OK) { + fprintf(stderr, "fs_mount_volume: %s\n", strerror(volume)); + return; + } + + BMessage m(B_REFS_RECEIVED); + entry_ref ref; + if (get_ref_for_path(prettyPath.String(), &ref) < B_OK) + return; + m.AddRef("refs", &ref); + be_roster->Launch(kTrackerSig, &m); + return; + } /* diff --git a/src/bin/urlwrapper.rdef b/src/bin/urlwrapper.rdef index c4329160c9..ca6dc2037f 100644 --- a/src/bin/urlwrapper.rdef +++ b/src/bin/urlwrapper.rdef @@ -17,6 +17,7 @@ resource(1, "BEOS:FILE_TYPES") message "types" = "application/x-vnd.Be.URL.icq", "types" = "application/x-vnd.Be.URL.msn", "types" = "application/x-vnd.Be.URL.mms", + "types" = "application/x-vnd.Be.URL.nfs", "types" = "application/x-vnd.Be.URL.rtp", "types" = "application/x-vnd.Be.URL.rtsp", // "types" = "application/x-vnd.Be.URL.audio",