This is the old SliTaz forum - Please use the main forum.slitaz.org

cooking pppd scripts umask prevents dns resolution as unpriviliged user after first connection
  • erniaernia October 2010
    the ip-up and ip-down scripts in cooking are executed by pppd, at least on my system, with a umask of 077, which leads to a /etc/resolv.conf permissions problem after the end of the first connection.
    having /etc/resolv.conf readable only by root does not let you make dns query as unpriviliged user in following connections.
    to fix this i wrote
    umask 022
    in the first line of both the scripts, but this was not required in slitaz 3.0
    is the 077 umask a feature or a bug?
  • erniaernia December 2010
    i'm still facing this problem, and ms3811 solved it with my solution, would it be possible to fix it?
    having a bad memory i was thinking to fight vs a localized glibc-base and instead i was fighting with this bug :-(
  • erniaernia December 2010
    this issue is driving me crazy, the only thing i can think of is related to busybox which makes su like su - , so it makes every su like a login shell, which was not 3.0 default.
    but if i give the umask command in the xterm from where i launch wvdial i get 0022 , which should be correct, how does it come that the very same version of ppp in 3.0 does not have the umask issue?
  • erniaernia December 2010
    if someone is interested i've slightly modified the official receipt to have umask 022 in the start of ip-up and ip-down files, until someone find out the reason of this odd behavior
    # SliTaz package receipt.

    PACKAGE="ppp"
    VERSION="2.4.5"
    CATEGORY="network"
    SHORT_DESC="Implements the Point-to-Point Protocol (PPP)."
    MAINTAINER="pankso@slitaz.org"
    TARBALL="$PACKAGE-$VERSION.tar.gz"
    WEB_SITE="http://ppp.samba.org/"
    WGET_URL="ftp://ftp.samba.org/pub/ppp/$TARBALL"
    CONFIG_FILES="/etc/ppp"

    # Rules to configure and make the package.
    compile_rules()
    {
    cd $src
    ./configure --prefix=/usr --mandir=/usr/share/man \
    $CONFIGURE_ARGS &&
    make &&
    make DESTDIR=$PWD/_pkg/usr install
    }

    # Rules to gen a SliTaz package suitable for Tazpkg.
    genpkg_rules()
    {
    mkdir -p $fs/usr
    cp -a $_pkg/usr/sbin $fs/usr
    cp -a $_pkg/usr/lib $fs/usr
    strip -s $fs/usr/sbin/*
    strip -s $fs/usr/lib/pppd/$VERSION/*
    # Config files.
    mkdir -p $fs/etc/ppp/scripts
    cp stuff/README.scripts $fs/etc/ppp
    cp -a $src/etc.ppp/* $fs/etc/ppp
    # PPP scripts.
    cp -a $src/scripts/ppp-on $fs/etc/ppp/scripts
    cp -a $src/scripts/ppp-on-dialer $fs/etc/ppp/scripts

    cp -a $src/scripts/ppp-off $fs/etc/ppp/scripts
    cp -a $src/scripts/callback $fs/etc/ppp/scripts
    cp -a $src/scripts/redialer $fs/etc/ppp/scripts

    cp -a $src/scripts/ip-up.local.add $fs/etc/ppp/ip-up
    cp -a $src/scripts/ip-down.local.add $fs/etc/ppp/ip-down
    chmod +x $fs/etc/ppp/ip*
    # insert #!/bin/sh on top line in ip* scripts
    sed -i '1i\#!/bin/sh' $fs/etc/ppp/ip*
    # insert umask 022 to avoid /etc/resolv.conf permissions problems
    sed -i '2i\umask 022' $fs/etc/ppp/ip*
    # add empty peers dir
    mkdir -p $fs/etc/ppp/peers
    sed -i 's:ppp/ppp-on-dialer:ppp/script/ppp-on-dialer:' $fs/etc/ppp/scripts/ppp-on

    }

    the resulting package is here: http://dump.no/files/07a66b2d3e9e/ppp-2.4.5.tazpkg
    remove ppp before to install this package or ip-up and ip-down will not be overwritten

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

SliTaz Social