Re: how to restrict file access below some top directory

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Thu, 10 Feb 2022 08:30:31 UTC
--------
Matthias Apitz writes:
> 
> Hello,
>
> I want restrict in a C- or Perl-written application the file access to
> only files below some top directory, say
>
> 	/var/spool/dir/
>
> and not allowing, for example, access to /var/spool/dir/../../../etc/passwd
> Ofc, this could be done easy with chroot(2), but this would require root
> permision. Any other ideas?

Jails.


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.