src/Pure/General/ssh.scala
changeset 78161 4b1b7cbb3e9a
parent 78158 8b5a2e4b16d4
child 78298 3b0f8f1010f2
--- a/src/Pure/General/ssh.scala	Thu Jun 15 14:45:21 2023 +0200
+++ b/src/Pure/General/ssh.scala	Thu Jun 15 15:04:23 2023 +0200
@@ -241,6 +241,11 @@
       if (cmd.nonEmpty) run_sftp(cmd + " " + sftp_path(path))
     }
 
+    override def restrict(path: Path): Unit =
+      if (!execute("chmod g-rwx,o-rwx " + bash_path(path)).ok) {
+        error("Failed to change permissions of " + quote(remote_path(path)))
+      }
+
     override def set_executable(path: Path, flag: Boolean = false): Unit =
       if (!execute("chmod a" + (if (flag) "+" else "-") + "x " + bash_path(path)).ok) {
         error("Failed to change executable status of " + quote(remote_path(path)))
@@ -402,6 +407,7 @@
     def is_dir(path: Path): Boolean = path.is_dir
     def is_file(path: Path): Boolean = path.is_file
     def delete(path: Path): Unit = path.file.delete
+    def restrict(path: Path): Unit = File.restrict(path)
     def set_executable(path: Path, flag: Boolean = false): Unit =
       File.set_executable(path, flag = flag)
     def make_directory(path: Path): Path = Isabelle_System.make_directory(path)