Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301619 - Problem with tabs instead of spaces in /etc/openvpn/openvpn.conf
Summary: Problem with tabs instead of spaces in /etc/openvpn/openvpn.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High minor (vote)
Assignee: Cédric Krier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 13:04 UTC by Kola Bernard
Modified: 2010-02-28 16:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for Init-file (openvpn.init.patch,2.37 KB, patch)
2010-01-21 08:19 UTC, Marcel Pennewiß
Details | Diff
new init file (openvpn,4.27 KB, text/plain)
2010-01-21 08:22 UTC, Marcel Pennewiß
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kola Bernard 2010-01-20 13:04:45 UTC
The new /etc/init.d/openvpn script does not work with tabs propertly.
Tested with 2.1_rc15 and 2.1.0-r1, .

Portage 2.1.6.13 (hardened/linux/amd64/10.0/no-multilib, gcc-4.3.4-vanilla, glibc-2.10.1-r1, 2.6.32-hardened-r2-hw0666 x86_64)
=================================================================                                                             
System uname: Linux-2.6.32-hardened-r2-hw0666-x86_64-AMD_Athlon-tm-_Dual_Core_Processor_5050e-with-gentoo-2.0.1               
Timestamp of tree: Mon, 18 Jan 2010 17:00:01 +0000
app-shells/bash:     4.0_p35
dev-lang/python:     2.6.4
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"

Reproducible: Always

Steps to Reproduce: Use only tabs in /etc/openvpn/*.conf

Solution 1: Use spaces instead of tabs in /etc/openvpn/*.conf && update docs to point this behaviour.

Solution 2: Modify the script to work with tabs.

Suboptimal function in init.d script is:
grep -q "^[ \t]*buzzword[ \t].*" "${VPNCONF}"
                        ^^^^^ This part do search only about spaces.
Dirty hack was to remove this.
Comment 1 Marcel Pennewiß 2010-01-21 08:19:44 UTC
Created attachment 217054 [details, diff]
Patch for Init-file

there are two possibilities:
you may use grep -P for interpreting RegEx as Perl RegEx which is "highly experimental" (see manpage) or you can use a literal tab (<ctrl-v><tab> in vim). this patch uses the second one...
Comment 2 Marcel Pennewiß 2010-01-21 08:22:48 UTC
Created attachment 217055 [details]
new init file

init-file (complete)
Comment 3 Kola Bernard 2010-01-21 13:22:39 UTC
(In reply to comment #2)
> new init file
Work like a charm, tnx!
Comment 4 Marcel Pennewiß 2010-01-21 13:45:45 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > new init file
> Work like a charm, tnx!

Please reopen this bug. 
IMHO this issue should be fixed in portage because "\t" seems not to work. Bug should be assigned to maintainer so that Cedrik can fix this. Thx.
Comment 5 Kola Bernard 2010-01-22 01:35:55 UTC
(In reply to comment #4)
> Please reopen this bug. 
I was to fast with my FIXED, sorry I am new in the bugtracker. :-/
Reopen.
Comment 6 Cédric Krier gentoo-dev 2010-02-28 16:21:43 UTC
Fix in CVS
Thanks