c28d6f Tell nmcli to not escape colon when getting the path of connection profile

Authored and Committed by Coiby Xu 2 years ago
    Tell nmcli to not escape colon when getting the path of connection profile
    
    Resolves: bz2151504
    Upstream: Fedora
    Conflict: None
    
    commit df6f25ff20a660ce8c300eba95e21e2fed6ed99f
    Author: Coiby Xu <coxu@redhat.com>
    Date:   Mon Mar 27 13:17:32 2023 +0800
    
        Tell nmcli to not escape colon when getting the path of connection profile
    
        Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2151504
    
        When a NetworManager connection profile contains a colon in the name,
        "nmcli --get-values UUID,FILENAME" by default would escape the colon
        because a colon is also used for separating the values. In this case,
        99kdumpbase fails to get the correct connection profile path,
                kdumpctl[5439]: cp: cannot stat '/run/NetworkManager/system-connections/static-52\\\:54\\\:01.nmconnection': No such file or directory
                kdumpctl[5440]: sed: can't read /tmp/1977-DRACUT_KDUMP_NM/ifcfg-static-52-54-01: No such file or directory
                kdumpctl[5449]: dracut-install: ERROR: installing '/tmp/1977-DRACUT_KDUMP_NM/ifcfg-static-52-54-01' to '/etc/NetworkManager/system-connections/ifcfg-static-52-54-01'
    
        As a result, dumping vmcore to a remote nfs would fail.
    
        In our case of getting connection profile path, there is no need to escape the
        colon so pass "-escape no" to nmcli,
    
                [root@localhost ~]# nmcli --get-values UUID,FILENAME c show
                659e09c1-a6bd-3549-9be4-a07a1a9a8ffd:/etc/NetworkManager/system-connections/aa\:bb.nmconnection
    
                [root@localhost ~]# nmcli -escape no --get-values UUID,FILENAME c show
                659e09c1-a6bd-3549-9be4-a07a1a9a8ffd:/etc/NetworkManager/system-connections/aa:bb.nmconnection
    
        Suggested-by: Beniamino Galvani <bgalvani@redhat.com>
        Reported-by: Martin Pitt <mpitt@redhat.com>
        Signed-off-by: Coiby Xu <coxu@redhat.com>
        Reviewed-by: Philipp Rudo <prudo@redhat.com>
    
    Signed-off-by: Coiby Xu <coxu@redhat.com>
    
        
file modified
+3 -1