Page MenuHomeVyOS Platform

system login banner is not removed on deletion.
Closed, ResolvedPublic

Description

If the banner is set via the config and then removed, the banner is still displayed on login.
So there is no delete option in the config script it seems.

Details

Difficulty level
Unknown (require assessment)
Version
1.4 1.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Behavior change
Issue type
Cosmetic issue (typos etc.)

Event Timeline

UnicronNL triaged this task as Normal priority.Dec 19 2021, 4:59 PM
UnicronNL created this task.

@UnicronNL ,

The custom banner is removed after the deletion operation. But it shows the default banner:

login as: vyos
Pre-authentication banner message from server:
| Welcome to VyOS
End of banner message from server
[email protected]'s password:

Check out project news at https://blog.vyos.io
and feel free to report bugs at https://phabricator.vyos.net

You can change this banner using "set system login banner post-login" command.

VyOS is a free software distribution that includes multiple components,
you can check individual component licenses under /usr/share/doc/*/copyright

Do you want to remove the default one as well ?

Well deleting the login banner results in the "default" behavior as expected.

If you do not wish to have any banner it is probably best to set the banner to ''.

c-po changed the task status from Open to Needs testing.Dec 20 2021, 8:46 PM
c-po lowered the priority of this task from Normal to Low.
c-po changed Issue type from Bug (incorrect behavior) to Cosmetic issue (typos etc.).

@SrividyaA
FYI

I set the banners via set system login pre-login 'test' and/or set system login post-login 'test'
and then the banners are set. (and the default is overwritten)

If I then delete them delete system login pre-login and/or set system login post-login
the banners on ssh connection still display 'test' instead of nothing.

@UnicronNL can you rechecknon todays rolling image? It behaved differently for me

Interestingly if vyos-configd is in use this bug is triggered. If vyos-configd is not used the bug is not triggered :/

c-po added a subscriber: c-po.

This is a mutability issue: since under vyos-configd the script is loaded as module, global variables persist, however:

banner = default_config_data

means changes to banner will change default_config_data. Fix with:

banner = deepcopy(default_config_data)

A copy would suffice, but in the unlikely case that the default banner data becomes a nested dict, we'll use 'deepcopy'. I will push the fix.