Page 1 of 1

wizzard bug - proxy configuration

Posted: 07 Feb 2018, 11:45
by asdf123
Hello,

During configuration in wizzard, wizzard strips \ character in configuration. Is there any reason to strip \ character in proxy configuration?

Thanks

wizzard bug - proxy configuration

Posted: 07 Feb 2018, 13:12
by fanthom
I cant recreate this bug.
Please provide the string which you are trying to enter and exac field in the wizard window.

Thank you.

wizzard bug - proxy configuration

Posted: 07 Feb 2018, 15:07
by asdf123
If set in wizzard:
proxy=username\here:password@myproxy.com:8080

it sets variable in system:
http_proxy=usernamehere:password@myproxy.com:8080
https_proxy=usernamehere:password@myproxy.com:8080

it strips \ character. double checked.

wizzard bug - proxy configuration

Posted: 07 Feb 2018, 16:03
by fanthom
Unfortunately this character is interpreted by the shell and i cant find any workaround that escaping it (shame).

Please use this:

Code: Select all

proxy=username\\\here:password@myproxy.com:8080
You may add a comment to the config that double backslash was added to workaround this bug (so you'll remember that real password is 'username\here'.

Thanks

wizzard bug - proxy configuration

Posted: 13 Feb 2018, 13:36
by asdf123
fanthom wrote:
07 Feb 2018, 16:03
Unfortunately this character is interpreted by the shell and i cant find any workaround that escaping it (shame).

Please use this: \\\
Unfortunately your solution does not work.

wizzard bug - proxy configuration

Posted: 13 Feb 2018, 15:29
by fanthom
Works here.

This parameter:

Code: Select all

proxy=fantho\\\m:test@192.168.0.15:3128
gives:

Code: Select all

root@automatic:~# cat /etc/profile.d/proxy.sh 
#!/bin/sh

# System proxy:
proxy=fantho\m:test@192.168.0.15:3128
[ "$proxy" = DIRECT ] || export http_proxy="http://$proxy" https_proxy="http://$proxy" ftp_proxy="http://$proxy"

# Proxy exceptions:
#noproxy=
[ "$noproxy" ] && export no_proxy="localhost,127.0.0.1,$noproxy" || export no_proxy="localhost,127.0.0.1"

wizzard bug - proxy configuration

Posted: 13 Feb 2018, 17:35
by asdf123
fanthom wrote:
13 Feb 2018, 15:29
Works here.

This parameter:
gives:
which not leads to proper string concatenation
Image

Small exercise:

Code: Select all

root@kiosk:~# test=a\b\c\d
root@kiosk:~# export test
root@kiosk:~# env |grep test
test=abcd
root@kiosk:~# 
How about:

Code: Select all

root@kiosk:~# test='a\b\c\d'
root@kiosk:~# export test
root@kiosk:~# inne=http://$test
root@kiosk:~# export inne
root@kiosk:~# env | grep -E '(test|inne)'
inne=http://a\b\c\d
test=a\b\c\d
root@kiosk:~# 
:secret:

wizzard bug - proxy configuration

Posted: 13 Feb 2018, 20:24
by fanthom
Its enough that you add one more '\':

Code: Select all

proxy=fantho\\\\m:test@192.168.0.15:3128

wizzard bug - proxy configuration

Posted: 14 Feb 2018, 08:08
by asdf123
fanthom wrote:
13 Feb 2018, 20:24
Its enough that you add one more '\':
I don't understand. The solution you provided adds "\" to the variable, but in env the "\" it's not visible.
Still no solution using porteus wizzard.

wizzard bug - proxy configuration

Posted: 14 Feb 2018, 09:27
by fanthom
Instead on one backslash in your password you need to use 4 backslashes.
This works for remote management, have not tested the wizard as it requires unlocking the shell during installation which is troublesome.

This parameter:

Code: Select all

proxy=fantho\\\\m:test@192.168.0.15:3128
gives:

Code: Select all

root@automatic:~# cat /etc/profile.d/proxy.sh 
#!/bin/sh

# System proxy:
proxy=fantho\\m:test@192.168.0.15:3128
[ "$proxy" = DIRECT ] || export http_proxy="http://$proxy" https_proxy="http://$proxy" ftp_proxy="http://$proxy"

# Proxy exceptions:
#noproxy=
[ "$noproxy" ] && export no_proxy="localhost,127.0.0.1,$noproxy" || export no_proxy="localhost,127.0.0.1"
and it gives:

Code: Select all

root@automatic:~# env | grep -i proxy
no_proxy=localhost,127.0.0.1
https_proxy=http://fantho\m:test@192.168.0.15:3128
http_proxy=http://fantho\m:test@192.168.0.15:3128
ftp_proxy=http://fantho\m:test@192.168.0.15:3128
Thanks