Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269614 - net-misc/openvpn up.sh script could create invalid domain configuration option in /etc/resolv.conf
Summary: net-misc/openvpn up.sh script could create invalid domain configuration optio...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Cédric Krier
URL:
Whiteboard: p.sh script could create invalid doma...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-12 19:32 UTC by Tomas Psika
Modified: 2009-06-07 16:55 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Psika 2009-05-12 19:32:00 UTC
Inside /etc/openvpn/up.sh there is slight chance to make resolver configuration file (/etc/resolv.conf) invalid when ${DOMAIN} variable is not properly set. Then only keyword "domain" without value appears in /etc/resolv.conf and this can cause problems within resolving.

Example:

$ rc-service openvpn start
[...]

$ cat /etc/resolv.conf
# Generated by openvpn for interface tap0
domain
nameserver A.B.C.D

$ host alice.in.wonderland
host: parse of /etc/resolv.conf failed

One possible solution to avoid this behaviour follows (patching /etc/openvpn/up.sh):

47c47,49
<                       DNS="${DNS}domain ${DOMAIN}\n"
---
>                       if [ -n "${DOMAIN}" ] ; then
>                               DNS="${DNS}domain ${DOMAIN}\n"
>                       fi

Using net-misc/openvpn-2.1_rc15 in client mode.


Reproducible: Sometimes

Steps to Reproduce:
Comment 1 Tomas Psika 2009-05-12 19:37:03 UTC
$ emerge --info
Portage 2.1.6.13 (default/linux/x86/2008.0, gcc-4.3.3, glibc-2.9_p20081201-r2, 2
.6.29-gentoo-r3 i686)
=================================================================
System uname: Linux-2.6.29-gentoo-r3-i686-Intel-R-_Core-TM-2_Duo_CPU_T5800_@_2.0
0GHz-with-gentoo-2.0.0
Timestamp of tree: Mon, 11 May 2009 20:30:01 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p17-r1
dev-java/java-config: 2.1.7
dev-lang/python:     2.4.4-r15, 2.6.2
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="x86 ~x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mtune=core2 -march=core2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/4.2/env /usr/kde/4.2/share/config /usr/kde/4.2/shu
tdown /usr/share/config /var/bind /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/
fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active
/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuil
d /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mtune=core2 -march=core2 -pipe"
DISTDIR="/home/portage/distfiles"
FEATURES="ccache distlocks fixpackages parallel-fetch protect-owned sandbox sfpe
rms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/
distributions/gentoo"
LANG="cs_CZ.UTF-8"
LC_ALL="cs_CZ.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="cs en"
MAKEOPTS="-j4"
PKGDIR="/home/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress 
--force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclu
de=/local --exclude=/packages"
PORTAGE_TMPDIR="/home/portage/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="   "
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa bash-completion berkdb bzip2 cli cracklib crypt cups dbus d
ri fortran gdbm gnutls gpm iconv isdnlog kdeprefix midi mmx mudflap ncurses nls 
nptl nptlonly openal opengl openmp pam pch pcre perl pppd python readline reflec
tion session smp spl sse sse2 ssl ssse3 sysfs tcpd truetype unicode vim-syntax w
in32codecs x86 xorg zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw as
ym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat 
linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACH
E2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_defa
ult authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner au
thz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires 
ext_filter file_cache filter headers include info log_config logio mem_cache mim
e mime_magic negotiation rewrite setenvif speling status unique_id userdir usert
rack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev synaptics" K
ERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtx
orb ncurses text" LINGUAS="cs en" USERLAND="GNU" VIDEO_CARDS="nvidia vesa nv"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_CO
MPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Cédric Krier gentoo-dev 2009-05-28 17:57:25 UTC
Fix in cvs
Thanks