Showing 1 changed files with 4 additions and 2 deletions
+4 -2
lib/Gitprep/Manager.pm
... ...
@@ -496,8 +496,8 @@ sub update_authorized_keys_file {
496 496
     my $ssh_public_keys = $self->app->dbi->model('ssh_public_key')->select->all;
497 497
     my $ssh_public_keys_str = '';
498 498
     for my $key (@$ssh_public_keys) {
499
-      my $ssh_public_key_str = $self->app->home->rel_file('script/gitprep-shell')
500
-        . " $key->{user_id},no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty $key->{key}";
499
+      my $ssh_public_key_str = 'command="' . $self->app->home->rel_file('script/gitprep-shell')
500
+        . " $key->{user_id}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty $key->{key}";
501 501
       $ssh_public_keys_str .= "$ssh_public_key_str $key->{user_id}\n\n";
502 502
     }
503 503
     
... ...
@@ -511,6 +511,8 @@ sub update_authorized_keys_file {
511 511
       or croak "Can't close authorized_keys tmp file $output_file";
512 512
 
513 513
     # Replace
514
+    chmod 0600, $output_file
515
+      or croak "Can't chmod authorized_keys tmp file: $output_file";
514 516
     move $output_file, $authorized_keys_file
515 517
       or croak "Can't replace $authorized_keys_file by $output_file";
516 518