changeset 23:4d1bc23e4d09

implemented acl saving.
author Robert McIntyre <rlm@mit.edu>
date Thu, 10 Jan 2013 07:47:08 +0000
parents 43cfd1a2c523
children eab9ad213a69
files src/hgrc src/pkg.pl src/save-acls.c src/system-init.pl
diffstat 4 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/src/hgrc	Thu Jan 10 07:36:04 2013 +0000
     1.2 +++ b/src/hgrc	Thu Jan 10 07:47:08 2013 +0000
     1.3 @@ -3,4 +3,4 @@
     1.4  
     1.5  
     1.6  [hooks]
     1.7 -pre-commit = echo "it's a commit"
     1.8 \ No newline at end of file
     1.9 +pre-commit = ~/.save-acls 2> /dev/null
    1.10 \ No newline at end of file
     2.1 --- a/src/pkg.pl	Thu Jan 10 07:36:04 2013 +0000
     2.2 +++ b/src/pkg.pl	Thu Jan 10 07:47:08 2013 +0000
     2.3 @@ -87,6 +87,10 @@
     2.4    ("install", "-g", "hg-wheel", "-o", "hg-committer",
     2.5     "-m", "6111", "/pkg/hg-committer/hg-wrapper", "$pkg_home/.hg-wrapper");
     2.6  
     2.7 +@pkg_copy_save_acls_cmd =
     2.8 +  ("install", "-g", "root", "-o", "root",
     2.9 +   "-m", "6111", "/pkg/hg-committer/save-acls", "$pkg_home/.save-acls");
    2.10 +
    2.11  sub execute{print "\t@_\n"; system(@_) and die $!;}
    2.12  
    2.13  #determine if the user already exists:
    2.14 @@ -110,6 +114,7 @@
    2.15  print "Copy Default Files.\n";
    2.16  
    2.17  execute(@pkg_copy_hg_wrapper_cmd);
    2.18 +execute(@pkg_copy_save_acls_cmd);
    2.19  copy_default_file(".profile");
    2.20  
    2.21  #execute(@pkg_link_bashrc_cmd);
     3.1 --- a/src/save-acls.c	Thu Jan 10 07:36:04 2013 +0000
     3.2 +++ b/src/save-acls.c	Thu Jan 10 07:47:08 2013 +0000
     3.3 @@ -1,8 +1,10 @@
     3.4  #include <unistd.h>
     3.5 +#include <stdio.h>
     3.6  
     3.7  main( int argc, char ** argv){
     3.8    setreuid(geteuid(), geteuid());
     3.9    setregid(getegid(), getegid());
    3.10 +  printf("saving acls to /etc/acls\n");
    3.11    system("getfacl -R /usr /opt /etc > /etc/acls");
    3.12  }
    3.13  
     4.1 --- a/src/system-init.pl	Thu Jan 10 07:36:04 2013 +0000
     4.2 +++ b/src/system-init.pl	Thu Jan 10 07:47:08 2013 +0000
     4.3 @@ -128,6 +128,7 @@
     4.4  execute("gpasswd --add hg-committer users");
     4.5  execute("ln -sf $pwd/profile  /pkg/hg-committer/.profile");
     4.6  execute("ln -sf $pwd/hg-wrapper /pkg/hg-committer/");
     4.7 +execute("ln -sf $pwd/save-acls /pkg/hg-committer/");
     4.8  execute("ln -sf `which hg` /pkg/hg-committer/");
     4.9  
    4.10  execute("install -o hg-committer -g hg-wheel -m 660 $pwd/hgignore /.hgignore");