Music non-stop.

Powered By Php

Mysql Logo

Powered By Apache

Subversion Pre-Commit hook to check sudoers file syntax
Posted by Joel (joelh-website at planetjoel dot com) on Tuesday, 6th of January, 2009 - 09:32:23 PM

In my short running series extremely obscure pieces of code that hopefully someone else in the universe will find useful I bring you a pre-commit hook for subversion that checks to make sure your sudoers file has correct syntax. This is useful for us because we have a very large sudoers file and once commited into subversion it will get deployed to all of our boxes. If it contains a syntax error this would be quite nasty.

While coding it I ran into a fun little bug that means if you try and print too much to stderr it hangs which made things a bit more interesting.

Enjoy

Add a comment