[scponly] setting a umask

James Boorn jboorn at pivotlink.com
Wed Apr 20 17:55:48 EDT 2005


If your are talking about scp, it will preserve permissions when it can
(-p preserves modification times, access times, and modes from the
original file).  Part of that is setting the umask to 0.  That is the
scp binary will set the umask itself replacing whatever it was set to
before.  You need to modify scp.

On Wed, 2005-04-20 at 13:25, Paul Jones wrote:
> 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
> 
> 
> 
> ______________________________________________________________________
> _______________________________________________
> scponly mailing list
> scponly at lists.ccs.neu.edu
> https://lists.ccs.neu.edu/bin/listinfo/scponly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ccs.neu.edu/pipermail/scponly/attachments/20050420/04ebbb83/attachment.bin


More information about the scponly mailing list