[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: umask wrapper

From: Steve Greenland <steveg_at_lsli.com>
Date: 2004-10-13 20:37:18 CEST

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
Received on Wed Oct 13 20:38:32 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.