Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315261 - app-portage/portage-utils: quoted variables (e.g. multiline/comments) not parsed in make.conf
Summary: app-portage/portage-utils: quoted variables (e.g. multiline/comments) not par...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage Utils Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-14 13:30 UTC by Michał Górny
Modified: 2010-12-04 12:37 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-04-14 13:30:22 UTC
When PORTDIR (and thus the profile path) contains special characters, quse fails to use it. Moreover, it looks like it does parse the variables in make.conf incorrectly.

$ quse something
use: chdir to PORTDIR '/usr/\n ▲ \n▲ ▲' failed: No such file or directory

$ quse -D something
use: skipping use.desc: No such file or directory
use: skipping use.local.desc: No such file or directory
use: skipping arch.list: No such file or directory
Segmentation fault

The PORTDIR as declared in make.conf is:
PORTDIR='/usr/\n ▲ \n▲ ▲'

--
Portage  (default/linux/amd64/10.0/desktop, gcc-4.4.3, glibc-2.11-r1, 2.6.33-gentoo-r1-mgorny-amd64 x86_64)
=================================================================
System uname: Linux-2.6.33-gentoo-r1-mgorny-amd64-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_3800+-with-gentoo-2.0.1
Timestamp of tree: Wed, 14 Apr 2010 12:15:01 +0000
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r1, 2.7_pre20100411, 3.1.2-r2, 3.2_pre20100411
dev-util/cmake:      2.8.1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     9999
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.4.3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/local/portage/distfiles"
EMERGE_DEFAULT_OPTS="--ask --keep-going"
FEATURES="assume-digests collision-protect distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pl_PL.UTF-8"
LC_ALL="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS=""
MAKEOPTS="-j3"
PKGDIR="/usr/local/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --times --compress --force --whole-file --delete --stats --timeout=45 --exclude=/distfiles --exclude=/packages --exclude=/local"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/
 ▲ 
▲ ▲"
PORTDIR_OVERLAY="/usr/local/portage/layman/x11 /usr/local/portage/layman/gamerlay /usr/local/portage/layman/science /usr/local/portage/layman/perl-experimental /usr/local/portage/layman/sunrise /usr/local/portage/layman/java-overlay /usr/local/portage/layman/games /usr/local/portage/layman/qting-edge /usr/local/portage/layman/python /usr/local/portage/layman/kde-sunset"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avahi bash-completion bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups curl cxx dbus dirac directfb djvu dri dts dvd dvdr emboss encode exif expat fam fbcon fftw firefox flac fontconfig fortran gd gdbm gif gmp gnome-keyring gnutls gpm graphviz gtk iconv icu idn imagemagick ipv6 java6 jbig jpeg jpeg2k kate lapack lcms libedit libnotify libproxy mad matroska mikmod mmap mmx mmxext mng modules mp3 mp4 mpeg mtp mudflap multilib ncurses nptl nptlonly ogg opencore-amr openexr opengl openmp pam pango pch pcre pdf perl png ppds pppd python qt3support qt4 raw readline reflection schroedinger sdl session slang smp sndfile speex spell spl sse sse2 ssl ssse3 startup-notification svg sysfs tcpd theora threads tiff timidity truetype unicode usb v4l2 vcd vim-syntax vorbis wavpack wifi wmf x264 xcb xcomposite xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym 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" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_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 mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" SANE_BACKENDS="artec_eplus48u" USERLAND="GNU" VIDEO_CARDS="radeon vesa" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 meyerm 2010-08-11 14:23:35 UTC
I just encountered the same behaviour even though I wasn't using any special characters. My problem was an additional comment after the PORTDIR variable declaration:

-----------8><--------------------------------------
PORTDIR="/var/lib/portage/gentoo_tree" # /etc/make.profile muss angepasst werden
-----------><8--------------------------------------

Using strace I saw that quse seems to parse the file on its own and fails in cutting away the comment (the second " is even masked "correctly" ;-) ). Of course there is no directory with the name "/var/lib/portage/gentoo_tree\" # /etc/make.profile muss angepasst werden" on my computer...



For the record:

-----------8><--------------------------------------
dantooine ~ # emerge --info
Portage 2.1.8.3 (default/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.32-xen-r1 x86_64)
=================================================================
System uname: Linux-2.6.32-xen-r1-x86_64-AMD_Opteron-tm-_Processor_850-with-gentoo-1.12.13
Timestamp of tree: Sun, 01 Aug 2010 23:45:01 +0000
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.5-r2, 3.1.2-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.65
sys-devel/automake:  1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/var/cache/portage/distfiles"
FEATURES="assume-digests buildpkg distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="[...]"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,--warn-once,--hash-style=gnu"
MAKEOPTS="-j3"
PKGDIR="/var/cache/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp/portage"
PORTDIR="/var/lib/portage/gentoo_tree"
PORTDIR_OVERLAY="/var/lib/portage/local_tree"
SYNC="[...]"
USE="acl amd64 bash-completion berkdb bzip2 cli cracklib crypt cups cxx dri fortran gdbm gpm iconv ipv6 mmx modules mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl pppd python readline reflection session spl sse sse2 ssl sysfs tcpd unicode vim-syntax xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym 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" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
-----------><8--------------------------------------

Comment 2 SpanKY gentoo-dev 2010-08-11 17:25:47 UTC
the original summary is incorrect.  portage-utils works just fine with weird chars.  it however does not support variables in make.conf that utilize quotes beyond a simple:
VAR="val"
Comment 3 SpanKY gentoo-dev 2010-12-04 12:37:28 UTC
initial support now in cvs

http://sources.gentoo.org/gentoo-projects/portage-utils/main.c?r1=1.176&r2=1.177