From 53968bf91c25a16cc927335e3cabeae65b1206d4 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Fri, 13 Oct 2023 14:26:28 +0200 Subject: [PATCH] Fix retrieving a password in case a function returns another callable --- osc/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osc/conf.py b/osc/conf.py index c9f10e996e..d87a9ac600 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -104,6 +104,11 @@ def data(self): # we use the password only from time to time to make a session cookie # and there's no need to keep the password in program memory longer than necessary result = self._data() + + # the function can also return a function, let's evaluate them recursively + while callable(result): + result = result() + if result is None: raise oscerr.OscIOError(None, "Unable to retrieve password") return result