Jump to content


Best way to prevent use of external symlinks


  • Please log in to reply
6 replies to this topic

#1 Miles O'Neal

Miles O'Neal

    Advanced Member

  • Members
  • PipPipPip
  • 208 posts
  • LocationAustin. Texas. Y'all.

Posted 30 December 2019 - 06:55 PM

We occasionally have someone include a symlink to an external file in their workspace. This might be something in their home dir, a simulation run, etc. Regardless, it then breaks things for others when they sync to the depot containing the symlink[s].

The filesys.checklinks configurable doesn't seem helpful. And I don't see a way to trigger on an add. Have any of you done this?

Thanks.

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1176 posts

Posted 30 December 2019 - 07:48 PM

Seems like the easiest thing would be a change-content trigger.  Pretty quick to run "p4 opened" and check for symlinks, and you could then inspect the contents of the symlink via "p4 print" if you want to allow relative paths but disallow absolute paths.

#3 Miles O'Neal

Miles O'Neal

    Advanced Member

  • Members
  • PipPipPip
  • 208 posts
  • LocationAustin. Texas. Y'all.

Posted 30 December 2019 - 08:31 PM

If there's no way to catch it at "add" time, that might be the best option. Ugh, but it could be ugher. Thanks.

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1176 posts

Posted 30 December 2019 - 08:45 PM

You could try to implement a command trigger on "add", but you're in for some really fun times trying to figure out if the file is an external symlink since it's not visible to the server at that point.  :)

#5 Miles O'Neal

Miles O'Neal

    Advanced Member

  • Members
  • PipPipPip
  • 208 posts
  • LocationAustin. Texas. Y'all.

Posted 30 December 2019 - 11:43 PM

I can't find a "p4 print" syntax that works within the trigger to show me anything useful. I either get nothing back, or I get something like "//foo/bar#1 - add change 1056 (symlink)".
I've tried "p4 print //foo/bar" with nothing after it, "#1", and "@=$changelist". No dice.

#6 Miles O'Neal

Miles O'Neal

    Advanced Member

  • Members
  • PipPipPip
  • 208 posts
  • LocationAustin. Texas. Y'all.

Posted 30 December 2019 - 11:54 PM

Nevermind. There was more info than I realized, and I see it. Thanks!

#7 edwadrosen

edwadrosen

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 31 December 2019 - 10:35 AM

use either the rm or unlink command followed by the name of the symlink as an argument..Need any help regarding animation videos visit simply explainer




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users