diff options
Diffstat (limited to 'system/cntlm')
-rw-r--r-- | system/cntlm/README | 15 | ||||
-rw-r--r-- | system/cntlm/cntlm.SlackBuild | 104 | ||||
-rw-r--r-- | system/cntlm/cntlm.info | 10 | ||||
-rw-r--r-- | system/cntlm/doinst.sh | 14 | ||||
-rw-r--r-- | system/cntlm/rc.cntlm | 64 | ||||
-rw-r--r-- | system/cntlm/slack-desc | 19 |
6 files changed, 226 insertions, 0 deletions
diff --git a/system/cntlm/README b/system/cntlm/README new file mode 100644 index 0000000000..a96529671e --- /dev/null +++ b/system/cntlm/README @@ -0,0 +1,15 @@ +Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP proxy +intended to help you break free from the chains of Microsoft proprietary world. +You can use a free OS and honor our noble idea, but you can't hide. Once you're +behind those cold steel bars of a corporate proxy server requiring NTLM +authentication, you're done with. The same even applies to 3rd party Windows +applications, which don't support NTLM natively. + +This package contain a start/stop script: /etc/rc.d/rc.cntlm + +If you need start cntlm at boot add the following to your /etc/rc.d/rc.local +script and make sure rc.cntlm has executable permissions set: + + if [ -x /etc/rc.d/rc.cntlm ]; then + /etc/rc.d/rc.cntlm start + fi diff --git a/system/cntlm/cntlm.SlackBuild b/system/cntlm/cntlm.SlackBuild new file mode 100644 index 0000000000..0220114d93 --- /dev/null +++ b/system/cntlm/cntlm.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# Slackware build script for cntlm + +# Copyright (c) 2013-2014 Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=cntlm +VERSION=${VERSION:-0.92.3} +BUILD=${BUILD:-1} +TAG=${TAG:-SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG SYSCONFDIR=$PKG/etc BINDIR=$PKG/usr/sbin MANDIR=$PKG/usr/man + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mv $PKG/etc/cntlm.conf $PKG/etc/cntlm.conf.new +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYRIGHT LICENSE README VERSION $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/etc/rc.d +cat $CWD/rc.cntlm > $PKG/etc/rc.d/rc.cntlm + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/system/cntlm/cntlm.info b/system/cntlm/cntlm.info new file mode 100644 index 0000000000..b826d65b93 --- /dev/null +++ b/system/cntlm/cntlm.info @@ -0,0 +1,10 @@ +PRGNAM="cntlm" +VERSION="0.92.3" +HOMEPAGE="http://cntlm.sourceforge.net" +DOWNLOAD="http://sourceforge.net/projects/cntlm/files/cntlm/cntlm%200.92.3/cntlm-0.92.3.tar.gz" +MD5SUM="0d7fcfbfbef0546306b896be246caa88" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Giuseppe Di Terlizzi" +EMAIL="giuseppe.diterlizzi@gmail.com" diff --git a/system/cntlm/doinst.sh b/system/cntlm/doinst.sh new file mode 100644 index 0000000000..bbc311c659 --- /dev/null +++ b/system/cntlm/doinst.sh @@ -0,0 +1,14 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/cntlm.conf.new diff --git a/system/cntlm/rc.cntlm b/system/cntlm/rc.cntlm new file mode 100644 index 0000000000..7aee0f70b5 --- /dev/null +++ b/system/cntlm/rc.cntlm @@ -0,0 +1,64 @@ +#!/bin/sh +# +# cntlm - NTLM Authentication Proxy + + +exec="/usr/sbin/cntlm" +prog=cntlm +pidfile="/var/run/cntlm.pid" + +start() { + echo -n $"Starting $prog... " + if [ -e $pidfile ];then + if ps `cat $pidfile`|grep -q $exec >/dev/null 2>&1 ; then + echo "already running!" + return 1 + else + rm $pidfile + fi + fi + $exec -f -c /etc/cntlm.conf -P $pidfile > /dev/null 2>&1 & pid=$! + retval=$? + if [ $retval -eq 0 ];then + echo "done." + echo $pid > $pidfile + fi + return $retval +} + +stop() { + echo -n $"Stopping $prog... " + if [ ! -e $pidfile ];then + ps -ef|grep -v grep|grep -q $exec && ( killall -9 $prog ; echo "done." ) || echo "already stopped!" + return 0 + fi + kill -9 `cat $pidfile` >/dev/null 2>&1 + if ps `cat $pidfile`|grep -q $exec >/dev/null 2>&1 ; then + echo "fail!" + return 1 + else + rm $pidfile + echo "done." + return 0 + fi +} + +restart() { + stop + start +} + + +case "$1" in + start) + $1 + ;; + stop) + $1 + ;; + restart) + $1 + ;; + *) + echo $"Usage: $0 {start|stop|restart}";; +esac
\ No newline at end of file diff --git a/system/cntlm/slack-desc b/system/cntlm/slack-desc new file mode 100644 index 0000000000..efc684190b --- /dev/null +++ b/system/cntlm/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler-------------------------------------------------------| +cntlm: cntlm (Authentication Proxy) +cntlm: +cntlm: Cntlm is an NTLM / NTLM Session Response / NTLMv2 authenticating HTTP +cntlm: proxy intended to help you break free from the chains of Microsoft +cntlm: proprietary world. You can use a free OS and honor our noble idea, +cntlm: but you can't hide. Once you're behind those cold steel bars of a +cntlm: corporate proxy server requiring NTLM authentication, you're done +cntlm: with. The same even applies to 3rd party Windows applications, which +cntlm: don't support NTLM natively. +cntlm: +cntlm: Homepage: http://cntlm.awk.cz/ |