On Fri, Jan 07, 2005 at 10:50:13PM +0100, Mathieu Roy wrote:
> > I guess we're ready for the merge now.
>
> I'll do a last test tomorrow morning and I'll do it (I usually make
> directly a backup of the tree, just in case).
>
> Regards,
By the way, there is also an upgrade script to fix the ssh keys w/o
trailing newline. I attach it.
For the script to be applied cleanly in the future, it may be needed
to fix something in SetUserSettings (see comments).
--
Sylvain
#!/usr/bin/perl
# Add a tailing '###' in table user, field authorized_keys
# Previous version of Savane did not add it, causing the authorized
# keys to be recreated at each cron job - with no harm but additional
# CPU and HD work
use strict;
use Savannah;
my $debug = 0;
my @users = GetUserList("", "user_name");
for my $user (@users) {
my ($keys) = GetUserSettings($user, "authorized_keys");
if($keys and not $keys =~ /\#\#\#$/) {
print "$user\n" if $debug; # if you want to get a list of fixed users
# an user can put ' in the SSH key comment and break the SQL command
$keys = s/'/\\'/; # hmmm, maybe SetUserSettings should rather do that
by itself
SetUserSettings($user, "authorized_keys", $keys . "###");
}
}