[Bug 433780] New: NetworkManager quotes arguments twice, netconfig does not reject them
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c429772 Summary: NetworkManager quotes arguments twice, netconfig does not reject them Product: openSUSE 11.1 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Critical Priority: P5 - None Component: Network AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: mt@novell.com QAContact: qa@suse.de CC: tambet@novell.com, milisav.radmanic@novell.com, mc@novell.com, mt@novell.com Depends on: 429772 Found By: Development +++ This bug was initially created as a clone of Bug #429772 +++ See attachment https://bugzilla.novell.com/attachment.cgi?id=244121 Here a find & cat on the data from the attachment showing the problem: $ find var/ var/ var/run var/run/netconfig var/run/netconfig/air var/run/netconfig/ppp0 var/run/netconfig/ppp0/netconfig0 var/run/netconfig/NetworkManager.netconfig var/run/netconfig/'air' var/run/netconfig/'cable' var/run/netconfig/'cable'/netconfig0 var/run/netconfig/'cable'/netconfig1 ^^^^^^^ $ cat var/run/netconfig/\'cable\'/netconfig0 SERVICE='dhclient' INTERFACE='cable' ^^^^^^^ NISDOMAIN='' NISSERVERS='' CREATETIME='1223398933' $ cat var/run/netconfig/\'cable\'/netconfig1 SERVICE='NetworkManager' INTERFACE='cable' CREATETIME='1223419459' NetworkManager & "NM-dhclient" seem to quote arguments twice netconfig modify -i "'cable'" There is no /sys/class/net/'cable' interface directory, so the config provided this way will be never used. That netconfig does not reject this, is also a bug. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.provo.novell.com |tambet@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|429772 | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User tambet@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c1 Tambet Ingo <tambet@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #1 from Tambet Ingo <tambet@novell.com> 2008-10-09 05:14:09 MDT --- Thanks for catching this, I'll take care of it for beta3. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User tambet@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c2 Tambet Ingo <tambet@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |mt@novell.com --- Comment #2 from Tambet Ingo <tambet@novell.com> 2008-10-09 05:31:56 MDT --- Hmm, so how should the the variables look like in the netconfigX files? Just without quotes like this? SERVICE=NetworkManager INTERFACE=cable CREATETIME=1223419459 How about values with spaces, like DNSSERVERS=192.168.0.1 192.168.0.2 or with quotes? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 JP Rosevear <jpr@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P2 - High -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c3 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lnussel@novell.com Status|NEEDINFO |ASSIGNED Info Provider|mt@novell.com | --- Comment #3 from Marius Tomaschewski <mt@novell.com> 2008-10-13 01:48:11 MDT --- When you provide input via stdin to netconfig modify, use explicit single quotes (the quote character ' is not allowed inside of the value an can't be quoted) even when there are no spaces in the value. The netconfig modify arguments without additional quotes around the value, for example: SERVICE='NetworkManager' INTERFACE='eth0' DNSSERVERS='192.168.0.1 192.168.0.2' { echo "INTERFACE='$INTERFACE' echo "DNSSERVERS='$DNSSERVERS'" } | /sbin/netconfig modify -s "$SERVICE" -i "$INTERFACE" or /sbin/netconfig modify -s "$SERVICE" -i "$INTERFACE" <<-EOF INTERFACE='$INTERFACE' DNSSERVERS='$DNSSERVERS' EOF This means, the argruments have to contain the bare string values: ... argv[] = { "/sbin/netconfig", "-s", "NetworkManager", "-i", "eth0", NULL}; The expected input format is dhcpcd complatible key='value string'; see also the "dhcpcd -T eth0" output, e.g.: INTERFACE='eth0' DNSSERVERS='192.168.0.1 192.168.0.2' I'm adding some code to netconfig rejecting invalid args & input. The keys have to be compatible with shell identifiers + a single quoted value: /^[[:space:]]*[a-z_][a-z0-9_]*='[^']*'[[:space:]]*$/ && !/^[[:space:]]*_+=/ We don't allow unquoted values to go away a misinterpretation as a bash reserved word, ... and keep it simple. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User tambet@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c4 --- Comment #4 from Tambet Ingo <tambet@novell.com> 2008-10-13 03:19:12 MDT --- Hmm, in that case, I don't see any bugs in NM at all, NM does always use a single quote (') around each value. This is a sample from NM log: Spawning '/sbin/netconfig modify --service NetworkManager' Writing to netconfig: INTERFACE='eth0' Writing to netconfig: DNSSEARCH='lan' Writing to netconfig: DNSSERVERS='192.168.0.3' There's no shell involved, so these are the exact values netconfig gets. NM never uses "-i" command line argument, the interface is always passed over stdin. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c5 --- Comment #5 from Marius Tomaschewski <mt@novell.com> 2008-10-13 08:13:42 MDT --- Created an attachment (id=245167) --> (https://bugzilla.novell.com/attachment.cgi?id=245167) Proposed patch for netconfig -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #245167|video/dv |text/plain mime type| | Attachment #245167|0 |1 is patch| | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c6 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|tambet@novell.com |mt@novell.com Summary|NetworkManager quotes arguments twice, netconfig|Netconfig quotes INTERFACE argument twice and |does not reject them |does not reject crap --- Comment #6 from Marius Tomaschewski <mt@novell.com> 2008-10-13 08:24:35 MDT --- (In reply to comment #4 from Tambet Ingo)
Hmm, in that case, I don't see any bugs in NM at all, NM does always use a single quote (') around each value. This is a sample from NM log:
Spawning '/sbin/netconfig modify --service NetworkManager' Writing to netconfig: INTERFACE='eth0' Writing to netconfig: DNSSEARCH='lan' Writing to netconfig: DNSSERVERS='192.168.0.3'
There's no shell involved, so these are the exact values netconfig gets. NM never uses "-i" command line argument, the interface is always passed over stdin.
Ah... I've found the bug. You're right - it didn't came via -i but via stdin: if [ "x$val1" = "xINTERFACE" ]; then _INTERFACE="$val2" fi The $val2 contained "'ethX'" at this time.... means it's my bug :-) Anyway, the above patch should fix both possibilities in netconfig. Going to submit all fixes to STABLE in few minutes... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c7 --- Comment #7 from Marius Tomaschewski <mt@novell.com> 2008-10-13 08:25:50 MDT --- Created an attachment (id=245171) --> (https://bugzilla.novell.com/attachment.cgi?id=245171) complete /etc/sysconfig/network/scripts/functions.netconfig -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c8 --- Comment #8 from Marius Tomaschewski <mt@novell.com> 2008-10-13 08:27:58 MDT --- Created an attachment (id=245173) --> (https://bugzilla.novell.com/attachment.cgi?id=245173) complete /sbin/netconfig Can you test if the files from attachment #245171 + this one work for you? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mt@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c9 Marius Tomaschewski <mt@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #9 from Marius Tomaschewski <mt@novell.com> 2008-10-14 08:36:25 MDT --- Fix submitted to STABLE/Factory. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=433780 User mc@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=433780#c10 Michael Calmer <mc@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jhodge@novell.com --- Comment #10 from Michael Calmer <mc@novell.com> 2008-10-21 03:21:23 MDT --- *** Bug 431322 has been marked as a duplicate of this bug. *** https://bugzilla.novell.com/show_bug.cgi?id=431322 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com