Attention is currently required from: laforge.
2 comments:
Commit Message:
Saving the current configuration by doing 'write file [FILE]' breaks
the 'show startup-config' command. If write succeeds, this command
will be showing contents of the new (potentially modified) file.
e.g. https://blog.netwrix.com/copy-running-config-to-startup-config-cisco/ […]
Ok, then I misunderstood the purpose of this command. My [incorrect] understanding was that this command is supposed to show the initial configuration that was effective when the process started. This might be useful, for instance, to see difference from the current (running) configuration.
Doesn't that mean that the write is then broken?
In the ticket I gave an example of writing the configuration to *another* file, which is not the same as the one that the current process loaded. The problem occurs when you do `write file some_file`: `show startup-config` will be showing contents of that new `some_file` even if it's not the one that was given to the process via `-c` (and thus will not be used if you restart the process).
Another problem occurs when you try writing to a location in which you don't have the write permissions: the `write file /forbidden/some_file` fails, but yet alters the VTY state, so `show startup-config` would be trying to `open()` that `/forbidden/some_file` and obviously would fail.
Maybe we should change the `write file [PATH]` command to not alter the state, i.e. remove invocation of `host_config_set()` in `config_write_file_cmd`. This would solve both problems I described above. What do you think?
To view, visit change 40187. To unsubscribe, or for help writing mail filters, visit settings.