Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 155928 - app-mobilephone/smstools-2.2.9 - smsd fails to read smsd.conf
Summary: app-mobilephone/smstools-2.2.9 - smsd fails to read smsd.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Tony Vroon (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-22 03:35 UTC by Niclas Felske
Modified: 2006-12-02 06:58 UTC (History)
1 user (show)

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


Attachments
Resolves the stack access bug in cfgfile.c (smstools-config.patch,535 bytes, patch)
2006-11-22 03:47 UTC, Niclas Felske
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Niclas Felske 2006-11-22 03:35:46 UTC
Package: app-mobilephone/smstools-2.2.9

If you specify devices in smsd.conf, smsd fails to read the config.

smsd.conf example:
------
devices=GSM1
logfile=/var/log/smsd.log
loglevel=7

outgoing = /var/spool/sms/outgoing
incoming = /var/spool/sms/incoming
failed = /var/spool/sms/failed
checked = /var/spool/sms/checked
mypath = /usr/bin

[GSM1]
device = /dev/ttyS0
incoming = no
------

Output of smsd, if started on console with option -s:

mail ~ # /usr/bin/smsd -s
Could not find device [] in config file.
--------------------------------

This bug is a result of a wrong stack access in cfgfile.c. The bug may occur in  earlier versions of smstools also.

Please include the following patch in the smstools ebuild:
###########################################################################

--- smstools/src/cfgfile.c.orig 2006-02-04 20:52:06.000000000 +0100
+++ smstools/src/cfgfile.c      2006-11-21 17:32:29.000000000 +0100
@@ -88,7 +88,7 @@
   if (equalchar)
   {
     strncpy(value,equalchar+1,size_value);
-    value[size_value]=0;
+    value[size_value-1]=0;
     cutspaces(value);
     n=equalchar-source;
     if (n>0)
@@ -144,7 +144,7 @@
         if (splitline(line,name,size_name,value,size_value)==0)
        {
          strncpy(value,line,size_value);
-         value[size_value]=0;
+         value[size_value-1]=0;
          return -1;
        }
        else

###########################################################################

emerge --info output:

Portage 2.1.1-r2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.18-gentoo-r2 i686)
=================================================================
System uname: 2.6.18-gentoo-r2 i686 Intel(R) Celeron(TM) CPU                1200MHz
Gentoo Base System version 1.12.6
Last Sync: Mon, 20 Nov 2006 08:50:01 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=i686 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=i686 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.intergenia.de "
LINGUAS="de en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/tmp/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 avi bash-completion bzip2 chroot cracklib crypt cups dbus dlloader dri dvd elibc_glibc fam fbcon firefox fortran gdbm gif gnome gpm gtk hal iconv input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 jpeg kde kernel_linux libg++ linguas_de linguas_en mysql ncurses nls nptl nptlonly pam pcre pdflib perl png ppds python qt3 qt4 readline reflection sasl sdl session spell spl ssl symlink tcpd truetype truetype-fonts type1-fonts udev unicode userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo xml xorg zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS


Best regards
Niclas
Comment 1 Niclas Felske 2006-11-22 03:47:39 UTC
Created attachment 102531 [details, diff]
Resolves the stack access bug in cfgfile.c
Comment 2 Alin Năstac (RETIRED) gentoo-dev 2006-12-02 06:58:52 UTC
fixed in 2.2.12.

The first buffer overflow has already been fixed by upstream, but the second overflow is still there.