Skip to content

Commit

Permalink
Raise Permission denied symlinking a symlink
Browse files Browse the repository at this point in the history
Google Drive doesn't support a shortcut that points to another
shortcut.
  • Loading branch information
astrada committed Apr 18, 2020
1 parent a1fd2dd commit 944b927
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/drive.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2489,7 +2489,11 @@ let create_remote_resource ?link_target is_folder path mode =
let (target_path_in_cache, target_trashed) =
get_path_in_cache target_path config in
get_resource target_path_in_cache target_trashed >>= fun resource ->
SessionM.return (Option.get resource.CacheData.Resource.remote_id)
if CacheData.Resource.is_shortcut resource then
(* Drive doesn't support shortcuts to shortcuts *)
Utils.raise_m Permission_denied
else
SessionM.return (Option.get resource.CacheData.Resource.remote_id)
end >>= fun target_id ->
let file = {
File.empty with
Expand Down

0 comments on commit 944b927

Please sign in to comment.