After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682570 - system connection files are renamed to match the id field
system connection files are renamed to match the id field
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
0.9.x
Other Linux
: Normal normal
: ---
Assigned To: Jiri Klimes
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-08-23 20:10 UTC by nathanael
Modified: 2012-11-01 11:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] keyfile: don't rename files on connection updates (4.83 KB, patch)
2012-10-24 14:15 UTC, Jiri Klimes
none Details | Review

Description nathanael 2012-08-23 20:10:54 UTC
Hello,

  I'm not sure if this is a bug or just something not a documented requirement. Here's the issue.

I've created a RPM that has multiple system connections, all using the keyfile plugin format. Many of the connections aren't named the same as the string in the id field

For example:

/etc/NetworkManager/system-connections/Gnat
[connection]
id=Gnat Office

/etc/NetworkManager/system-connections/Sunridge
[connection]
id=UCMC Sunridge

etc...

I'm not sure when or what triggers it however eventually the connection file is duplicated and named to the string in the id. The old file isn't removed. 


There are differences between it and the newly created file:

-read-only=true

-proto=rsn
+proto=rsn;


It causes problems when I upgrade the connections since it leaves these non-rpm controlled files in place.

So is this a bug? Or should I be naming these after the id string?

Also I'm slightly unsure/concerned how it removes the read-only attribute...
Comment 1 Pavel Simerda 2012-08-24 15:08:04 UTC
Expected behavior is one of:

1) don't accept connections where file name and id don't match

In this case the id could just be left out as it can be read from the
filename.

2) accept it but never move around configuration files
Comment 2 Jiri Klimes 2012-10-24 14:13:17 UTC
(In reply to comment #0)
> I'm not sure when or what triggers it however eventually the connection file is
> duplicated and named to the string in the id. The old file isn't removed. 
> 

The thing is that when connection is saved the new file name is generated according to connection's name (ID). However, the old file *is* removed.
There was a bug causing not removing the old files, but that was fixed a year ago. You may use an older NM version.

Nonetheless, I still think we shouldn't rename files on updating connection.

(In reply to comment #1)
> 2) accept it but never move around configuration files

I'd go with this option. I think it makes sense to allow different IDs and file names.
Comment 3 Jiri Klimes 2012-10-24 14:15:09 UTC
Created attachment 227151 [details] [review]
[PATCH] keyfile: don't rename files on connection updates
Comment 4 Pavel Simerda 2012-10-25 10:56:03 UTC
Looks good, would push it but as we have 'pavlix/keyfile' branch anyway,
I pushed it there first.

commit 2937c4645a44549afa1008c8adc8bb6c95785679
Author: Jiří Klimeš <jklimes@redhat.com>
Date:   Thu Oct 25 12:15:09 2012 +0200

    keyfile: don't rename system connection files (bgo #682570)
    
    When updating connections, it is less confusing to reuse the existing file
    instead of renaming files according to connection's ID. That reduces surprises
    of moving connection files when a connection is edited.

It will be merged soon together with the other 'keyfile' stuff.
Comment 5 Pavel Simerda 2012-11-01 11:08:03 UTC
As 'pavlix/keyfile' is not yet ready, I'm pushing this patch alone.