Bug 802711

Summary: dhclient does not correctly escape SSIDs - prevents suspend from working
Product: [Fedora] Fedora Reporter: Nick Strugnell <nstrug>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: cdemills, dcbw, jklimes, jpopelka
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-26 12:36:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
ifcfg that triggers the error
none
suspend log demonstrating abort due to dhcpclient fail none

Description Nick Strugnell 2012-03-13 10:34:35 UTC
Created attachment 569629 [details]
ifcfg that triggers the error

Description of problem:
/usr/lib64/pm-utils/sleep.d/56dhclient fails on SSIDs that contain an apostrophe. This results in suspend and hibernate aborting.

Version-Release number of selected component (if applicable):
dhclient-4.2.3-6.P2.fc16.x86_64

How reproducible:
Always

Steps to Reproduce:
1. cp attached ifcfg file to /etc/sysconfig/network-scripts
2. Select suspend from user menu
3. 
  
Actual results:
Screensaver activates but machine does not suspend. Inspection of /var/log/pm-suspend.log shows that 56dhclient returned an exit status of 2, causing suspend to abort. 

Further investigation shows that dhclient barfed on the ifcfg containing the SSID "Auto JoikuSpot_Martin\'s h"

Expected results:
suspend shoud work!

Additional info:

Comment 1 Nick Strugnell 2012-03-13 10:35:39 UTC
Created attachment 569631 [details]
suspend log demonstrating abort due to dhcpclient fail

Comment 2 Jiri Popelka 2012-03-13 11:10:05 UTC
Problem is that
ESSID='JoikuSpot_Martin\'s h'
or
DEVICE=Auto_JoikuSpot_Martin's_h
are not correct bash strings,
while
NAME="Auto JoikuSpot_Martin\'s h"
is.

So the problem is not in dhclient but in program/hands that introduced
these ESSID and DEVICE lines.

Comment 3 Jiri Popelka 2012-03-15 12:15:18 UTC
Ok, I'm reassigning this to NetworkManager as that's probably the cause of these wrong string variables definitions.

Comment 4 Jirka Klimes 2012-03-26 12:36:51 UTC
(In reply to comment #2)
> Problem is that
> ESSID='JoikuSpot_Martin\'s h'
> or
> DEVICE=Auto_JoikuSpot_Martin's_h
> are not correct bash strings,
> while
> NAME="Auto JoikuSpot_Martin\'s h"
> is.
> 
> So the problem is not in dhclient but in program/hands that introduced
> these ESSID and DEVICE lines.

Yeah, the ESSID and DEVICE are not placed in double quotes, that results in bash failing on the file.
However, NetworkManager *does* put the string in double quotes when it contains an apostrophe (or other special characters). So, the ifcfg file from the Description was probably modified manually.

Closing as not a bug. Feel free to reopen if NM (nm-connection-editor) creates
invalid ifcfg-* files.

Comment 5 Jiri Popelka 2012-08-07 10:04:58 UTC
(In reply to comment #4)
> However, NetworkManager *does* put the string in double quotes when it
> contains an apostrophe (or other special characters). So, the ifcfg file
> from the Description was probably modified manually.

Seems that system-config-network was the culprit, see bug #846081.

Comment 6 Jiri Popelka 2012-08-16 07:44:32 UTC

*** This bug has been marked as a duplicate of bug 846081 ***

Comment 7 Jiri Popelka 2012-08-17 18:04:00 UTC
*** Bug 848089 has been marked as a duplicate of this bug. ***