Skip to content

Commit

Permalink
Merge pull request #3955 from jestabro/configd-in-session-false
Browse files Browse the repository at this point in the history
configd: T6640: enforce in_session returns False under configd
  • Loading branch information
dmbaturin authored Aug 8, 2024
2 parents 7a54689 + 6543f44 commit 7b9d5f0
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 7b9d5f0

Please sign in to comment.