-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://svn.code.sf.net/p/ntlmaps/code/trunk@142 4414eb6b-45f7-0310-abf5-9c8861e1d96f
- Loading branch information
dixond
committed
Jun 10, 2005
1 parent
287ac05
commit 9ab8c7d
Showing
13 changed files
with
322 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
Version 0.9.9.2 Wednesday 23rd February 2005 Darryl Dixon <[email protected]> | ||
- Added support for hostnames to FRIENDLY_IPS in server.cfg and config_affairs.py | ||
- Include some preliminary (alpha) packaging stuff | ||
- REQUEST sourceforge ID#1143827: Changed logic in config.py to make # work in passwords | ||
- Add fix for Python 1.5.2 compatability to exception clause in config_affairs.py | ||
- Fix Host check in self.determinemode() in proxy_client.py | ||
- Fix self.monitor with no threadsToKill attribute in server.py | ||
|
||
Version 0.9.9.1 Monday 14th February 2005 Darryl Dixon <[email protected]> | ||
- Added HOSTS_TO_BYPASS_PARENT_PROXY configuration item in server.cfg | ||
- Added processing of HOSTS_TO_BYPASS_PARENT_PROXY to config_affairs.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,38 +17,33 @@ | |
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
|
||
import string | ||
import getopt | ||
import string, getopt | ||
|
||
#------------------------------------------------------------------------------------------- | ||
def read_config(fname): | ||
"" | ||
res = {} | ||
section_name = 'DEFAULT' | ||
|
||
buf = open(fname).readlines() | ||
for i in range(len(buf)): | ||
t = buf[i] | ||
t = string.split(t, '#')[0] | ||
t = string.strip(t) | ||
|
||
if t: | ||
if t[0] == '[' and t[-1] == ']': | ||
section_name = string.strip(t[1:-1]) | ||
if section_name: | ||
res[section_name] = {} | ||
else: | ||
parts = string.split(t, ':') | ||
if len(parts) > 1: | ||
res[section_name][string.strip(parts[0])] = string.strip(parts[1]) | ||
|
||
for line in buf: | ||
workingLine = string.strip(line) | ||
if workingLine: | ||
if workingLine[0] != '#': | ||
if workingLine[0] == '[' and workingLine[-1] == ']': | ||
section_name = string.strip(workingLine[1:-1]) | ||
if section_name: | ||
res[section_name] = {} | ||
else: | ||
parts = string.split(workingLine, ':') | ||
if len(parts) > 1: | ||
res[section_name][string.strip(parts[0])] = string.strip(parts[1]) | ||
return res | ||
|
||
#------------------------------------------------------------------------------------------- | ||
# Thanks Janek Schwarz <[email protected]> for this addition. | ||
|
||
def findConfigFileNameInArgv(argv, configFileDir=''): | ||
""" Resolves configuration file. Resolution goes as follows: | ||
if the command switch '-c' is given it's argument is taken as | ||
if the command switch '-c' is given its argument is taken as | ||
the config file. Otherwise the function falls back to | ||
'server.cfg' in the current directory. """ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/python | ||
|
||
""" | ||
compile.py | ||
Copyright (C) 2004 Darryl Dixon <[email protected]> | ||
This program may be freely redistributed under the terms of the GNU GPL | ||
""" | ||
|
||
from compileall import compile_dir | ||
import sys | ||
|
||
compile_dir(sys.argv[1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
; This file is Copyright 2005 Mario Zoppetti, and was added by | ||
; Darryl A. Dixon <[email protected]> to | ||
; 'NTLM Authorization Proxy Server', | ||
; Copyright 2001 Dmitry A. Rozmanov <[email protected]> | ||
; | ||
; NTLM APS is free software; you can redistribute it and/or modify | ||
; it under the terms of the GNU General Public License as published by | ||
; the Free Software Foundation; either version 2 of the License, or | ||
; (at your option) any later version. | ||
; | ||
; NTLM APS is distributed in the hope that it will be useful, | ||
; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
; GNU General Public License for more details. | ||
; | ||
; You should have received a copy of the GNU General Public License | ||
; along with the sofware; see the file COPYING. If not, write to the | ||
; Free Software Foundation, Inc., | ||
; 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | ||
|
||
; HM NIS Edit Wizard helper defines | ||
!define PRODUCT_NAME "ntlmaps" | ||
!define PRODUCT_VERSION "0.9.9.2" | ||
!define PRODUCT_PUBLISHER "MZ" | ||
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" | ||
!define PRODUCT_UNINST_ROOT_KEY "HKLM" | ||
|
||
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" | ||
OutFile "ntlmaps-setup-${PRODUCT_VERSION}.exe" | ||
SetCompressor lzma | ||
|
||
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf" | ||
InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" | ||
Icon "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" | ||
UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" | ||
DirText "Setup will install $(^Name) in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder." | ||
LicenseText "If you accept all the terms of the agreement, choose I Agree to continue. You must accept the agreement to install $(^Name)." | ||
LicenseData "COPYING" | ||
ShowInstDetails show | ||
ShowUnInstDetails show | ||
|
||
Section "MainSection" SEC01 | ||
SetOutPath "$INSTDIR" | ||
SetOverwrite ifnewer | ||
ClearErrors | ||
FileOpen $0 "${PRODUCT_NAME}.cmd" w | ||
IfErrors done | ||
FileWrite $0 "${PRODUCT_NAME}.exe -c server.cfg" | ||
FileClose $0 | ||
done: | ||
|
||
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}" | ||
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.cmd" | ||
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.cmd" | ||
|
||
File "dist\bz2.pyd" | ||
File "dist\library.zip" | ||
File /oname="${PRODUCT_NAME}.exe" "dist\main.exe" | ||
File "dist\python24.dll" | ||
File "dist\select.pyd" | ||
File "dist\server.cfg" | ||
File "dist\unicodedata.pyd" | ||
File "dist\w9xpopen.exe" | ||
File "dist\zlib.pyd" | ||
File "dist\_socket.pyd" | ||
File "dist\_ssl.pyd" | ||
SectionEnd | ||
|
||
Section -AdditionalIcons | ||
CreateShortCut "$SMPROGRAMS\InstrumentationXSqlTunnel\Uninstall.lnk" "$INSTDIR\uninst.exe" | ||
SectionEnd | ||
|
||
Section -Post | ||
WriteUninstaller "$INSTDIR\uninst.exe" | ||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" | ||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" | ||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_VERSION}.cmd" | ||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" | ||
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" | ||
SectionEnd | ||
|
||
|
||
Function un.onUninstSuccess | ||
HideWindow | ||
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." | ||
FunctionEnd | ||
|
||
Function un.onInit | ||
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 | ||
Abort | ||
FunctionEnd | ||
|
||
Section Uninstall | ||
Delete "$INSTDIR\uninst.exe" | ||
Delete "$INSTDIR\_ssl.pyd" | ||
Delete "$INSTDIR\_socket.pyd" | ||
Delete "$INSTDIR\zlib.pyd" | ||
Delete "$INSTDIR\w9xpopen.exe" | ||
Delete "$INSTDIR\unicodedata.pyd" | ||
Delete "$INSTDIR\server.cfg" | ||
Delete "$INSTDIR\select.pyd" | ||
Delete "$INSTDIR\python24.dll" | ||
Delete "$INSTDIR\${PRODUCT_NAME}.exe" | ||
Delete "$INSTDIR\library.zip" | ||
Delete "$INSTDIR\bz2.pyd" | ||
Delete "$INSTDIR\${PRODUCT_NAME}.cmd" | ||
|
||
Delete "$SMPROGRAMS\${PRODUCT_NAME}\Uninstall.lnk" | ||
Delete "$DESKTOP\${PRODUCT_NAME}.lnk" | ||
Delete "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" | ||
RMDir "$SMPROGRAMS\${PRODUCT_NAME}" | ||
RMDir "$INSTDIR" | ||
|
||
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" | ||
SetAutoClose true | ||
SectionEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# ntlmaps.spec | ||
# Copyright (C) 2004 Darryl Dixon <[email protected]> | ||
# This program may be freely redistributed under the terms of the GNU GPL | ||
|
||
%define name ntlmaps | ||
%define ver 0.9.9.2 | ||
%define rel 1 | ||
|
||
Summary: NTLMAPS is a proxy server that authenticates requests to Microsoft proxies that require NTLM authentication. | ||
Name: %{name} | ||
Version: %{ver} | ||
Release: %{rel} | ||
License: GPL | ||
Group: Applications/Internet | ||
URL: http://ntlmaps.sourceforge.net | ||
Vendor: Dmitry Rozmanov, Darryl Dixon, and others | ||
Source: http://prdownloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz | ||
Packager: Darryl Dixon <[email protected]> | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot | ||
|
||
%description | ||
NTLM Authorization Proxy Server (ntlmaps) is a proxy software that allows | ||
you to authenticate via a Microsoft Proxy Server using the proprietary NTLM | ||
protocol. NTLMAPS has the ability to behave as a standalone proxy server and | ||
authenticate HTTP clients at Web servers using the NTLM protocol. It can | ||
change arbitrary values in your client's request headers so that those | ||
requests will look like they were created by Microsoft Internet Explorer. It | ||
is written in Python 1.5.2. | ||
|
||
%prep | ||
|
||
%setup | ||
|
||
%build | ||
|
||
%install | ||
if [ -d $RPM_BUILD_ROOT ]; then rm -rf $RPM_BUILD_ROOT; fi | ||
# This can be vastly improved, but it Works For Now!(tm) ;) | ||
mkdir -p $RPM_BUILD_ROOT | ||
mkdir -p $RPM_BUILD_ROOT/opt/ntlmaps | ||
mkdir -p $RPM_BUILD_ROOT/opt/ntlmaps/lib | ||
mkdir -p $RPM_BUILD_ROOT/opt/ntlmaps/doc | ||
mkdir -p $RPM_BUILD_ROOT/opt/ntlmaps/packaging | ||
install --mode=0755 --group=root --owner=root changelog.txt \ | ||
Install.txt \ | ||
main.py \ | ||
readme.txt \ | ||
runserver.bat \ | ||
COPYING \ | ||
__init__.py \ | ||
research.txt \ | ||
server.cfg \ | ||
$RPM_BUILD_ROOT/opt/ntlmaps | ||
install --mode=0755 --group=root --owner=root lib/* $RPM_BUILD_ROOT/opt/ntlmaps/lib | ||
install --mode=0755 --group=root --owner=root doc/* $RPM_BUILD_ROOT/opt/ntlmaps/doc | ||
install --mode=0755 --group=root --owner=root packaging/* $RPM_BUILD_ROOT/opt/ntlmaps/packaging | ||
$RPM_BUILD_ROOT/opt/ntlmaps/packaging/compile.py $RPM_BUILD_ROOT/opt/ntlmaps | ||
$RPM_BUILD_ROOT/opt/ntlmaps/packaging/compile.py $RPM_BUILD_ROOT/opt/ntlmaps/lib | ||
mkdir -p $RPM_BUILD_ROOT%{_bindir} | ||
ln -s $PYTHON_SITE/opt/ntlmaps/main.py $RPM_BUILD_ROOT%{_bindir}/ntlmaps | ||
#mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1 | ||
#install --mode=0644 --group=root --owner=root ntlmaps.1 $RPM_BUILD_ROOT%{_mandir}/man1 | ||
#gzip $RPM_BUILD_ROOT%{_mandir}/man1/ntlmaps.1 | ||
|
||
%clean | ||
rm -rf %{buildroot} | ||
|
||
%files | ||
%defattr(-,root,root) | ||
/opt/* | ||
#%{_libdir}/* | ||
%{_bindir}/* | ||
#%{_mandir}/* | ||
|
||
%changelog | ||
* Wed Feb 23 2005 Darryl Dixon <[email protected]> | ||
[ntlmaps-0.9.9.2] | ||
- Initial release of .spec file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
The files in this directory are included for the convenience of all packagers | ||
of ntlmaps on any platform. Please feel free to contribute if you can see | ||
enhancements or improvements to be made. Directory contents so far: | ||
ntlmaps.spec -- Distribution-neutral RPM .spec file. Currently only | ||
vaguely FHS compliant. | ||
compile.py -- Basic wrapper of compileall.compile_dir() for convenience | ||
of RPM builders. | ||
setup.py -- Script for building standalone ntlmaps distributables with | ||
py2exe on Windows. | ||
ntlmaps.nsi -- NSIS (Nullsoft Scriptable Installer) configuration for | ||
turning py2exe'ed ntlmaps into a pretty installer for | ||
Windows. |
Oops, something went wrong.