You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Faine, Mark" <Ma...@msfc.nasa.gov> on 2004/10/13 13:44:42 UTC

umask wrapper

I'd like to create bash wrapper scripts for svnlook, svnadmin and svnserve
that change the umask to 002 before running the command but reset it back to
022 afterwards. How can I do this?

-Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: umask wrapper

Posted by Tobias Ringström <to...@ringstrom.mine.nu>.
Faine, Mark wrote:

>I'd like to create bash wrapper scripts for svnlook, svnadmin and svnserve
>that change the umask to 002 before running the command but reset it back to
>022 afterwards. How can I do this?
>  
>
The umask is a process property which means that setting it in the child 
process (e.g. the hook script) will not affect the parent process (e.g. 
your shell, svnserve or httpd). There is no need to reset it.

/Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: umask wrapper

Posted by Steve Greenland <st...@lsli.com>.
On Wed, Oct 13, 2004 at 08:44:42AM -0500, Faine, Mark wrote:
> I'd like to create bash wrapper scripts for svnlook, svnadmin and svnserve
> that change the umask to 002 before running the command but reset it back to
> 022 afterwards. How can I do this?

As noted, there's no need to change it back.

Here's a generic script:

#!/bin/sh
# Generic wrapper for svn commands to enforce correct umask
umask 002
cmdname=`basename $0`
exec /usr/bin/$cmdname "$@"

Put that in /usr/local/bin/svnwrap, make it excutable, and create links
for each command you want to wrap:

cd /usr/local/bin
ln -s svnwrap svn
ln -s svnwrap svnlook
ln -s svnwrap svnadmin
ln -s svnwrap svnserve

(Assuming your *real* svn commands are in /usr/bin. Adjust script, PATH,
and links as necessary. No warranty expressed or implied. YMMV. Good
luck, Jim. This message will self destruct when no longer needed...)

Steve

-- 
"Outlook not so good." That magic 8-ball knows everything! I'll ask
about Exchange Server next.
                           -- (Stolen from the net)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org