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

Re: Blocking root from SVN repository

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Thu, 28 Aug 2014 10:51:56 +0100

Stefan Sperling <stsp_at_elego.de> writes:

> That said, a one-line pre-commit hook script could check its UID and
> disallow the commit if it is invoked as root:
> if [ "`whoami`" == "root" ]; then exit 1; fi

The start-commit is probably better than the pre-commit as there is no
point allowing the transaction to start.

The start-commit gets a username as $2 and the script could use that,
but invoking whoami is probably better for the purpose of blocking root.
For file:// access whoami and $2 will usually be the same but they could
be different if --username is used.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2014-08-28 11:52:27 CEST

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.