Skip to content

Commit

Permalink
Don't assume KRB5CCNAME is in the environment in replica install
Browse files Browse the repository at this point in the history
The replica install was unilaterally removing KRB5CCNAME from
os.environ in some cases. Instead check first to see if it is
present and only remove in that case.

Fixes: https://pagure.io/freeipa/issue/9446

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
  • Loading branch information
rcritten authored and flo-renaud committed Sep 14, 2023
1 parent dade02d commit f248b22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ipaserver/install/server/replicainstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ def promote_check(installer):
raise errors.ACIError(info="Not authorized")

if installer._ccache is None:
del os.environ['KRB5CCNAME']
os.environ.pop('KRB5CCNAME', None)
else:
os.environ['KRB5CCNAME'] = installer._ccache

Expand Down Expand Up @@ -1197,7 +1197,7 @@ def promote_check(installer):
if add_to_ipaservers:
# use user's credentials when the server host is not ipaservers
if installer._ccache is None:
del os.environ['KRB5CCNAME']
os.environ.pop('KRB5CCNAME', None)
else:
os.environ['KRB5CCNAME'] = installer._ccache

Expand Down

0 comments on commit f248b22

Please sign in to comment.