From 208c401858b638ad07f736b43d7e96ae5bd0985e Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 1 Sep 2009 19:40:42 +0530 Subject: [PATCH] compile: chmod internal, and save "old" authkeys --- src/gl-compile-conf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gl-compile-conf b/src/gl-compile-conf index 8454eb4..0907655 100755 --- a/src/gl-compile-conf +++ b/src/gl-compile-conf @@ -193,7 +193,7 @@ for my $repo (keys %repos) wrap_chdir("$repo.git"); system("git init --bare"); system("cp $GL_ADMINDIR/src/update-hook.pl hooks/update"); - system("chmod 755 hooks/update"); + chmod 0755, "hooks/update"; wrap_chdir("$repo_base_abs"); } } @@ -223,10 +223,8 @@ for my $pubkey (glob("*.pub")) print $newkeys_fh "# gitolite end\n"; close $newkeys_fh or die "close newkeys failed: $!"; -# check what changes are being made; just a comfort factor -# system("vim -d ~/.ssh/authorized_keys ~/.ssh/new_authkeys"); - # all done; overwrite the file (use cat to avoid perm changes) +system("cat $ENV{HOME}/.ssh/authorized_keys > $ENV{HOME}/.ssh/old_authkeys"); system("cat $ENV{HOME}/.ssh/new_authkeys > $ENV{HOME}/.ssh/authorized_keys"); system("rm $ENV{HOME}/.ssh/new_authkeys");