Skip to content

Commit

Permalink
Merge pull request #3959 from vyos/mergify/bp/circinus/pr-3955
Browse files Browse the repository at this point in the history
configd: T6640: enforce in_session returns False under configd (backport #3955)
  • Loading branch information
c-po authored Aug 12, 2024
2 parents 33273bc + 3c556ed commit c50c55b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/vyos/configsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ def in_session(self):
Returns:
True if called from a configuration session, False otherwise.
"""
if os.getenv('VYOS_CONFIGD', ''):
return False
try:
self._run(self._make_command('inSession', ''))
return True
Expand Down
2 changes: 2 additions & 0 deletions src/services/vyos-configd
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ if __name__ == '__main__':
cfg_group = grp.getgrnam(CFG_GROUP)
os.setgid(cfg_group.gr_gid)

os.environ['VYOS_CONFIGD'] = 't'

def sig_handler(signum, frame):
shutdown()

Expand Down

0 comments on commit c50c55b

Please sign in to comment.