Description
This is just a small thing, but for my CI (jenkins) user testRmrf
fails.
I've looked into the implementation and my environment and it happens because the jenkins
user is a local user and has a $HOME
of /foo/home/jenkins
instead of /home/jenkins
, which I think is the tacit assumption in the isSafeToRmrf
function.
In general, it feels to me like that function is giving a false sense of security, or could at least use some additional documentation, since from the function name I would never have guessed the criteria.
Also, in some sense it may also be too strict, because something like /tmp/occa
should be 'safe' to remove even though it only has depth 2. Maybe it would be nicer to check if the normalized path is below the user's actual home directory instead, or something like that? That still wouldn't cover the /tmp
case though.