[scponly] setting a umask

Paul Jones shagreel at gmail.com
Wed Apr 20 16:25:21 EDT 2005


Thanks,

Do you know why I can't just compile umask(0002); into scponly? I tried that 
and it did not work. I was just wondering why.

Paul

On 4/20/05, Thomas Wana <thomas at wana.at> wrote:
> 
> Paul Jones wrote:
> > I have scponly running pretty well now chrooting my users. Is there a
> > way to set a easily umask for them? I need to set the umask to 002.
> >
> > Paul
> 
> umask in a scponly chroot is a bit of a problem; in my case, I had to
> write a wrapper program that sets the umask and executes the real program
> afterwards. In the case of 'svnserve', I copied the real svnserve binary
> to svnserve.real and wrote the following fake-svnserve program:
> 
> #include <unistd.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> 
> int main(int argc, char **argv, char **envp)
> {
> umask(0002);
> argv[0]="/usr/bin/svnserve.real";
> execve(argv[0], argv, envp);
> return 0; // not reached
> }
> 
> Tom
>
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the scponly mailing list