# HG changeset patch # User Robert McIntyre # Date 1357804028 0 # Node ID 4d1bc23e4d0927c6ff5cec8d3814e914799915c0 # Parent 43cfd1a2c523cfce8cd9a6723b3d3f5718803793 implemented acl saving. diff -r 43cfd1a2c523 -r 4d1bc23e4d09 src/hgrc --- a/src/hgrc Thu Jan 10 07:36:04 2013 +0000 +++ b/src/hgrc Thu Jan 10 07:47:08 2013 +0000 @@ -3,4 +3,4 @@ [hooks] -pre-commit = echo "it's a commit" \ No newline at end of file +pre-commit = ~/.save-acls 2> /dev/null \ No newline at end of file diff -r 43cfd1a2c523 -r 4d1bc23e4d09 src/pkg.pl --- a/src/pkg.pl Thu Jan 10 07:36:04 2013 +0000 +++ b/src/pkg.pl Thu Jan 10 07:47:08 2013 +0000 @@ -87,6 +87,10 @@ ("install", "-g", "hg-wheel", "-o", "hg-committer", "-m", "6111", "/pkg/hg-committer/hg-wrapper", "$pkg_home/.hg-wrapper"); +@pkg_copy_save_acls_cmd = + ("install", "-g", "root", "-o", "root", + "-m", "6111", "/pkg/hg-committer/save-acls", "$pkg_home/.save-acls"); + sub execute{print "\t@_\n"; system(@_) and die $!;} #determine if the user already exists: @@ -110,6 +114,7 @@ print "Copy Default Files.\n"; execute(@pkg_copy_hg_wrapper_cmd); +execute(@pkg_copy_save_acls_cmd); copy_default_file(".profile"); #execute(@pkg_link_bashrc_cmd); diff -r 43cfd1a2c523 -r 4d1bc23e4d09 src/save-acls.c --- a/src/save-acls.c Thu Jan 10 07:36:04 2013 +0000 +++ b/src/save-acls.c Thu Jan 10 07:47:08 2013 +0000 @@ -1,8 +1,10 @@ #include +#include main( int argc, char ** argv){ setreuid(geteuid(), geteuid()); setregid(getegid(), getegid()); + printf("saving acls to /etc/acls\n"); system("getfacl -R /usr /opt /etc > /etc/acls"); } diff -r 43cfd1a2c523 -r 4d1bc23e4d09 src/system-init.pl --- a/src/system-init.pl Thu Jan 10 07:36:04 2013 +0000 +++ b/src/system-init.pl Thu Jan 10 07:47:08 2013 +0000 @@ -128,6 +128,7 @@ execute("gpasswd --add hg-committer users"); execute("ln -sf $pwd/profile /pkg/hg-committer/.profile"); execute("ln -sf $pwd/hg-wrapper /pkg/hg-committer/"); +execute("ln -sf $pwd/save-acls /pkg/hg-committer/"); execute("ln -sf `which hg` /pkg/hg-committer/"); execute("install -o hg-committer -g hg-wheel -m 660 $pwd/hgignore /.hgignore");