I would like to trick a non-malicious process to think that it is writing to directory $HOME/abc/def/ while it writes in fact to $HOME/xyz/def (the former path is hardcoded and it does not work for my for various reasons). The $HOME/abc/def/ directory should not exists at all. I thought about using user namespace + filesystem name-space to mount a aufs filesystem over it but I failed (the mount finished stating insufficient privileges).

Is it possible to do using user + filesystem namespaces? If not is there any risk creating suid program that creates such filesystem namespace for single program (the setup is currently low-security but I prefer to be security concious)? Or maybe there is existing solution to do it?


Will using a symbolic link not suffice? Example:

[root@talara ~]# ls -la /tmp/home/
total 12
drwxr-xr-x  3 root root 4096 Jul  5 16:01 .
drwxrwxrwt. 9 root root 4096 Jul  5 16:01 ..
drwxr-xr-x  2 root root 4096 Jul  5 16:01 123
lrwxrwxrwx  1 root root   13 Jul  5 16:01 321 -> /tmp/home/123
[root@talara ~]# touch /tmp/home/321/ACTIVITY_TEST
[root@talara ~]# ls -la /tmp/home/123/
total 8
drwxr-xr-x 2 root root 4096 Jul  5 16:02 .
drwxr-xr-x 3 root root 4096 Jul  5 16:01 ..
-rw-r--r-- 1 root root    0 Jul  5 16:02 ACTIVITY_TEST
[root@talara ~]#

This should suffice for tricking a hard coded script or program.

  • To some extend. One of the reason is that, for me, those files shouldn't be there and should not appear during ls, opening directory by file manager etc. – Maciej Piechotka Jul 5 '13 at 20:12
  • Ahh. Invisible folder.. Lets call this idea last ditch effort ;) – Tim Jul 5 '13 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.