You are not logged in.

#1 2013-09-06 15:46:10

skunk_junior
Member
Registered: 2010-04-25
Posts: 20

How to quote a literal ' in a netctl wpa profile?

Hi,

I would like to use netctl to connect to eduroam.  I use the sample config from https://wiki.archlinux.org/index.php/Netctl#Eduroam .  Unfortunately, my password contains a ' and I don't know, how to enter this.

If I enter it without any quoting

WPAConfigSection=(
'ssid="eduroam"'
...
'password="foobar'"'
)

then the connection fails, and journalctl says

Sep 06 16:53:51 ultraskunk network[2852]: /etc/netctl/eduroam: line 14: unexpected EOF while looking for matching `"'
Sep 06 16:53:51 ultraskunk network[2852]: /etc/netctl/eduroam: line 17: syntax error: unexpected end of file

(Line 14 is the line containing password=... .)

I also tried

'password="foobar\'"'

and

'password="foobar\\'"'

with the same results.

Unfortunately, the man page netctl.profile(5) only mentions, how to escape the double quote "...

Any help would be appreciated.

Last edited by skunk_junior (2013-09-06 15:47:07)


It's not a bug -- it's a feature!

Offline

#2 2013-09-07 00:36:57

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 179
Website

Re: How to quote a literal ' in a netctl wpa profile?

(Just a guess):
Setup your connection like mentioned here and then scramble your password like explained here.


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#3 2015-05-22 09:19:23

cladmi
Member
Registered: 2013-05-24
Posts: 3

Re: How to quote a literal ' in a netctl wpa profile?

Just faced the same problem, and ended up in this thread.
I found a workaround by using a config file instead of writing the configuration in the netctl profile

[root@hal netctl]# cat eduroam
Description='Profil eduroam'
Interface=wlan0
Connection=wireless
Security=wpa-config
#Security=wpa-configsection
IP=dhcp
ESSID=eduroam
WPAConfigFile=/etc/netctl/eduroam_supplicant.conf

I watched wpa_supplicant process being run and copied /run/network/wpa_supplicant_wlan0.conf file created by netctl and adapted it.

[root@hal netctl]# cat eduroam_supplicant.conf 
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
network={
    ssid="eduroam"
    proto=WPA WPA2
    key_mgmt=WPA-EAP
    eap=TTLS
    phase2="auth=PAP"
    anonymous_identity="anonymous@domain.org"
    ca_path="/etc/ssl/certs/"
    identity="login@domain.org"
    password="password_with'quote"
}

It's not answering the initial question, but at least it works like this.

Offline

#4 2015-05-22 12:45:08

mwillems
Member
Registered: 2014-08-09
Posts: 89

Re: How to quote a literal ' in a netctl wpa profile?

Based on the method for escaping double quotes, it looks like the normal bash solution for escaping single quotes might work?

'\''

Note that that's a single quote, a backslash, and then two single quotes.

Last edited by mwillems (2015-05-22 12:46:19)

Offline

Board footer

Powered by FluxBB