From fc4c81a2e6c6612adf88e1f9535e5c5283a281cf Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Sep 02 2022 16:04:02 +0000 Subject: MyBS: Fix upload to OBS. When a cookie is received and SSH authentication is not used osc_wrapper crashes with message: Can't use an undefined value as a symbol reference at MyBS.pm line 290. Fix this by not trying to save cookies for plain authentication. Signed-off-by: Michal Suchanek --- diff --git a/scripts/lib/SUSE/MyBS.pm b/scripts/lib/SUSE/MyBS.pm index ce9f37d..e429616 100644 --- a/scripts/lib/SUSE/MyBS.pm +++ b/scripts/lib/SUSE/MyBS.pm @@ -287,15 +287,17 @@ sub save_cookie { my ($self, $cookie) = @_; my $fh = $self->{lock}; - print $fh $cookie; + if ($fh) { + print $fh $cookie; - close($fh); + close($fh); - move($self->{cookiefile}, $cookiefile); - unlink($lockfile); + move($self->{cookiefile}, $cookiefile); + unlink($lockfile); - $self->{lock} = undef; - $self->{cookiefile} = undef; + $self->{lock} = undef; + $self->{cookiefile} = undef; + } } sub ssh_auth {