From: Greg Hudson Date: Fri, 11 May 2018 18:02:41 +0000 (-0400) Subject: Remove unused Windows sources X-Git-Tag: krb5-1.17-beta1~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ef59b469dc433cc52860db6196e5e47c5ec7817;p=thirdparty%2Fkrb5.git Remove unused Windows sources windows/build and windows/installer/nsis are not used by the KfW 4.x build process. windows/wintel was removed from the build in commit 530043377ee6f39b9ca95c13f6260602e6fe7674. windows/cns and most of the windows/lib objects were removed from the build in commit 52fa910f413e016b3d432ce34e2d5bcea3230a7d. Most of the Leash krb4 files were removed from the build in commit 9f097418620513813ecc086bcd9002b6e07bf2a1; some unnecessary includes of the corresponding header files remain, so delete those now. LeashControlPanel.cpp was not part of the leash build when the leash sources were imported into this tree. --- diff --git a/src/windows/build/BKWconfig.xml b/src/windows/build/BKWconfig.xml deleted file mode 100644 index c787befae0..0000000000 --- a/src/windows/build/BKWconfig.xml +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/windows/build/Logger.pm b/src/windows/build/Logger.pm deleted file mode 100644 index c7f904a946..0000000000 --- a/src/windows/build/Logger.pm +++ /dev/null @@ -1,87 +0,0 @@ -package Logger; - -use strict; -use IO::File; -use FindBin; - -my $bStarted = 0; - -sub new { - my $class = shift; - my $file = shift; - my $append = shift; - $file || die "Usage: \$foo = new Logger filename [append]\n"; - my $self = {}; - bless $self, $class; - $self->{FILE} = $file; - $self->{APPEND} = $append?'-a':''; - return $self; -} - -sub start { - my $self = shift; - - return 1 if $self->{PIPE}; - - STDOUT->flush; - STDERR->flush; - - my $fh_out = new IO::File; - my $fh_err = new IO::File; - my $fh_pipe = new IO::File; - - $self->{OUT} = $fh_out; - $self->{ERR} = $fh_err; - $self->{PIPE} = $fh_pipe; - - $fh_out->open(">&STDOUT") || die; - $fh_err->open(">&STDERR") || die; - $fh_pipe->open("|$^X $FindBin::Bin/tee.pl $self->{APPEND} $self->{FILE}") || die; - - STDOUT->fdopen(fileno $fh_pipe, "w") || die; - STDERR->fdopen(fileno $fh_pipe, "w") || die; - - STDOUT->autoflush(1); - STDERR->autoflush(1); - - $SIG{__DIE__} = sub { - print STDERR $_[0]; - $self->stop; - die "\n"; - }; - - $bStarted = 1; - return 1; -} - -# 20070314 kpkoch: -# There appears to be a bug in ActivePerl where Logger's games with streams -# and the SIG DIE handler cause eval to throw exceptions. By deleting the DIE handler, -# subsequent evals do not fail. -sub no_die_handler { - delete $SIG{__DIE__}; - } - -sub stop { - my $self = shift; - - return 0 if !$self->{PIPE}; - - STDOUT->close; - STDERR->close; - $self->{PIPE}->close; - STDOUT->fdopen(fileno $self->{OUT}, "w"); - STDERR->fdopen(fileno $self->{ERR}, "w"); - delete $self->{OUT}; - delete $self->{ERR}; - delete $self->{PIPE}; - $bStarted = 0; - return 1; -} - -sub DESTROY { - my $self = shift; - $self->stop if ($bStarted); - } - -1; diff --git a/src/windows/build/bkw-automation.html b/src/windows/build/bkw-automation.html deleted file mode 100644 index 9592f49af0..0000000000 --- a/src/windows/build/bkw-automation.html +++ /dev/null @@ -1,367 +0,0 @@ - - - lore-bkw-automation - Confluence - - - - - - - - -
-
The - Kerberos for Windows (KfW) build is automated.  A script will fetch the - sources from a repository and then build, sign and package all the KfW - distribution components. -
-
This - description consists of -
- -

Setting Up the Build Environment

-

KfW is built on a Windows PC, in the default Windows shell (cmd.exe). These - components must be installed:

- -

Environment variables

-

- All the components above must be in PATH. Installing ActivePerl puts perl in - the PATH. Doxygen, Cygwin, hhc, wix and nsis need to be added.

-

perl must be installed so that .pl files are automatically executed with perl. - The ActivePerl installation will do this for you.

-

In the INCLUDE path, the Microsoft Platform SDK must come before the Microsoft - Visual C++ include files. In the PATH path, the Platform SDK bin area must come before the Visual Studio VC\bin area. Using a Platform SDK Build Environment window will - set this up the right way.  Make sure to use a Platform SDK Windows XP Build Environment shell.

-

If you make your path modifications permanent via Control Panel / System / - Advanced / Environment Variables:  If you use a Platform SDK Build - Environment window, it appears that you need to put your PATH components in the - System PATH, not the User PATH.

-

Visual Studio installs hhc in C:\Program Files\HTML Help Workshop.

-

nmake must be in PATH. If you use a Platform SDK build environment window, it is - already done for you.

-

Running the Script

-

- The build is a perl script controlled by command line switches and an XML - configuration file. The config file is required. Settings in the config file - can be overridden by optional command line switches. 

-

There are options for controlling most steps of the build process.  The - steps are

- -

The usage message shows the switches that control these steps:

-

C:\Projects\KfW>perl bkw.pl /?
- Usage: bkw.pl [options] NMAKE-options

-

  Options are case insensitive. -

-

  Options:  -
-
  /help /?          - usage information (what you now see). -
-   /config /f path   Path to config file. Default is - bkwconfig.xml. -
-   /src /s dir       Source directory to use. - Should contain -
-     -                 - pismere/athena. If cvstag or svntag is null, -
-       -               - the directory should be prepopulated. -
-   /out /o dir       Directory to be created - where build results will go -
-
  /repository checkout | co \ What repository action to take. -
-      /r       - update   | up \ Options are to checkout, update, export
-               export   - | ex \ or take no action [skip]. 
-               - skip
-   /username /u name username used to access svn if checking out. -
-   /cvstag /c tag    use -r <tag> - in cvs -command
  /svnbranch /b tag use -/branches/<tag> instead of /trunk.
  /svntag /t tag    use -/tags/<tag> instead of /trunk.
  /debug -/d         Do debug make instead of -release make.
  -/[no]make         -Control the make -step.
  -/clean            Build -clean target.
  -/[no]package      Control the packaging step.
  -/[no]sign         Control -signing -of executable files.
  /verbose -/v       Debug mode - verbose output.
  /logfile /l path  Where to write output. -Default is bkw.pl.log.
  - /nolog            Don't - save output.
-

-

  Other: -
-     NMAKE-options any options you want to pass to NMAKE, which - can be: -
-                   - (note: /nologo is always used)
-                   NODEBUG=1

-

NMAKE-options any options you want to pass to NMAKE, which can be:
- (note: /nologo is always used)
- [ nmake options follow ]

-


- Notes on the script steps:

-

Verifying the environment:  -
- The script tests for each program that it needs and warns if the program isn't - found.

-

Fetching sources from repositories:  -
- If building from a source distribution kit, this section does not apply.

-

CVSROOT and SVNURL must be specified in the configuration file.

-

A source zip file can only be produced if checking out fresh sources from a - repository. 

-

If checking out, the entire pismere directory will be deleted.  A warning - message requires that you confirm this action.

-

Building the sources:
- /DEBUG controls whether a debug or release build is done.  /CLEAN will - build the CLEAN target.

-

Setting up the packaging environment :
-
The pre-package steps gathers up build results and puts them in a - staging area.  -

-

If /SIGN is specified, .exes, .dlls - and .cpls are signed.  The signing command - template is in the configuration file.

-

Building the installers:
- The staging area is copied into a fresh area for - each of the installers.  The installer results are copied back to the - staging area.

-

Building the rest of the components:
- Zip files are built in temporary areas and copied to outdir.  - The installers and assorted files are copied from staging - to outdir.  If /SIGN is specified, the - installers will be signed.

-

 

-

Script Internal Details

-

Copy Lists

-

CopyLists are used in many places.  For example, files to be put into - a .zip are copied to a fresh directory which is then zipped up.  There is - an optional Configuration section and a required Files section. 

-

The configuration section defines the roots of the from and to paths and can - optionally define path substitutions.  -

-

The to and from paths are forced by the script rather than being set in the - config file.  Comments in the copyfile xml indicate this.

-

Lengthy copy lists can be kept in separate files and included with the Include - directive.  Example:

-

<Include path="sdkfiles.xml" />

-

Substitution tags

-

Filenames in copylists can contain variable 'tags' that are replaced before the - file is copied.  Some configuration files contain substitution tags which - customize the configuration.  The supported tags are

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
%VERSION_MAJOR%KfW Version from pismere/athena/include/kerberos.ver.
%VERSION_MINOR%KfW Version from pismere/athena/include/kerberos.ver.
%VERSION_PATCH%KfW Version from pismere/athena/include/kerberos.ver.
%filestem%Defined as kfw-%VERSION_MAJOR%-%VERSION_MINOR%-%VERSION_PATCH%.
%debug%'dbg.'  Only substituted during a debug build. 
%release%'rel.'  Only substituted during a release build.  -
%bldtype%Always substituted, to 'dbg' or 'rel,' depending on the type of build.
%-DEBUG%'-DEBUG' during a debug build; otherwise empty.
%BUILDDIR%SRCDIR\pismere.  Used in site-local installer configuration files.
%TARGETDIR%SRCDIR\pismere\staging.  Used in site-local installer configuration files.
%CONFIGDIR-WIX%SRCDIR\pismere\staging\sample.  Used in site-local installer configuration - files.
%CONFIGDIR-NSI%SRCDIR\pismere\staging.  Used in site-local installer configuration files.
-

-

The overall build configuration specifies a debug or release build.  Debug - and release results are put in different places.  Files whose location - depend on the build type can use %bldtype% in their names.  The script - will substitute %bldtype% with either dbg or rel, depending on the build - type. 

-
-
-

Example

-
-

Here is a copylist entry.  Each segment of the file's path that comes - from a different place is in a different color.

-

Release build.  Config file: -

-

- - - - - - - - - - - - - -
<BKW_Config>
<Config>
<src value ="C:\bkw" /> -
-

-

Copylist comments:

-

<!-- File from paths are relative to - \pismere\athena -->
<!-- File to paths are relative to \ - pismere\staging - -->
-

-

When the script processes this copylist, it will force the from and to paths as - indicated.

-

This line -

-

<File name="comerr32.dll" from="..\target\bin\i386\%bldtype%\" - to="\bin\i386" />

-

will result in C:\bkw\pismere\athena\..\target\bin\i386\rel\comerr32.dll

-

being copied to C:\bkw\pismere\staging\bin\i386\comerr32.dll.

-

Other possible attributes in a copylist entry:

- -

By default, copylist entries are required and the script will die if they aren't - present. To ignore missing files, add notrequired.

-

To rename the file, set the newname attribute.

-

Remaining Work / Bug List

-

Implement RETAIL, OFFICIAL, PRERELEASE, PRIVATE, SPECIAL.

-

Figure out what MIT_ONLY, BUILD_KFW, DEBUG_SYMBOL should be.

-

TARGET, APPVER.

-

NODEBUG=1.  Set if release build.

-

Troubleshooting -

-

Can't clean directory; can't delete file or directory
- Make sure a file in the named directory isn't open in another application.

-

Can't find kerberos.ver
- You skipped the repository step and are trying to build in an empty directory.

-

Directories don't exist or can't be created
-
This can be a symptom of the Platform SDK bin area not being before the Visual Studio bin areas, such that the version of nmake running is version 8.x.
-
[This explanation courtesy of Jeff Altman]:
- nmake V8 appears to favor executables over shell commands. As a result, using 'mkdir' instead of 'md' in Makefiles, as a command for creating directory trees, fails when the Cygwin mkdir.exe is present in the PATH. Changing the

-

MKDIR=mkdir
- RMDIR=rmdir

-

macros in the Makefiles to

-

MKDIR=md
- RMDIR=rd

-

should make the shell versions execute in all cases.

-
- - diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl deleted file mode 100644 index f23c9be631..0000000000 --- a/src/windows/build/bkw.pl +++ /dev/null @@ -1,700 +0,0 @@ -#!perl -w - -#use strict; -use FindBin; -use File::Spec; -use File::Basename; -use lib "$FindBin::Bin/build/lib"; -use Getopt::Long; -use Cwd; -use XML::Simple; -use Data::Dumper; -use Archive::Zip; -use Logger; -require "copyfiles.pl"; -require "prunefiles.pl"; -require "signfiles.pl"; -require "zipXML.pl"; - -my $BAIL; -$0 = fileparse($0); -my $OPT = {foo => 'bar'}; -my $MAKE = 'NMAKE'; -our $config; - -sub get_info { - my $cmd = shift || die; - my $which = $^X.' which.pl'; - my $full = `$which $cmd`; - return 0 if ($? / 256); - chomp($full); - $full = "\"".$full."\""; - return { cmd => $cmd, full => $full}; - } - -sub usage { - print < in cvs command - /svnbranch /b tag use /branches/ instead of /trunk. - /svntag /t tag use /tags/ instead of /trunk. - /debug /d Do debug make instead of release make. - /[no]make Control the make step. - /clean Build clean target. - /[no]package Control the packaging step. - /[no]sign Control signing of executable files. - /verbose /v Debug mode - verbose output. - /logfile /l path Where to write output. Default is bkw.pl.log. - /nolog Don't save output. - Other: - NMAKE-options any options you want to pass to NMAKE, which can be: - (note: /nologo is always used) - -USAGE - system("$MAKE /?"); - } - -sub handler { - my $sig = shift; - my $bailmsg = "Bailing out due to SIG$sig!\n"; - my $warnmsg = <{config}) {$OPT->{config} = "bkwconfig.xml";} - my $configfile = $OPT->{config}; - print "Info -- Reading configuration from $configfile.\n"; - my $xml = new XML::Simple(); - $config = $xml->XMLin($configfile); ## Read in configuration file. - - # Set up convenience variables: - local $odr = $config->{Config}; ## Options, directories, repository, environment. - - # Build argument description from Config section of the XML, - # to parse the rest of the arguments: - local @xmlargs; - while (($sw, $val) = each %$odr) { - local $arg = $sw; - if (exists $val->{abbr}) {$arg .= "|$val->{abbr}";} - if (exists $val->{value}) { ## Can't do both negations and string values. - $arg .= ":s"; - } - else { - if (! ($val->{def} =~ /A/)) {$arg .= "!";} - } - push @xmlargs, $arg; - } - - if (!GetOptions($OPT, @xmlargs)) {$OPT->{help} = 1;} - - if ( $OPT->{help} ) { - usage(); - exit(0); - } - - delete $OPT->{foo}; - -##++ Validate required conditions: - - # List of programs which must be in PATH:' - # 'cvs', 'svn', 'hhc', 'makensis', 'plink', 'filever' - my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'doxygen', - 'candle', 'light', 'nmake'); - my $requirements_met = 1; - my $first_missing = 0; - my $error_list = ""; - foreach my $required (@required_list) { - if (!get_info($required)) { - $requirements_met = 0; - if (!$first_missing) { - $first_missing = 1; - $error_list = "Fatal -- Environment problem! The following program(s) are not in PATH:\n"; - } - $error_list .= "$required\n"; - } - } - if (!$requirements_met) { - print $error_list; - print "Info -- Update PATH or install the programs and try again.\n"; - exit(0); - } - -##-- Validate required conditions. - - use Time::gmtime; - $ENV{DATE} = gmctime()." GMT"; - our $originalDir = `cd`; - $originalDir =~ s/\n//g; - -##++ Assemble configuration from config file and command line: - - my $bOutputCleaned = 0; - # Scan the configuration for switch definitions: - while (($sw, $val) = each %$odr) { - next if (! exists $val->{def}); ## ?? Should always exist. - - # Set/clear environment variables: - if ($val->{env}) { - if ($val->{def}) {$ENV{$sw} = (exists $val->{value}) ? $val->{value} : 1; } - else { - delete $ENV{$sw}; - undef $sw; - } - } - - # If the switch is in the command line, override the stored value: - if (exists $OPT->{$sw}) { - if (exists $val->{value}) { - $val->{value} = $OPT->{$sw}; - $val->{def} = 1; - } - else { - $val->{def} = $OPT->{$sw}; ## If -NO, value will be zero. - } - } - # If the switch can be negated, test that, too: - if ( ! ($val->{def} =~ /A/)) { - local $nosw = "no".$sw; - if (exists $OPT->{$nosw}) { ## -NO ? - if ($val->{env}) { - if (!$val->{def}) { - print "Deleting environment variable $sw\n"; - delete $ENV{$sw}; - undef $sw; - } - } - } - } - - # For any switch definition with fixed values ("options"), validate: - if (exists $val->{options}) { - local $bValid = 0; - # options can be like value1|syn1 value2|syn2|syn3 - foreach $option (split(/ /, $val->{options})) { - local $bFirst = 1; - local $sFirst; - foreach $opt (split(/\|/, $option)) { - # opt will be like value2, syn2, syn3 - if ($bFirst) { - $sFirst = $opt; ## Remember the full name of the option. - $bFirst = 0; - } - if ($val->{value} =~ /$opt/i) { - $val->{value} = $sFirst; ## Save the full name. - $bValid = 1; - } - } - } - if (! $bValid) { - print "Fatal -- invalid $sw value $val->{value}. Possible values are $val->{options}.\n"; - usage(); - die; - } - } - } - - # Set up convenience variables: - our $verbose = $odr->{verbose}->{def}; - our $vverbose = $odr->{vverbose}->{def}; - our $clean = $clean->{clean}->{def}; - local $src = $odr->{src}->{value}; - local $out = $odr->{out}->{value}; - - if ($clean && $odr->{package}->{def}) { - print "Info -- /clean forces /nopackage.\n"; - $odr->{package}->{def} = 0; - } - - if ($vverbose) {print "Debug -- Config: ".Dumper($config);} - - # Test the unix find command: - # List of directories where it might be: - my @find_dirs = ('c:\\cygwin\\bin', 'c:\\tools\\cygwin\\bin'); - if (exists $odr->{unixfind}->{value}) { ## Was an additional place to look specified? - push (@find_dirs, $odr->{unixfind}->{value}); - } - my $bFindFound = 0; - foreach my $dir (@find_dirs) { - if (-d $dir) { - local $savedPATH = $ENV{PATH}; - $ENV{PATH} = $dir.";".$savedPATH; - if (-e "a.tmp") {!system("rm a.tmp") or die "Fatal -- Couldn't clean temporary file a.tmp.";} - !system("find . -maxdepth 0 -name a.tmp > b.tmp 2>&1") or die "Fatal -- find test failed."; - local $filesize = -s "b.tmp"; - $ENV{PATH} = $savedPATH; - if ($filesize <= 0) { - $bFindFound = 1; - $odr->{unixfind}->{value} = $dir; - last; - } - } - } - if (! $bFindFound) { - print "Fatal -- unix find command not found in \n"; - map {print " $_ "} @find_dirs; - print "\n"; - die; - } - - # Don't allow /svntag and /svnbranch simultaneously: - if ( (length $odr->{svntag}->{value} > 0) && - (length $odr->{svnbranch}->{value} > 0) ) { - die "Fatal -- Can't specify both /SVNTAG and /SVNBRANCH."; - } - - # /logfile and /nolog interact: - if ($odr->{nolog}->{def}) {$odr->{logfile}->{def} = 0;} - -##-- Assemble configuration from config file and command line. - - local $rverb = $odr->{repository}->{value}; - if ( (($rverb =~ /checkout/) || ($rverb =~ /export/)) && $clean) { - print "Warning -- Because sources are being checked out, make clean will not be run.\n"; - $clean = $odr->{clean}->{def} = 0; - } - - my $wd = $src; - - if (! ($rverb =~ /skip/)) { - local $len = 0; - if (exists $odr->{username}->{value}) { - $len = length $odr->{username}->{value}; - } - if ($len < 1) { - die "Fatal -- you won't get far accessing the repository without specifying a username."; - } - } - - # (------------------------------------------------) - if ( (-d $wd) && ( ($rverb =~ /export/) || ($rverb =~ /checkout/) ) ) { - print "\n\nHEADS UP!!\n\n"; - print "/REPOSITORY ".uc($rverb)." will cause everything under $wd to be deleted.\n"; - print "If this is not what you intended, here's your chance to bail out!\n\n\n"; - print "Are you sure you want to remove everything under $wd? "; - my $char = getc; - if (! ($char =~ /y/i)) {die "Info -- operation aborted by user."} - !system("rm -rf $wd/*") or die "Fatal -- Couldn't clean $wd."; - !system("rmdir $wd") or die "Fatal -- Couldn't remove $wd."; - } - -# Begin logging: - my $l; - if ($odr->{logfile}->{def}) { - print "Info -- logging to $odr->{logfile}->{value}.\n"; - $l = new Logger $odr->{logfile}->{value}; - $l->start; - $l->no_die_handler; ## Needed so XML::Simple won't throw exceptions. - } - - print "Command line options:\n"; - while ($v = each %$OPT) {print "$v: $OPT->{$v}\n";} - - print "Executing $cmdline\n"; - local $argvsize = @ARGV; - local $nmakeargs = ""; - if ($argvsize > 0) { - map {$nmakeargs .= " $_ "} @ARGV; - print "Arguments for NMAKE: $nmakeargs\n"; - } - - print "Info -- Using unix find in $odr->{unixfind}->{value}\n" if ($verbose); - -##++ Begin repository action: - if ($rverb =~ /skip/) {print "Info -- *** Skipping repository access.\n" if ($verbose);} - else { - if ($verbose) {print "Info -- *** Begin fetching sources.\n";} - local $cvspath = "$src"; - if (! -d $cvspath) { ## xcopy will create the entire path for us. - !system("echo foo > a.tmp") or die "Fatal -- Couldn't create temporary file in ".`cd`; - !system("echo F | xcopy a.tmp $cvspath\\a.tmp") or die "Fatal -- Couldn't xcopy to $cvspath."; - !system("rm a.tmp") or die "Fatal -- Couldn't remove temporary file."; - !system("rm $cvspath\\a.tmp") or die "Fatal -- Couldn't remove temporary file."; - } - - # Set up cvs environment variables: - $ENV{CVSROOT} = $odr->{CVSROOT}->{value}; - local $krb5dir = "$wd\\athena\\auth\\krb5"; - - local $cvscmdroot = "cvs $rverb"; - if (length $odr->{cvstag}->{value} > 0) { - $cvscmdroot .= " -r $odr->{cvstag}->{value}"; - } - - if (($rverb =~ /checkout/) || ($rverb =~ /export/)) { - chdir($src) or die "Fatal -- couldn't chdir to $src\n"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - my @cvsmodules = ( - 'krb', - 'pismere/athena/util/lib/delaydlls', - 'pismere/athena/util/lib/getopt', - 'pismere/athena/util/guiwrap' - ); - foreach my $module (@cvsmodules) { - local $cvscmd = $cvscmdroot." ".$module; - if ($verbose) {print "Info -- cvs command: $cvscmd\n";} - !system("$cvscmd") or die "Fatal -- command \"$cvscmd\" failed; return code $?\n"; - } - } - else { ## Update. - chdir($wd) or die "Fatal -- couldn't chdir to $wd\n"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - if ($verbose) {print "Info -- cvs command: $cvscmdroot\n";} - !system($cvscmdroot) or die "Fatal -- command \"$cvscmdroot\" failed; return code $?\n"; - } - - # Set up svn environment variable: - $ENV{SVN_SSH} = "plink.exe"; - # If the directory structure doesn't exist, many cd commands will fail. - if (! -d $krb5dir) { ## xcopy will create the entire path for us. - !system("echo foo > a.tmp") or die "Fatal -- Couldn't create temporary file in ".`cd`; - !system("echo F | xcopy a.tmp $krb5dir\\a.tmp") or die "Fatal -- Couldn't xcopy to $krb5dir."; - !system("rm a.tmp") or die "Fatal -- Couldn't remove temporary file."; - !system("rm $krb5dir\\a.tmp") or die "Fatal -- Couldn't remove temporary file."; - } - - chdir($krb5dir) or die "Fatal -- Couldn't chdir to $krb5dir"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - my $svncmd = "svn $rverb "; - if (($rverb =~ /checkout/) || ($rverb =~ /export/)) { # Append the rest of the checkout/export command: - chdir(".."); - if ($rverb =~ /export/) { - ## svn export will fail if the destination directory exists - rmdir "krb5"; - } - $svncmd .= "svn+ssh://".$odr->{username}->{value}."@".$odr->{SVNURL}->{value}."/krb5/"; - if (length $odr->{svntag}->{value} > 0) { - $svncmd .= "tags/$odr->{svntag}->{value}"; - } - elsif (length $odr->{svnbranch}->{value} > 0) { - $svncmd .= "branches/$odr->{svnbranch}->{value}"; - } - else { - $svncmd .= "trunk"; - } - - $svncmd .= " krb5"; - - } - if ($verbose) {print "Info -- svn command: $svncmd\n";} - !system($svncmd) or die "Fatal -- command \"$svncmd\" failed; return code $?\n"; - if ($verbose) {print "Info -- *** End fetching sources.\n";} - } -##-- End repository action. - - ##++ Read in the version information to be able to update the - # site-local files in the install build areas. - # ** Do this now (after repository update and before first zip) - # because making zip files requires some configuration data be set up. - local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path}; - open(DAT, "$src/$version_path") or die "Could not open $src/$version_path."; - @raw = ; - close DAT; - foreach $line (@raw) { - chomp $line; - if ($line =~ /#define/) { # Process #define lines: - $line =~ s/#define//; # Remove #define token - $line =~ s/^\s+//; # and leading & trailing whitespace - $line =~ s/\s+$//; - local @qr = split("\"", $line); # Try splitting with quotes - if (exists $qr[1]) { - $qr[0] =~ s/^\s+//; # Clean up whitespace - $qr[0] =~ s/\s+$//; - $config->{Versions}->{$qr[0]} = $qr[1]; # Save string - } - else { # No quotes, so - local @ar = split(" ", $line); # split with space - $ar[0] =~ s/^\s+//; # Clean up whitespace - $ar[0] =~ s/\s+$//; - $config->{Versions}->{$ar[0]} = $ar[1]; # and save numeric value - } - } - } - - # Check that the versions we will need for site-local have been defined: - my @required_versions = ('VER_PROD_MAJOR', 'VER_PROD_MINOR', 'VER_PROD_REV', - 'VER_PROD_MAJOR_STR', 'VER_PROD_MINOR_STR', 'VER_PROD_REV_STR', - 'VER_PRODUCTNAME_STR'); - $requirements_met = 1; - $first_missing = 0; - $error_list = ""; - foreach my $required (@required_versions) { - if (! exists $config->{Versions}->{$required}) { - $requirements_met = 0; - if (!$first_missing) { - $first_missing = 1; - $error_list = "Fatal -- The following version(s) are not defined in $src/$version_path.\n"; - } - $error_list .= "$required\n"; - } - } - if (!$requirements_met) { - print $error_list; - exit(0); - } - - # Apply any of these tags to filestem: - my $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name}; - $filestem =~ s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/; - $filestem =~ s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/; - $filestem =~ s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/; - $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name} = $filestem; - ##-- Read in the version information & set config info. - -##++ Repository action, part 2: - if (($rverb =~ /checkout/) || ($rverb =~ /export/)) { - if (! $bOutputCleaned) { ## In case somebody cleaned $out before us. - if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory. - else {mkdir($out);} - $bOutputCleaned = 1; - } - zipXML($config->{Stages}->{FetchSources}, $config); ## Make zips. - } -##-- End repository action, part 2. - -##++ Make action: - if ( ($odr->{make}->{def}) ) { - if ($verbose) {print "Info -- *** Begin preparing for build.\n";} - - chdir("$wd") or die "Fatal -- couldn't chdir to $wd\n"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - - my ($path, $destpath); - - # Copy athena\scripts\site\graft\krb5\Makefile.src to athena\auth\krb5: - $path = "scripts\\site\\graft\\krb5\\Makefile.src"; - if (!-e $path) {die "Fatal -- Expected file $wd\\$path not found.";} - $destpath = "athena\\auth\\krb5\\Makefile.src"; - !system("echo F | xcopy /D $wd\\$path $wd\\$destpath /Y > NUL") or die "Fatal -- Copy of $wd\\$path to $wd\\$destpath failed."; - print "Info -- copied $wd\\$path to $wd\\$destpath\n" if ($verbose);; - - # Add DEBUG_SYMBOL to .../wshelper/Makefile.src: - $path = "athena\\wshelper\\wshelper\\Makefile.src"; - if (!-e $path) {die "Fatal -- Expected file $wd\\$path not found.";} - if (system("grep DEBUG_SYMBOL $path > NUL") != 0) { - !system ("echo DEBUG_SYMBOL=1 >> $wd\\$path") or die "Fatal -- Append line to file failed.\n"; - print "Info -- Added DEBUG_SYMBOL to $wd\\$path\n" if ($verbose); - } - - # Prune any unwanted directories before the build: - pruneFiles($config->{Stages}->{Make}, $config); - - if ($verbose) {print "Info -- *** End preparing for build.\n";} - - my ($buildtarget, $buildtext); - if ($clean) { - $buildtarget = "clean" ; - $buildtext = " clean." - } - else { - $buildtarget = "" ; - $buildtext = "." - } - - chdir("$wd\\athena") or die "Fatal -- couldn't chdir to source directory $wd\\athena\n"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - local $dbgswitch = ($odr->{debug}->{def}) ? " " : "NODEBUG=1"; - !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget $dbgswitch BUILD_KFW=1 BUILD_OFFICIAL=1 DEBUG_SYMBOL=1 $nmakeargs") - or die "Fatal -- build $buildtarget failed."; - - chdir("$wd") or die "Fatal -- couldn't chdir to $wd."; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - if ($clean) { - if (-d "staging") { - !system("rm -rf staging") or die "Fatal -- Couldn't remove $wd\\staging."; - } - } - - if ($verbose) {print "Info -- *** End build".$buildtext."\n";} - } ## End make conditional. - else {print "Info -- *** Skipping build.\n" if ($verbose);} -##-- Make action. - -##++ Package action: - if (! $odr->{package}->{def}) { ## If /clean, nopackage will be set. - print "Info -- *** Skipping packaging.\n"; - if ((-d $out) && ! $bOutputCleaned) { - print "Warning -- *** Output directory $out will not be cleaned.\n"; - } - } - else { - if ($verbose) {print "Info -- *** Begin prepackage.\n";} - - if (! $bOutputCleaned) { ## In case somebody cleaned $out before us. - if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory. - else {mkdir($out);} - $bOutputCleaned = 1; - } - - # The build results are copied to a staging area, where the packager expects to find them. - # We put the staging area in the fixed area .../pismere/staging. - #my $prepackage = $config->{Stages}->{PrePackage}; - #my $staging = "$wd\\staging"; - #chdir($wd) or die "Fatal -- couldn't chdir to $wd\n"; - #print "Info -- chdir to ".`cd`."\n" if ($verbose); - #if (-d "staging") { - # !system("rm -rf $staging/*") or die "Fatal -- Couldn't clean $staging."; - # } - #else { - # mkdir($staging) or die "Fatal -- Couldn't create $staging."; - # } - - # Force Where From and To are relative to: - #$prepackage->{CopyList}->{Config}->{From}->{root} = "$wd\\athena"; - #$prepackage->{CopyList}->{Config}->{To}->{root} = "$wd\\staging"; - #copyFiles($prepackage->{CopyList}, $config); ## Copy any files [this step takes a while] - - # Sign files: - #chdir($staging) or die "Fatal -- couldn't chdir to $staging\n"; - #print "Info -- chdir to ".`cd`."\n" if ($verbose); - #if ($odr->{sign}->{def}) { - # signFiles($config->{Stages}->{PostPackage}->{Config}->{Signing}, $config); - # } - - # Create working directories for building the installers: - if (-d "$wd\\buildwix") {!system("rm -rf $wd\\buildwix/*") or die "Fatal -- Couldn't clean $wd\\buildwix."} - !system("echo D | xcopy /s $wd\\windows\\installer\\wix\\*.* $wd\\buildwix") or die "Fatal -- Couldn't create $wd\\buildwix."; - #if (-d "$wd\\buildnsi") {!system("rm -rf $wd\\buildnsi/*") or die "Fatal -- Couldn't clean $wd\\buildnsi."} - #!system("echo D | xcopy /s $wd\\staging\\install\\nsis\\*.* $wd\\buildnsi") or die "Fatal -- Couldn't create $wd\\buildnsi."; - - chdir("$wd\\windows\\installer\\wix") or die "Fatal -- Couldn't cd to $wd\\windows\\installer\\wix"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - # Correct errors in files.wxi: - #!system("sed 's/WorkingDirectory=\"\\[dirbin\\]\"/WorkingDirectory=\"dirbin\"/g' files.wxi > a.tmp") or die "Fatal -- Couldn't modify files.wxi."; - #!system("mv a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi."; - - # Make sed script to run on the site-local configuration files: - local $tmpfile = "site-local.sed" ; - if (-e $tmpfile) {system("del $tmpfile");} - # Basic substitutions: - local $dblback_wd = $wd; - $dblback_wd =~ s/\\/\\\\/g; - !system("echo s/%BUILDDIR%/$dblback_wd/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - local $dblback_staging = "$wd\\staging"; - $dblback_staging =~ s/\\/\\\\/g; - !system("echo s/%TARGETDIR%/$dblback_staging/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - local $dblback_sample = "$wd\\staging\\sample"; - $dblback_sample =~ s/\\/\\\\/g; - !system("echo s/%CONFIGDIR-WIX%/$dblback_sample/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%CONFIGDIR-NSI%/$dblback_staging/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - # Strip out some defines so they can be replaced: [used for site-local.nsi] - !system("echo /\^!define\.\*RELEASE\.\*\$/d >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo /\^!define\.\*DEBUG\.\*\$/d >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo /\^!define\.\*BETA\.\*\$/d >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - - # Run the script on site-local.wxi: - !system("sed -f $tmpfile site-local-tagged.wxi > $wd\\buildwix\\site-local.wxi") or die "Fatal -- Couldn't modify site-local.wxi."; - - # Now update site-local.nsi: - #chdir "..\\nsis"; - #print "Info -- chdir to ".`cd`."\n" if ($verbose); - #!system("sed -f ..\\wix\\$tmpfile site-local-tagged.nsi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi."; - # Add DEBUG or RELEASE: - #if ($odr->{debug}->{def}) { ## debug build - # !system("echo !define DEBUG >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; - # } - #else { ## release build - # !system("echo !define RELEASE >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; - # } - # Add BETA if present: - #if (exists $config->{Versions}->{'BETA_STR'}) { - # !system("echo !define BETA $config->{Versions}->{'BETA_STR'} >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; - # } - #!system("mv -f b.tmp $wd\\buildnsi\\site-local.nsi") or die "Fatal -- Couldn't replace site-local.nsi."; - - # Run the script on nsi-includes-tagged.nsi: - #!system("sed -f ..\\wix\\$tmpfile nsi-includes-tagged.nsi > $wd\\buildnsi\\nsi-includes.nsi") or die "Fatal -- Couldn't modify nsi-includes.nsi."; - #!system("rm ..\\wix\\$tmpfile") or die "Fatal -- Couldn't remove $tmpfile."; - - #if ($verbose) {print "Info -- *** End prepackage.\n";} - - #if ($verbose) {print "Info -- *** Begin package.\n";} - # Make the msi: - chdir("$wd\\buildwix") or die "Fatal -- Couldn't cd to $wd\\buildwix"; - print "Info -- *** Make .msi:\n" if ($verbose); - print "Info -- chdir to ".`cd`."\n" if ($verbose); - !system("$MAKE") or die "Error -- msi installer build failed."; - - #chdir("$wd\\buildnsi") or die "Fatal -- Couldn't cd to $wd\\buildnsi"; - #print "Info -- *** Make NSIS:\n" if ($verbose); - #print "Info -- chdir to ".`cd`."\n" if ($verbose); - #!system("cl.exe killer.cpp advapi32.lib") or die "Error -- nsis killer.exe not built."; - #!system("rename killer.exe Killer.exe") or die "Error -- Couldn't rename killer.exe"; - #!system("makensis kfw.nsi") or die "Error -- executable installer build failed."; - -# Begin packaging extra items: - chdir($wd) or die "Fatal -- Couldn't cd to $wd"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - - zipXML($config->{Stages}->{PostPackage}, $config); ## Make zips. - - $config->{Stages}->{PostPackage}->{CopyList}->{Config} = $config->{Stages}->{PostPackage}->{Config}; ## Use the post package config. - $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{From}->{root} = "$src\\pismere"; - $config->{Stages}->{PostPackage}->{CopyList}->{Config}->{To}->{root} = $out; - copyFiles($config->{Stages}->{PostPackage}->{CopyList}, $config); ## Copy any files - - !system("rm -rf $wd\\buildwix") or die "Fatal -- Couldn't remove $wd\\buildwix."; - !system("rm -rf $wd\\buildnsi") or die "Fatal -- Couldn't remove $wd\\buildnsi."; - - chdir($out) or die "Fatal -- Couldn't cd to $out"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - if ($odr->{sign}->{def}) { - signFiles($config->{Stages}->{PostPackage}->{Config}->{Signing}, $config); - } - - if ($verbose) {print "Info -- *** End package.\n";} - } -##-- Package action. - - system("rm -rf $src/a.tmp"); ## Clean up junk. - system("rm -rf $out/a.tmp"); ## Clean up junk. - system("rm -rf $out/ziptemp"); ## Clean up junk. - -# End logging: - if ($odr->{logfile}->{def}) {$l->stop;} - - return 0; - } ## End subroutine main. - -$SIG{'INT'} = \&handler; -$SIG{'QUIT'} = \&handler; - -exit(main()); diff --git a/src/windows/build/bootstrap.xml b/src/windows/build/bootstrap.xml deleted file mode 100644 index 7cff6f53f3..0000000000 --- a/src/windows/build/bootstrap.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/windows/build/commandandcontrol.pl b/src/windows/build/commandandcontrol.pl deleted file mode 100644 index 305b966030..0000000000 --- a/src/windows/build/commandandcontrol.pl +++ /dev/null @@ -1,170 +0,0 @@ -#!perl -w - -#use strict; - -sub commandandcontrol { - local ($configdefault, $bIgnoreCmdlineConfig) = @_; - local $OPT = {foo => 'bar'}; - - Getopt::Long::Configure('no_bundling', 'no_auto_abbrev', - 'no_getopt_compat', 'require_order', - 'ignore_case', 'pass_through', - 'prefix_pattern=(--|-|\+|\/)' - ); - GetOptions($OPT, - 'help|h|?', - 'cvstag|c:s', - 'svntag|s:s', - 'svnbranch|b:s', - 'src|r:s', - 'out|o:s', - 'debug|d', - 'nodebug', - 'config|f=s', - 'logfile|l:s', - 'nolog', - 'repository:s', - 'username|u:s', - 'verbose|v', - 'vverbose', - 'make!', - 'clean', - 'package!', - 'sign!', - ); - - if ( $OPT->{help} ) { - usage(); - exit(0); - } - - delete $OPT->{foo}; - - local $argvsize = @ARGV; - if ($argvsize > 0) { - print "Error -- invalid argument: $ARGV[0]\n"; - usage(); - die; - } - # The first time C&C is called, it is OK to override the default (./bkwconfig.xml) - # with a value from the command line. - # The second time C&C is called, the repository has been updated and C&C will be passed - # /pismere/athena/auth/krb5/windows/build/bkwconfig.xml. That value MUST be used. - if ($bIgnoreCmdlineConfig) {$OPT->{config} = $configdefault;} - elsif (! exists $OPT->{config}) {$OPT->{config} = $configdefault;} - - my $configfile = $OPT->{config}; - my $bOutputCleaned = 0; - - print "Info -- Reading configuration from $configfile.\n"; - - # Get configuration file: - local $xml = new XML::Simple(); - my $config = $xml->XMLin($configfile); - # Set up convenience variables: - local $odr = $config->{Config}; ## Options, directories, repository, environment. - -#while ($v = each %$OPT) {print "$v: $OPT->{$v}\n";} - - # Scan the configuration for switch definitions: - while (($sw, $val) = each %$odr) { - next if (! exists $val->{def}); ## ?? Should always exist. - - # Set/clear environment variables: - if ($val->{env}) { - if ($val->{def}) {$ENV{$sw} = (exists $val->{value}) ? $val->{value} : 1; } - else {delete $ENV{$sw}; } - } - - # If the switch is in the command line, override the stored value: - if (exists $OPT->{$sw}) { - if (exists $val->{value}) { - $val->{value} = $OPT->{$sw}; - $val->{def} = 1; - } - else { - $val->{def} = $OPT->{$sw}; ## If no, value will be zero. - } - } - # If the switch can be negated, test that, too: - if ( ! ($val->{def} =~ /A/)) { - local $nosw = "no".$sw; - if (exists $OPT->{$nosw}) { - $val->{def} = 0; - } - } - - # For any switch definition with fixed values ("options"), validate: - if (exists $val->{options}) { - local $bValid = 0; - # options can be like value1|syn1 value2|syn2|syn3 - foreach $option (split(/ /, $val->{options})) { - local $bFirst = 1; - local $sFirst; - foreach $opt (split(/\|/, $option)) { - # opt will be like value2, syn2, syn3 - if ($bFirst) { - $sFirst = $opt; ## Remember the full name of the option. - $bFirst = 0; - } - if ($val->{value} =~ /$opt/i) { - $val->{value} = $sFirst; ## Save the full name. - $bValid = 1; - } - } - } - if (! $bValid) { - print "Fatal -- invalid $sw value $val->{value}. Possible values are $val->{options}.\n"; - usage(); - die; - } - } - } - - # Don't allow /svntag and /svnbranch simultaneously: - if ( (length $odr->{svntag}->{value} > 0) && - (length $odr->{svnbranch}->{value} > 0) ) { - die "Fatal -- Can't specify both /SVNTAG and /SVNBRANCH."; - } - - return $config; - } - - -sub usage { - print < in cvs command - /svnbranch /b tag use /branches/ instead of /trunk. - /svntag /s tag use /tags/ instead of /trunk. - /debug /d Do debug make instead of release make. - /[no]make Control the make step. - /clean Build clean target. - /[no]package Control the packaging step. - /[no]sign Control signing of executable files. - /verbose /v Debug mode - verbose output. - /logfile /l path Where to write output. Default is bkw.pl.log. - /nolog Don't save output. - Other: - NMAKE-options any options you want to pass to NMAKE, which can be: - (note: /nologo is always used) - -USAGE - system("$MAKE /?"); - } - -return 1; \ No newline at end of file diff --git a/src/windows/build/copyfiles.pl b/src/windows/build/copyfiles.pl deleted file mode 100644 index 9f9ccdde68..0000000000 --- a/src/windows/build/copyfiles.pl +++ /dev/null @@ -1,137 +0,0 @@ -#!perl -w - -#use strict; -use XML::Simple; -use Data::Dumper; - -sub copyFiles { - local ($xml, $config) = @_; - local @odr = $config->{Config}; - local @files = $xml->{Files}; - # Check for includes: - if (exists $xml->{Files}->{Include}->{path}) { - my $includepath = $xml->{Files}->{Include}->{path}; - print "Info -- Including files from $includepath\n"; - my $savedDir = `cd`; - $savedDir =~ s/\n//g; - chdir $originalDir; ## Includes are relative to where we were invoked. - print "Info -- chdir to ".`cd`."\n" if ($verbose); - my $tmp = new XML::Simple; - my $includeXML = $tmp->XMLin($includepath); - chdir $savedDir; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - - local $i = 0; - while ($includeXML->{File}[$i]) { ## Copy File entries from includeXML. - $files[0]->{File}[++$#{$files[0]->{File}}] = $includeXML->{File}[$i]; - $i++; - } - delete $files->{Include}; - } - ##++ Set up path substitution variables for use inside the copy loop: - # A path can contain a variable part, which will be handled here. If the variable part is - # the Always or BuildDependent tag, then the variable will be changed to the - # build-type-dependent PathFragment. - # If the variable part is the IgnoreTag, then the file will not be copied. - # If the variable part is %filestem%, it will be replaced with Config->FileStem->name. - my ($PathFragment, $BuildDependentTag, $IgnoreTag, $FileStemFragment, $fromRoot, $toRoot); - my $bPathTags = (exists $xml->{Config}->{DebugArea}) && (exists $xml->{Config}->{ReleaseArea}); - my $bFileStem = (exists $xml->{Config}->{FileStem}); - - if ($odr->{debug}->{def}) { ## Debug build tags: - $PathFragment = $xml->{Config}->{DebugArea}->{value}; - $BuildDependentTag = $xml->{Config}->{DebugTag}->{value}; - $IgnoreTag = $xml->{Config}->{ReleaseTag}->{value}; - } - else { ## Release build tags: - $PathFragment = $xml->{Config}->{ReleaseArea}->{value}; - $BuildDependentTag = $xml->{Config}->{ReleaseTag}->{value}; - $IgnoreTag = $xml->{Config}->{DebugTag}->{value}; - } - my $AlwaysTag = $xml->{Config}->{AlwaysTag}->{value}; - $FileStemFragment = $xml->{Config}->{FileStem}->{name}; - $fromRoot = $xml->{Config}->{From}->{root}; - $toRoot = $xml->{Config}->{To}->{root}; - ##-- Set up path substitution variables for use inside the copy loop. - # For each file in the file list: - # Substitute any variable parts of the path name. - # Handle wildcards - # Copy - - local $i = 0; - my $bOldDot = 1; - my $bDot = 0; - while ($files[0]->{File}[$i]) { - - my ($name, $newname, $from, $to, $file); - $file = $files[0]->{File}->[$i]; - $name = $file->{name}; - if (exists $file->{newname}) {$newname = $file->{newname};} - else {$newname = $name;} - if ($name && (! exists $file->{ignore})) { ## Ignore or process this entry? - $from = "$fromRoot\\$file->{from}\\$name"; - $to = "$toRoot\\$file->{to}\\$newname"; - # Copy this file? Check for ignore tag [debug-only in release mode or vice versa]. - if ( $bPathTags || $bFileStem || (index($from.$to, $IgnoreTag) <0) ) { - if ($bPathTags) { ## Apply PathTag substitutions: - $from =~ s/$AlwaysTag/$PathFragment/g; - $to =~ s/$AlwaysTag/$PathFragment/g; - $from =~ s/$BuildDependentTag/$PathFragment/g; - $to =~ s/$BuildDependentTag/$PathFragment/g; - } - if ($bFileStem) { ## FileStem substitution? - $from =~ s/%filestem%/$FileStemFragment/g; - $to =~ s/%filestem%/$FileStemFragment/g; - } - # %-DEBUG% substitution: - local $DebugFragment = ($odr->{debug}->{def}) ? "-DEBUG" : ""; - $from =~ s/%\-DEBUG%/$DebugFragment/g; - $to =~ s/%\-DEBUG%/$DebugFragment/g; - $to =~ s/\*.*//; ## Truncate to path before any wildcard - - my $bCopyOK = 1; - my $fromcheck = $from; - my $bRequired = ! (exists $file->{notrequired}); - if ($name =~ /\*/) { ## Wildcard case - $fromcheck =~ s/\*.*//; - if ($bRequired && (! -d $fromcheck)) { - if ($bDot) {print "\n";} - die "Fatal -- Can't find $fromcheck"; - } - $bCopyOK = !system("echo D | xcopy /D /F /Y /S $from $to > a.tmp 2>NUL"); - } - else { ## Specific file case - if ($bRequired && (! -e $fromcheck)) { - if ($bDot) {print "\n";} - die "Fatal -- Can't find $fromcheck"; - } - $bCopyOK = !system("echo F | xcopy /D /F /Y $from $to > a.tmp 2>NUL"); - } - - if ($bCopyOK) { ## xcopy OK - show progress - # To show progress when files aren't copied, print a string of dots. - open(MYINPUTFILE, "; - foreach $line (@lines) { - $bDot = ($line =~ /^0/); - } - close(MYINPUTFILE); - if (!$bDot && $bOldDot) {print "\n";} - if ($bDot) {print "."; STDOUT->flush;} - else {print "$from copied to $to\n";} - $bOldDot = $bDot; - } - else { ## xcopy failed - if (!exists $file->{notrequired}) { - if ($bDot) {print "\n";} - die "Fatal -- Copy of $from to $to failed"; - } - } ## End xcopy succeed or fail - } ## End not dummy entry nor ignored - } - $i++; - } - if ($bDot) {print "\n";} - } - -return 1; diff --git a/src/windows/build/copyfiles.xml b/src/windows/build/copyfiles.xml deleted file mode 100644 index 4b24e1f65d..0000000000 --- a/src/windows/build/copyfiles.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/windows/build/corebinaryfiles.xml b/src/windows/build/corebinaryfiles.xml deleted file mode 100644 index 9fcf8aa3a1..0000000000 --- a/src/windows/build/corebinaryfiles.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/windows/build/css/main-action(1).css b/src/windows/build/css/main-action(1).css deleted file mode 100644 index 2a1cfc0d9e..0000000000 --- a/src/windows/build/css/main-action(1).css +++ /dev/null @@ -1,54 +0,0 @@ -.sidebar { - BACKGROUND-COLOR: #f0f0f0 -} -#logodiv { - PADDING-RIGHT: 15px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; TEXT-ALIGN: center -} -#menu { - WIDTH: 150px -} -.leftnav H1 { - PADDING-RIGHT: 4px; BORDER-TOP: white 1px solid; PADDING-LEFT: 4px; FONT-WEIGHT: bold; FONT-SIZE: 11px; PADDING-BOTTOM: 4px; MARGIN: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #ccc 1px solid -} -.leftnav H5 { - PADDING-RIGHT: 0px; BORDER-TOP: white 1px solid; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 11px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: #ccc 1px solid -} -.leftnav H5 A { - BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 5px; DISPLAY: block; PADDING-LEFT: 5px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; BORDER-RIGHT-WIDTH: 0px; TEXT-DECORATION: none -} -.leftnav H5 A:hover { - BORDER-TOP-WIDTH: 0px; DISPLAY: block; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BACKGROUND-COLOR: white; BORDER-RIGHT-WIDTH: 0px; TEXT-DECORATION: none -} -.leftnav UL { - PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; LIST-STYLE-TYPE: none -} -.leftnav LI { - PADDING-RIGHT: 0px; DISPLAY: inline; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px -} -.leftnav LI A { - PADDING-RIGHT: 2px; DISPLAY: block; PADDING-LEFT: 5px; PADDING-BOTTOM: 2px; MARGIN: 0px; COLOR: white; PADDING-TOP: 2px; TEXT-DECORATION: none -} -.leftnav LI A.current { - COLOR: white; BACKGROUND-COLOR: #003366 -} -.leftnav LI A:active { - COLOR: white -} -.leftnav LI A:visited { - COLOR: white -} -.leftnav LI A:hover { - COLOR: white; BACKGROUND-COLOR: #003366 -} -.leftnav LI.current { - BACKGROUND-COLOR: #487bb7 -} -.leftnav LI.current A { - COLOR: #3c78b5 -} -#PageContent { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #fff; TEXT-ALIGN: left -} -H1 { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 22px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 27px 0px 4px; COLOR: #660000; PADDING-TOP: 0px; FONT-FAMILY: Arial, sans-serif; BACKGROUND-COLOR: #fff -} diff --git a/src/windows/build/css/main-action.css b/src/windows/build/css/main-action.css deleted file mode 100644 index e08c50ecd1..0000000000 --- a/src/windows/build/css/main-action.css +++ /dev/null @@ -1,1032 +0,0 @@ -BODY { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -P { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -TD { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -TABLE { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -TR { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -.bodytext { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -.stepfield { - FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: #000000; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -#PageContent { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 20px; MARGIN: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #fff; TEXT-ALIGN: left -} -BODY { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px; BACKGROUND-COLOR: #ffffff; TEXT-ALIGN: center -} -.monospaceInput { - FONT: 12px monospace -} -.wiki-content P { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 16px 0px; PADDING-TOP: 0px -} -.commentblock P { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 16px 0px; PADDING-TOP: 0px -} -.wiki-content-preview { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 5px -} -UL { - MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px -} -OL { - MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px -} -PRE { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 5px 5px 5px 15px; PADDING-TOP: 0px; TEXT-ALIGN: left -} -.helpheading { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; PADDING-BOTTOM: 4px; MARGIN: 10px 0px 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #d0d9bd -} -.helpcontent { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 20px; PADDING-TOP: 4px; BACKGROUND-COLOR: #f5f7f1 -} -.code { - BORDER-RIGHT: #3c78b5 1px dashed; BORDER-TOP: #3c78b5 1px dashed; FONT-SIZE: 11px; MARGIN: 10px; BORDER-LEFT: #3c78b5 1px dashed; LINE-HEIGHT: 13px; BORDER-BOTTOM: #3c78b5 1px dashed; FONT-FAMILY: Courier -} -.focusedComment { - BACKGROUND: #ffffce -} -.commentBox { - BORDER-RIGHT: #bbb 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #bbb 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 5px 0px; BORDER-LEFT: #bbb 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #bbb 1px solid -} -.focusedComment { - BORDER-RIGHT: #bbb 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #bbb 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 5px 0px; BORDER-LEFT: #bbb 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #bbb 1px solid -} -.codeHeader { - PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px dashed; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -.codeContent { - PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: left -} -.preformatted { - BORDER-RIGHT: #3c78b5 1px dashed; BORDER-TOP: #3c78b5 1px dashed; FONT-SIZE: 11px; MARGIN: 10px; BORDER-LEFT: #3c78b5 1px dashed; LINE-HEIGHT: 13px; BORDER-BOTTOM: #3c78b5 1px dashed; FONT-FAMILY: Courier -} -.preformattedHeader { - PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px dashed; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -.preformattedContent { - PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; BACKGROUND-COLOR: #eeefcc -} -.panel { - BORDER-RIGHT: #3c78b5 1px dashed; BORDER-TOP: #3c78b5 1px dashed; MARGIN: 0px 10px 10px; BORDER-LEFT: #3c78b5 1px dashed; BORDER-BOTTOM: #3c78b5 1px dashed -} -.panelHeader { - PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px dashed; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -.panelContent { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; BACKGROUND-COLOR: #eeefcc -} -.anonymousAlert { - BORDER-RIGHT: red 1px dashed; PADDING-RIGHT: 5px; BORDER-TOP: red 1px dashed; PADDING-LEFT: 5px; FONT-SIZE: 11px; PADDING-BOTTOM: 10px; MARGIN: 4px; BORDER-LEFT: red 1px dashed; LINE-HEIGHT: 13px; PADDING-TOP: 10px; BORDER-BOTTOM: red 1px dashed; BACKGROUND-COLOR: #eeefcc -} -.lockAlert { - BORDER-RIGHT: red 1px dashed; PADDING-RIGHT: 5px; BORDER-TOP: red 1px dashed; PADDING-LEFT: 5px; FONT-SIZE: 11px; PADDING-BOTTOM: 10px; MARGIN: 4px; BORDER-LEFT: red 1px dashed; WIDTH: 50%; LINE-HEIGHT: 13px; PADDING-TOP: 10px; BORDER-BOTTOM: red 1px dashed; BACKGROUND-COLOR: #eeefcc -} -.code-keyword { - COLOR: #000091 -} -.code-object { - COLOR: #910091 -} -.code-quote { - COLOR: #009100 -} -.code-comment { - COLOR: #808080 -} -.code-xml .code-keyword { - FONT-WEIGHT: bold -} -.code-tag { - COLOR: #000091 -} -.breadcrumbs { - BORDER-RIGHT: #3c78b5 0px solid; PADDING-RIGHT: 0px; BORDER-TOP: #3c78b5 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 11px; PADDING-BOTTOM: 3px; BORDER-LEFT: #3c78b5 0px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #eeefcc -} -.navmenu { - BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid -} -.menuheading { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; PADDING-BOTTOM: 2px; PADDING-TOP: 4px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #eeefcc -} -.menuitems { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 20px; PADDING-TOP: 4px -} -.rightpanel { - BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid -} -#helpheading { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; PADDING-BOTTOM: 4px; MARGIN: 0px; PADDING-TOP: 4px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #d0d9bd; TEXT-ALIGN: left -} -#helpcontent { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px; BACKGROUND-COLOR: #f5f7f1 -} -.helptab-unselected { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; BACKGROUND-COLOR: #f5f7f1 -} -.helptab-selected { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; BACKGROUND-COLOR: #d0d9bd -} -.helptabs { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; MARGIN: 0px; PADDING-TOP: 5px; BACKGROUND-COLOR: #f5f7f1 -} -.infopanel-heading { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; PADDING-BOTTOM: 2px; PADDING-TOP: 4px -} -.pagebody { - -} -.pageheader { - PADDING-RIGHT: 5px; PADDING-LEFT: 0px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; BORDER-BOTTOM: #3c78b5 1px solid -} -.pagetitle { - FONT-WEIGHT: bold; FONT-SIZE: 22px; COLOR: #003366; FONT-FAMILY: Arial, sans-serif -} -.newpagetitle { - COLOR: #ccc! important -} -.steptitle { - FONT-WEIGHT: bold; FONT-SIZE: 18px; MARGIN-BOTTOM: 7px; COLOR: #003366; FONT-FAMILY: Arial, sans-serif -} -.substeptitle { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 1px; MARGIN: 2px 4px 4px; COLOR: #003366; PADDING-TOP: 2px; FONT-FAMILY: Arial, sans-serif -} -.stepdesc { - MARGIN-TOP: 7px; FONT-WEIGHT: normal; FONT-SIZE: 11px; MARGIN-BOTTOM: 7px; COLOR: #666666; LINE-HEIGHT: 16px; FONT-FAMILY: Verdana, arial, sans-serif -} -.steplabel { - FONT-WEIGHT: bold; FLOAT: left; WIDTH: 15%; COLOR: black; MARGIN-RIGHT: 4px; TEXT-ALIGN: right -} -.stepfield { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; BACKGROUND: #eeefcc; PADDING-BOTTOM: 5px; PADDING-TOP: 5px -} -.submitButtons { - MARGIN-TOP: 5px; TEXT-ALIGN: right -} -.formtitle { - FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #003366; FONT-FAMILY: Arial, sans-serif -} -.sectionbottom { - BORDER-BOTTOM: #3c78b5 1px solid -} -.topRow { - BORDER-TOP: #3c78b5 2px solid -} -.tabletitle { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 14px; PADDING-BOTTOM: 2px; MARGIN: 8px 4px 2px 0px; COLOR: #003366; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 2px solid; FONT-FAMILY: Arial, sans-serif -} -.pagesubheading { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 10px; PADDING-BOTTOM: 5px; COLOR: #666666; PADDING-TOP: 0px -} -HR { - -} -A:link { - COLOR: #003366 -} -A:visited { - COLOR: #003366 -} -A:active { - COLOR: #003366 -} -A:hover { - COLOR: #003366 -} -H1 A:link { - TEXT-DECORATION: none -} -H1 A:visited { - TEXT-DECORATION: none -} -H1 A:active { - TEXT-DECORATION: none -} -H1 A:hover { - BORDER-BOTTOM: #003366 1px dotted -} -UNKNOWN { - MARGIN-TOP: 3px -} -.logocell { - PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px -} -INPUT { - FONT-SIZE: 11px; COLOR: #000000; FONT-FAMILY: verdana, geneva, arial, sans-serif -} -TEXTAREA { - FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: verdana, geneva, arial, sans-serif -} -TEXTAREA.editor { - FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: verdana, geneva, arial, sans-serif -} -.spacenametitle-printable { - MARGIN: 0px; FONT: 100 20px/25px Impact, Arial, Helvetica; COLOR: #999999 -} -.spacenametitle-printable A { - COLOR: #999999; TEXT-DECORATION: none -} -.spacenametitle-printable A:visited { - COLOR: #999999; TEXT-DECORATION: none -} -.blogDate { - FONT-WEIGHT: bold; COLOR: black; TEXT-DECORATION: none -} -.blogSurtitle { - BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px solid; PADDING-LEFT: 3px; BACKGROUND: #eeefcc; PADDING-BOTTOM: 3px; MARGIN: 1px 1px 10px; BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px solid -} -.blogHeading { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bold; FONT-SIZE: 20px; PADDING-BOTTOM: 0px; MARGIN: 0px; LINE-HEIGHT: normal; PADDING-TOP: 0px -} -.blogHeading A { - COLOR: black; TEXT-DECORATION: none -} -.endsection { - MARGIN-TOP: 10px; COLOR: #666666; align: right -} -.endsectionleftnav { - MARGIN-TOP: 10px; COLOR: #666666; align: right -} -H1 { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 24px; PADDING-BOTTOM: 2px; MARGIN: 36px 0px 4px; COLOR: #003366; LINE-HEIGHT: normal; PADDING-TOP: 2px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #eeefcc -} -H2 { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 18px; PADDING-BOTTOM: 2px; MARGIN: 27px 0px 4px; LINE-HEIGHT: normal; PADDING-TOP: 2px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #eeefcc -} -H3 { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 14px; PADDING-BOTTOM: 2px; MARGIN: 21px 0px 4px; LINE-HEIGHT: normal; PADDING-TOP: 2px; BACKGROUND-COLOR: #eeefcc -} -H4 { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 12px; PADDING-BOTTOM: 2px; MARGIN: 18px 0px 4px; LINE-HEIGHT: normal; PADDING-TOP: 2px; BACKGROUND-COLOR: #eeefcc -} -H4.search { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: normal; FONT-SIZE: 12px; PADDING-BOTTOM: 4px; MARGIN: 18px 0px 4px; LINE-HEIGHT: normal; PADDING-TOP: 4px; BACKGROUND-COLOR: #eeefcc -} -H5 { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 10px; PADDING-BOTTOM: 2px; MARGIN: 14px 0px 4px; LINE-HEIGHT: normal; PADDING-TOP: 2px; BACKGROUND-COLOR: #eeefcc -} -H6 { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: 8px; PADDING-BOTTOM: 2px; MARGIN: 14px 0px 4px; LINE-HEIGHT: normal; PADDING-TOP: 2px; BACKGROUND-COLOR: #eeefcc -} -.smallfont { - FONT-SIZE: 10px -} -.descfont { - FONT-SIZE: 10px; COLOR: #666666 -} -.smallerfont { - FONT-SIZE: 9px -} -.smalltext { - FONT-SIZE: 10px; COLOR: #666666 -} -.smalltext A { - COLOR: #666666 -} -.smalltext-blue { - FONT-SIZE: 10px; COLOR: #3c78b5 -} -.surtitle { - FONT-SIZE: 14px; MARGIN-BOTTOM: 5px; MARGIN-LEFT: 1px; COLOR: #666666 -} -.navItemOver { - FONT-WEIGHT: bold; FONT-SIZE: 10px; CURSOR: pointer; COLOR: #ffffff; BACKGROUND-COLOR: #003366; voice-family: inherit -} -.navItemOver A { - COLOR: #ffffff; BACKGROUND-COLOR: #003366; TEXT-DECORATION: none -} -.navItemOver A:visited { - COLOR: #ffffff; BACKGROUND-COLOR: #003366; TEXT-DECORATION: none -} -.navItemOver A:hover { - COLOR: #ffffff; BACKGROUND-COLOR: #003366; TEXT-DECORATION: none -} -.navItem { - FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #ffffff; BACKGROUND-COLOR: #3c78b5 -} -.navItem A { - COLOR: #ffffff; TEXT-DECORATION: none -} -.navItem A:hover { - COLOR: #ffffff; TEXT-DECORATION: none -} -.navItem A:visited { - COLOR: #ffffff; TEXT-DECORATION: none -} -DIV.padded { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px -} -DIV.thickPadded { - PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px -} -H3.macrolibrariestitle { - MARGIN: 0px -} -DIV.centered { - MARGIN: 10px; TEXT-ALIGN: center -} -DIV.centered TABLE { - MARGIN: 0px auto; TEXT-ALIGN: left -} -.tableview TABLE { - MARGIN: 0px -} -.tableview TH { - PADDING-RIGHT: 0px; PADDING-LEFT: 5px; FONT-SIZE: 12px; PADDING-BOTTOM: 0px; COLOR: #003366; PADDING-TOP: 5px; BORDER-BOTTOM: #3c78b5 2px solid; TEXT-ALIGN: left -} -.tableview TD { - BORDER-RIGHT: #ccc 0px solid; PADDING-RIGHT: 10px; BORDER-TOP: #ccc 0px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 4px; MARGIN: 0px; BORDER-LEFT: #ccc 0px solid; PADDING-TOP: 4px; BORDER-BOTTOM: #ccc 1px solid; TEXT-ALIGN: left -} -.grid { - MARGIN: 2px 0px 5px; BORDER-COLLAPSE: collapse -} -.grid TH { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; BACKGROUND: #eeefcc; PADDING-BOTTOM: 2px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid; TEXT-ALIGN: center -} -.grid TD { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ccc 1px solid -} -.gridHover { - BACKGROUND-COLOR: #f9f9f9 -} -TD.infocell { - BACKGROUND-COLOR: #eeefcc -} -.label { - FONT-WEIGHT: bold; COLOR: #003366 -} -LABEL { - FONT-WEIGHT: bold; COLOR: #003366 -} -.error { - BACKGROUND-COLOR: #fcc -} -.errorBox { - BORDER-RIGHT: #c00 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #c00 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; MARGIN: 5px; BORDER-LEFT: #c00 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #c00 1px solid; BACKGROUND-COLOR: #fcc -} -.errorMessage { - COLOR: #c00 -} -.success { - BACKGROUND-COLOR: #dfd -} -.successBox { - BORDER-RIGHT: #090 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #090 1px solid; MARGIN-TOP: 5px; PADDING-LEFT: 5px; MARGIN-BOTTOM: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #090 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #090 1px solid; BACKGROUND-COLOR: #dfd -} -BLOCKQUOTE { - PADDING-RIGHT: 10px; PADDING-LEFT: 10px; MARGIN-LEFT: 5px; BORDER-LEFT: #3c78b5 1px solid; MARGIN-RIGHT: 0px -} -TABLE.confluenceTable { - MARGIN: 5px; BORDER-COLLAPSE: collapse -} -TABLE.confluenceTable TD.confluenceTd { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ccc 1px solid -} -TABLE.confluenceTable TH.confluenceTh { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ccc 1px solid; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -TD.confluenceTd { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ccc 1px solid -} -TH.confluenceTh { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 3px; BORDER-LEFT: #ccc 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ccc 1px solid; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -DIV.small { - FONT-SIZE: 9px -} -H1.pagename { - MARGIN-TOP: 0px -} -IMG.inline { - -} -.loginform { - BORDER-RIGHT: #ccc 1px solid; BORDER-TOP: #ccc 1px solid; MARGIN: 5px; BORDER-LEFT: #ccc 1px solid; BORDER-BOTTOM: #ccc 1px solid -} -.previewnote { - FONT-SIZE: 11px; COLOR: red; TEXT-ALIGN: center -} -.previewcontent { - BACKGROUND: #e0e0e0 -} -.messagecontent { - BACKGROUND: #e0e0e0 -} -.conflictnote { - -} -.createlink { - COLOR: maroon -} -A.createlink { - COLOR: maroon -} -.templateparameter { - FONT-SIZE: 9px; COLOR: darkblue -} -.diffadded { - PADDING-RIGHT: 1px; PADDING-LEFT: 4px; BACKGROUND: #ddffdd; PADDING-BOTTOM: 1px; BORDER-LEFT: darkgreen 4px solid; PADDING-TOP: 1px -} -.diffdeleted { - PADDING-RIGHT: 1px; PADDING-LEFT: 4px; BACKGROUND: #ffdddd; PADDING-BOTTOM: 1px; BORDER-LEFT: darkred 4px solid; COLOR: #999; PADDING-TOP: 1px -} -.diffnochange { - PADDING-RIGHT: 1px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: lightgrey 4px solid; PADDING-TOP: 1px -} -.differror { - BACKGROUND: brown -} -.diff { - FONT-SIZE: 12px; LINE-HEIGHT: 14px; FONT-FAMILY: lucida console, courier new, fixed-width -} -.diffaddedchars { - FONT-WEIGHT: bolder; BACKGROUND-COLOR: #99ff99 -} -.diffremovedchars { - FONT-WEIGHT: bolder; BACKGROUND-COLOR: #ff9999; TEXT-DECORATION: line-through -} -.greybackground { - BACKGROUND: #eeefcc -} -.greybox { - BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px solid; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; MARGIN: 1px 1px 10px; BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px solid -} -.borderedGreyBox { - BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BORDER-LEFT: #cccccc 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeefcc -} -.greyboxfilled { - BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px solid; PADDING-LEFT: 3px; BACKGROUND: #eeefcc; PADDING-BOTTOM: 3px; MARGIN: 1px 1px 10px; BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px solid -} -.navBackgroundBox { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-WEIGHT: bold; FONT-SIZE: 22px; BACKGROUND: #3c78b5; PADDING-BOTTOM: 5px; COLOR: white; PADDING-TOP: 5px; FONT-FAMILY: Arial, sans-serif; TEXT-DECORATION: none -} -.previewBoxTop { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #3c78b5 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; MARGIN: 5px 0px 0px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #3c78b5 0px solid; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -.previewContent { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 10px; BORDER-TOP: #3c78b5 0px solid; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; MARGIN: 0px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 10px; BORDER-BOTTOM: #3c78b5 0px solid; BACKGROUND-COLOR: #fff -} -.previewBoxBottom { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #3c78b5 0px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; MARGIN: 0px 0px 5px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #eeefcc; TEXT-ALIGN: center -} -.functionbox { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #3c78b5 1px solid; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; MARGIN: 1px 1px 10px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #eeefcc -} -.functionbox-greyborder { - BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 3px; BORDER-TOP: #ddd 1px solid; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; MARGIN: 1px 1px 10px; BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #ddd 1px solid; BACKGROUND-COLOR: #eeefcc -} -.search-highlight { - BACKGROUND-COLOR: #ffffcc -} -.rowNormal { - BACKGROUND-COLOR: #ffffff -} -.rowAlternate { - BACKGROUND-COLOR: #f7f7f7 -} -.rowAlternateNoBottomColor { - BACKGROUND-COLOR: #f7f7f7 -} -.rowAlternateNoBottomNoColor { - -} -.rowAlternateNoBottomColor TD { - BORDER-BOTTOM-WIDTH: 0px -} -.rowAlternateNoBottomNoColor TD { - BORDER-BOTTOM-WIDTH: 0px -} -.rowHighlight { - BACKGROUND-COLOR: #eeefcc -} -TD.greenbar { - BORDER-RIGHT: #9c9c9c 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #9c9c9c 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 2px; BACKGROUND: #00df00; PADDING-BOTTOM: 0px; BORDER-LEFT: #9c9c9c 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #9c9c9c 1px solid -} -TD.redbar { - BORDER-RIGHT: #9c9c9c 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #9c9c9c 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 2px; BACKGROUND: #df0000; PADDING-BOTTOM: 0px; BORDER-LEFT: #9c9c9c 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #9c9c9c 1px solid -} -TD.darkredbar { - BORDER-RIGHT: #9c9c9c 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #9c9c9c 1px solid; PADDING-LEFT: 0px; FONT-SIZE: 2px; BACKGROUND: #af0000; PADDING-BOTTOM: 0px; BORDER-LEFT: #9c9c9c 1px solid; PADDING-TOP: 0px; BORDER-BOTTOM: #9c9c9c 1px solid -} -TR.testpassed { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING-BOTTOM: 0px; PADDING-TOP: 0px -} -TR.testfailed { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING-BOTTOM: 0px; PADDING-TOP: 0px -} -.toolbar { - MARGIN: 0px; BORDER-COLLAPSE: collapse -} -.toolbar TD { - BORDER-RIGHT: #ccc 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ccc 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; BORDER-LEFT: #ccc 1px solid; COLOR: #ccc; PADDING-TOP: 2px; BORDER-BOTTOM: #ccc 1px solid -} -TD.noformatting { - BORDER-RIGHT: 0px; PADDING-RIGHT: 0px; BORDER-TOP: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; BORDER-LEFT: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: 0px; TEXT-ALIGN: center -} -.commentblock { - MARGIN: 12px 0px -} -.license-eval { - BORDER-TOP: #bbbbbb 1px solid; FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-ALIGN: center -} -.license-none { - BORDER-TOP: #bbbbbb 1px solid; FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-ALIGN: center -} -.license-nonprofit { - BORDER-TOP: #bbbbbb 1px solid; FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; TEXT-ALIGN: center -} -.license-eval { - BACKGROUND-COLOR: #ffcccc -} -.license-none { - BACKGROUND-COLOR: #ffcccc -} -.license-eval B { - COLOR: #990000 -} -.license-none B { - COLOR: #990000 -} -.license-nonprofit { - BACKGROUND-COLOR: #ffffff -} -.bottomshadow { - BACKGROUND-IMAGE: url(/confluence/images/border/border_bottom.gif); BACKGROUND-REPEAT: repeat-x; HEIGHT: 12px -} -.navmenu .operations LI { - PADDING-LEFT: 0px; MARGIN-LEFT: 0px; LIST-STYLE-TYPE: none -} -.navmenu .operations UL { - PADDING-LEFT: 0px; MARGIN-LEFT: 0px; LIST-STYLE-TYPE: none -} -.navmenu .operations UL { - MARGIN-BOTTOM: 9px -} -.navmenu .label { - -} -.toolbar DIV { - DISPLAY: none -} -.toolbar .label { - DISPLAY: none -} -.toolbar .operations { - DISPLAY: block -} -.toolbar .operations UL { - DISPLAY: inline; PADDING-LEFT: 0px; MARGIN-LEFT: 10px; LIST-STYLE-TYPE: none -} -.toolbar .operations LI { - DISPLAY: inline; LIST-STYLE-TYPE: none -} -#foldertab { - PADDING-RIGHT: 0px; PADDING-LEFT: 8px; PADDING-BOTTOM: 3px; FONT: bold 11px Verdana, sans-serif; MARGIN-LEFT: 0px; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px solid -} -#foldertab LI { - DISPLAY: inline; MARGIN: 0px; LIST-STYLE-TYPE: none -} -#foldertab LI A { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: #3c78b5 1px solid; PADDING-LEFT: 0.5em; BACKGROUND: #3c78b5; PADDING-BOTTOM: 3px; MARGIN-LEFT: 3px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px; TEXT-DECORATION: none -} -#foldertab LI A:link { - COLOR: #ffffff -} -#foldertab LI A:visited { - COLOR: #ffffff -} -#foldertab LI A:hover { - BORDER-LEFT-COLOR: #003366; BACKGROUND: #003366; BORDER-BOTTOM-COLOR: #003366; COLOR: #ffffff; BORDER-TOP-COLOR: #003366; BORDER-RIGHT-COLOR: #003366 -} -#foldertab LI A.current { - BACKGROUND: white; COLOR: black; BORDER-BOTTOM: white 1px solid -} -#foldertab LI A.current:link { - COLOR: black -} -#foldertab LI A.current:visited { - COLOR: black -} -#foldertab LI A.current:hover { - BACKGROUND: white; COLOR: black; BORDER-BOTTOM: white 1px solid -} -UL#squaretab { - PADDING-LEFT: 0px; FONT: bold 8px Verdana, sans-serif; MARGIN-LEFT: 0px; WHITE-SPACE: nowrap -} -#squaretab LI { - DISPLAY: inline; LIST-STYLE-TYPE: none -} -#squaretab A { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 6px; BORDER-TOP: #3c78b5 1px solid; PADDING-LEFT: 6px; PADDING-BOTTOM: 2px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #3c78b5 1px solid -} -#squaretab A:link { - COLOR: #fff; BACKGROUND-COLOR: #3c78b5; TEXT-DECORATION: none -} -#squaretab A:visited { - COLOR: #fff; BACKGROUND-COLOR: #3c78b5; TEXT-DECORATION: none -} -#squaretab A:hover { - BORDER-LEFT-COLOR: #003366; BORDER-BOTTOM-COLOR: #003366; COLOR: #ffffff; BORDER-TOP-COLOR: #003366; BACKGROUND-COLOR: #003366; TEXT-DECORATION: none; BORDER-RIGHT-COLOR: #003366 -} -#squaretab LI A#current { - BACKGROUND: white; COLOR: black -} -.blogcalendar { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: normal; FONT-SIZE: x-small; PADDING-BOTTOM: 2px; LINE-HEIGHT: 140%; PADDING-TOP: 2px; FONT-FAMILY: verdana, arial, sans-serif -} -TABLE.blogcalendar { - BORDER-RIGHT: #3c78b5 1px solid; BORDER-TOP: #3c78b5 1px solid; BORDER-LEFT: #3c78b5 1px solid; BORDER-BOTTOM: #3c78b5 1px solid -} -.blogcalendar TH.calendarhead { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: x-small; PADDING-BOTTOM: 2px; TEXT-TRANSFORM: uppercase; COLOR: #ffffff; PADDING-TOP: 2px; LETTER-SPACING: 0.3em; BACKGROUND-COLOR: #3c78b5 -} -A.calendarhead { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: x-small; PADDING-BOTTOM: 2px; TEXT-TRANSFORM: uppercase; COLOR: #ffffff; PADDING-TOP: 2px; LETTER-SPACING: 0.3em; BACKGROUND-COLOR: #3c78b5 -} -.calendarhead:visited { - COLOR: white -} -.calendarhead:active { - COLOR: white -} -.calendarhead:hover { - COLOR: white -} -.blogcalendar TH { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-WEIGHT: bold; FONT-SIZE: x-small; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; BACKGROUND-COLOR: #eeefcc -} -.blogcalendar TD { - FONT-WEIGHT: normal; FONT-SIZE: x-small -} -.searchGroup { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BACKGROUND: #eeefcc; PADDING-BOTTOM: 10px; PADDING-TOP: 0px -} -.searchGroupHeading { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; FONT-SIZE: 10px; PADDING-BOTTOM: 1px; COLOR: #ffffff; PADDING-TOP: 2px; BACKGROUND-COLOR: #3c78b5 -} -.searchItem { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; PADDING-TOP: 1px -} -.searchItemSelected { - PADDING-RIGHT: 4px; PADDING-LEFT: 4px; FONT-WEIGHT: bold; BACKGROUND: #ddd; PADDING-BOTTOM: 1px; PADDING-TOP: 1px -} -.permissionHeading { - BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; FONT-SIZE: 16px; BORDER-LEFT: 0px solid; BORDER-BOTTOM: #bbb 1px solid; TEXT-ALIGN: left -} -.permissionTab { - BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; FONT-SIZE: 10px; BACKGROUND: #3c78b5; BORDER-LEFT: 1px solid; COLOR: #ffffff; BORDER-BOTTOM: 0px solid -} -.permissionSuperTab { - BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BACKGROUND: #003366; BORDER-LEFT: 1px solid; COLOR: #ffffff; BORDER-BOTTOM: 0px solid -} -.permissionCell { - BORDER-RIGHT: 0px solid; BORDER-TOP: 0px solid; BORDER-LEFT: #bbb 1px solid; BORDER-BOTTOM: 0px solid -} -.warningPanel { - BORDER-RIGHT: #f0c000 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #f0c000 1px solid; PADDING-LEFT: 8px; BACKGROUND: #ffffce; PADDING-BOTTOM: 8px; MARGIN: 10px; BORDER-LEFT: #f0c000 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #f0c000 1px solid -} -.alertPanel { - BORDER-RIGHT: #c00 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #c00 1px solid; PADDING-LEFT: 8px; BACKGROUND: #ffcccc; PADDING-BOTTOM: 8px; MARGIN: 10px; BORDER-LEFT: #c00 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #c00 1px solid -} -.infoPanel { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #3c78b5 1px solid; PADDING-LEFT: 8px; BACKGROUND: #d8e4f1; PADDING-BOTTOM: 8px; MARGIN: 10px; BORDER-LEFT: #3c78b5 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #3c78b5 1px solid -} -.optionPadded { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; PADDING-TOP: 2px -} -.optionSelected { - BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ddd 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: -1px; BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #ddd 1px solid; BACKGROUND-COLOR: #ffffcc -} -.optionSelected A { - FONT-WEIGHT: bold; COLOR: black; TEXT-DECORATION: none -} -.noteMacro { - BORDER-RIGHT: #f0c000 1px solid; BORDER-TOP: #f0c000 1px solid; MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px; BORDER-LEFT: #f0c000 1px solid; BORDER-BOTTOM: #f0c000 1px solid; BACKGROUND-COLOR: #ffffce; TEXT-ALIGN: left -} -.warningMacro { - BORDER-RIGHT: #c00 1px solid; BORDER-TOP: #c00 1px solid; MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px; BORDER-LEFT: #c00 1px solid; BORDER-BOTTOM: #c00 1px solid; BACKGROUND-COLOR: #fcc; TEXT-ALIGN: left -} -.infoMacro { - BORDER-RIGHT: #3c78b5 1px solid; BORDER-TOP: #3c78b5 1px solid; MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px; BORDER-LEFT: #3c78b5 1px solid; BORDER-BOTTOM: #3c78b5 1px solid; BACKGROUND-COLOR: #d8e4f1; TEXT-ALIGN: left -} -.tipMacro { - BORDER-RIGHT: #090 1px solid; BORDER-TOP: #090 1px solid; MARGIN-TOP: 5px; MARGIN-BOTTOM: 5px; BORDER-LEFT: #090 1px solid; BORDER-BOTTOM: #090 1px solid; BACKGROUND-COLOR: #dfd; TEXT-ALIGN: left -} -.informationMacroPadding { - PADDING-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-BOTTOM: 0px; PADDING-TOP: 5px -} -TABLE.infoMacro TD { - BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none -} -TABLE.warningMacro TD { - BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none -} -TABLE.tipMacro TD { - BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none -} -TABLE.noteMacro TD { - BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none -} -TABLE.sectionMacro TD { - BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none -} -TABLE.sectionMacroWithBorder TD.columnMacro { - BORDER-RIGHT: #cccccc 1px dashed; BORDER-TOP: #cccccc 1px dashed; BORDER-LEFT: #cccccc 1px dashed; BORDER-BOTTOM: #cccccc 1px dashed -} -.pagecontent { - PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; TEXT-ALIGN: left -} -.topBarDiv A:link { - COLOR: #ffffff -} -.topBarDiv A:visited { - COLOR: #ffffff -} -.topBarDiv A:active { - COLOR: #ffffff -} -.topBarDiv A:hover { - COLOR: #ffffff -} -.topBarDiv { - COLOR: #ffffff -} -.topBar { - BACKGROUND-COLOR: #003366 -} -.greyLinks A:link { - COLOR: #666666; TEXT-DECORATION: underline -} -.greyLinks A:visited { - COLOR: #666666; TEXT-DECORATION: underline -} -.greyLinks A:active { - COLOR: #666666; TEXT-DECORATION: underline -} -.greyLinks A:hover { - COLOR: #666666; TEXT-DECORATION: underline -} -.greyLinks { - PADDING-RIGHT: 10px; DISPLAY: block; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; COLOR: #666666; PADDING-TOP: 10px -} -.logoSpaceLink { - COLOR: #999999; TEXT-DECORATION: none -} -.logoSpaceLink A:link { - COLOR: #999999; TEXT-DECORATION: none -} -.logoSpaceLink A:visited { - COLOR: #999999; TEXT-DECORATION: none -} -.logoSpaceLink A:active { - COLOR: #999999; TEXT-DECORATION: none -} -.logoSpaceLink A:hover { - COLOR: #003366; TEXT-DECORATION: none -} -.basicPanelContainer { - BORDER-RIGHT: #3c78b5 1px solid; BORDER-TOP: #3c78b5 1px solid; MARGIN-TOP: 2px; MARGIN-BOTTOM: 8px; BORDER-LEFT: #3c78b5 1px solid; WIDTH: 100%; BORDER-BOTTOM: #3c78b5 1px solid -} -.basicPanelTitle { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; MARGIN: 0px; COLOR: black; PADDING-TOP: 5px; BACKGROUND-COLOR: #eeefcc -} -.basicPanelBody { - PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; MARGIN: 0px; PADDING-TOP: 5px -} -.separatorLinks A:link { - COLOR: white -} -.separatorLinks A:visited { - COLOR: white -} -.separatorLinks A:active { - COLOR: white -} -.greynavbar { - BORDER-TOP: #3c78b5 1px solid; MARGIN-TOP: 2px; BACKGROUND-COLOR: #eeefcc -} -DIV.headerField { - FLOAT: left; WIDTH: auto; HEIGHT: 100% -} -.headerFloat { - MARGIN-LEFT: auto; WIDTH: 50% -} -.headerFloatLeft { - FLOAT: left; MARGIN-BOTTOM: 10px; MARGIN-RIGHT: 20px -} -#headerRow { - PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 10px -} -DIV.license-personal { - COLOR: #ffffff; BACKGROUND-COLOR: #003366 -} -DIV.license-personal A { - COLOR: #ffffff -} -.greyFormBox { - BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #cccccc 1px solid -} -.marginlessForm { - MARGIN: 0px -} -.openPageHighlight { - BORDER-RIGHT: #ddd 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #ddd 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; BORDER-LEFT: #ddd 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #ddd 1px solid; BACKGROUND-COLOR: #ffffcc -} -.editPageInsertLinks { - FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #666666 -} -.editPageInsertLinks A { - FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #666666 -} -.top10 A { - FONT-WEIGHT: bold; FONT-SIZE: 2em; COLOR: #003366 -} -.top25 A { - FONT-WEIGHT: bold; FONT-SIZE: 1.6em; COLOR: #003366 -} -.top50 A { - FONT-SIZE: 1.4em; COLOR: #003366 -} -.top100 A { - FONT-SIZE: 1.2em; COLOR: #003366 -} -.heatmap { - MARGIN: 0px auto; WIDTH: 95%; LIST-STYLE-TYPE: none -} -.heatmap A { - TEXT-DECORATION: none -} -.heatmap A:hover { - TEXT-DECORATION: underline -} -.heatmap LI { - DISPLAY: inline -} -.minitab { - PADDING-RIGHT: 0px; MARGIN-TOP: 1px; PADDING-LEFT: 8px; FLOAT: none; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; FONT: bold 9px Verdana, sans-serif; MARGIN-LEFT: 0px; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px solid; TEXT-DECORATION: none -} -.selectedminitab { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: #3c78b5 1px solid; MARGIN-TOP: 1px; PADDING-LEFT: 0.5em; BACKGROUND: white; PADDING-BOTTOM: 3px; MARGIN-LEFT: 3px; BORDER-LEFT: #3c78b5 1px solid; COLOR: #000000; PADDING-TOP: 3px; BORDER-BOTTOM: white 1px solid; TEXT-DECORATION: none -} -.unselectedminitab { - BORDER-RIGHT: #3c78b5 1px solid; PADDING-RIGHT: 0.5em; BORDER-TOP: #3c78b5 1px solid; MARGIN-TOP: 1px; PADDING-LEFT: 0.5em; BACKGROUND: #3c78b5; PADDING-BOTTOM: 3px; MARGIN-LEFT: 3px; BORDER-LEFT: #3c78b5 1px solid; COLOR: #ffffff; PADDING-TOP: 3px; BORDER-BOTTOM: #3c78b5 1px; TEXT-DECORATION: none -} -A.unselectedminitab:hover { - BORDER-LEFT-COLOR: #003366; BACKGROUND: #003366; BORDER-BOTTOM-COLOR: #003366; COLOR: #ffffff; BORDER-TOP-COLOR: #003366; BORDER-RIGHT-COLOR: #003366 -} -A.unselectedminitab:link { - COLOR: white -} -A.unselectedminitab:visited { - COLOR: white -} -A.selectedminitab:link { - COLOR: black -} -A.selectedminitab:visited { - COLOR: black -} -.linkerror { - BACKGROUND-COLOR: #fcc -} -A.labelOperationLink:link { - TEXT-DECORATION: underline -} -A.labelOperationLink:active { - TEXT-DECORATION: underline -} -A.labelOperationLink:visited { - TEXT-DECORATION: underline -} -A.labelOperationLink:hover { - TEXT-DECORATION: underline -} -A.newLabel:link { - BACKGROUND-COLOR: #ddffdd -} -A.newLabel:active { - BACKGROUND-COLOR: #ddffdd -} -A.newLabel:visited { - BACKGROUND-COLOR: #ddffdd -} -A.newLabel:hover { - BACKGROUND-COLOR: #ddffdd -} -UL.square { - LIST-STYLE-TYPE: square -} -.inline-control-link { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 9px; BACKGROUND: #ffc; PADDING-BOTTOM: 2px; TEXT-TRANSFORM: uppercase; COLOR: #666; PADDING-TOP: 2px; TEXT-DECORATION: none -} -.inline-control-link A:link { - TEXT-DECORATION: none -} -.inline-control-link A:active { - TEXT-DECORATION: none -} -.inline-control-link A:visited { - TEXT-DECORATION: none -} -.inline-control-link A:hover { - TEXT-DECORATION: none -} -.inline-control-link { - PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 9px; BACKGROUND: #ffc; PADDING-BOTTOM: 2px; TEXT-TRANSFORM: uppercase; CURSOR: pointer; COLOR: #666; PADDING-TOP: 2px; TEXT-DECORATION: none -} -DIV.auto_complete { - BACKGROUND: #fff; WIDTH: 350px -} -DIV.auto_complete UL { - BORDER-RIGHT: #888 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #888 1px solid; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; BORDER-LEFT: #888 1px solid; WIDTH: 100%; PADDING-TOP: 0px; BORDER-BOTTOM: #888 1px solid; LIST-STYLE-TYPE: none -} -DIV.auto_complete UL LI { - PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; MARGIN: 0px; PADDING-TOP: 3px -} -DIV.auto_complete UL LI.selected { - BACKGROUND-COLOR: #ffb -} -DIV.auto_complete UL STRONG.highlight { - PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px; COLOR: #800; PADDING-TOP: 0px -} -.toogleFormDiv { - BORDER-RIGHT: #a7a6aa 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a7a6aa 1px solid; MARGIN-TOP: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #a7a6aa 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #a7a6aa 1px solid; BACKGROUND-COLOR: white -} -.toogleInfoDiv { - BORDER-RIGHT: #a7a6aa 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #a7a6aa 1px solid; MARGIN-TOP: 10px; DISPLAY: none; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #a7a6aa 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #a7a6aa 1px solid; BACKGROUND-COLOR: white -} -.inputSection { - MARGIN-BOTTOM: 20px -} -#editBox { - BACKGROUND-COLOR: #eeefcc -} -.leftnav LI A { - PADDING-RIGHT: 2px; BORDER-TOP: #3c78b5 1px solid; DISPLAY: block; PADDING-LEFT: 5px; PADDING-BOTTOM: 2px; MARGIN: 0px; COLOR: white; PADDING-TOP: 2px; BACKGROUND-COLOR: #3c78b5; TEXT-DECORATION: none -} -.leftnav LI A:active { - COLOR: white -} -.leftnav LI A:visited { - COLOR: white -} -.leftnav LI A:hover { - COLOR: white; BACKGROUND-COLOR: #003366 -} -.replaced { - BACKGROUND-COLOR: #33cc66 -} -.topPadding { - MARGIN-TOP: 20px -} -.form-block { - PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px -} -.form-error-block { - PADDING-RIGHT: 12px; BORDER-TOP: #eeefcc 1px solid; PADDING-LEFT: 12px; BACKGROUND: #fcc; MARGIN-BOTTOM: 6px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: #eeefcc 1px solid -} -.form-element-large { - FONT-WEIGHT: bold; FONT-SIZE: 16px; COLOR: #003366; FONT-FAMILY: Arial, sans-serif -} -.form-element-small { - FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #003366; FONT-FAMILY: Arial, sans-serif -} -.form-header { - PADDING-RIGHT: 12px; BORDER-TOP: #eeefcc 1px solid; PADDING-LEFT: 12px; BACKGROUND: lightyellow; MARGIN-BOTTOM: 6px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; BORDER-BOTTOM: #eeefcc 1px solid -} -.form-header P { - MARGIN: 12px 0px; LINE-HEIGHT: normal -} -.form-block P { - MARGIN: 12px 0px; LINE-HEIGHT: normal -} -.form-error-block P { - MARGIN: 12px 0px; LINE-HEIGHT: normal -} -.form-example { - FONT-SIZE: 11px; COLOR: #888 -} -.form-divider { - MARGIN-BOTTOM: 6px; BORDER-BOTTOM: #ccc 1px solid -} -.form-buttons { - PADDING-RIGHT: 10px; BORDER-TOP: #ccc 1px solid; MARGIN-TOP: 6px; PADDING-LEFT: 10px; BACKGROUND: #eeefcc; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; BORDER-BOTTOM: #ccc 1px solid; TEXT-ALIGN: center -} -.form-buttons INPUT { - WIDTH: 100px -} -.form-block .error { - PADDING-RIGHT: 6px; PADDING-LEFT: 6px; MARGIN-BOTTOM: 6px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px -} diff --git a/src/windows/build/makeZip.pl b/src/windows/build/makeZip.pl deleted file mode 100644 index 30f0cf14b3..0000000000 --- a/src/windows/build/makeZip.pl +++ /dev/null @@ -1,84 +0,0 @@ -#!perl -w - -#use strict; - -require "prunefiles.pl"; - -use Data::Dumper; - -sub makeZip { - local ($zip, $config) = @_; - - local $odr = $config->{Config}; ## Options, directories, repository, environment. - local $src = $odr->{src}->{value}; - local $out = $odr->{out}->{value}; - local $zipname = $zip->{filename}; - local $filestem = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name}; - $zipname =~ s/%filestem%/$filestem/g; - if (exists $zip->{Requires}) { - local $bMakeIt = 1; - local $rverb = $odr->{repository}->{value}; - local $j = 0; - while ($zip->{Requires}->{Switch}[$j]) { ## Check Require switches - local $switch = $zip->{Requires}->{Switch}[$j]; - if (exists $switch->{name}) { ## Ignore dummy entry - # We handle REPOSITORY and CLEAN switches: - if ($switch->{name} =~ /REPOSITORY/i) { - $bMakeIt &&= ($switch->{value} =~ /$rverb/i); ## Repository verb must match requirement - } - elsif ($switch->{name} =~ /CLEAN/i) { ## Clean must be specified - $bMakeIt &&= $clean; - } - else {print "Error -- Unsupported switch $switch->{name} in Requires in ".Dumper($zip); - $bMakeIt = 0; - } - } - $j++; - } - if ( !$bMakeIt ) { - if (exists $zip->{Requires}->{ErrorMsg}) { - print "Error -- $zip->{Requires}->{ErrorMsg}->{text}\n"; - } - else { - print "Error -- requirements not met for building $zipname.\n"; - } - return 0; - } - } - - local $ziptemp = "$out\\ziptemp"; - chdir "$out"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - system("rm -rf $ziptemp") if (-d $ziptemp); - die "Fatal -- Couldn't remove $ziptemp" if (-d $ziptemp); - mkdir($ziptemp); - # Set up the zip's config section: - $zip->{Config} = $config->{Stages}->{PostPackage}->{Config}; - # Add to the copylist's config section. Don't copy Postpackage->Config, - # because the CopyList's Config might contain substitution tags. - $zip->{CopyList}->{Config}->{FileStem}->{name} = $config->{Stages}->{PostPackage}->{Config}->{FileStem}->{name}; - $zip->{CopyList}->{Config}->{From}->{root} = "$src\\pismere"; ## Add zip-specific config settings. - $zip->{CopyList}->{Config}->{To}->{root} = $ziptemp; - copyFiles($zip->{CopyList}, $config); - # Drop down into /ziptemp so the path to the added file won't include : - chdir $ziptemp; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - - # Prune any unwanted files or directories from the directory we're about to zip: - pruneFiles($zip, $config); - - local $zipfile = Archive::Zip->new(); - local $topdir = $zip->{topdir}; - $topdir =~ s/%filestem%/$filestem/g; - $zipfile->addTree('.', $topdir); - if (-e $zipname) {!system("rm -f $zipname") or die "Error -- Couldn't remove $zipname.";} - $zipfile->writeToFileNamed($zipname); - chdir("$out"); - print "Info -- chdir to ".`cd`."\n" if ($verbose); - # move .zip from /ziptemp to . - !system("mv -f ziptemp/$zipname .") or die "Error -- Couldn't move $zipname to .."; - system("rm -rf ziptemp") if (-d "ziptemp"); ## Clean up any temp directory. - print "Info -- created $out\\$zipname.\n" if ($verbose); - } - -return 1; \ No newline at end of file diff --git a/src/windows/build/pruneFiles.pl b/src/windows/build/pruneFiles.pl deleted file mode 100644 index 0bb517624e..0000000000 --- a/src/windows/build/pruneFiles.pl +++ /dev/null @@ -1,36 +0,0 @@ -#!perl -w - -#use strict; -use Data::Dumper; - -sub pruneFiles { - local ($xml, $config) = @_; - local $prunes = $xml->{Prunes}; - if (! $prunes) {return 0;} - - # Use Unix find instead of Windows find. Save PATH so we can restore it when we're done: - local $savedPATH = $ENV{PATH}; - $ENV{PATH} = $config->{Config}->{unixfind}->{value}.";".$savedPATH; - print "Info -- Processing prunes in ".`cd`."\n" if ($verbose); - local $pru = $prunes->{Prune}; - local $files = "( "; - local $bFirst = 1; - while (($key, $val) = each %$pru) { - local $flags = $val->{flags}; - $flags = "" if (!$flags); - if (!$bFirst) {$files .= " -or ";} - $bFirst = 0; - $files .= "-".$flags."name $key"; - print "Info -- Looking for filenames matching $key\n" if ($verbose); - } - $files .= " )"; - local $list = `find . $files`; - if (length($list) > 1) { - print "Info -- Pruning $list\n" if ($verbose); - ! system("rm -rf $list") or die "Unable to prune $list"; - } - - $ENV{PATH} = $savedPATH; - } - -return 1; diff --git a/src/windows/build/repository1.pl b/src/windows/build/repository1.pl deleted file mode 100644 index 2f4ee21ae9..0000000000 --- a/src/windows/build/repository1.pl +++ /dev/null @@ -1,90 +0,0 @@ -#!perl -w - -#use strict; - -sub repository1 { - local ($config) = @_; - local $odr = $config->{Config}; ## Options, directories, repository, environment. - local $src = $odr->{src}->{value}; - local $rverb = $odr->{repository}->{value}; - local $wd = $src."\\pismere"; - - if ($rverb =~ /skip/) {print "Info -- *** Skipping repository access.\n" if ($verbose);} - else { - if ($verbose) {print "Info -- *** Begin fetching sources.\n";} - local $cvspath = "$src"; - if (! -d $cvspath) { ## xcopy will create the entire path for us. - !system("echo foo > a.tmp") or die "Fatal -- Couldn't create temporary file in ".`cd`; - !system("echo F | xcopy a.tmp $cvspath\\a.tmp") or die "Fatal -- Couldn't xcopy to $cvspath."; - !system("rm a.tmp") or die "Fatal -- Couldn't remove temporary file."; - !system("rm $cvspath\\a.tmp") or die "Fatal -- Couldn't remove temporary file."; - } - - # Set up cvs environment variables: - $ENV{CVSROOT} = $odr->{CVSROOT}->{value}; - local $krb5dir = "$wd\\athena\\auth\\krb5"; - - local $cvscmdroot = "cvs $rverb"; - if (length $odr->{cvstag}->{value} > 0) { - $cvscmdroot .= " -r $odr->{cvstag}->{value}"; - } - - if ($rverb =~ /checkout/) { - chdir($src) or die "Fatal -- couldn't chdir to $src\n"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - my @cvsmodules = ( - 'krb', - 'pismere/athena/util/lib/delaydlls', - 'pismere/athena/util/lib/getopt', - 'pismere/athena/util/guiwrap' - ); - - foreach my $module (@cvsmodules) { - local $cvscmd = $cvscmdroot." ".$module; - if ($verbose) {print "Info -- cvs command: $cvscmd\n";} - !system($cvscmd) or die "Fatal -- command \"$cvscmd\" failed; return code $?\n"; - } - } - else { ## Update. - chdir($wd) or die "Fatal -- couldn't chdir to $wd\n"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - if ($verbose) {print "Info -- cvs command: $cvscmdroot\n";} - !system($cvscmdroot) or die "Fatal -- command \"$cvscmdroot\" failed; return code $?\n"; - } - - # Set up svn environment variable: - $ENV{SVN_SSH} = "plink.exe"; - # If the directory structure doesn't exist, many cd commands will fail. - if (! -d $krb5dir) { ## xcopy will create the entire path for us. - !system("echo foo > a.tmp") or die "Fatal -- Couldn't create temporary file in ".`cd`; - !system("echo F | xcopy a.tmp $krb5dir\\a.tmp") or die "Fatal -- Couldn't xcopy to $krb5dir."; - !system("rm a.tmp") or die "Fatal -- Couldn't remove temporary file."; - !system("rm $krb5dir\\a.tmp") or die "Fatal -- Couldn't remove temporary file."; - } - - chdir($krb5dir) or die "Fatal -- Couldn't chdir to $krb5dir"; - print "Info -- chdir to ".`cd`."\n" if ($verbose); - my $svncmd = "svn $rverb "; - if ($rverb =~ /checkout/) { # Append the rest of the checkout command: - chdir(".."); - $svncmd .= "svn+ssh://".$odr->{username}->{value}."@".$odr->{SVNURL}->{value}."/krb5/"; - if (length $odr->{svntag}->{value} > 0) { - $svncmd .= "tags/$odr->{svntag}->{value}"; - } - elsif (length $odr->{svnbranch}->{value} > 0) { - $svncmd .= "branches/$odr->{svnbranch}->{value}"; - } - else { - $svncmd .= "trunk"; - } - - $svncmd .= " krb5"; - - } - if ($verbose) {print "Info -- svn command: $svncmd\n";} - !system($svncmd) or die "Fatal -- command \"$svncmd\" failed; return code $?\n"; - if ($verbose) {print "Info -- *** End fetching sources.\n";} - } - } - -return 1; \ No newline at end of file diff --git a/src/windows/build/sdkfiles.xml b/src/windows/build/sdkfiles.xml deleted file mode 100644 index c938107ca5..0000000000 --- a/src/windows/build/sdkfiles.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/windows/build/signFiles.pl b/src/windows/build/signFiles.pl deleted file mode 100644 index ea093b1d7e..0000000000 --- a/src/windows/build/signFiles.pl +++ /dev/null @@ -1,27 +0,0 @@ -#!perl -w - -#use strict; -use Data::Dumper; - -sub signFiles { - local ($signing, $config) = @_; - local $exprs = $signing->{FilePatterns}->{value}; - local $template = $signing->{CommandTemplate}->{value}; - # Use Unix find instead of Windows find. Save PATH so we can restore it when we're done: - local $savedPATH= $ENV{PATH}; - $ENV{PATH} = $config->{Config}->{unixfind}->{value}.";".$savedPATH; - foreach $expr (split(" ", $exprs)) { ## exprs is something like "*.exe *.dll" - local $cmd = "find . -iname \"$expr\""; - local $list = `$cmd`; ## $list is files matching *.exe, for example. - foreach $target (split("\n", $list)) { - $target =~ s|/|\\|g; ## Flip path separators from unix-style to windows-style. - local $template2 = $template; - $template2 =~ s/%filename%/$target/; - print "Info -- Signing $target\n" if ($verbose); - !system("$template2") or die "Fatal -- Error signing $target."; - } - } - $ENV{PATH} = $savedPATH; - } - -return 1; \ No newline at end of file diff --git a/src/windows/build/site-local.sed b/src/windows/build/site-local.sed deleted file mode 100644 index 191d200897..0000000000 --- a/src/windows/build/site-local.sed +++ /dev/null @@ -1,2 +0,0 @@ -s/// -s/// \ No newline at end of file diff --git a/src/windows/build/tee.pl b/src/windows/build/tee.pl deleted file mode 100644 index 2c33370af0..0000000000 --- a/src/windows/build/tee.pl +++ /dev/null @@ -1,79 +0,0 @@ -# Usage 'tee filename' -# Make sure that when using this as a perl pipe you -# print a EOF char! -# (This may be a bug in perl 4 for NT) -# -# Use it like: -# open(PIPE, "|$^X tee.pl foo.log") || die "Can't pipe"; -# open(STDOUT, ">&PIPE") || die "Can't dup pipe to stdout"; -# open(STDERR, ">&PIPE") || die "Can't dup pipe to stderr"; - -use IO::File; - -#$SIG{'INT'} = \&handler; -#$SIG{'QUIT'} = \&handler; - -$SIG{'INT'} = 'IGNORE'; -$SIG{'QUIT'} = \&handler; - -my $fh = new IO::File; - -my $arg = shift; -my $file; -my $access = ">"; - -while ($arg) { - if ($arg =~ /-a/) { - $access = ">>"; - } elsif ($arg =~ /-i/) { - $SIG{'INT'} = 'IGNORE'; - $SIG{'QUIT'} = 'IGNORE'; - } else { - $file = $arg; - last; - } - $arg = shift; -} - -STDOUT->autoflush(1); - -if ($file) { - $fh->open($access.$file) || die "Could not open $file\n"; - $fh->autoflush(1); -} - -while (<>) { - $_ = &logtime.$_; - print $_; - print $fh $_ if $file; -} - -sub logtime { - my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); - $mon = $mon + 1; - $year %= 100; - sprintf ("[%02d/%02d/%02d %02d:%02d:%02d] ", - $year, $mon, $mday, - $hour, $min, $sec); -} - -sub handler { - my $sig = shift; - my $bailmsg = &logtime."Bailing out due to SIG$sig!\n"; - my $warnmsg = <{help} || !$f) { - usage(); - exit(0) if $OPT->{help}; - exit(1); - } - - my $p = $OPT->{path} || $ENV{PATH}; - my $s = $Config{path_sep}; - my @d = split(/$s/, $p); - my @e = split(/$s/, lc($ENV{PATHEXT} || '.bat;.exe;.com')); - my @f = ($f, map { $f.$_; } @e); - my $found = 0; - foreach my $d (@d) { - print "(Searching $d)\n" if $OPT->{debug}; - foreach my $f (@f) { - my $df = $d.'\\'.$f; # cannot use $File::Spec->catfile due to UNC. - print "(Checking for $df)\n" if $OPT->{debug}; - if (-f $df) { - exit(0) if $OPT->{quiet}; - print "$df\n"; - exit(0) if !$OPT->{all}; - $found = 1; - } - } - } - print "Could not find $f\n" if !$found && !$OPT->{quiet}; - exit($found?0:1); -} - -sub usage -{ - print <{Zips}; - if (! $zipsXML) {return 0;} - - local $i = 0; - while ($zipsXML->{Zip}[$i]) { - local $zip = $zipsXML->{Zip}[$i]; - makeZip($zip, $config) if (exists $zip->{name}); ## Ignore dummy entry. - $i++; - } ## End zip in xml. - } - -return 1; diff --git a/src/windows/cns/Makefile.in b/src/windows/cns/Makefile.in deleted file mode 100644 index 75c5e34aba..0000000000 --- a/src/windows/cns/Makefile.in +++ /dev/null @@ -1,76 +0,0 @@ -# Makefile for the Kerberos for Windows ticket manager -# Works for both k4 and k5 releases. -# -NAME = krb5 -OBJS = $(OUTPRE)cns.obj $(OUTPRE)tktlist.obj $(OUTPRE)password.obj $(OUTPRE)options.obj - -##### Options -# Set NODEBUG if building release instead of debug -!IF ! defined(KVERSION) -KVERSION = 5 -!endif -KRB = KRB$(KVERSION) - -!if $(KVERSION) == 4 -BUILDTOP = .. -LIBDIR = $(BUILDTOP)\lib\krb -KLIB = $(LIBDIR)\kerberos.lib -RESFILE = $(OUTPRE)cnsres4.res -XOBJS = $(RESFILE) -LOCALINCLUDES = /I$(BUILDTOP) /I$(BUILDTOP)\include -!endif - -!if $(KVERSION) == 5 -BUILDTOP =..\.. -LIBDIR = $(BUILDTOP)\lib -RESFILE = $(OUTPRE)cnsres5.res -XOBJS = $(RESFILE) $(OUTPRE)kpasswd.obj $(OUTPRE)cns_reg.obj -LOCALINCLUDES = /I$(BUILDTOP) /I$(BUILDTOP)\include /I$(BUILDTOP)\include\krb5 -!endif - -##### C Compiler -#CC = cl -!ifdef NODEBUG -DEFINES = /D$(KRB)=1 -!else -DEFINES = /D$(KRB)=1 /DDEBUG -!endif - -##### RC Compiler -#RC = rc -RFLAGS = /D$(KRB)=1 $(LOCALINCLUDES) -RCFLAGS = $(RFLAGS) -DKRB5_APP - -##### CVSRES -- .res -> .obj converter -CVTRES = cvtres - -##### Linker -LINK = link -LIBS = $(KLIB) $(CLIB) $(WLIB) ../lib/$(OUTPRE)libwin.lib -SYSLIBS = kernel32.lib ws2_32.lib user32.lib gdi32.lib advapi32.lib -LFLAGS = /nologo $(LOPTS) - -all: Makefile $(OUTPRE)$(NAME).exe - -$(OUTPRE)$(NAME).exe: $(NAME).def $(OBJS) $(XOBJS) $(LIBS) - $(LINK) $(LFLAGS) /map:$*.map /out:$@ $(OBJS) $(XOBJS) \ - $(LIBS) $(SYSLIBS) - $(_VC_MANIFEST_EMBED_EXE) - -install: - $(CP) $(OUTPRE)$(NAME).exe $(DESTDIR) - $(CP) krb5.hlp $(DESTDIR) - -clean: - $(RM) $(OUTPRE)*.exe - $(RM) $(OUTPRE)*.res - $(RM) $(OUTPRE)*.map - -$(OBJS): cns.h tktlist.h - -$(RESFILE): cns.h ..\version.rc - -$(RESFILE): clock00.ico clock05.ico clock10.ico clock15.ico clock20.ico \ - clock25.ico clock30.ico clock35.ico clock40.ico clock45.ico \ - clock50.ico clock55.ico clock60.ico clockexp.ico clocktkt.ico \ - cns.ico diff --git a/src/windows/cns/clock00.ico b/src/windows/cns/clock00.ico deleted file mode 100644 index 1c2e424c83..0000000000 Binary files a/src/windows/cns/clock00.ico and /dev/null differ diff --git a/src/windows/cns/clock05.ico b/src/windows/cns/clock05.ico deleted file mode 100644 index 1e092832be..0000000000 Binary files a/src/windows/cns/clock05.ico and /dev/null differ diff --git a/src/windows/cns/clock10.ico b/src/windows/cns/clock10.ico deleted file mode 100644 index 15e00b24af..0000000000 Binary files a/src/windows/cns/clock10.ico and /dev/null differ diff --git a/src/windows/cns/clock15.ico b/src/windows/cns/clock15.ico deleted file mode 100644 index 93a52866c8..0000000000 Binary files a/src/windows/cns/clock15.ico and /dev/null differ diff --git a/src/windows/cns/clock20.ico b/src/windows/cns/clock20.ico deleted file mode 100644 index 5fd55dad65..0000000000 Binary files a/src/windows/cns/clock20.ico and /dev/null differ diff --git a/src/windows/cns/clock25.ico b/src/windows/cns/clock25.ico deleted file mode 100644 index fc163fa23d..0000000000 Binary files a/src/windows/cns/clock25.ico and /dev/null differ diff --git a/src/windows/cns/clock30.ico b/src/windows/cns/clock30.ico deleted file mode 100644 index 3dfd8458d2..0000000000 Binary files a/src/windows/cns/clock30.ico and /dev/null differ diff --git a/src/windows/cns/clock35.ico b/src/windows/cns/clock35.ico deleted file mode 100644 index b508e881d6..0000000000 Binary files a/src/windows/cns/clock35.ico and /dev/null differ diff --git a/src/windows/cns/clock40.ico b/src/windows/cns/clock40.ico deleted file mode 100644 index d7e64a3984..0000000000 Binary files a/src/windows/cns/clock40.ico and /dev/null differ diff --git a/src/windows/cns/clock45.ico b/src/windows/cns/clock45.ico deleted file mode 100644 index e35b2008df..0000000000 Binary files a/src/windows/cns/clock45.ico and /dev/null differ diff --git a/src/windows/cns/clock50.ico b/src/windows/cns/clock50.ico deleted file mode 100644 index b1eaa1c829..0000000000 Binary files a/src/windows/cns/clock50.ico and /dev/null differ diff --git a/src/windows/cns/clock55.ico b/src/windows/cns/clock55.ico deleted file mode 100644 index 845a7b3d78..0000000000 Binary files a/src/windows/cns/clock55.ico and /dev/null differ diff --git a/src/windows/cns/clock60.ico b/src/windows/cns/clock60.ico deleted file mode 100644 index 0e9d6ebd14..0000000000 Binary files a/src/windows/cns/clock60.ico and /dev/null differ diff --git a/src/windows/cns/clockexp.ico b/src/windows/cns/clockexp.ico deleted file mode 100644 index 6a22b90b94..0000000000 Binary files a/src/windows/cns/clockexp.ico and /dev/null differ diff --git a/src/windows/cns/clocktkt.ico b/src/windows/cns/clocktkt.ico deleted file mode 100644 index dc4d246f4a..0000000000 Binary files a/src/windows/cns/clocktkt.ico and /dev/null differ diff --git a/src/windows/cns/cns-help.doc b/src/windows/cns/cns-help.doc deleted file mode 100644 index 6aae7b7528..0000000000 Binary files a/src/windows/cns/cns-help.doc and /dev/null differ diff --git a/src/windows/cns/cns-help.hlp b/src/windows/cns/cns-help.hlp deleted file mode 100644 index a9a00244d5..0000000000 Binary files a/src/windows/cns/cns-help.hlp and /dev/null differ diff --git a/src/windows/cns/cns-help.hpj b/src/windows/cns/cns-help.hpj deleted file mode 100644 index bd668b31cf..0000000000 --- a/src/windows/cns/cns-help.hpj +++ /dev/null @@ -1,133 +0,0 @@ -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; Help Project File for KERBNET -; -; You may edit this file. -; -; It's probably best not to change the CONTENTS= value -; unless you rename the IDH_CONTENTS context string in -; the KERBNET.DOC file. -; - -[OPTIONS] -; The optional ROOT= entry sets the working directory for the Help Compiler -; ROOT=C:\PROJECT - -; The optional BMROOT= entry sets forth the directories which the -; help compiler will search for bitmaps used in the Help system. -; -;BMROOT=C:\ROBOHELP - -; The CONTENTS= tells the help Engine which topic contains the contents -CONTENTS=IDH_CONTENTS - -; Title is Displayed in the Title Bar of WINHELP.EXE -TITLE=Kerb*Net - -; The BUILD= setting allows complex Help systems which require -; different versions to use the same source. This is similar to #ifdef's -; in the 'C' language. Everything to the right of the = sign in the -; BUILD= statement is an EXPRESSION. See the Help compiler -; documentation for more information about build expressions. -BUILD=WINDOWS - -; The Warning Level is used by the Help Compiler (HC.EXE) -; WARNING=1 - Only the most severe warnings are reported -; WARNING=2 - Intermediate Level of warnings -; WARNING=3 - Most stringent error reporting - -; The Compress option is used by the Help Compiler to make -; smaller, faster loading .HLP files. However, using compression -; increases Compile times. -; COMPRESS=YES, ON, OFF, NO, TRUE or FALSE - - -OLDKEYPHRASE=NO -OPTCDROM=0 -NOTES=1 -REPORT=YES -COMPRESS=12 -ERRORLOG=C:\krbhelp\KERBNET.ERR -[BUILDTAGS] -; The Build Tags section specifies to the Help Compiler the names -; of all the valid build tags used in this Help project. The [BUILDTAGS] -; section is optional. -WINDOWS - - -[CONFIG] -; The config section allows you to define some macros which will be -; executed when the help system is first executed. -; -; The next line gives you browse buttons: -; -BrowseButtons() - -; -; To create a glossary button which displays a list of defined terms -; in a secondary window, remove the semi colon at the start of the next -; line and do the same with the Glossary window in the [WINDOWS] section -;CreateButton("Glossary_Btn","&Glossary","JI(`bubble.hlp>Gloss',`IDH_Glossary')") -; - - -[FILES] -; The files section is where you specify to the Help Compiler which -; Rich Text Format (.RTF) (your help source) files will be used in the -; Help system. RoboHELP generates and maintains the main .RTF -; file for your Help System. If you desire to have multiple .RTF files, -; simply add the additonal names to the [FILES] section. - -KERBNET.RTF -[ALIAS] -; The Alias section allows you to set up aliases for context strings -; in your help system. -; -; Brief example: -; -; IDH_UserID = IDH_RoboGenerated_Id -; IDH_WMP_MenuID = IDH_RoboGenerated_Id -; IDH_Any = IDH_AnyOther - -[MAP] -; -; The Map Section is where the C language #defines are translated -; or mapped into the Help System Context Strings. Standard C syntax -; can be employed. The .HH file is meant to be #include(d) into your -; Windows application source code. -; - -[BITMAPS] -; -; The [BITMAPS] section is where you list any Bitmaps which have -; been placed by reference in the Help System. See the Help compiler -; documentation for more information about placing bitmaps. -; -; The [BITMAPS] section is not really required under Windows 3.1, -; with the advent of the BMROOT item in the [OPTIONS] section. -; -;FOO1.BMP -;FOO2.BMP -;C:\FOO\FOO3.BMP -;And So On - -[WINDOWS] -; Windows Help can display help in one of 5 secondary windows. -; Before using a secondary window, the window must be defined -; in this section: -; -;Gloss = "Glossary",(100,100,350,350),0,(255,255,255),(255,255,255) -main=,,0,, - -[BAGGAGE] -; -; The Baggage section allows the user to include files which -; will be placed in the internal file system for WinHelp. -; Using files from Baggage is a little faster for CDROM, since -; the CDROM drive table does not need to be read from disk. -; -; Baggage files are referred to as regular bitmaps, except -; that you prefix the filename with '!'. -; -; For Instance: -; {bmc !bitmap.bmp} instead of {bmc bitmap.bmp} -; diff --git a/src/windows/cns/cns.c b/src/windows/cns/cns.c deleted file mode 100644 index 8e40a807a8..0000000000 --- a/src/windows/cns/cns.c +++ /dev/null @@ -1,2196 +0,0 @@ -/* windows/cns/cns.c */ -/* - * Copyright 1994 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - */ - -/* - * Main routine of the Kerberos user interface. Also handles - * all dialog level management functions. - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cns.h" -#include "tktlist.h" -#include "cns_reg.h" - -#include "../lib/gic.h" - -enum { /* Actions after login */ - LOGIN_AND_EXIT, - LOGIN_AND_MINIMIZE, - LOGIN_AND_RUN, -}; - -/* - * Globals - */ -static HICON kwin_icons[MAX_ICONS]; /* Icons depicting time */ -HFONT hfontdialog = NULL; /* Font in which the dialog is drawn. */ -static HFONT hfonticon = NULL; /* Font for icon label */ -HINSTANCE hinstance; -static int dlgncmdshow; /* ncmdshow from WinMain */ -#if 0 -static UINT wm_kerberos_changed; /* message for cache changing */ -#endif -static int action; /* After login actions */ -static UINT kwin_timer_id; /* Timer being used for update */ -BOOL alert; /* Actions on ticket expiration */ -BOOL beep; -static BOOL alerted; /* TRUE when user already alerted */ -BOOL isblocking = FALSE; /* TRUE when blocked in WinSock */ -static DWORD blocking_end_time; /* Ending count for blocking timeout */ -static FARPROC hook_instance; /* handle for blocking hook function */ - -char confname[FILENAME_MAX]; /* krb5.conf (or krb.conf for krb4) */ - -#ifdef KRB5 -char ccname[FILENAME_MAX]; /* ccache file location */ -BOOL forwardable; /* TRUE to get forwardable tickets */ -BOOL noaddresses; -krb5_context k5_context; -krb5_ccache k5_ccache; -#endif - -/* - * Function: Called during blocking operations. Implement a timeout - * if nothing occurs within the specified time, cancel the blocking - * operation. Also permit the user to press escape in order to - * cancel the blocking operation. - * - * Returns: TRUE if we got and dispatched a message, FALSE otherwise. - */ -BOOL CALLBACK -blocking_hook_proc(void) -{ - MSG msg; - BOOL rc; - - if (GetTickCount() > blocking_end_time) { - WSACancelBlockingCall(); - return FALSE; - } - - rc = (BOOL)PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); - if (!rc) - return FALSE; - - if (msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE) { - WSACancelBlockingCall(); - blocking_end_time = msg.time - 1; - return FALSE; - } - - TranslateMessage(&msg); - DispatchMessage(&msg); - - return TRUE; -} - - -/* - * Function: Set up a blocking hook function. - * - * Parameters: - * timeout - # of seconds to block for before cancelling. - */ -void -start_blocking_hook(int timeout) -{ - FARPROC proc; - - if (isblocking) - return; - - isblocking = TRUE; - blocking_end_time = GetTickCount() + (1000 * timeout); -#ifdef _WIN32 - proc = WSASetBlockingHook(blocking_hook_proc); -#else - hook_instance = MakeProcInstance(blocking_hook_proc, hinstance); - proc = WSASetBlockingHook(hook_instance); -#endif - assert(proc != NULL); -} - - -/* - * Function: End the blocking hook fuction set up above. - */ -void -end_blocking_hook(void) -{ -#ifndef _WIN32 - FreeProcInstance(hook_instance); -#endif - WSAUnhookBlockingHook(); - isblocking = FALSE; -} - - -/* - * Function: Centers the specified window on the screen. - * - * Parameters: - * hwnd - the window to center on the screen. - */ -void -center_dialog(HWND hwnd) -{ - int scrwidth, scrheight; - int dlgwidth, dlgheight; - RECT r; - HDC hdc; - - if (hwnd == NULL) - return; - - GetWindowRect(hwnd, &r); - dlgwidth = r.right - r.left; - dlgheight = r.bottom - r.top ; - hdc = GetDC(NULL); - scrwidth = GetDeviceCaps(hdc, HORZRES); - scrheight = GetDeviceCaps(hdc, VERTRES); - ReleaseDC(NULL, hdc); - r.left = (scrwidth - dlgwidth) / 2; - r.top = (scrheight - dlgheight) / 2; - MoveWindow(hwnd, r.left, r.top, dlgwidth, dlgheight, TRUE); -} - - -/* - * Function: Positions the kwin dialog either to the saved location - * or the center of the screen if no saved location. - * - * Parameters: - * hwnd - the window to center on the screen. - */ -static void -position_dialog(HWND hwnd) -{ - int scrwidth, scrheight; - HDC hdc; - int x, y, cx, cy; - - if (hwnd == NULL) - return; - - hdc = GetDC(NULL); - scrwidth = GetDeviceCaps(hdc, HORZRES); - scrheight = GetDeviceCaps(hdc, VERTRES); - ReleaseDC(NULL, hdc); - x = cns_res.x; - y = cns_res.y; - cx = cns_res.cx; - cy = cns_res.cy; - - if (x > scrwidth || - y > scrheight || - x + cx <= 0 || - y + cy <= 0) - center_dialog(hwnd); - else - MoveWindow(hwnd, x, y, cx, cy, TRUE); -} - - -/* - * Function: Set font of all dialog items. - * - * Parameters: - * hwnd - the dialog to set the font of - */ -void -set_dialog_font(HWND hwnd, HFONT hfont) -{ - hwnd = GetWindow(hwnd, GW_CHILD); - - while (hwnd != NULL) { - SetWindowFont(hwnd, hfont, 0); - hwnd = GetWindow(hwnd, GW_HWNDNEXT); - } -} - - -/* - * Function: Trim leading and trailing white space from a string. - * - * Parameters: - * s - the string to trim. - */ -void -trim(char *s) -{ - int l; - int i; - - for (i = 0 ; s[i] ; i++) - if (s[i] != ' ' && s[i] != '\t') - break; - - l = strlen(&s[i]); - memmove(s, &s[i], l + 1); - - for (l--; l >= 0; l--) { - if (s[l] != ' ' && s[l] != '\t') - break; - } - s[l + 1] = 0; -} - - -/* - * Function: This routine figures out the current time epoch and - * returns the conversion factor. It exists because Microloss - * screwed the pooch on the time() and _ftime() calls in its release - * 7.0 libraries. They changed the epoch to Dec 31, 1899! - */ -time_t -kwin_get_epoch(void) -{ - static struct tm jan_1_70 = {0, 0, 0, 1, 0, 70}; - time_t epoch = 0; - - epoch = -mktime(&jan_1_70); /* Seconds til 1970 localtime */ - epoch += _timezone; /* Seconds til 1970 GMT */ - - return epoch; -} - - -/* - * Function: Save the credentials for later restoration. - * - * Parameters: - * c - Returned pointer to saved credential cache. - * - * pname - Returned as principal name of session. - * - * pinstance - Returned as principal instance of session. - * - * ncred - Returned number of credentials saved. - */ -static void -push_credentials(CREDENTIALS **cp, char *pname, char *pinstance, int *ncred) -{ -#ifdef KRB4 - int i; - char service[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; - CREDENTIALS *c; - - if (krb_get_tf_fullname(NULL, pname, pinstance, NULL) != KSUCCESS) { - pname[0] = 0; - - pinstance[0] = 0; - } - - *ncred = krb_get_num_cred(); - if (*ncred <= 0) - return; - - c= malloc(*ncred * sizeof(CREDENTIALS)); - assert(c != NULL); - if (c == NULL) { - *ncred = 0; - - return; - } - - for (i = 0; i < *ncred; i++) { - krb_get_nth_cred(service, instance, realm, i + 1); - krb_get_cred(service, instance, realm, &c[i]); - } - - *cp = c; -#endif - -#ifdef KRB5 /* FIXME */ - return; -#endif -} - - -/* - * Function: Restore the saved credentials. - * - * c - Pointer to saved credential cache. - * - * pname - Principal name of session. - * - * pinstance - Principal instance of session. - * - * ncred - Number of credentials saved. - */ -static void -pop_credentials(CREDENTIALS *c, char *pname, char *pinstance, int ncred) -{ -#ifdef KRB4 - int i; - - if (pname[0]) - in_tkt(pname, pinstance); - else - dest_tkt(); - - if (ncred <= 0) - return; - - for (i = 0; i < ncred; i++) { - krb_save_credentials(c[i].service, c[i].instance, c[i].realm, - c[i].session, c[i].lifetime, c[i].kvno, - &(c[i].ticket_st), - c[i].issue_date); - } - - free(c); -#endif -#ifdef KRB5 /* FIXME */ - return; -#endif -} - - -/* - * Function: Save most recent login triplets for placement on the - * bottom of the file menu. - * - * Parameters: - * hwnd - the handle of the window containing the menu to edit. - * - * name - A login name to save in the recent login list - * - * instance - An instance to save in the recent login list - * - * realm - A realm to save in the recent login list - */ -static void -kwin_push_login(HWND hwnd, char *name, char *instance, char *realm) -{ - HMENU hmenu; - int i; - int id; - int ctitems; - char fullname[MAX_K_NAME_SZ + 3]; - char menuitem[MAX_K_NAME_SZ + 3]; - BOOL rc; - - fullname[sizeof(fullname) - 1] = '\0'; - strncpy(fullname, "&x ", sizeof(fullname) - 1); - strncat(fullname, name, sizeof(fullname) - 1 - strlen(fullname)); - strncat(fullname, ".", sizeof(fullname) - 1 - strlen(fullname)); - strncat(fullname, instance, sizeof(fullname) - 1 - strlen(fullname)); - strncat(fullname, "@", sizeof(fullname) - 1 - strlen(fullname)); - strncat(fullname, realm, sizeof(fullname) - 1 - strlen(fullname)); - - hmenu = GetMenu(hwnd); - assert(hmenu != NULL); - - hmenu = GetSubMenu(hmenu, 0); - assert(hmenu != NULL); - - ctitems = GetMenuItemCount(hmenu); - assert(ctitems >= FILE_MENU_ITEMS); - - if (ctitems == FILE_MENU_ITEMS) { - rc = AppendMenu(hmenu, MF_SEPARATOR, 0, NULL); - assert(rc); - - ctitems++; - } - - for (i = FILE_MENU_ITEMS + 1; i < ctitems; i++) { - GetMenuString(hmenu, i, menuitem, sizeof(menuitem), MF_BYPOSITION); - - if (strcmp(&fullname[3], &menuitem[3]) == 0) { - rc = RemoveMenu(hmenu, i, MF_BYPOSITION); - assert(rc); - - ctitems--; - - break; - } - } - - rc = InsertMenu(hmenu, FILE_MENU_ITEMS + 1, MF_BYPOSITION, 1, fullname); - assert(rc); - - ctitems++; - if (ctitems - FILE_MENU_ITEMS - 1 > FILE_MENU_MAX_LOGINS) { - RemoveMenu(hmenu, ctitems - 1, MF_BYPOSITION); - - ctitems--; - } - - id = 0; - for (i = FILE_MENU_ITEMS + 1; i < ctitems; i++) { - GetMenuString(hmenu, i, menuitem, sizeof(menuitem), MF_BYPOSITION); - - rc = RemoveMenu(hmenu, i, MF_BYPOSITION); - assert(rc); - - menuitem[1] = '1' + id; - rc = InsertMenu(hmenu, i, MF_BYPOSITION, IDM_FIRST_LOGIN + id, menuitem); - assert(rc); - - id++; - } -} - - -/* - * Function: Initialize the logins on the file menu form the KERBEROS.INI - * file. - * - * Parameters: - * hwnd - handle of the dialog containing the file menu. - */ -static void -kwin_init_file_menu(HWND hwnd) -{ - HMENU hmenu; - int i; - char menuitem[MAX_K_NAME_SZ + 3]; - int id; - BOOL rc; - - hmenu = GetMenu(hwnd); - assert(hmenu != NULL); - - hmenu = GetSubMenu(hmenu, 0); - assert(hmenu != NULL); - - id = 0; - for (i = 0; i < FILE_MENU_MAX_LOGINS; i++) { - strcpy(menuitem + 3, cns_res.logins[i]); - - if (!menuitem[3]) - continue; - - menuitem[0] = '&'; - menuitem[1] = '1' + id; - menuitem[2] = ' '; - - if (id == 0) { - rc = AppendMenu(hmenu, MF_SEPARATOR, 0, NULL); - assert(rc); - } - AppendMenu(hmenu, MF_STRING, IDM_FIRST_LOGIN + id, menuitem); - - id++; - } -} - - -/* - * Function: Save the items on the file menu in the KERBEROS.INI file. - * - * Parameters: - * hwnd - handle of the dialog containing the file menu. - */ -static void -kwin_save_file_menu(HWND hwnd) -{ - HMENU hmenu; - int i; - int id; - int ctitems; - char menuitem[MAX_K_NAME_SZ + 3]; - - hmenu = GetMenu(hwnd); - assert(hmenu != NULL); - - hmenu = GetSubMenu(hmenu, 0); - assert(hmenu != NULL); - - ctitems = GetMenuItemCount(hmenu); - assert(ctitems >= FILE_MENU_ITEMS); - - id = 0; - for (i = FILE_MENU_ITEMS + 1; i < ctitems; i++) { - GetMenuString(hmenu, i, menuitem, sizeof(menuitem), MF_BYPOSITION); - - strcpy(cns_res.logins[id], menuitem + 3); - - id++; - } -} - - - -/* - * Function: Given an expiration time, choose an appropriate - * icon to display. - * - * Parameters: - * expiration time of expiration in time() compatible units - * - * Returns: Handle of icon to display - */ -HICON -kwin_get_icon(time_t expiration) -{ - int ixicon; - time_t dt; - - dt = expiration - time(NULL); - dt = dt / 60; /* convert to minutes */ - if (dt <= 0) - ixicon = IDI_EXPIRED - IDI_FIRST_CLOCK; - else if (dt > 60) - ixicon = IDI_TICKET - IDI_FIRST_CLOCK; - else - ixicon = (int)(dt / 5); - - return kwin_icons[ixicon]; -} - - -/* - * Function: Intialize name fields in the Kerberos dialog. - * - * Parameters: - * hwnd - the window recieving the message. - * - * fullname - the full kerberos name to initialize with - */ -void -kwin_init_name(HWND hwnd, char *fullname) -{ - char name[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; - int krc; -#ifdef KRB5 - krb5_error_code code; - char *ptr; -#endif - - if (fullname == NULL || fullname[0] == 0) { -#ifdef KRB4 - strcpy(name, krb_get_default_user()); - strcpy(instance, cns_res.instance); - krc = krb_get_lrealm(realm, 1); - if (krc != KSUCCESS) - realm[0] = 0; - strcpy(realm, cns_res.realm); -#endif /* KRB4 */ - -#ifdef KRB5 - strcpy(name, cns_res.name); - - *realm = '\0'; - code = krb5_get_default_realm(k5_context, &ptr); - if (!code) { - strcpy(realm, ptr); - /* free(ptr); XXX */ - } - strcpy(realm, cns_res.realm); -#endif /* KRB5 */ - - } else { -#ifdef KRB4 - kname_parse(name, instance, realm, fullname); - SetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance); -#endif - -#ifdef KRB5 - krc = k5_kname_parse(name, realm, fullname); - *instance = '\0'; -#endif - } - - SetDlgItemText(hwnd, IDD_LOGIN_NAME, name); - SetDlgItemText(hwnd, IDD_LOGIN_REALM, realm); -} - - -/* - * Function: Set the focus to the name control if no name - * exists, the realm control if no realm exists or the - * password control. Uses PostMessage not SetFocus. - * - * Parameters: - * hwnd - the Window handle of the parent. - */ -void -kwin_set_default_focus(HWND hwnd) -{ - char name[ANAME_SZ]; - char realm[REALM_SZ]; - HWND hwnditem; - - GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); - - trim(name); - if (strlen(name) <= 0) - hwnditem = GetDlgItem(hwnd, IDD_LOGIN_NAME); - else { - GetDlgItemText(hwnd, IDD_LOGIN_REALM, realm, sizeof(realm)); - trim(realm); - - if (strlen(realm) <= 0) - hwnditem = GetDlgItem(hwnd, IDD_LOGIN_REALM); - else - hwnditem = GetDlgItem(hwnd, IDD_LOGIN_PASSWORD); - } - - PostMessage(hwnd, WM_NEXTDLGCTL, (WPARAM)hwnditem, MAKELONG(1, 0)); -} - - -/* - * Function: Save the values which live in the KERBEROS.INI file. - * - * Parameters: - * hwnd - the window handle of the dialog containing fields to - * be saved - */ -static void -kwin_save_name(HWND hwnd) -{ - char name[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; - - GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); - trim(name); - -#ifdef KRB4 - krb_set_default_user(name); - GetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); - trim(instance); - strcpy(cns_res.instance, instance); -#endif - -#ifdef KRB5 - strcpy(cns_res.name, name); - *instance = '\0'; -#endif - - GetDlgItemText(hwnd, IDD_LOGIN_REALM, realm, sizeof(realm)); - trim(realm); - strcpy(cns_res.realm, realm); - - kwin_push_login(hwnd, name, instance, realm); -} - - -/* - * Function: Process WM_INITDIALOG messages. Set the fonts - * for all items on the dialog and populate the ticket list. - * Also set the default values for user, instance and realm. - * - * Returns: TRUE if we didn't set the focus here, - * FALSE if we did. - */ -static BOOL -kwin_initdialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) -{ - LOGFONT lf; - HDC hdc; - char name[ANAME_SZ]; - - position_dialog(hwnd); - ticket_init_list(GetDlgItem(hwnd, IDD_TICKET_LIST)); - kwin_init_file_menu(hwnd); - kwin_init_name(hwnd, (char *)lParam); - hdc = GetDC(NULL); - assert(hdc != NULL); - - memset(&lf, 0, sizeof(lf)); - lf.lfHeight = -MulDiv(9, GetDeviceCaps(hdc, LOGPIXELSY), 72); - strcpy(lf.lfFaceName, "Arial"); - hfontdialog = CreateFontIndirect(&lf); - assert(hfontdialog != NULL); - - if (hfontdialog == NULL) { - ReleaseDC(NULL, hdc); - - return TRUE; - } - - lf.lfHeight = -MulDiv(8, GetDeviceCaps(hdc, LOGPIXELSY), 72); - hfonticon = CreateFontIndirect(&lf); - assert(hfonticon != NULL); - - if (hfonticon == NULL) { - ReleaseDC(NULL, hdc); - - return TRUE; - } - - ReleaseDC(NULL, hdc); - - set_dialog_font(hwnd, hfontdialog); - GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); - trim(name); - - if (strlen(name) > 0) - SetFocus(GetDlgItem(hwnd, IDD_LOGIN_PASSWORD)); - else - SetFocus(GetDlgItem(hwnd, IDD_LOGIN_NAME)); - - ShowWindow(hwnd, dlgncmdshow); - - kwin_timer_id = SetTimer(hwnd, 1, KWIN_UPDATE_PERIOD, NULL); - assert(kwin_timer_id != 0); - - return FALSE; -} - - -/* - * Function: Process WM_DESTROY messages. Delete the font - * created for use by the controls. - */ -static void -kwin_destroy(HWND hwnd) -{ - RECT r; - - ticket_destroy(GetDlgItem(hwnd, IDD_TICKET_LIST)); - - if (hfontdialog != NULL) - DeleteObject(hfontdialog); - - if (hfonticon != NULL) - DeleteObject(hfonticon); - - kwin_save_file_menu(hwnd); - GetWindowRect(hwnd, &r); - cns_res.x = r.left; - cns_res.y = r.top; - cns_res.cx = r.right - r.left; - cns_res.cy = r.bottom - r.top; - - KillTimer(hwnd, kwin_timer_id); -} - - -/* - * Function: Retrievs item WindowRect in hwnd client - * coordiate system. - * - * Parameters: - * hwnditem - the item to retrieve - * - * item - dialog in which into which to translate - * - * r - rectangle returned - */ -static void -windowrect(HWND hwnditem, HWND hwnd, RECT *r) -{ - GetWindowRect(hwnditem, r); - ScreenToClient(hwnd, (LPPOINT)&(r->left)); - ScreenToClient(hwnd, (LPPOINT)&(r->right)); -} - - -/* - * Function: Process WM_SIZE messages. Resize the - * list and position the buttons attractively. - */ -static void -kwin_size(HWND hwnd, UINT state, int cxdlg, int cydlg) -{ -#define listgap 8 - RECT r; - RECT rdlg; - int hmargin, vmargin; - HWND hwnditem; - int cx, cy; - int i; - int titlebottom; - int editbottom; - int listbottom; - int gap; - int left; - int titleleft[IDD_MAX_TITLE - IDD_MIN_TITLE + 1]; - - if (state == SIZE_MINIMIZED) - return; - - GetClientRect(hwnd, &rdlg); - - /* - * The ticket list title - */ - hwnditem = GetDlgItem(hwnd, IDD_TICKET_LIST_TITLE); - - if (hwnditem == NULL) - return; - - windowrect(hwnditem, hwnd, &r); - hmargin = r.left; - vmargin = r.top; - cx = cxdlg - 2 * hmargin; - cy = r.bottom - r.top; - MoveWindow(hwnditem, r.left, r.top, cx, cy, TRUE); - - /* - * The buttons - */ - cx = 0; - - for (i = IDD_MIN_BUTTON; i <= IDD_MAX_BUTTON; i++) { - hwnditem = GetDlgItem(hwnd, i); - windowrect(hwnditem, hwnd, &r); - if (i == IDD_MIN_BUTTON) - hmargin = r.left; - - cx += r.right - r.left; - } - - gap = (cxdlg - 2 * hmargin - cx) / (IDD_MAX_BUTTON - IDD_MIN_BUTTON); - left = hmargin; - for (i = IDD_MIN_BUTTON; i <= IDD_MAX_BUTTON; i++) { - hwnditem = GetDlgItem(hwnd, i); - windowrect(hwnditem, hwnd, &r); - editbottom = -r.top; - cx = r.right - r.left; - cy = r.bottom - r.top; - r.top = rdlg.bottom - vmargin - cy; - MoveWindow(hwnditem, left, r.top, cx, cy, TRUE); - - left += cx + gap; - } - - /* - * Edit fields: stretch boxes, keeping the gap between boxes equal to - * what it was on entry. - */ - editbottom += r.top; - - hwnditem = GetDlgItem(hwnd, IDD_MIN_EDIT); - windowrect(hwnditem, hwnd, &r); - gap = r.right; - hmargin = r.left; - editbottom += r.bottom; - titlebottom = -r.top; - - hwnditem = GetDlgItem(hwnd, IDD_MIN_EDIT + 1); - windowrect(hwnditem, hwnd, &r); - gap = r.left - gap; - - cx = cxdlg - 2 * hmargin - (IDD_MAX_EDIT - IDD_MIN_EDIT) * gap; - cx = cx / (IDD_MAX_EDIT - IDD_MIN_EDIT + 1); - left = hmargin; - - for (i = IDD_MIN_EDIT; i <= IDD_MAX_EDIT; i++) { - hwnditem = GetDlgItem(hwnd, i); - windowrect(hwnditem, hwnd, &r); - cy = r.bottom - r.top; - r.top = editbottom - cy; - MoveWindow(hwnditem, left, r.top, cx, cy, TRUE); - titleleft[i-IDD_MIN_EDIT] = left; - - left += cx + gap; - } - - /* - * Edit field titles - */ - titlebottom += r.top; - windowrect(GetDlgItem(hwnd, IDD_MIN_TITLE), hwnd, &r); - titlebottom += r.bottom; - listbottom = -r.top; - - for (i = IDD_MIN_TITLE; i <= IDD_MAX_TITLE; i++) { - hwnditem = GetDlgItem(hwnd, i); - windowrect(hwnditem, hwnd, &r); - cx = r.right - r.left; - cy = r.bottom - r.top; - r.top = titlebottom - cy; - MoveWindow(hwnditem, titleleft[i-IDD_MIN_TITLE], r.top, cx, cy, TRUE); - } - - /* - * The list - */ - listbottom = r.top - listgap; - hwnditem = GetDlgItem(hwnd, IDD_TICKET_LIST); - windowrect(hwnditem, hwnd, &r); - hmargin = r.left; - cx = cxdlg - 2 * hmargin; - cy = listbottom - r.top; - MoveWindow(hwnditem, r.left, r.top, cx, cy, TRUE); -} - - -/* - * Function: Process WM_GETMINMAXINFO messages - */ -static void -kwin_getminmaxinfo(HWND hwnd, LPMINMAXINFO lpmmi) -{ - lpmmi->ptMinTrackSize.x = - (KWIN_MIN_WIDTH * LOWORD(GetDialogBaseUnits())) / 4; - - lpmmi->ptMinTrackSize.y = - (KWIN_MIN_HEIGHT * HIWORD(GetDialogBaseUnits())) / 8; -} - - -/* - * Function: Process WM_TIMER messages - */ -static void -kwin_timer(HWND hwnd, UINT timer_id) -{ - HWND hwndfocus; - time_t t; - time_t expiration; - BOOL expired; -#ifdef KRB4 - CREDENTIALS c; - int ncred; - int i; - char service[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; -#endif -#ifdef KRB5 - krb5_error_code code; - krb5_cc_cursor cursor; - krb5_creds cred; - int n; - char *s; -#endif - - if (timer_id != 1) { - FORWARD_WM_TIMER(hwnd, timer_id, DefDlgProc); - return; - } - - expired = FALSE; - ticket_init_list(GetDlgItem(hwnd, IDD_TICKET_LIST)); - - if (alerted) { - if (IsIconic(hwnd)) - InvalidateRect(hwnd, NULL, TRUE); - - return; - } - -#ifdef KRB4 - ncred = krb_get_num_cred(); - for (i = 1; i <= ncred; i++) { - krb_get_nth_cred(service, instance, realm, i); - - if (_stricmp(service, "krbtgt") == 0) { - /* Warn if ticket will expire w/i TIME_BUFFER seconds */ - krb_get_cred(service, instance, realm, &c); - expiration = c.issue_date + (long)c.lifetime * 5L * 60L; - t = TIME_BUFFER + time(NULL); - - if (t >= expiration) { - expired = TRUE; - /* Don't alert because of stale tickets */ - if (t >= expiration + KWIN_UPDATE_PERIOD / 1000) { - alerted = TRUE; - - if (IsIconic(hwnd)) - InvalidateRect(hwnd, NULL, TRUE); - return; - } - break; - } - } - } -#endif - -#ifdef KRB5 - code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor); - - while (code == 0) { - code = krb5_cc_next_cred(k5_context, k5_ccache, &cursor, &cred); - if (code) - break; - n = krb5_princ_component(k5_context, cred.server, 0)->length; - s = krb5_princ_component(k5_context, cred.server, 0)->data; - if (n != KRB5_TGS_NAME_SIZE) - continue; - if (memcmp(KRB5_TGS_NAME, s, KRB5_TGS_NAME_SIZE)) - continue; - - /* Warn if ticket will expire w/i TIME_BUFFER seconds */ - expiration = cred.times.endtime; - t = TIME_BUFFER + time(NULL); - - if (t >= expiration) { - expired = TRUE; - /* Don't alert because of stale tickets */ - if (t >= expiration + KWIN_UPDATE_PERIOD / 1000) { - alerted = TRUE; - - if (IsIconic(hwnd)) - InvalidateRect(hwnd, NULL, TRUE); - return; - } - break; - } - } - if (code == 0 || code == KRB5_CC_END) - krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); - -#endif - - if (!expired) { - if (IsIconic(hwnd)) - InvalidateRect(hwnd, NULL, TRUE); - - return; - } - - alerted = TRUE; - - if (beep) - MessageBeep(MB_ICONEXCLAMATION); - - if (alert) { - if (IsIconic(hwnd)) { - hwndfocus = GetFocus(); - ShowWindow(hwnd, SW_RESTORE); - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); - SetFocus(hwndfocus); - } - - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, - SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); - - return; - } - - if (IsIconic(hwnd)) - InvalidateRect(hwnd, NULL, TRUE); -} - -/* - * Function: Process WM_COMMAND messages - */ -static void -kwin_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify) -{ - char name[ANAME_SZ]; - char realm[REALM_SZ]; - char password[MAX_KPW_LEN]; - HCURSOR hcursor; - BOOL blogin; - HMENU hmenu; - char menuitem[MAX_K_NAME_SZ + 3]; - char copyright[128]; - int id; -#ifdef KRB4 - char instance[INST_SZ]; - int lifetime; - int krc; -#endif -#ifdef KRB5 - long lifetime; - krb5_error_code code; - krb5_principal principal; - krb5_creds creds; - krb5_get_init_creds_opt opts; - gic_data gd; -#endif - -#ifdef KRB4 - EnableWindow(GetDlgItem(hwnd, IDD_TICKET_DELETE), krb_get_num_cred() > 0); -#endif - -#ifdef KRB5 - EnableWindow(GetDlgItem(hwnd, IDD_TICKET_DELETE), k5_get_num_cred(1) > 0); -#endif - - GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); - trim(name); - blogin = strlen(name) > 0; - - if (blogin) { - GetDlgItemText(hwnd, IDD_LOGIN_REALM, realm, sizeof(realm)); - trim(realm); - blogin = strlen(realm) > 0; - } - - if (blogin) { - GetDlgItemText(hwnd, IDD_LOGIN_PASSWORD, password, sizeof(password)); - blogin = strlen(password) > 0; - } - - EnableWindow(GetDlgItem(hwnd, IDD_LOGIN), blogin); - id = (blogin) ? IDD_LOGIN : IDD_PASSWORD_CR2; - SendMessage(hwnd, DM_SETDEFID, id, 0); - - if (codeNotify != BN_CLICKED && codeNotify != 0 && codeNotify != 1) - return; /* FALSE */ - - /* - * Check to see if this item is in a list of the ``recent hosts'' sort - * of list, under the FILE menu. - */ - if (cid >= IDM_FIRST_LOGIN && cid < IDM_FIRST_LOGIN + FILE_MENU_MAX_LOGINS) { - hmenu = GetMenu(hwnd); - assert(hmenu != NULL); - - hmenu = GetSubMenu(hmenu, 0); - assert(hmenu != NULL); - - if (!GetMenuString(hmenu, cid, menuitem, sizeof(menuitem), MF_BYCOMMAND)) - return; /* TRUE */ - - if (menuitem[0]) - kwin_init_name(hwnd, &menuitem[3]); - - return; /* TRUE */ - } - - switch (cid) { - case IDM_EXIT: - if (isblocking) - WSACancelBlockingCall(); - WinHelp(hwnd, KERBEROS_HLP, HELP_QUIT, 0); - PostQuitMessage(0); - - return; /* TRUE */ - - case IDD_PASSWORD_CR2: /* Make CR == TAB */ - id = GetDlgCtrlID(GetFocus()); - assert(id != 0); - - if (id == IDD_MAX_EDIT) - PostMessage(hwnd, WM_NEXTDLGCTL, - (WPARAM)GetDlgItem(hwnd, IDD_MIN_EDIT), MAKELONG(1, 0)); - else - PostMessage(hwnd, WM_NEXTDLGCTL, 0, 0); - - return; /* TRUE */ - - case IDD_LOGIN: - if (isblocking) - return; /* TRUE */ - - GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); - trim(name); - GetDlgItemText(hwnd, IDD_LOGIN_REALM, realm, sizeof(realm)); - trim(realm); - GetDlgItemText(hwnd, IDD_LOGIN_PASSWORD, password, sizeof(password)); - SetDlgItemText(hwnd, IDD_LOGIN_PASSWORD, ""); /* nuke the password */ - trim(password); - -#ifdef KRB4 - GetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); - trim(instance); -#endif - - hcursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); - lifetime = cns_res.lifetime; - start_blocking_hook(BLOCK_MAX_SEC); - -#ifdef KRB4 - lifetime = (lifetime + 4) / 5; - krc = krb_get_pw_in_tkt(name, instance, realm, "krbtgt", realm, - lifetime, password); -#endif - -#ifdef KRB5 - principal = NULL; - - /* - * convert the name + realm into a krb5 principal string and parse it into a principal - */ - sprintf(menuitem, "%s@%s", name, realm); - code = krb5_parse_name(k5_context, menuitem, &principal); - if (code) - goto errorpoint; - - /* - * set the various ticket options. First, initialize the structure, then set the ticket - * to be forwardable if desired, and set the lifetime. - */ - krb5_get_init_creds_opt_init(&opts); - krb5_get_init_creds_opt_set_forwardable(&opts, forwardable); - krb5_get_init_creds_opt_set_tkt_life(&opts, lifetime * 60); - if (noaddresses) { - krb5_get_init_creds_opt_set_address_list(&opts, NULL); - } - - /* - * get the initial creds using the password and the options we set above - */ - gd.hinstance = hinstance; - gd.hwnd = hwnd; - gd.id = ID_VARDLG; - code = krb5_get_init_creds_password(k5_context, &creds, principal, password, - gic_prompter, &gd, 0, NULL, &opts); - if (code) - goto errorpoint; - - /* - * initialize the credential cache - */ - code = krb5_cc_initialize(k5_context, k5_ccache, principal); - if (code) - goto errorpoint; - - /* - * insert the principal into the cache - */ - code = krb5_cc_store_cred(k5_context, k5_ccache, &creds); - - errorpoint: - - if (principal) - krb5_free_principal(k5_context, principal); - - end_blocking_hook(); - SetCursor(hcursor); - kwin_set_default_focus(hwnd); - - if (code) { - if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) - MessageBox(hwnd, "Password incorrect", NULL, - MB_OK | MB_ICONEXCLAMATION); - else - com_err(NULL, code, "while logging in"); - } -#endif /* KRB5 */ - -#ifdef KRB4 - if (krc != KSUCCESS) { - MessageBox(hwnd, krb_get_err_text(krc), "", - MB_OK | MB_ICONEXCLAMATION); - - return; /* TRUE */ - } -#endif - - kwin_save_name(hwnd); - alerted = FALSE; - - switch (action) { - case LOGIN_AND_EXIT: - SendMessage(hwnd, WM_COMMAND, GET_WM_COMMAND_MPS(IDM_EXIT, 0, 0)); - break; - - case LOGIN_AND_MINIMIZE: - ShowWindow(hwnd, SW_MINIMIZE); - break; - } - - return; /* TRUE */ - - case IDD_TICKET_DELETE: - if (isblocking) - return; /* TRUE */ - -#ifdef KRB4 - krc = dest_tkt(); - if (krc != KSUCCESS) - MessageBox(hwnd, krb_get_err_text(krc), "", - MB_OK | MB_ICONEXCLAMATION); -#endif - -#ifdef KRB5 - code = k5_dest_tkt(); -#endif - - kwin_set_default_focus(hwnd); - alerted = FALSE; - - return; /* TRUE */ - - case IDD_CHANGE_PASSWORD: - if (isblocking) - return; /* TRUE */ - password_dialog(hwnd); - kwin_set_default_focus(hwnd); - - return; /* TRUE */ - - case IDM_OPTIONS: - if (isblocking) - return; /* TRUE */ - opts_dialog(hwnd); - - return; /* TRUE */ - - case IDM_HELP_INDEX: - WinHelp(hwnd, KERBEROS_HLP, HELP_INDEX, 0); - - return; /* TRUE */ - - case IDM_ABOUT: - ticket_init_list(GetDlgItem(hwnd, IDD_TICKET_LIST)); - if (isblocking) - return; /* TRUE */ - -#ifdef KRB4 - strcpy(copyright, " Kerberos 4 for Windows "); -#endif -#ifdef KRB5 - strcpy(copyright, " Kerberos V5 for Windows "); -#endif -#ifdef _WIN32 - strncat(copyright, "32-bit\n", sizeof(copyright) - 1 - strlen(copyright)); -#else - strncat(copyright, "16-bit\n", sizeof(copyright) - 1 - strlen(copyright)); -#endif - strncat(copyright, "\n Version 1.12\n\n", - sizeof(copyright) - 1 - strlen(copyright)); -#ifdef ORGANIZATION - strncat(copyright, " For information, contact:\n", - sizeof(copyright) - 1 - strlen(copyright)); - strncat(copyright, ORGANIZATION, sizeof(copyright) - 1 - strlen(copyright)); -#endif - MessageBox(hwnd, copyright, KWIN_DIALOG_NAME, MB_OK); - - return; /* TRUE */ - } - - return; /* FALSE */ -} - - -/* - * Function: Process WM_SYSCOMMAND messages by setting - * the focus to the password or name on restore. - */ -static void -kwin_syscommand(HWND hwnd, UINT cmd, int x, int y) -{ - if (cmd == SC_RESTORE) - kwin_set_default_focus(hwnd); - - if (cmd == SC_CLOSE) { - SendMessage(hwnd, WM_COMMAND, GET_WM_COMMAND_MPS(IDM_EXIT, 0, 0)); - return; - } - - FORWARD_WM_SYSCOMMAND(hwnd, cmd, x, y, DefDlgProc); -} - - -/* - * Function: Process WM_PAINT messages by displaying an - * informative icon when we are iconic. - */ -static void -kwin_paint(HWND hwnd) -{ - HDC hdc; - PAINTSTRUCT ps; - HICON hicon; - time_t expiration = 0; - time_t dt; - char buf[20]; - RECT r; -#ifdef KRB4 - int i; - int ncred; - char service[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; - CREDENTIALS c; -#endif -#ifdef KRB5 - krb5_error_code code; - krb5_cc_cursor cursor; - krb5_creds c; - int n; - char *service; -#endif - - if (!IsIconic(hwnd)) { - FORWARD_WM_PAINT(hwnd, DefDlgProc); - return; - } - -#ifdef KRB4 - ncred = krb_get_num_cred(); - - for (i = 1; i <= ncred; i++) { - krb_get_nth_cred(service, instance, realm, i); - krb_get_cred(service, instance, realm, &c); - if (_stricmp(c.service, "krbtgt") == 0) { - expiration = c.issue_date - kwin_get_epoch() - + (long)c.lifetime * 5L * 60L; - break; - } - } -#endif - -#ifdef KRB5 - code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor); - - while (code == 0) { - code = krb5_cc_next_cred(k5_context, k5_ccache, &cursor, &c); - if (code) - break; - n = krb5_princ_component(k5_context, c.server, 0)->length; - service = krb5_princ_component(k5_context, c.server, 0)->data; - if (n != KRB5_TGS_NAME_SIZE) - continue; - if (memcmp(KRB5_TGS_NAME, service, KRB5_TGS_NAME_SIZE)) - continue; - expiration = c.times.endtime; - break; - - } - if (code == 0 || code == KRB5_CC_END) - krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); -#endif - - hdc = BeginPaint(hwnd, &ps); - GetClientRect(hwnd, &r); - DefWindowProc(hwnd, WM_ICONERASEBKGND, (WPARAM)hdc, 0); - - if (expiration == 0) { - strcpy(buf, KWIN_DIALOG_NAME); - hicon = LoadIcon(hinstance, MAKEINTRESOURCE(IDI_KWIN)); - } - else { - hicon = kwin_get_icon(expiration); - dt = (expiration - time(NULL)) / 60; - - if (dt <= 0) - sprintf(buf, "%s - %s", KWIN_DIALOG_NAME, "Expired"); - else if (dt < 60) { - dt %= 60; - sprintf(buf, "%s - %ld min", KWIN_DIALOG_NAME, dt); - } - else { - dt /= 60; - sprintf(buf, "%s - %ld hr", KWIN_DIALOG_NAME, dt); - } - - buf[sizeof(buf) - 1] = '\0'; - if (dt > 1) - strncat(buf, "s", sizeof(buf) - 1 - strlen(buf)); - } - - DrawIcon(hdc, r.left, r.top, hicon); - EndPaint(hwnd, &ps); - SetWindowText(hwnd, buf); -} - - -/* - * Function: Window procedure for the Kerberos control panel dialog. - */ -LRESULT CALLBACK -kwin_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - -#if 0 - if (message == wm_kerberos_changed) { /* Message from the ccache */ - n = ticket_init_list(GetDlgItem(hwnd, IDD_TICKET_LIST)); - EnableWindow(GetDlgItem(hwnd, IDD_TICKET_DELETE), n > 0); - - return 0; - } -#endif - - switch (message) { - HANDLE_MSG(hwnd, WM_GETMINMAXINFO, kwin_getminmaxinfo); - - HANDLE_MSG(hwnd, WM_DESTROY, kwin_destroy); - - HANDLE_MSG(hwnd, WM_MEASUREITEM, ticket_measureitem); - - HANDLE_MSG(hwnd, WM_DRAWITEM, ticket_drawitem); - - case WM_SETCURSOR: - if (isblocking) { - SetCursor(LoadCursor(NULL, IDC_WAIT)); - return TRUE; - } - break; - - HANDLE_MSG(hwnd, WM_SIZE, kwin_size); - - HANDLE_MSG(hwnd, WM_SYSCOMMAND, kwin_syscommand); - - HANDLE_MSG(hwnd, WM_TIMER, kwin_timer); - - HANDLE_MSG(hwnd, WM_PAINT, kwin_paint); - - case WM_ERASEBKGND: - if (!IsIconic(hwnd)) - break; - return 0; - - case WM_KWIN_SETNAME: - kwin_init_name(hwnd, (char *)lParam); - } - - return DefDlgProc(hwnd, message, wParam, lParam); -} - - -/* - * Function: Dialog procedure called by the dialog manager - * to process dialog specific messages. - */ -static BOOL CALLBACK -kwin_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - HANDLE_MSG(hwnd, WM_INITDIALOG, kwin_initdialog); - - HANDLE_MSG(hwnd, WM_COMMAND, kwin_command); - } - - return FALSE; -} - - -/* - * Function: Initialize the kwin dialog class. - * - * Parameters: - * hinstance - the instance to initialize - * - * Returns: TRUE if dialog class registration is sucessfully, false otherwise. - */ -static BOOL -kwin_init(HINSTANCE hinstance) -{ - WNDCLASS class; - ATOM rc; - - class.style = CS_HREDRAW | CS_VREDRAW; - class.lpfnWndProc = (WNDPROC)kwin_wnd_proc; - class.cbClsExtra = 0; - class.cbWndExtra = DLGWINDOWEXTRA; - class.hInstance = hinstance; - class.hIcon = NULL; - /* LoadIcon(hinstance, MAKEINTRESOURCE(IDI_KWIN)); */ - class.hCursor = NULL; - class.hbrBackground = NULL; - class.lpszMenuName = NULL; - class.lpszClassName = KWIN_DIALOG_CLASS; - - rc = RegisterClass(&class); - assert(rc); - - return rc; -} - - -/* - * Function: Initialize the KWIN application. This routine should - * only be called if no previous instance of the application - * exists. Currently it only registers a class for the kwin - * dialog type. - * - * Parameters: - * hinstance - the instance to initialize - * - * Returns: TRUE if initialized sucessfully, false otherwise. - */ -static BOOL -init_application(HINSTANCE hinstance) -{ - BOOL rc; - -#if 0 -#ifdef KRB4 - wm_kerberos_changed = krb_get_notification_message(); -#endif - -#ifdef KRB5 - wm_kerberos_changed = krb5_get_notification_message(); -#endif -#endif - - rc = kwin_init(hinstance); - - return rc; -} - - -/* - * Function: Quits the KWIN application. This routine should - * be called when the last application instance exits. - * - * Parameters: - * hinstance - the instance which is quitting. - * - * Returns: TRUE if initialized sucessfully, false otherwise. - */ -static BOOL -quit_application(HINSTANCE hinstance) -{ - return TRUE; -} - - -/* - * Function: Initialize the current instance of the KWIN application. - * - * Parameters: - * hinstance - the instance to initialize - * - * ncmdshow - show flag to indicate wheather to come up minimized - * or not. - * - * Returns: TRUE if initialized sucessfully, false otherwise. - */ -static BOOL -init_instance(HINSTANCE hinstance, int ncmdshow) -{ - WORD versionrequested; - WSADATA wsadata; - int rc; - int i; - - versionrequested = 0x0101; /* We need version 1.1 */ - rc = WSAStartup(versionrequested, &wsadata); - if (rc != 0) { - MessageBox(NULL, "Couldn't initialize Winsock library", "", - MB_OK | MB_ICONSTOP); - - return FALSE; - } - - if (versionrequested != wsadata.wVersion) { - WSACleanup(); - MessageBox(NULL, "Winsock version 1.1 not available", "", - MB_OK | MB_ICONSTOP); - - return FALSE; - } - -#ifdef KRB5 - { - krb5_error_code code; - - code = krb5_init_context(&k5_context); - if (!code) { -#if 0 /* Not needed under windows */ - krb5_init_ets(k5_context); -#endif - code = k5_init_ccache(&k5_ccache); - } - if (code) { - com_err(NULL, code, "while initializing program"); - return FALSE; - } - k5_name_from_ccache(k5_ccache); - } -#endif - - cns_load_registry(); - - /* - * Set up expiration action - */ - alert = cns_res.alert; - beep = cns_res.beep; - - /* - * ticket options - */ - forwardable = cns_res.forwardable; - noaddresses = cns_res.noaddresses; - - /* - * Load clock icons - */ - for (i = IDI_FIRST_CLOCK; i <= IDI_LAST_CLOCK; i++) - kwin_icons[i - IDI_FIRST_CLOCK] = LoadIcon(hinstance, MAKEINTRESOURCE(i)); - -#ifdef KRB4 - krb_start_session(NULL); -#endif - - return TRUE; -} - - -/* - * Function: Quits the current instance of the KWIN application. - * - * Parameters: - * hinstance - the instance to quit. - * - * Returns: TRUE if termination was sucessfully, false otherwise. - */ -static BOOL -quit_instance(HINSTANCE hinstance) -{ - int i; - -#ifdef KRB4 - krb_end_session(NULL); -#endif - -#ifdef KRB5 /* FIXME */ - krb5_cc_close(k5_context, k5_ccache); -#endif - - WSACleanup(); - - /* - * Unload clock icons - */ - for (i = IDI_FIRST_CLOCK; i <= IDI_LAST_CLOCK; i++) - DestroyIcon(kwin_icons[i - IDI_FIRST_CLOCK]); - - return TRUE; -} - - -/* - * Function: Main routine called on program invocation. - * - * Parameters: - * hinstance - the current instance - * - * hprevinstance - previous instance if one exists or NULL. - * - * cmdline - the command line string passed by Windows. - * - * ncmdshow - show flag to indicate wheather to come up minimized - * or not. - * - * Returns: TRUE if initialized sucessfully, false otherwise. - */ -int PASCAL -WinMain(HINSTANCE hinst, HINSTANCE hprevinstance, LPSTR cmdline, int ncmdshow) -{ - DLGPROC dlgproc; - HWND hwnd; - HACCEL haccel; - MSG msg; - char *p; - char buf[MAX_K_NAME_SZ + 9]; - char name[MAX_K_NAME_SZ]; - - strcpy(buf, cmdline); - action = LOGIN_AND_RUN; - name[0] = 0; - p = strtok(buf, " ,"); - - while (p != NULL) { - if (_stricmp(p, "/exit") == 0) - action = LOGIN_AND_EXIT; - else if (_stricmp(p, "/minimize") == 0) - action = LOGIN_AND_MINIMIZE; - else - strcpy(name, p); - - p = strtok(NULL, " ,"); - } - - dlgncmdshow = ncmdshow; - hinstance = hinst; - -#ifndef _WIN32 - /* - * If a previous instance of this application exits, bring it - * to the front and exit. - * - * This code is not compiled for WIN32, since hprevinstance will always - * be NULL. - */ - if (hprevinstance != NULL) { - hwnd = FindWindow(KWIN_DIALOG_CLASS, NULL); - - if (IsWindow(hwnd) && IsWindowVisible(hwnd)) { - if (GetWindowWord(hwnd, GWW_HINSTANCE) == hprevinstance) { - if (name[0]) - SendMessage(hwnd, WM_KWIN_SETNAME, 0, (LONG)name); - - ShowWindow(hwnd, ncmdshow); - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, - SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); - - return FALSE; - } - } - } - - if (hprevinstance == NULL) -#endif /* _WIN32 */ - - if (!init_application(hinstance)) - return FALSE; - - if (!init_instance(hinstance, ncmdshow)) - return FALSE; - -#ifdef _WIN32 - dlgproc = kwin_dlg_proc; -#else - dlgproc = (FARPROC)MakeProcInstance(kwin_dlg_proc, hinstance); - assert(dlgproc != NULL); - - if (dlgproc == NULL) - return 1; -#endif - - hwnd = CreateDialogParam(hinstance, MAKEINTRESOURCE(ID_KWIN), - HWND_DESKTOP, dlgproc, (LONG)name); - assert(hwnd != NULL); - - if (hwnd == NULL) - return 1; - haccel = LoadAccelerators(hinstance, MAKEINTRESOURCE(IDA_KWIN)); - assert(hwnd != NULL); - - while (GetMessage(&msg, NULL, 0, 0)) { - if (!TranslateAccelerator(hwnd, haccel, &msg) && - !IsDialogMessage(hwnd, &msg)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - DestroyWindow(hwnd); - -#ifndef _WIN32 - FreeProcInstance((FARPROC)dlgproc); -#endif - - cns_save_registry(); - - return 0; -} - - -#if 0 - -#define WM_ASYNC_COMPLETED (WM_USER + 1) -#define GETHOSTBYNAME_CLASS "krb_gethostbyname" -static HTASK htaskasync; /* Asynchronos call in progress */ -static BOOL iscompleted; /* True when async call is completed */ - -/* - * This routine is called to cancel a blocking hook call within - * the Kerberos library. The need for this routine arises due - * to bugs which exist in existing WINSOCK implementations. We - * blocking gethostbyname with WSAASyncGetHostByName. In order - * to cancel such an operation, this routine must be called. - * Applications may call this routine in addition to calls to - * WSACancelBlockingCall to get any sucy Async calls canceled. - * Return values are as they would be for WSACancelAsyncRequest. - */ -int -krb_cancel_blocking_call(void) -{ - if (htaskasync == NULL) - return 0; - iscompleted = TRUE; - - return WSACancelAsyncRequest(htask); -} - - -/* - * Window proceedure for temporary Windows created in - * krb_gethostbyname. Fields completion messages. - */ -LRESULT CALLBACK -krb_gethostbyname_wnd_proc(HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam) -{ - if (message == WM_ASYNC_COMPLETED) { - iscompleted = TRUE; - return 0; - } - - return DefWindowProc(hwnd, message, wParam, lParam); -} - - -/* - * The WINSOCK routine gethostbyname has a bug in both FTP and NetManage - * implementations which causes the blocking hook, if any, not to be - * called. This routine attempts to work around the problem by using - * the async routines to emulate the functionality of the synchronous - * routines - */ -struct hostent *PASCAL -krb_gethostbyname( - const char *name) -{ - HWND hwnd; - char buf[MAXGETHOSTSTRUCT]; - BOOL FARPROC blockinghook; - WNDCLASS wc; - static BOOL isregistered; - - blockinghook = WSASetBlockingHook(NULL); - WSASetBlockingHook(blockinghook); - - if (blockinghook == NULL) - return gethostbyname(name); - - if (RegisterWndClass() == NULL) - return gethostbyname(name); - - if (!isregistered) { - wc.style = 0; - wc.lpfnWndProc = gethostbyname_wnd_proc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hlibinstance; - wc.hIcon = NULL; - wc.hCursor = NULL; - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = GETHOSTBYNAME_CLASS; - - if (!RegisterClass(&wc)) - return gethostbyname(name); - - isregistered = TRUE; - } - - hwnd = CreateWindow(GETHOSTBYNAME_CLASS, "", WS_OVERLAPPED, - -100, -100, 0, 0, HWND_DESKTOP, NULL, hlibinstance, NULL); - if (hwnd == NULL) - return gethostbyname(name); - - htaskasync = - WSAAsyncGetHostByName(hwnd, WM_ASYNC_COMPLETED, name, buf, sizeof(buf)); - b = blockinghook(NULL); -} - -#endif /* if 0 */ - -#ifdef KRB5 - -/* - * Function: destroys all tickets in a k5 ccache - * - * Returns: K5 error code (0 == success) - */ -krb5_error_code -k5_dest_tkt(void) -{ - krb5_error_code code; - krb5_principal princ; - - if (code = krb5_cc_get_principal(k5_context, k5_ccache, &princ)) { - com_err(NULL, code, "while retrieving principal name"); - return code; - } - - code = krb5_cc_initialize(k5_context, k5_ccache, princ); - if (code != 0) { - com_err(NULL, code, "when re-initializing cache"); - krb5_free_principal(k5_context, princ); - return code; - } - - krb5_free_principal(k5_context, princ); - - return code; -} - -/* - * - * k5_get_num_cred - * - * Returns: number of creds in the credential cache, -1 on error - * - */ -int -k5_get_num_cred(int verbose) -{ - krb5_error_code code; - krb5_cc_cursor cursor; - krb5_creds c; - int ncreds = 0; - - if (code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor)) { - if (code == KRB5_FCC_NOFILE) - return 0; - if (verbose) - com_err(NULL, code, "while starting to retrieve tickets."); - return -1; - } - - while (1) { /* Loop and get creds */ - code = krb5_cc_next_cred(k5_context, k5_ccache, &cursor, &c); - if (code) - break; - ++ncreds; - } - - if (code != KRB5_CC_END) { /* Error while looping??? */ - if (verbose) - com_err(NULL, code, "while retrieving a ticket."); - return -1; - } - - if (code = krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor)) { - if (verbose) - com_err(NULL, code, "while closing ccache."); - } - - return ncreds; -} - -static int -k5_get_num_cred2() -{ - krb5_error_code code; - krb5_cc_cursor cursor; - krb5_creds c; - int ncreds = 0; - - code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor); - if (code == KRB5_FCC_NOFILE) - return 0; - - while (1) { - code = krb5_cc_next_cred(k5_context, k5_ccache, &cursor, &c); - if (code) - break; - ++ncreds; - } - - if (code == KRB5_CC_END) - krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); - - return ncreds; -} - - -/* - * Function: Parses fullname into name and realm - * - * Parameters: - * name - buffer filled with name of user - * realm - buffer filled with realm of user - * fullname - string in form name.instance@realm - * - * Returns: 0 - */ -int -k5_kname_parse(char *name, char *realm, char *fullname) -{ - char *ptr; /* For parsing */ - - ptr = strchr(fullname, '@'); /* Name, realm separator */ - - if (ptr != NULL) /* Get realm */ - strcpy(realm, ptr + 1); - else - *realm = '\0'; - - if (ptr != NULL) { /* Get the name */ - strncpy(name, fullname, ptr - fullname); - name[ptr - fullname] = '\0'; - } else - strcpy(name, fullname); - - ptr = strchr(name, '.'); /* K4 compatability */ - if (ptr != NULL) - *ptr = '\0'; - - return 0; -} - - -/* - * Function: Initializes ccache and catches illegal caches such as - * bad format or no permissions. - * - * Parameters: - * ccache - credential cache structure to use - * - * Returns: krb5_error_code - */ -krb5_error_code -k5_init_ccache(krb5_ccache *ccache) -{ - krb5_error_code code; - krb5_principal princ; - FILE *fp; - - code = krb5_cc_default(k5_context, ccache); /* Initialize the ccache */ - if (code) - return code; - - code = krb5_cc_get_principal(k5_context, *ccache, &princ); - if (code == KRB5_FCC_NOFILE) { /* Doesn't exist yet */ - fp = fopen(krb5_cc_get_name(k5_context, *ccache), "w"); - if (fp == NULL) /* Can't open it */ - return KRB5_FCC_PERM; - fclose (fp); - } - - if (code) { /* Bad, delete and try again */ - remove(krb5_cc_get_name(k5_context, *ccache)); - code = krb5_cc_get_principal(k5_context, *ccache, &princ); - if (code == KRB5_FCC_NOFILE) /* Doesn't exist yet */ - return 0; - if (code) - return code; - } - - /* krb5_free_principal(k5_context, princ); */ - - return 0; -} - - -/* - * - * Function: Reads the name and realm out of the ccache. - * - * Parameters: - * ccache - credentials cache to get info from - * - * name - buffer to hold user name - * - * realm - buffer to hold the realm - * - * - * Returns: TRUE if read names, FALSE if not - * - */ -int -k5_name_from_ccache(krb5_ccache k5_ccache) -{ - krb5_error_code code; - krb5_principal princ; - char name[ANAME_SZ]; - char realm[REALM_SZ]; - char *defname; - - if (code = krb5_cc_get_principal(k5_context, k5_ccache, &princ)) - return FALSE; - - code = krb5_unparse_name(k5_context, princ, &defname); - if (code) { - return FALSE; - } - - k5_kname_parse(name, realm, defname); /* Extract the components */ - strcpy(cns_res.name, name); - strcpy(cns_res.realm, realm); - - return TRUE; -} -#endif /* KRB5 */ diff --git a/src/windows/cns/cns.h b/src/windows/cns/cns.h deleted file mode 100644 index cdd6da3b39..0000000000 --- a/src/windows/cns/cns.h +++ /dev/null @@ -1,249 +0,0 @@ -/* - * cns.h - * - * Public Domain -- written by Cygnus Support. - */ - -/* Only one time, please */ -#ifndef KWIN_DEFS -#define KWIN_DEFS - -#if !defined(KRB4) && !defined(KRB5) -#define KRB5 -#endif - -#ifndef RC_INVOKED - -#ifdef KRB4 -#include "mit-copyright.h" -#include "krb.h" -#include "kadm.h" -#include "org.h" -#endif - -#ifdef KRB5 -#include "winsock.h" -#include "krb5.h" -#include "krbini.h" -#include "com_err.h" - -#define DEFAULT_TKT_LIFE 120 /* In 5 minute units */ -#define ANAME_SZ 40 -#define REALM_SZ 40 -#define SNAME_SZ 40 -#define INST_SZ 40 -#define MAX_KPW_LEN 128 -/* include space for '.' and '@' */ -#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2) -#ifdef CYGNUS -#define ORGANIZATION "Cygnus Solutions\n(800)CYGNUS-1\nhttp://www.cygnus.com\ninfo@cygnus.com" -#endif -#define CREDENTIALS char -#endif - -/* - * Constants - */ -#define BLOCK_MAX_SEC 30 /* Blocking timeout duration */ -#define KWIN_UPDATE_PERIOD 30000 /* Every 30 seconds update the screen */ -#define TIME_BUFFER 300 /* Pop-up time buffer in seconds */ -#define WM_KWIN_SETNAME (WM_USER+100) /* Sets the name fields in the dialog */ - -#endif /* RC_INVOKED */ - -/* - * Menu items - */ -#define FILE_MENU_ITEMS 3 -#define FILE_MENU_MAX_LOGINS 5 -#define IDM_KWIN 1000 -#define IDM_OPTIONS 1001 -#define IDM_EXIT 1002 -#define IDM_FIRST_LOGIN 1003 - -#define IDM_HELP_INDEX 1020 -#define IDM_ABOUT 1021 - -/* - * Accelerator - */ -#define IDA_KWIN 2000 - -/* - * Dialog and dialog item ids - */ -#define KWIN_DIALOG_CLASS "KERBEROS" /* class for kerberos dialog */ -#define KWIN_DIALOG_NAME "Krb5" /* name for kerberos dialog */ - -#define ID_KWIN 100 /* the main kerberos dialog */ -#define IDD_KWIN_FIRST 101 -#define IDD_TICKET_LIST_TITLE 101 -#define IDD_TICKET_LIST 102 - -#ifdef KRB4 - -#define IDD_MIN_TITLE 103 -#define IDD_LOGIN_NAME_TITLE 103 -#define IDD_LOGIN_INSTANCE_TITLE 104 -#define IDD_LOGIN_REALM_TITLE 105 -#define IDD_LOGIN_PASSWORD_TITLE 106 -#define IDD_MAX_TITLE 106 - -#define IDD_MIN_EDIT 107 -#define IDD_LOGIN_NAME 107 -#define IDD_LOGIN_INSTANCE 108 -#define IDD_LOGIN_REALM 109 -#define IDD_LOGIN_PASSWORD 110 -#define IDD_MAX_EDIT 110 - -#endif - -#ifdef KRB5 - -#define IDD_MIN_TITLE 103 -#define IDD_LOGIN_NAME_TITLE 103 -#define IDD_LOGIN_PASSWORD_TITLE 104 -#define IDD_LOGIN_REALM_TITLE 105 -#define IDD_MAX_TITLE 105 - -#define IDD_MIN_EDIT 107 -#define IDD_LOGIN_NAME 107 -#define IDD_LOGIN_PASSWORD 108 -#define IDD_LOGIN_REALM 109 -#define IDD_MAX_EDIT 109 - -#endif - -#define IDD_MIN_BUTTON 111 -#define IDD_CHANGE_PASSWORD 111 -#define IDD_TICKET_DELETE 112 -#define IDD_LOGIN 113 -#define IDD_MAX_BUTTON 113 -#define IDD_PASSWORD_CR2 114 /* For better cr handling */ - -#define IDD_KWIN_LAST 114 - - -#define ID_PASSWORD 200 -#define IDD_PASSWORD_NAME 204 -#define IDD_PASSWORD_INSTANCE 205 -#define IDD_PASSWORD_REALM 206 -#define IDD_OLD_PASSWORD 207 -#define IDD_NEW_PASSWORD1 208 -#define IDD_NEW_PASSWORD2 209 -#define IDD_PASSWORD_CR 210 - - -#define ID_OPTS 300 -#define IDD_CONF 301 -#define IDD_REALMS 302 -#define IDD_LIFETIME 303 -#define IDD_CCACHE 304 -#define IDD_ACTIONS 310 -#define IDD_BEEP 311 -#define IDD_ALERT 312 -#define IDD_TKOPT 320 -#define IDD_FORWARDABLE 321 -#define IDD_NOADDRESSES 322 - -/* - * the entire range (400 through 499) is reserved for the blasted variable - * dialog box thingie. - */ -#define ID_VARDLG 400 - -/* - * Dialog dimensions - */ -#define KWIN_MIN_WIDTH 180 -#define KWIN_MIN_HEIGHT 110 - -/* - * Icons - */ -#define IDI_KWIN 1 /* The program icon */ - -#define ICON_WIDTH 30 /* Width used with icons */ -#define ICON_HEIGHT 20 /* Height used with icons */ - -#define IDI_FIRST_CLOCK 2 -#define IDI_0_MIN 2 /* < 5 minutes left */ -#define IDI_5_MIN 3 -#define IDI_10_MIN 4 -#define IDI_15_MIN 5 -#define IDI_20_MIN 6 -#define IDI_25_MIN 7 -#define IDI_30_MIN 8 -#define IDI_35_MIN 9 -#define IDI_40_MIN 10 -#define IDI_45_MIN 11 -#define IDI_50_MIN 12 -#define IDI_55_MIN 13 -#define IDI_60_MIN 14 -#define IDI_EXPIRED 15 -#define IDI_TICKET 16 -#define IDI_LAST_CLOCK 16 -#define MAX_ICONS (IDI_LAST_CLOCK - IDI_FIRST_CLOCK + 1) - -#ifndef RC_INVOKED - -extern BOOL isblocking; -extern HFONT hfontdialog; -extern HINSTANCE hinstance; -extern BOOL alert; -extern BOOL beep; - -extern char confname[FILENAME_MAX]; - -#ifdef KRB5 -extern krb5_context k5_context; -extern krb5_ccache k5_ccache; -extern char ccname[FILENAME_MAX]; -extern BOOL forwardable; -extern BOOL noaddresses; -#endif - -/* - * Prototypes - */ - -/* in cns.c */ - -void kwin_init_name(HWND, char *); -void kwin_set_default_focus(HWND); -time_t kwin_get_epoch(void); - -/* in options.c */ -BOOL opts_initdialog(HWND, HWND, LPARAM); -void opts_command(HWND, int, HWND, UINT); -BOOL CALLBACK opts_dlg_proc(HWND, UINT, WPARAM, LPARAM); -BOOL opts_dialog(HWND); - -/* in password.c */ -BOOL change_password(HWND, char *, char *, char *, char *, char *); -void password_command(HWND, int, HWND, UINT); -BOOL password_initdialog(HWND, HWND, LPARAM); -BOOL CALLBACK password_dlg_proc(HWND, UINT, WPARAM, LPARAM); -BOOL password_dialog(HWND); - -#ifdef KRB5 -krb5_error_code k5_dest_tkt(void); -int k5_get_num_cred(int); -int k5_kname_parse(char *, char *, char *); -krb5_error_code k5_init_ccache(krb5_ccache *); -int k5_name_from_ccache(krb5_ccache); -krb5_error_code k5_change_password(HWND, krb5_context, char *, char *, char *, - char *, char **); - -#endif /* KRB5 */ - -HICON kwin_get_icon(time_t); -void trim(char *); -void start_blocking_hook(int); -void end_blocking_hook(void); -void center_dialog(HWND); -void set_dialog_font(HWND, HFONT); - -#endif /* RC_INVOKED */ - -#endif diff --git a/src/windows/cns/cns.ico b/src/windows/cns/cns.ico deleted file mode 100644 index 645efa5ba0..0000000000 Binary files a/src/windows/cns/cns.ico and /dev/null differ diff --git a/src/windows/cns/cns_reg.c b/src/windows/cns/cns_reg.c deleted file mode 100644 index 357e5d636f..0000000000 --- a/src/windows/cns/cns_reg.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 1997 Cygnus Solutions - * - * Author: Michael Graff - */ - -#include -#include -#include -#include - -#include "cns.h" -#include "cns_reg.h" - -#include "../lib/registry.h" - -cns_reg_t cns_res; /* yes, a global. Sue me. */ - -/* - * function to load all the data we will want from the registry. If the - * registry data cannot be found this function will initialize a default - * environment. - */ -void -cns_load_registry(void) -{ - char tmp[1024]; - DWORD tdw; - char *ts; - HKEY key; - int i; - - /* - * Set up reasonable default values. These will all be overwritten if - * the registry is successfully opened. - */ - cns_res.name[0] = '\0'; - cns_res.realm[0] = '\0'; - cns_res.x = 0; - cns_res.y = 0; - cns_res.cx = 0; - cns_res.cy = 0; - - cns_res.alert = 0; - cns_res.beep = 0; - cns_res.lifetime = DEFAULT_TKT_LIFE * 5; - cns_res.forwardable = 1; - cns_res.noaddresses = 0; - - for (i = 1 ; i < FILE_MENU_MAX_LOGINS ; i++) - cns_res.logins[i][0] = '\0'; - - /* - * by default, allow the user to override the config file location and NOT the - * cred cache name. - */ - cns_res.conf_override = 1; - cns_res.cc_override = 0; - - { - char *s; - s = krb5_cc_default_name(k5_context); - - strcpy(cns_res.def_ccname, s); - } - - cns_res.def_confname[0] = '\0'; - - /* - * If the system has these keys in the registry, do not allow the user to - * override the config file and ccache locations. - */ - key = registry_open(HKEY_LOCAL_MACHINE, KERBNET_BASE, KEY_READ); - if (key != INVALID_HANDLE_VALUE) { - if (registry_string_get(key, KERBNET_HOME, &ts) == 0) { - cns_res.conf_override = 0; - cns_res.def_confname[sizeof(cns_res.def_confname) - 1]; - strncpy(cns_res.def_confname, ts, - sizeof(cns_res.def_confname) - 1); - strncat(cns_res.def_confname, "\\etc\\krb5.conf", - sizeof(cns_res.def_confname) - 1 - - strlen(cns_res.def_confname)); - free(ts); - } - - if (registry_string_get(key, "ccname", &ts) == 0) { - cns_res.cc_override = 0; - strcpy(cns_res.def_ccname, ts); - free(ts); - } - } - - /* - * Try to open the registry. If we succeed, read the last used values from there. If we - * do not get the registry open simply return. - */ - key = registry_open(HKEY_CURRENT_USER, KERBNET_CNS_BASE, KEY_ALL_ACCESS); - - if (key == INVALID_HANDLE_VALUE) - return; - - if (registry_dword_get(key, "x", &tdw) == 0) - cns_res.x = tdw; - - if (registry_dword_get(key, "y", &tdw) == 0) - cns_res.y = tdw; - - if (registry_dword_get(key, "cx", &tdw) == 0) - cns_res.cx = tdw; - - if (registry_dword_get(key, "cy", &tdw) == 0) - cns_res.cy = tdw; - - if (registry_dword_get(key, "lifetime", &tdw) == 0) - cns_res.lifetime = tdw; - - if (registry_dword_get(key, "forwardable", &tdw) == 0) - cns_res.forwardable = tdw; - - if (registry_dword_get(key, "noaddresses", &tdw) == 0) - cns_res.noaddresses = tdw; - - if (registry_dword_get(key, "alert", &tdw) == 0) - cns_res.alert = tdw; - - if (registry_dword_get(key, "beep", &tdw) == 0) - cns_res.beep = tdw; - - if (registry_string_get(key, "name", &ts) == 0) { - strcpy(cns_res.name, ts); - free(ts); - } - - if (registry_string_get(key, "realm", &ts) == 0) { - strcpy(cns_res.realm, ts); - free(ts); - } - - if (cns_res.conf_override && (registry_string_get(key, "confname", &ts) == 0)) { - strcpy(cns_res.confname, ts); - free(ts); - } else - strcpy(cns_res.confname, cns_res.def_confname); - - if (cns_res.cc_override && (registry_string_get(key, "ccname", &ts) == 0)) { - strcpy(cns_res.ccname, ts); - free(ts); - } else - strcpy(cns_res.ccname, cns_res.def_ccname); - - for (i = 0 ; i < FILE_MENU_MAX_LOGINS ; i++) { - sprintf(tmp, "login_%02d", i); - if (registry_string_get(key, tmp, &ts) == 0) { - strcpy(cns_res.logins[i], ts); - free(ts); - } - } - - registry_close(key); -} - -/* - * save all the registry data, creating the keys if needed. - */ -void -cns_save_registry(void) -{ - char tmp[1024]; - HKEY key; - int i; - - /* - * First, create the heirachy... This is gross, but functional - */ - key = registry_key_create(HKEY_CURRENT_USER, CYGNUS_SOLUTIONS, KEY_WRITE); - if (key == INVALID_HANDLE_VALUE) - return; - - key = registry_key_create(HKEY_CURRENT_USER, KERBNET_SANS_VERSION, KEY_WRITE); - if (key == INVALID_HANDLE_VALUE) - return; - registry_close(key); - - key = registry_key_create(HKEY_CURRENT_USER, KERBNET_BASE, KEY_WRITE); - if (key == INVALID_HANDLE_VALUE) - return; - registry_close(key); - - key = registry_key_create(HKEY_CURRENT_USER, KERBNET_CNS_BASE, KEY_WRITE); - if (key == INVALID_HANDLE_VALUE) - return; - - registry_dword_set(key, "x", cns_res.x); - registry_dword_set(key, "y", cns_res.y); - registry_dword_set(key, "cx", cns_res.cx); - registry_dword_set(key, "cy", cns_res.cy); - - registry_dword_set(key, "alert", cns_res.alert); - registry_dword_set(key, "beep", cns_res.beep); - registry_dword_set(key, "lifetime", cns_res.lifetime); - registry_dword_set(key, "forwardable", cns_res.forwardable); - registry_dword_set(key, "noaddresses", cns_res.noaddresses); - - registry_string_set(key, "name", cns_res.name); - registry_string_set(key, "realm", cns_res.realm); - - if (cns_res.conf_override) - { - if (strcmp(cns_res.confname, cns_res.def_confname)) - registry_string_set(key, "confname", cns_res.confname); - else - registry_value_delete(key, "confname"); - } - - if (cns_res.cc_override) - { - if (strcmp(cns_res.ccname, cns_res.def_ccname)) - registry_string_set(key, "ccname", cns_res.ccname); - else - registry_value_delete(key, "ccname"); - } - - for (i = 0 ; i < FILE_MENU_MAX_LOGINS ; i++) - if (cns_res.logins[i][0] != '\0') { - sprintf(tmp, "login_%02d", i); - registry_string_set(key, tmp, cns_res.logins[i]); - } - - registry_close(key); -} diff --git a/src/windows/cns/cns_reg.h b/src/windows/cns/cns_reg.h deleted file mode 100644 index 9ebed4fe85..0000000000 --- a/src/windows/cns/cns_reg.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 1997 Cygnus Solutions - * - * Author: Michael Graff - */ - -#include - -typedef struct cns_reg { - DWORD x; /* default dialog size */ - DWORD y; - DWORD cx; - DWORD cy; - DWORD lifetime; /* ticket lifetime */ - DWORD beep; /* beep on expire/warning? */ - DWORD alert; /* alert (deiconify) when tix expired? */ - DWORD forwardable; /* get forwardable tickets? */ - DWORD conf_override; /* allow changing of confname */ - DWORD cc_override; /* allow changing of ccname */ - DWORD noaddresses; /* Don't require address in tickets */ - char name[MAX_K_NAME_SZ]; /* last user used */ - char realm[MAX_K_NAME_SZ]; /* last realm used */ - char confname[FILENAME_MAX]; - char ccname[FILENAME_MAX]; - char def_confname[FILENAME_MAX]; - char def_ccname[FILENAME_MAX]; - char logins[FILE_MENU_MAX_LOGINS][MAX_K_NAME_SZ]; -} cns_reg_t; - -extern cns_reg_t cns_res; - -void cns_load_registry(void); -void cns_save_registry(void); diff --git a/src/windows/cns/cnsres4.rc b/src/windows/cns/cnsres4.rc deleted file mode 100644 index 77e21e028d..0000000000 --- a/src/windows/cns/cnsres4.rc +++ /dev/null @@ -1,108 +0,0 @@ -#include - -#define KRB4 -#include "cns.h" - -IDI_KWIN ICON PRELOAD cns.ico -IDI_0_MIN ICON PRELOAD clock00.ico -IDI_5_MIN ICON PRELOAD clock05.ico -IDI_10_MIN ICON PRELOAD clock10.ico -IDI_15_MIN ICON PRELOAD clock15.ico -IDI_20_MIN ICON PRELOAD clock20.ico -IDI_25_MIN ICON PRELOAD clock25.ico -IDI_30_MIN ICON PRELOAD clock30.ico -IDI_35_MIN ICON PRELOAD clock35.ico -IDI_40_MIN ICON PRELOAD clock40.ico -IDI_45_MIN ICON PRELOAD clock45.ico -IDI_50_MIN ICON PRELOAD clock50.ico -IDI_55_MIN ICON PRELOAD clock55.ico -IDI_60_MIN ICON PRELOAD clock60.ico -IDI_EXPIRED ICON PRELOAD clockexp.ico -IDI_TICKET ICON PRELOAD clocktkt.ico - -IDM_KWIN MENU PRELOAD -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&Options...", IDM_OPTIONS - MENUITEM SEPARATOR - MENUITEM "E&xit", IDM_EXIT - END - - POPUP "&Help" - BEGIN - MENUITEM "&Index\tF1", IDM_HELP_INDEX - MENUITEM SEPARATOR - MENUITEM "&About Kerberos...", IDM_ABOUT - END -END - -IDA_KWIN ACCELERATORS PRELOAD -BEGIN - VK_F1, IDM_HELP_INDEX, VIRTKEY -END - -ID_KWIN DIALOG PRELOAD MOVEABLE DISCARDABLE 0, 0, 276, 114 -STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX -CLASS KWIN_DIALOG_CLASS -CAPTION KWIN_DIALOG_NAME -MENU IDM_KWIN -FONT 8, "Arial" -BEGIN - CONTROL " Start Time End Time Ticket", IDD_TICKET_LIST_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 7, 240, 8 - CONTROL "", IDD_TICKET_LIST, "LISTBOX", LBS_NOTIFY | LBS_DISABLENOSCROLL | LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 8, 18, 261, 52 - CONTROL "&Name", IDD_LOGIN_NAME_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 6, 69, 27, 8 - CONTROL "&Instance", IDD_LOGIN_INSTANCE_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 73, 69, 36, 8 - CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 140, 69, 26, 8 - CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 207, 69, 36, 8 - CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 62, 12 - CONTROL "", IDD_LOGIN_INSTANCE, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 73, 79, 62, 12 - CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 140, 79, 62, 12 - CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 207, 79, 62, 12 - - CONTROL "&Change Password...", IDD_CHANGE_PASSWORD, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 6, 96, 74, 14 - CONTROL "&Delete", IDD_TICKET_DELETE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 122, 96, 52, 14 - CONTROL "&Login", IDD_LOGIN, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 96, 52, 14 - CONTROL "", IDD_PASSWORD_CR2, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0 -END - -ID_PASSWORD DIALOG 96, 50, 143, 129 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Change Password" -FONT 8, "Arial" -BEGIN - CONTROL "&Name:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 53, 8 - CONTROL "", IDD_PASSWORD_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_GROUP | WS_TABSTOP, 61, 6, 76, 12 - CONTROL "&Instance:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 53, 8 - CONTROL "", IDD_PASSWORD_INSTANCE, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 23, 76, 12 - CONTROL "&Realm:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 43, 53, 8 - CONTROL "", IDD_PASSWORD_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 40, 76, 12 - CONTROL "&Old Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 60, 53, 8 - CONTROL "", IDD_OLD_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 57, 76, 12 - CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 77, 53, 8 - CONTROL "", IDD_NEW_PASSWORD1, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 74, 76, 12 - CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 94, 53, 8 - CONTROL "", IDD_NEW_PASSWORD2, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 91, 76, 12 - CONTROL "", IDD_PASSWORD_CR, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0 - CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 13, 110, 52, 14 - CONTROL "Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 77, 110, 52, 14 -END - -ID_OPTS DIALOG 97, 52, 148, 107 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Kerberos Options" -FONT 8, "Arial" -BEGIN - CONTROL "&Conf file:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 40, 8 - CONTROL "", IDD_CONF, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 60, 6, 82, 12 - CONTROL "&Realms file:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 40, 8 - CONTROL "", IDD_REALMS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 60, 23, 82, 12 - CONTROL "&Ticket lifetime:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 43, 53, 8 - CONTROL "", IDD_LIFETIME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 60, 40, 20, 12 - CONTROL "minutes", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 85, 43, 46, 8 - CONTROL "Action when login expires", 209, "BUTTON", BS_GROUPBOX | WS_CHILD | WS_VISIBLE | WS_GROUP, 5, 56, 138, 23 - CONTROL "&Alert ", IDD_ALERT, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 31, 65, 28, 12 - CONTROL "&Beep", IDD_BEEP, "BUTTON", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 80, 65, 39, 12 - CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 17, 87, 52, 14 - CONTROL "Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 81, 87, 52, 14 -END diff --git a/src/windows/cns/cnsres5.rc b/src/windows/cns/cnsres5.rc deleted file mode 100644 index d398078e39..0000000000 --- a/src/windows/cns/cnsres5.rc +++ /dev/null @@ -1,215 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "cns.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_KWIN ICON PRELOAD DISCARDABLE "cns.ico" -IDI_0_MIN ICON PRELOAD DISCARDABLE "clock00.ico" -IDI_5_MIN ICON PRELOAD DISCARDABLE "clock05.ico" -IDI_10_MIN ICON PRELOAD DISCARDABLE "clock10.ico" -IDI_15_MIN ICON PRELOAD DISCARDABLE "clock15.ico" -IDI_20_MIN ICON PRELOAD DISCARDABLE "clock20.ico" -IDI_25_MIN ICON PRELOAD DISCARDABLE "clock25.ico" -IDI_30_MIN ICON PRELOAD DISCARDABLE "clock30.ico" -IDI_35_MIN ICON PRELOAD DISCARDABLE "clock35.ico" -IDI_40_MIN ICON PRELOAD DISCARDABLE "clock40.ico" -IDI_45_MIN ICON PRELOAD DISCARDABLE "clock45.ico" -IDI_50_MIN ICON PRELOAD DISCARDABLE "clock50.ico" -IDI_55_MIN ICON PRELOAD DISCARDABLE "clock55.ico" -IDI_60_MIN ICON PRELOAD DISCARDABLE "clock60.ico" -IDI_EXPIRED ICON PRELOAD DISCARDABLE "clockexp.ico" -IDI_TICKET ICON PRELOAD DISCARDABLE "clocktkt.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDM_KWIN MENU PRELOAD DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "&Options...", IDM_OPTIONS - MENUITEM SEPARATOR - MENUITEM "E&xit", IDM_EXIT - END - POPUP "&Help" - BEGIN - MENUITEM "&Index\tF1", IDM_HELP_INDEX - MENUITEM SEPARATOR - MENUITEM "&About Kerberos...", IDM_ABOUT - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Accelerator -// - -IDA_KWIN ACCELERATORS PRELOAD MOVEABLE PURE -BEGIN - VK_F1, IDM_HELP_INDEX, VIRTKEY -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -ID_KWIN DIALOG PRELOAD DISCARDABLE 0, 0, 336, 115 -STYLE WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -#ifdef CYGNUS -CAPTION "KerbNet" -#else -CAPTION "Kerberos" -#endif -MENU IDM_KWIN -CLASS "KERBEROS" -FONT 8, "Arial" -BEGIN - CONTROL " Start Time End Time Ticket", - IDD_TICKET_LIST_TITLE,"Static",SS_LEFTNOWORDWRAP | - WS_GROUP,16,7,311,8 - LISTBOX IDD_TICKET_LIST,8,18,319,52,LBS_OWNERDRAWFIXED | - LBS_DISABLENOSCROLL | WS_VSCROLL - LTEXT "&Name",IDD_LOGIN_NAME_TITLE,6,69,27,8 - LTEXT "&Password",IDD_LOGIN_PASSWORD_TITLE,125,69,42,8 - LTEXT "&Realm",IDD_LOGIN_REALM_TITLE,239,69,26,8 - EDITTEXT IDD_LOGIN_NAME,6,79,84,12,ES_AUTOHSCROLL - EDITTEXT IDD_LOGIN_PASSWORD,126,78,84,12,ES_PASSWORD | - ES_AUTOHSCROLL - EDITTEXT IDD_LOGIN_REALM,239,79,84,12,ES_AUTOHSCROLL - PUSHBUTTON "&Change Password...",IDD_CHANGE_PASSWORD,6,96,84,14 - PUSHBUTTON "&Delete",IDD_TICKET_DELETE,141,96,52,14 - DEFPUSHBUTTON "&Login",IDD_LOGIN,271,96,52,14 - PUSHBUTTON "",IDD_PASSWORD_CR2,5000,5000,6,6,NOT WS_TABSTOP -END - -ID_PASSWORD DIALOG DISCARDABLE 96, 50, 143, 112 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Change Password" -FONT 8, "Arial" -BEGIN - LTEXT "&Name:",-1,5,9,53,8,NOT WS_GROUP - EDITTEXT IDD_PASSWORD_NAME,61,6,76,12,ES_AUTOHSCROLL | WS_GROUP - LTEXT "&Realm:",-1,5,26,53,8,NOT WS_GROUP - EDITTEXT IDD_PASSWORD_REALM,61,23,76,12,ES_AUTOHSCROLL - LTEXT "&Old Password:",-1,5,43,53,8,NOT WS_GROUP - EDITTEXT IDD_OLD_PASSWORD,61,40,76,12,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "&New Password:",-1,5,60,53,8,NOT WS_GROUP - EDITTEXT IDD_NEW_PASSWORD1,61,57,76,12,ES_PASSWORD | - ES_AUTOHSCROLL - LTEXT "&New Password:",-1,5,77,53,8,NOT WS_GROUP - EDITTEXT IDD_NEW_PASSWORD2,61,74,76,12,ES_PASSWORD | - ES_AUTOHSCROLL - PUSHBUTTON "",IDD_PASSWORD_CR,5000,5000,0,0,NOT WS_TABSTOP - DEFPUSHBUTTON "OK",IDOK,13,93,52,14,WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,77,93,52,14 -END - -ID_OPTS DIALOG DISCARDABLE 97, 52, 169, 138 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -#ifdef CYGNUS -CAPTION "KerbNet Options" -#else -CAPTION "Kerberos Options" -#endif -FONT 8, "Arial" -BEGIN - LTEXT "&Config file:",-1,5,9,40,8,NOT WS_GROUP - EDITTEXT IDD_CONF,70,6,92,12,ES_AUTOHSCROLL - LTEXT "Cre&dential cache:",-1,5,26,58,8,NOT WS_GROUP - EDITTEXT IDD_CCACHE,70,23,92,12,ES_AUTOHSCROLL - LTEXT "&Ticket lifetime:",-1,5,43,53,8,NOT WS_GROUP - EDITTEXT IDD_LIFETIME,70,40,32,12,ES_AUTOHSCROLL - LTEXT "minutes",-1,109,42,46,8,NOT WS_GROUP - GROUPBOX "Action when login expires",IDD_ACTIONS,5,56,158,23, - WS_GROUP - CONTROL "&Alert ",IDD_ALERT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,41,65,28,12 - CONTROL "&Beep",IDD_BEEP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, - 95,65,39,12 - GROUPBOX "Ticket options",IDD_TKOPT,5,86,158,23,WS_GROUP - CONTROL "&Forwardable",IDD_FORWARDABLE,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,25,95,65,12 - CONTROL "&NoAddresses",IDD_NOADDRESSES,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,90,95,65,12 - DEFPUSHBUTTON "OK",IDOK,19,117,52,14 - PUSHBUTTON "Cancel",IDCANCEL,95,117,52,14 -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""cns.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - -#include "..\version.rc" diff --git a/src/windows/cns/debug.c b/src/windows/cns/debug.c deleted file mode 100644 index 052bf4e685..0000000000 --- a/src/windows/cns/debug.c +++ /dev/null @@ -1,90 +0,0 @@ -#ifdef DEBUG - -#include -#include -#include -#include - -void -OutputHeading(const char *explanation) -{ - _RPT1(_CRT_WARN, - "\n\n%s:\n*********************************\n", explanation ); -} - -/* - * The following macros set and clear, respectively, given bits - * of the C runtime library debug flag, as specified by a bitmask. - */ -#define SET_CRT_DEBUG_FIELD(a) \ - _CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) -#define CLEAR_CRT_DEBUG_FIELD(a) \ - _CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) - -_CrtMemState s1; -_CrtMemState s2; -_CrtMemState s3; -static _CrtMemState *ss1 = NULL; -static _CrtMemState *ss2 = NULL; - -void debug_init(); - -void -debug_check() -{ - _CrtMemState *temp; - - OutputHeading("Checking memory..."); - - if (ss1 == NULL) { - debug_init(); - ss1 = &s1; - ss2 = &s2; - } - - _CrtCheckMemory(); - - /* _CrtMemDumpAllObjectsSince( NULL ); */ - - _CrtMemCheckpoint( &s2 ); - - if ( _CrtMemDifference( &s3, &s1, &s2 ) ) - _CrtMemDumpStatistics( &s3 ); - - /* _CrtDumpMemoryLeaks(); */ - - /* - * swap the snapshots around - */ - temp = ss1; - ss1 = ss2; - ss2 = temp; -} - -void -debug_init() -{ - /* Send all reports to STDOUT */ - _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); - _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT ); - _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); - _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT ); - _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE ); - _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT ); - - _CrtMemCheckpoint( &s1 ); - - /* - * Set the debug-heap flag so that freed blocks are kept on the - * linked list, to catch any inadvertent use of freed memory - */ - SET_CRT_DEBUG_FIELD( _CRTDBG_DELAY_FREE_MEM_DF ); - - - /* - * Set the debug-heap flag so that memory leaks are reported when - * the process terminates. Then, exit. - */ - SET_CRT_DEBUG_FIELD( _CRTDBG_LEAK_CHECK_DF ); -} -#endif /* DEBUG */ diff --git a/src/windows/cns/heap.c b/src/windows/cns/heap.c deleted file mode 100644 index 46d39df0bf..0000000000 --- a/src/windows/cns/heap.c +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -void heapdump( void ) -{ - _HEAPINFO hinfo; - int heapstatus; - hinfo._pentry = NULL; - while( ( heapstatus = _heapwalk( &hinfo ) ) == _HEAPOK ) - { printf( "%6s block at %Fp of size %4.4X\n", - ( hinfo._useflag == _USEDENTRY ? "USED" : "FREE" ), - hinfo._pentry, hinfo._size ); - } - - switch( heapstatus ) - { - case _HEAPEMPTY: - printf( "OK - empty heap\n" ); - break; - case _HEAPEND: - printf( "OK - end of heap\n" ); - break; - case _HEAPBADPTR: - printf( "ERROR - bad pointer to heap\n" ); - break; - case _HEAPBADBEGIN: - printf( "ERROR - bad start of heap\n" ); - break; - case _HEAPBADNODE: - printf( "ERROR - bad node in heap\n" ); - break; - } -} diff --git a/src/windows/cns/kerbnet.doc b/src/windows/cns/kerbnet.doc deleted file mode 100644 index 161b3c31ea..0000000000 Binary files a/src/windows/cns/kerbnet.doc and /dev/null differ diff --git a/src/windows/cns/kerbnet.hlp b/src/windows/cns/kerbnet.hlp deleted file mode 100644 index c25fafcd5b..0000000000 Binary files a/src/windows/cns/kerbnet.hlp and /dev/null differ diff --git a/src/windows/cns/kerbnet.hpj b/src/windows/cns/kerbnet.hpj deleted file mode 100644 index 7d03569936..0000000000 --- a/src/windows/cns/kerbnet.hpj +++ /dev/null @@ -1,133 +0,0 @@ -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; Help Project File for KERBNET -; -; You may edit this file. -; -; It's probably best not to change the CONTENTS= value -; unless you rename the IDH_CONTENTS context string in -; the KERBNET.DOC file. -; - -[OPTIONS] -; The optional ROOT= entry sets the working directory for the Help Compiler -; ROOT=C:\PROJECT - -; The optional BMROOT= entry sets forth the directories which the -; help compiler will search for bitmaps used in the Help system. -; -;BMROOT=C:\ROBOHELP - -; The CONTENTS= tells the help Engine which topic contains the contents -CONTENTS=IDH_CONTENTS - -; Title is Displayed in the Title Bar of WINHELP.EXE -TITLE=Kerb*Net - -; The BUILD= setting allows complex Help systems which require -; different versions to use the same source. This is similar to #ifdef's -; in the 'C' language. Everything to the right of the = sign in the -; BUILD= statement is an EXPRESSION. See the Help compiler -; documentation for more information about build expressions. -BUILD=WINDOWS - -; The Warning Level is used by the Help Compiler (HC.EXE) -; WARNING=1 - Only the most severe warnings are reported -; WARNING=2 - Intermediate Level of warnings -; WARNING=3 - Most stringent error reporting - -; The Compress option is used by the Help Compiler to make -; smaller, faster loading .HLP files. However, using compression -; increases Compile times. -; COMPRESS=YES, ON, OFF, NO, TRUE or FALSE - - -OLDKEYPHRASE=NO -OPTCDROM=0 -NOTES=1 -REPORT=YES -COMPRESS=12 -ERRORLOG=C:\windows\desktop\kerberos 5\win95 gui\cns help\KERBNET.ERR -[BUILDTAGS] -; The Build Tags section specifies to the Help Compiler the names -; of all the valid build tags used in this Help project. The [BUILDTAGS] -; section is optional. -WINDOWS - - -[CONFIG] -; The config section allows you to define some macros which will be -; executed when the help system is first executed. -; -; The next line gives you browse buttons: -; -BrowseButtons() - -; -; To create a glossary button which displays a list of defined terms -; in a secondary window, remove the semi colon at the start of the next -; line and do the same with the Glossary window in the [WINDOWS] section -;CreateButton("Glossary_Btn","&Glossary","JI(`bubble.hlp>Gloss',`IDH_Glossary')") -; - - -[FILES] -; The files section is where you specify to the Help Compiler which -; Rich Text Format (.RTF) (your help source) files will be used in the -; Help system. RoboHELP generates and maintains the main .RTF -; file for your Help System. If you desire to have multiple .RTF files, -; simply add the additonal names to the [FILES] section. - -KERBNET.RTF -[ALIAS] -; The Alias section allows you to set up aliases for context strings -; in your help system. -; -; Brief example: -; -; IDH_UserID = IDH_RoboGenerated_Id -; IDH_WMP_MenuID = IDH_RoboGenerated_Id -; IDH_Any = IDH_AnyOther - -[MAP] -; -; The Map Section is where the C language #defines are translated -; or mapped into the Help System Context Strings. Standard C syntax -; can be employed. The .HH file is meant to be #include(d) into your -; Windows application source code. -; - -[BITMAPS] -; -; The [BITMAPS] section is where you list any Bitmaps which have -; been placed by reference in the Help System. See the Help compiler -; documentation for more information about placing bitmaps. -; -; The [BITMAPS] section is not really required under Windows 3.1, -; with the advent of the BMROOT item in the [OPTIONS] section. -; -;FOO1.BMP -;FOO2.BMP -;C:\FOO\FOO3.BMP -;And So On - -[WINDOWS] -; Windows Help can display help in one of 5 secondary windows. -; Before using a secondary window, the window must be defined -; in this section: -; -;Gloss = "Glossary",(100,100,350,350),0,(255,255,255),(255,255,255) -main=,,0,, - -[BAGGAGE] -; -; The Baggage section allows the user to include files which -; will be placed in the internal file system for WinHelp. -; Using files from Baggage is a little faster for CDROM, since -; the CDROM drive table does not need to be read from disk. -; -; Baggage files are referred to as regular bitmaps, except -; that you prefix the filename with '!'. -; -; For Instance: -; {bmc !bitmap.bmp} instead of {bmc bitmap.bmp} -; diff --git a/src/windows/cns/kpasswd.c b/src/windows/cns/kpasswd.c deleted file mode 100644 index 09991c3838..0000000000 --- a/src/windows/cns/kpasswd.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1997 Cygnus Solutions. - * - * Author: Michael Graff - */ - -#include -#include -#include - -#include "krb5.h" -#include "com_err.h" - -#include "cns.h" - -#include "../lib/gic.h" - -/* - * k5_change_password - * - * Use the new functions to change the password. - */ -krb5_error_code -k5_change_password(HWND hwnd, krb5_context context, char *user, char *realm, - char *opasswd, char *npasswd, char **text) -{ - krb5_error_code ret; - krb5_data result_string; - krb5_data result_code_string; - int result_code; - krb5_get_init_creds_opt opts; - krb5_creds creds; - krb5_principal princ; - char *name; - gic_data gd; - - *text = NULL; - - name = malloc(strlen(user) + strlen(realm) + 2); - if (name == NULL) { - *text = "Failed to allocate memory while changing password"; - return 1; - } - sprintf(name, "%s@%s", user, realm); - - ret = krb5_parse_name(context, name, &princ); - free(name); - if (ret) { - *text = "while parsing name"; - return ret; - } - - krb5_get_init_creds_opt_init(&opts); - krb5_get_init_creds_opt_set_tkt_life(&opts, 5*60); - krb5_get_init_creds_opt_set_renew_life(&opts, 0); - krb5_get_init_creds_opt_set_forwardable(&opts, 0); - krb5_get_init_creds_opt_set_proxiable(&opts, 0); - - gd.hinstance = hinstance; - gd.hwnd = hwnd; - gd.id = ID_VARDLG; - - ret = krb5_get_init_creds_password(context, &creds, princ, opasswd, gic_prompter, - &gd, 0, "kadmin/changepw", &opts); - if (ret) { - *text = "while getting creds"; - return ret; - } - - ret = krb5_change_password(context, &creds, npasswd, &result_code, &result_code_string, - &result_string); - if (ret) { - *text = "while changing password"; - return ret; - } - - if (result_code) { - *text = malloc(result_code_string.length + result_string.length + 3); - if (*text == NULL) - return -1; - - sprintf(*text, "%.*s%s%.*s", - result_code_string.length, result_code_string.data, - (result_string.length ? ": " : ""), - result_string.length, - result_string.data ? result_string.data : ""); - } - - return 0; -} diff --git a/src/windows/cns/krb5.def b/src/windows/cns/krb5.def deleted file mode 100644 index 6a88ffbb91..0000000000 --- a/src/windows/cns/krb5.def +++ /dev/null @@ -1,9 +0,0 @@ -NAME KRB5 -DESCRIPTION 'KRB5 - Credentials Manager' -EXETYPE WINDOWS -STUB 'WINSTUB.EXE' -SEGMENTS _TEXT CLASS 'CODE' PRELOAD -CODE DISCARDABLE -DATA PRELOAD MULTIPLE MOVEABLE -HEAPSIZE 20480 -STACKSIZE 20480 diff --git a/src/windows/cns/krbini.h b/src/windows/cns/krbini.h deleted file mode 100644 index c6113d1dd2..0000000000 --- a/src/windows/cns/krbini.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Kerberos changed window message */ -#define WM_KERBEROS_CHANGED "Kerberos Changed" - -/* Kerberos Windows initialization file */ -#define KERBEROS_INI "kerberos.ini" -#ifdef CYGNUS -#define KERBEROS_HLP "kerbnet.hlp" -#else -#define KERBEROS_HLP "krb5.hlp" -#endif -#define INI_DEFAULTS "Defaults" -#define INI_USER "User" /* Default user */ -#define INI_INSTANCE "Instance" /* Default instance */ -#define INI_REALM "Realm" /* Default realm */ -#define INI_POSITION "Position" -#define INI_OPTIONS "Options" -#define INI_DURATION "Duration" /* Ticket duration in minutes */ -#define INI_EXPIRATION "Expiration" /* Action on expiration (alert or beep) */ -#define INI_ALERT "Alert" -#define INI_BEEP "Beep" -#define INI_FILES "Files" -#ifdef KRB4 -#define INI_KRB_CONF "krb.conf" /* Location of krb.conf file */ -#define DEF_KRB_CONF "krb.conf" /* Default name for krb.conf file */ -#endif /* KRB4 */ -#ifdef KRB5 -#define INI_KRB5_CONF "krb5.ini" /* From k5-config.h */ -#define INI_KRB_CONF INI_KRB5_CONF /* Location of krb.conf file */ -#define DEF_KRB_CONF INI_KRB5_CONF /* Default name for krb.conf file */ -#define INI_TICKETOPTS "TicketOptions" /* Ticket options */ -#define INI_FORWARDABLE "Forwardable" /* get forwardable tickets */ -#define INI_KRB_CCACHE "krb5cc" /* From k5-config.h */ -#endif /* KRB5 */ -#define INI_KRB_REALMS "krb.realms" /* Location of krb.realms file */ -#define DEF_KRB_REALMS "krb.realms" /* Default name for krb.realms file */ -#define INI_RECENT_LOGINS "Recent Logins" -#define INI_LOGIN "Login" diff --git a/src/windows/cns/options.c b/src/windows/cns/options.c deleted file mode 100644 index 0992f1a74f..0000000000 --- a/src/windows/cns/options.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright 1994 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - */ - -/* - * functions to tweak the options dialog - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cns.h" -#include "tktlist.h" -#include "cns_reg.h" - -/* - * Function: Process WM_INITDIALOG messages for the options dialog. - * Set up all initial dialog values from the KERBEROS_INI file. - * - * Returns: TRUE if we didn't set the focus here, - * FALSE if we did. - */ -BOOL -opts_initdialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) -{ - center_dialog(hwnd); - set_dialog_font(hwnd, hfontdialog); - - /* krb.conf file */ - strcpy(confname, cns_res.confname); -#ifndef _WIN32 - _strupr(confname); -#endif - SetDlgItemText(hwnd, IDD_CONF, confname); - - if (cns_res.conf_override == 0) - EnableWindow(GetDlgItem(hwnd, IDD_CONF), 0); - else - EnableWindow(GetDlgItem(hwnd, IDD_CONF), 1); - - /* Credential cache file */ - strcpy(ccname, cns_res.ccname); -#ifndef _WIN32 - _strupr(ccname); -#endif - SetDlgItemText(hwnd, IDD_CCACHE, ccname); - - if (cns_res.cc_override == 0) - EnableWindow(GetDlgItem(hwnd, IDD_CCACHE), 0); - else - EnableWindow(GetDlgItem(hwnd, IDD_CCACHE), 1); - - /* Ticket duration */ - SetDlgItemInt(hwnd, IDD_LIFETIME, cns_res.lifetime, FALSE); - - /* Expiration action */ - alert = cns_res.alert; - SendDlgItemMessage(hwnd, IDD_ALERT, BM_SETCHECK, alert, 0); - - beep = cns_res.beep; - SendDlgItemMessage(hwnd, IDD_BEEP, BM_SETCHECK, beep, 0); - - forwardable = cns_res.forwardable; - SendDlgItemMessage(hwnd, IDD_FORWARDABLE, BM_SETCHECK, forwardable, 0); - - noaddresses = cns_res.noaddresses; - SendDlgItemMessage(hwnd, IDD_NOADDRESSES, BM_SETCHECK, noaddresses, 0); - - return TRUE; -} - - -/* - * Function: Process WM_COMMAND messages for the options dialog. - */ -void -opts_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify) -{ - char newname[FILENAME_MAX]; - BOOL b; - int lifetime; - - switch (cid) { - case IDOK: - - /* Ticket duration */ - lifetime = GetDlgItemInt(hwnd, IDD_LIFETIME, &b, FALSE); - - if (!b) { - MessageBox(hwnd, "Lifetime must be a number!", "", - MB_OK | MB_ICONEXCLAMATION); - return; /* TRUE */ - } - - cns_res.lifetime = lifetime; - - if (cns_res.conf_override) { - /* krb.conf file */ - GetDlgItemText(hwnd, IDD_CONF, newname, sizeof(newname)); - trim(newname); - if (newname[0] == '\0') - strcpy(newname, cns_res.def_confname); - if (_stricmp(newname, confname)) { /* file name changed */ - MessageBox(NULL, - "Change to configuration file location requires a restart" - "of KerbNet.\n" - "Please exit this application and restart it for the change to take" - "effect", - "", MB_OK | MB_ICONEXCLAMATION); - } - strcpy(confname, newname); - } - - /* Credential cache file */ - GetDlgItemText(hwnd, IDD_CCACHE, newname, sizeof(newname)); - trim(newname); - - if (newname[0] == '\0') - strcpy(newname, cns_res.def_ccname); - - if (_stricmp(ccname, newname)) { /* Did we change ccache file? */ - krb5_error_code code; - krb5_ccache cctemp; - - code = k5_init_ccache(&cctemp); - if (code) { /* Problem opening new one? */ - com_err(NULL, code, - "while changing ccache.\r\nRestoring old ccache."); - } else { - strcpy(ccname, newname); - strcpy(cns_res.ccname, newname); - - code = krb5_cc_close(k5_context, k5_ccache); - k5_ccache = cctemp; /* Copy new into old */ - if (k5_name_from_ccache(k5_ccache)) { - kwin_init_name(GetParent(hwnd), ""); - kwin_set_default_focus(GetParent(hwnd)); - } - ticket_init_list(GetDlgItem (GetParent(hwnd), - IDD_TICKET_LIST)); - } - } - - /* - * get values for the clickboxes - */ - alert = SendDlgItemMessage(hwnd, IDD_ALERT, BM_GETCHECK, 0, 0); - cns_res.alert = alert; - - beep = SendDlgItemMessage(hwnd, IDD_BEEP, BM_GETCHECK, 0, 0); - cns_res.beep = beep; - - forwardable = SendDlgItemMessage(hwnd, IDD_FORWARDABLE, BM_GETCHECK, 0, 0); - cns_res.forwardable = forwardable; - - noaddresses = SendDlgItemMessage(hwnd, IDD_NOADDRESSES, BM_GETCHECK, 0, 0); - cns_res.noaddresses = noaddresses; - - EndDialog(hwnd, IDOK); - - return; /* TRUE */ - - case IDCANCEL: - EndDialog(hwnd, IDCANCEL); - - return; /* TRUE */ - } - - return; /* FALSE */ -} - - -/* - * Function: Process dialog specific messages for the opts dialog. - */ -BOOL CALLBACK -opts_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - HANDLE_MSG(hwnd, WM_INITDIALOG, opts_initdialog); - - HANDLE_MSG(hwnd, WM_COMMAND, opts_command); - } - - return FALSE; -} - - -/* - * Function: Display and process the options dialog. - * - * Parameters: - * hwnd - the parent window for the dialog - * - * Returns: TRUE if the dialog completed successfully, FALSE otherwise. - */ -BOOL -opts_dialog(HWND hwnd) -{ - DLGPROC dlgproc; - int rc; - -#ifdef _WIN32 - dlgproc = opts_dlg_proc; -#else - dlgproc = (FARPROC)MakeProcInstance(opts_dlg_proc, hinstance); - assert(dlgproc != NULL); - - if (dlgproc == NULL) - return FALSE; -#endif - - rc = DialogBox(hinstance, MAKEINTRESOURCE(ID_OPTS), hwnd, dlgproc); - assert(rc != -1); - -#ifndef _WIN32 - FreeProcInstance((FARPROC)dlgproc); -#endif - - return rc == IDOK; -} diff --git a/src/windows/cns/password.c b/src/windows/cns/password.c deleted file mode 100644 index b986659949..0000000000 --- a/src/windows/cns/password.c +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright 1994 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - */ - -/* - * functions to tweak the options dialog - */ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cns.h" - -/* - * Function: Changes the password. - * - * Parameters: - * hwnd - the current window from which command was invoked. - * - * name - name of user to change password for - * - * instance - instance of user to change password for - * - * realm - realm in which to change password - * - * oldpw - the old password - * - * newpw - the new password to change to - * - * Returns: TRUE if change took place, FALSE otherwise. - */ -BOOL -change_password(HWND hwnd, char *name, char *instance, char *realm, - char *oldpw, char *newpw) -{ -#ifdef KRB4 - des_cblock new_key; - char *ret_st; - int krc; - char *p; - CREDENTIALS *c; - int ncred; - char pname[ANAME_SZ]; - char pinstance[INST_SZ]; - - push_credentials(&c, pname, pinstance, &ncred); - krc = krb_get_pw_in_tkt(name, instance, realm, PWSERV_NAME, KADM_SINST, - 1, oldpw); - - if (krc != KSUCCESS) { - if (krc == INTK_BADPW) - p = "Old password is incorrect"; - else - p = krb_get_err_text(krc); - pop_credentials(c, pname, pinstance, ncred); - MessageBox(hwnd, p, "", MB_OK | MB_ICONEXCLAMATION); - - return FALSE; - } - - krc = kadm_init_link(PWSERV_NAME, KRB_MASTER, realm); - - if (krc != KSUCCESS) { - pop_credentials(c, pname, pinstance, ncred); - MessageBox(hwnd, kadm_get_err_text(krc), "", MB_OK | MB_ICONEXCLAMATION); - - return FALSE; - } - - des_string_to_key(newpw, new_key); - krc = kadm_change_pw2(new_key, newpw, &ret_st); - pop_credentials(c, pname, pinstance, ncred); - - if (ret_st != NULL) - free(ret_st); - - if (krc != KSUCCESS) { - MessageBox(hwnd, kadm_get_err_text(krc), "", MB_OK | MB_ICONEXCLAMATION); - - return FALSE; - } - - return TRUE; -#endif /* KRB4 */ - -#ifdef KRB5 - char *msg; /* Message string */ - krb5_error_code code; /* Return value */ - code = k5_change_password(hwnd, k5_context, name, realm, oldpw, newpw, &msg); - - if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) - MessageBox(NULL, "Password incorrect", NULL, MB_ICONEXCLAMATION); - else if (code == -1) - MessageBox(NULL, (msg ? msg : "Cannot change password"), NULL, - MB_ICONEXCLAMATION); - else if (code != 0) - com_err(NULL, code, (msg ? msg : "while changing password.")); - else - MessageBox(NULL, (msg ? msg : "Password changed"), "Kerberos", MB_OK | MB_APPLMODAL); - - return (code == 0); - -#endif /* KRB5 */ -} -/* - * Function: Process WM_COMMAND messages for the password dialog. - */ -void -password_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify) -{ - char name[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; - char oldpw[MAX_KPW_LEN]; - char newpw1[MAX_KPW_LEN]; - char newpw2[MAX_KPW_LEN]; - HCURSOR hcursor; - BOOL b; - int id; - - if (codeNotify != BN_CLICKED) { - GetDlgItemText(hwnd, IDD_PASSWORD_NAME, name, sizeof(name)); - trim(name); - GetDlgItemText(hwnd, IDD_PASSWORD_REALM, realm, sizeof(realm)); - trim(realm); - GetDlgItemText(hwnd, IDD_OLD_PASSWORD, oldpw, sizeof(oldpw)); - GetDlgItemText(hwnd, IDD_NEW_PASSWORD1, newpw1, sizeof(newpw1)); - GetDlgItemText(hwnd, IDD_NEW_PASSWORD2, newpw2, sizeof(newpw2)); - b = strlen(name) && strlen(realm) && strlen(oldpw) && - strlen(newpw1) && strlen(newpw2); - EnableWindow(GetDlgItem(hwnd, IDOK), b); - id = (b) ? IDOK : IDD_PASSWORD_CR; - SendMessage(hwnd, DM_SETDEFID, id, 0); - - return; /* FALSE */ - } - - switch (cid) { - case IDOK: - if (isblocking) - return; /* TRUE */ - - GetDlgItemText(hwnd, IDD_PASSWORD_NAME, name, sizeof(name)); - trim(name); - GetDlgItemText(hwnd, IDD_PASSWORD_INSTANCE, instance, sizeof(instance)); - trim(instance); - GetDlgItemText(hwnd, IDD_PASSWORD_REALM, realm, sizeof(realm)); - trim(realm); - GetDlgItemText(hwnd, IDD_OLD_PASSWORD, oldpw, sizeof(oldpw)); - GetDlgItemText(hwnd, IDD_NEW_PASSWORD1, newpw1, sizeof(newpw1)); - GetDlgItemText(hwnd, IDD_NEW_PASSWORD2, newpw2, sizeof(newpw2)); - - if (strcmp(newpw1, newpw2) != 0) { - MessageBox(hwnd, "The two passwords you entered don't match!", "", - MB_OK | MB_ICONEXCLAMATION); - SetDlgItemText(hwnd, IDD_NEW_PASSWORD1, ""); - SetDlgItemText(hwnd, IDD_NEW_PASSWORD2, ""); - PostMessage(hwnd, WM_NEXTDLGCTL, - (WPARAM)GetDlgItem(hwnd, IDD_NEW_PASSWORD1), MAKELONG(1, 0)); - - return; /* TRUE */ - } - - hcursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); - start_blocking_hook(BLOCK_MAX_SEC); - - if (change_password(hwnd, name, instance, realm, oldpw, newpw1)) - EndDialog(hwnd, IDOK); - else - PostMessage(hwnd, WM_NEXTDLGCTL, - (WPARAM)GetDlgItem(hwnd, IDD_OLD_PASSWORD), MAKELONG(1, 0)); - - end_blocking_hook(); - SetCursor(hcursor); - - return; /* TRUE */ - - case IDCANCEL: - if (isblocking) - WSACancelBlockingCall(); - EndDialog(hwnd, IDCANCEL); - - return; /* TRUE */ - - case IDD_PASSWORD_CR: - id = GetDlgCtrlID(GetFocus()); - assert(id != 0); - - if (id == IDD_NEW_PASSWORD2) - PostMessage(hwnd, WM_NEXTDLGCTL, - (WPARAM)GetDlgItem(hwnd, IDD_PASSWORD_NAME), MAKELONG(1, 0)); - else - PostMessage(hwnd, WM_NEXTDLGCTL, 0, 0); - - return; /* TRUE */ - - } - - return; /* FALSE */ -} - - -/* - * Function: Process WM_INITDIALOG messages for the password dialog. - * Set up all initial dialog values from the parent dialog. - * - * Returns: TRUE if we didn't set the focus here, - * FALSE if we did. - */ -BOOL -password_initdialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) -{ - char name[ANAME_SZ]; - char realm[REALM_SZ]; - HWND hwndparent; - int id; -#ifdef KRB4 - char instance[INST_SZ]; -#endif - - center_dialog(hwnd); - set_dialog_font(hwnd, hfontdialog); - - hwndparent = GetParent(hwnd); - assert(hwndparent != NULL); - - GetDlgItemText(hwndparent, IDD_LOGIN_NAME, name, sizeof(name)); - trim(name); - SetDlgItemText(hwnd, IDD_PASSWORD_NAME, name); - -#ifdef KRB4 - GetDlgItemText(hwndparent, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); - trim(instance); - SetDlgItemText(hwnd, IDD_PASSWORD_INSTANCE, instance); -#endif - - GetDlgItemText(hwndparent, IDD_LOGIN_REALM, realm, sizeof(realm)); - trim(realm); - SetDlgItemText(hwnd, IDD_PASSWORD_REALM, realm); - - if (strlen(name) == 0) - id = IDD_PASSWORD_NAME; - else if (strlen(realm) == 0) - id = IDD_PASSWORD_REALM; - else - id = IDD_OLD_PASSWORD; - - SetFocus(GetDlgItem(hwnd, id)); - - return FALSE; -} - - -/* - * Function: Process dialog specific messages for the password dialog. - */ -BOOL CALLBACK -password_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - - HANDLE_MSG(hwnd, WM_INITDIALOG, password_initdialog); - - HANDLE_MSG(hwnd, WM_COMMAND, password_command); - - case WM_SETCURSOR: - if (isblocking) { - SetCursor(LoadCursor(NULL, IDC_WAIT)); - SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE); - - return TRUE; - } - break; - } - - return FALSE; -} - - -/* - * Function: Display and process the password dialog. - * - * Parameters: - * hwnd - the parent window for the dialog - * - * Returns: TRUE if the dialog completed successfully, FALSE otherwise. - */ -BOOL -password_dialog(HWND hwnd) -{ - DLGPROC dlgproc; - int rc; - -#ifdef _WIN32 - dlgproc = password_dlg_proc; -#else - dlgproc = (FARPROC)MakeProcInstance(password_dlg_proc, hinstance); - assert(dlgproc != NULL); - - if (dlgproc == NULL) - return FALSE; -#endif - - rc = DialogBox(hinstance, MAKEINTRESOURCE(ID_PASSWORD), hwnd, dlgproc); - assert(rc != -1); - -#ifndef _WIN32 - FreeProcInstance((FARPROC)dlgproc); -#endif - - return rc == IDOK; -} diff --git a/src/windows/cns/tktlist.c b/src/windows/cns/tktlist.c deleted file mode 100644 index 26e699faea..0000000000 --- a/src/windows/cns/tktlist.c +++ /dev/null @@ -1,434 +0,0 @@ -/* windows/cns/tktlist.c */ -/* - * Copyright 1994 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - */ - -/* Handle all actions of the Kerberos ticket list. */ - -#if !defined(KRB5) && !defined(KRB4) -#define KRB5 1 -#endif - -#include -#include - -#include -#include -#include -#include -#include - -#ifdef KRB4 -#include "mit-copyright.h" -#include "kerberos.h" -#endif - -#ifdef KRB5 -#include "winsock.h" -#include "krb5.h" -#include "com_err.h" -#endif - -#include "cns.h" -#include "tktlist.h" - -#define ts2tt(t) (time_t)(uint32_t)(t) - -/* - * Ticket information for a list line - */ -typedef struct { - BOOL ticket; /* TRUE if this is a real ticket */ - time_t issue_time; /* time_t of issue */ - long lifetime; /* Lifetime for ticket in 5 minute intervals */ - char buf[0]; /* String to display */ -} TICKETINFO, *LPTICKETINFO; - -/* - * Function: Returns a standard ctime date with day of week and year - * removed. - * - * Parameters: - * t - time_t date to convert - * - * Returns: A pointer to the adjusted time value. - */ -static char * -short_date (time_t t) -{ - static char buf[26 - 4]; - char *p; - - p = ctime(&t); - assert(p != NULL); - - strcpy (buf, p + 4); - buf[12] = '\0'; - - return buf; -} - - -/*+ - * Function: Initializes and populates the ticket list with all existing - * Kerberos tickets. - * - * Parameters: - * hwnd - the window handle of the ticket window. - * - * Returns: Number of elements in the list or -1 on error - */ -int -ticket_init_list (HWND hwnd) -{ - int ncred; - LRESULT rc; - int l; - LPTICKETINFO lpinfo; - char buf[26+2 + 26+2 + ANAME_SZ+1 + INST_SZ+1 + REALM_SZ + 22]; -#ifdef KRB4 - int i; - time_t expiration; - char service[ANAME_SZ]; - char instance[INST_SZ]; - char realm[REALM_SZ]; - CREDENTIALS c; -#endif -#ifdef KRB5 - krb5_cc_cursor cursor; - krb5_error_code code; - krb5_creds c; - char *sname; /* Name of the service */ - char *flags_string(krb5_creds *cred); -#endif - - SetWindowRedraw(hwnd, FALSE); - - rc = ListBox_GetCount(hwnd); - assert(rc != LB_ERR); - - if (rc > 0) - ticket_destroy(hwnd); - - while (--rc >= 0) - ListBox_DeleteString(hwnd, rc); - -#ifdef KRB4 - ncred = krb_get_num_cred(); - for (i = 1; i <= ncred; i++) { - krb_get_nth_cred(service, instance, realm, i); - krb_get_cred(service, instance, realm, &c); - strcpy(buf, " "); - strncat(buf, short_date(c.issue_date - kwin_get_epoch()), - sizeof(buf) - 1 - strlen(buf)); - expiration = c.issue_date - kwin_get_epoch() + (long) c.lifetime * 5L * 60L; - strncat(buf, " ", sizeof(buf) - 1 - strlen(buf)); - strncat(buf, short_date(expiration), sizeof(buf) - 1 - strlen(buf)); - strncat(buf, " ", sizeof(buf) - 1 - strlen(buf)); - l = strlen(buf); - sprintf(&buf[l], "%s%s%s%s%s (%d)", - c.service, (c.instance[0] ? "." : ""), c.instance, - (c.realm[0] ? "@" : ""), c.realm, c.kvno); - l = strlen(buf); - - lpinfo = (LPTICKETINFO) malloc(sizeof(TICKETINFO) + l + 1); - assert(lpinfo != NULL); - - if (lpinfo == NULL) - return -1; - - lpinfo->ticket = TRUE; - lpinfo->issue_time = c.issue_date - kwin_get_epoch(); /* back to system time */ - lpinfo->lifetime = (long) c.lifetime * 5L * 60L; - strcpy(lpinfo->buf, buf); - - rc = ListBox_AddItemData(hwnd, lpinfo); - assert(rc >= 0); - - if (rc < 0) - return -1; - } - -#endif - -#ifdef KRB5 - - ncred = 0; - if (code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor)) { - if (code != KRB5_FCC_NOFILE) { - return -1; - } - } else { - while (1) { - code = krb5_cc_next_cred(k5_context, k5_ccache, &cursor, &c); - if (code != 0) - break; - - ncred++; - strcpy (buf, " "); - strncat(buf, short_date(ts2tt(c.times.starttime) - kwin_get_epoch()), - sizeof(buf) - 1 - strlen(buf)); - strncat(buf, " ", sizeof(buf) - 1 - strlen(buf)); - strncat(buf, short_date(ts2tt(c.times.endtime) - kwin_get_epoch()), - sizeof(buf) - 1 - strlen(buf)); - strncat(buf, " ", sizeof(buf) - 1 - strlen(buf)); - - /* Add ticket service name and realm */ - code = krb5_unparse_name (k5_context, c.server, &sname); - if (code) { - com_err (NULL, code, "while unparsing server name"); - break; - } - strncat (buf, sname, sizeof(buf) - 1 - strlen(buf)); - - strncat (buf, flags_string (&c), sizeof(buf) - 1 - strlen(buf)); /* Add flag info */ - - l = strlen(buf); - lpinfo = (LPTICKETINFO) malloc(sizeof(TICKETINFO) + l + 1); - assert(lpinfo != NULL); - - if (lpinfo == NULL) - return -1; - - lpinfo->ticket = TRUE; - lpinfo->issue_time = ts2tt(c.times.starttime) - kwin_get_epoch(); - lpinfo->lifetime = ts2tt(c.times.endtime) - c.times.starttime; - strcpy(lpinfo->buf, buf); - - rc = ListBox_AddItemData(hwnd, lpinfo); - assert(rc >= 0); - - if (rc < 0) - return -1; - } - if (code == KRB5_CC_END) { /* End of ccache */ - if (code = krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor)) { - return -1; - } - } else { - return -1; - } - } -#endif - - if (ncred <= 0) { - strcpy(buf, " No Tickets"); - lpinfo = (LPTICKETINFO) malloc(sizeof(TICKETINFO) + strlen(buf) + 1); - assert(lpinfo != NULL); - - if (lpinfo == NULL) - return -1; - - lpinfo->ticket = FALSE; - strcpy (lpinfo->buf, buf); - rc = ListBox_AddItemData(hwnd, lpinfo); - assert(rc >= 0); - } - - SetWindowRedraw(hwnd, TRUE); - - return ncred; -} - - -/* - * Function: Destroy the ticket list. Make sure to delete all - * ticket entries created during ticket initialization. - * - * Parameters: - * hwnd - the window handle of the ticket window. - */ -void -ticket_destroy ( - HWND hwnd) -{ - int i; - int n; - LRESULT rc; - - n = ListBox_GetCount(hwnd); - - for (i = 0; i < n; i++) { - rc = ListBox_GetItemData(hwnd, i); - assert(rc != LB_ERR); - - if (rc != LB_ERR) - free ((void *) rc); - } -} - - -/* - * Function: Respond to the WM_MEASUREITEM message for the ticket list - * by setting each list item up at 1/4 inch hight. - */ -void -ticket_measureitem(HWND hwnd, MEASUREITEMSTRUCT *lpmi) -{ - int logpixelsy; - HDC hdc; - - if (lpmi->CtlID != IDD_TICKET_LIST) - return; - - hdc = GetDC(HWND_DESKTOP); - logpixelsy = GetDeviceCaps(hdc, LOGPIXELSY); - ReleaseDC(HWND_DESKTOP, hdc); - lpmi->itemHeight = logpixelsy / 4; /* 1/4 inch */ -} - - -/* - * Function: Respond to the WM_DRAWITEM message for the ticket list - * by displaying a single list item. - */ -void -ticket_drawitem(HWND hwnd, const DRAWITEMSTRUCT *lpdi) -{ - BOOL rc; - COLORREF bkcolor; - HBRUSH hbrush; - UINT textheight; - UINT alignment; - int left, top; - BOOL b; - LPTICKETINFO lpinfo; - HICON hicon; -#if 0 - COLORREF textcolor; - COLORREF orgbkcolor; - COLORREF orgtextcolor; -#endif - SIZE Size; - - if (lpdi->CtlID != IDD_TICKET_LIST) - return; - - lpinfo = (LPTICKETINFO) lpdi->itemData; - - if (lpdi->itemAction == ODA_FOCUS) - return; - -#if 0 - if (lpdi->itemState & ODS_SELECTED) { - textcolor = GetSysColor(COLOR_HIGHLIGHTTEXT); - bkcolor = GetSysColor(COLOR_HIGHLIGHT); - - orgtextcolor = SetTextColor(lpdi->hDC, textcolor); - assert(textcolor != 0x80000000); - - orgbkcolor = SetBkColor(lpdi->hDC, bkcolor); - assert(bkcolor != 0x80000000); - } - else -#endif - - bkcolor = GetBkColor(lpdi->hDC); - hbrush = CreateSolidBrush(bkcolor); - assert(hbrush != NULL); - - FillRect(lpdi->hDC, &(lpdi->rcItem), hbrush); - DeleteObject(hbrush); - - /* - * Display the appropriate icon - */ - if (lpinfo->ticket) { - hicon = kwin_get_icon(lpinfo->issue_time + lpinfo->lifetime); - left = lpdi->rcItem.left - (32 - ICON_WIDTH) / 2; - top = lpdi->rcItem.top; - top += (lpdi->rcItem.bottom - lpdi->rcItem.top - 32) / 2; - - b = DrawIcon(lpdi->hDC, left, top, hicon); - assert(b); - } - - /* - * Display centered string - */ -#ifdef _WIN32 - GetTextExtentPoint32(lpdi->hDC, "X", 1, &Size); -#else - GetTextExtentPoint(lpdi->hDC, "X", 1, &Size); -#endif - - textheight = Size.cy; - - alignment = SetTextAlign(lpdi->hDC, TA_TOP | TA_LEFT); - - if (lpinfo->ticket) - left = lpdi->rcItem.left + ICON_WIDTH; - else - left = lpdi->rcItem.left; - - top = lpdi->rcItem.top; - top += (lpdi->rcItem.bottom - lpdi->rcItem.top - textheight) / 2; - rc = TextOut(lpdi->hDC, left, top, (LPSTR) lpinfo->buf, - strlen((LPSTR) lpinfo->buf)); - assert(rc); - - alignment = SetTextAlign(lpdi->hDC, alignment); - -#if 0 - if (lpdi->itemState & ODS_SELECTED) { - textcolor = SetTextColor(lpdi->hDC, orgtextcolor); - assert(textcolor != 0x80000000); - - bkcolor = SetBkColor(lpdi->hDC, orgbkcolor); - assert(bkcolor != 0x80000000); - } - -#endif -} - - -#ifdef KRB5 - -/* - * - * Flags_string - * - * Return buffer with the current flags for the credential - * - */ -char * -flags_string(krb5_creds *cred) { - static char buf[32]; - int i = 0; - - buf[i++] = ' '; - buf[i++] = '('; - if (cred->ticket_flags & TKT_FLG_FORWARDABLE) - buf[i++] = 'F'; - if (cred->ticket_flags & TKT_FLG_FORWARDED) - buf[i++] = 'f'; - if (cred->ticket_flags & TKT_FLG_PROXIABLE) - buf[i++] = 'P'; - if (cred->ticket_flags & TKT_FLG_PROXY) - buf[i++] = 'p'; - if (cred->ticket_flags & TKT_FLG_MAY_POSTDATE) - buf[i++] = 'D'; - if (cred->ticket_flags & TKT_FLG_POSTDATED) - buf[i++] = 'd'; - if (cred->ticket_flags & TKT_FLG_INVALID) - buf[i++] = 'i'; - if (cred->ticket_flags & TKT_FLG_RENEWABLE) - buf[i++] = 'R'; - if (cred->ticket_flags & TKT_FLG_INITIAL) - buf[i++] = 'I'; - if (cred->ticket_flags & TKT_FLG_HW_AUTH) - buf[i++] = 'H'; - if (cred->ticket_flags & TKT_FLG_PRE_AUTH) - buf[i++] = 'A'; - - buf[i++] = ')'; - buf[i] = '\0'; - if (i <= 3) - buf[0] = '\0'; - return(buf); -} - -#endif /* KRB5 */ diff --git a/src/windows/cns/tktlist.h b/src/windows/cns/tktlist.h deleted file mode 100644 index 96d6ff82a7..0000000000 --- a/src/windows/cns/tktlist.h +++ /dev/null @@ -1,26 +0,0 @@ -/* windows/cns/tktlist.h */ -/* - * Copyright 1994 by the Massachusetts Institute of Technology. - * - * For copying and distribution information, please see the file - * . - */ - -/* Handle all actions of the Kerberos ticket list. */ - -/* Only one time, please */ -#ifndef TKTLIST_DEFS -#define TKTLIST_DEFS - -/* - * Prototypes - */ -BOOL ticket_init_list(HWND); - -void ticket_destroy(HWND); - -void ticket_measureitem(HWND, MEASUREITEMSTRUCT *); - -void ticket_drawitem(HWND, const DRAWITEMSTRUCT *); - -#endif diff --git a/src/windows/installer/nsis/KfWConfigPage.ini b/src/windows/installer/nsis/KfWConfigPage.ini deleted file mode 100644 index abc0ed63b7..0000000000 --- a/src/windows/installer/nsis/KfWConfigPage.ini +++ /dev/null @@ -1,59 +0,0 @@ -[Settings] -NumFields=7 - -[Field 1] -Type=label -Text=The Kerberos Client may utilize configuration files to assist in contacting KDCs. Where do you want to get these files? -Left=0 -Right=-1 -Top=0 -Bottom=20 - -[Field 2] -Type=RadioButton -Text=Use existing configuration files from a previous installation. -Left=10 -Right=-1 -Top=25 -Bottom=35 - -[Field 3] -Type=RadioButton -Text=Use packaged configuration files. -Left=10 -Right=-1 -Top=40 -Bottom=50 - -[Field 4] -type=RadioButton -Text=Download from web path: -State=0 -Left=10 -Right=-1 -Top=55 -Bottom=65 - -[Field 5] -type=Text -State= -Left=20 -Right=-1 -Top=70 -Bottom=80 - -[Field 6] -type=radioButton -text=Select a directory -Left=10 -Right=-1 -Top=85 -Bottom=95 - -[Field 7] -type=DirRequest -Flags=PATH_MUST_EXIST -Left=20 -Right=-40 -Top=100 -Bottom=110 diff --git a/src/windows/installer/nsis/KfWConfigPage2.ini b/src/windows/installer/nsis/KfWConfigPage2.ini deleted file mode 100644 index 353bf179bc..0000000000 --- a/src/windows/installer/nsis/KfWConfigPage2.ini +++ /dev/null @@ -1,20 +0,0 @@ -[Settings] -NumFields=3 - -[Field 1] -Type=label -Text=The Network Identity Manager maybe installed with the following optional functionality. Please check those items you wish activated. -Left=0 -Right=-1 -Top=0 -Bottom=20 - -[Field 2] -Type=CheckBox -Text=Autostart the Network Identity Manager each time you login to Windows. -State=1 -Left=10 -Right=-1 -Top=25 -Bottom=35 - diff --git a/src/windows/installer/nsis/kfw-fixed.nsi b/src/windows/installer/nsis/kfw-fixed.nsi deleted file mode 100644 index cef8b60dd5..0000000000 --- a/src/windows/installer/nsis/kfw-fixed.nsi +++ /dev/null @@ -1,1907 +0,0 @@ -;----------------------------------------------------------------- -; KfW defines and functionality -; Copyright (c) 2004,2005,2006,2007 Massachusetts Institute of Technology -; Copyright (c) 2006,2007 Secure Endpoints Inc. - -!define KFW_VERSION "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}" - -!define PROGRAM_NAME "Kerberos for Windows" -!ifdef RELEASE -!ifndef DEBUG ; !DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION}" -!else ; DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Checked/Debug" -!endif ; End DEBUG/!DEBUG -!else -!ifdef BETA -!ifndef DEBUG ; !DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA}" -!else ; DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA} Checked/Debug" -!endif ; End DEBUG/!DEBUG -!else -!ifndef DEBUG ; !DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__}" -!else ; DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__} Checked/Debug" -!endif ; End DEBUG/!DEBUG -!endif -!endif -VIProductVersion "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.00" -VIAddVersionKey "ProductName" "${PROGRAM_NAME}" -VIAddVersionKey "CompanyName" "Massachusetts Institute of Technology" -VIAddVersionKey "FileVersion" ${VIProductVersion} -VIAddVersionKey "ProductVersion" "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.0" -VIAddVersionKey "FileDescription" "MIT Kerberos for Windows Installer" -VIAddVersionKey "LegalCopyright" "(C)2004,2005,2006,2007" -!ifdef DEBUG -VIAddVersionKey "PrivateBuild" "Checked/Debug" -!endif ; End DEBUG - - -;-------------------------------- -;Configuration - - ;General - SetCompressor lzma -!ifndef DEBUG - OutFile "MITKerberosForWindows.exe" -!else - OutFile "MITKerberosForWindows-DEBUG.exe" -!endif - SilentInstall normal - ShowInstDetails show - XPStyle on - !define MUI_ICON "kfw.ico" - !define MUI_UNICON "kfw.ico" - !define KFW_COMPANY_NAME "Massachusetts Institute of Technology" - !define KFW_PRODUCT_NAME "${PROGRAM_NAME}" - !define KFW_REGKEY_ROOT "Software\MIT\Kerberos\" - !define NIM_REGKEY_ROOT "Software\MIT\NetIDMgr\" - CRCCheck force - !define REPLACEDLL_NOREGISTER - - ;Folder selection page - InstallDir "$PROGRAMFILES\MIT\Kerberos" ; Install to shorter path - - ;Remember install folder - InstallDirRegKey HKLM "${KFW_REGKEY_ROOT}" "" - - ;Remember the installer language - !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" - !define MUI_LANGDLL_REGISTRY_KEY "${KFW_REGKEY_ROOT}" - !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" - - ;Where are the files? - !define KFW_BIN_DIR "${KFW_TARGETDIR}\bin\i386" - !define KFW_DOC_DIR "${KFW_TARGETDIR}\doc" - !define KFW_INC_DIR "${KFW_TARGETDIR}\inc" - !define KFW_LIB_DIR "${KFW_TARGETDIR}\lib\i386" - !define KFW_SAMPLE_DIR "${KFW_TARGETDIR}\sample" - !define KFW_INSTALL_DIR "${KFW_TARGETDIR}\install" - !define SYSTEMDIR "$%SystemRoot%\System32" - - -;-------------------------------- -;Modern UI Configuration - - !define MUI_LICENSEPAGE - !define MUI_CUSTOMPAGECOMMANDS - !define MUI_WELCOMEPAGE - !define MUI_COMPONENTSPAGE - !define MUI_COMPONENTSPAGE_SMALLDESC - !define MUI_DIRECTORYPAGE - - !define MUI_ABORTWARNING - !define MUI_FINISHPAGE - - !define MUI_UNINSTALLER - !define MUI_UNCONFIRMPAGE - - - !insertmacro MUI_PAGE_WELCOME - !insertmacro MUI_PAGE_LICENSE "Licenses.rtf" - !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - Page custom KFWPageGetConfigFiles - Page custom KFWPageGetStartupConfig - !insertmacro MUI_PAGE_INSTFILES - !insertmacro MUI_PAGE_FINISH - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Language Strings - - ;Descriptions - LangString DESC_SecCopyUI ${LANG_ENGLISH} "${PROGRAM_NAME}: English" - - LangString DESC_secClient ${LANG_ENGLISH} "Client: Allows you to utilize MIT Kerberos from your Windows PC." - - LangString DESC_secDebug ${LANG_ENGLISH} "Debug Symbols: Used for debugging problems with MIT Kerberos for Windows" - - LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Allows you to build MIT Kerberos aware applications." - - LangString DESC_secDocs ${LANG_ENGLISH} "Documentation: Release Notes and User Manuals." - -; Popup error messages - LangString RealmNameError ${LANG_ENGLISH} "You must specify a realm name for your client to use." - - LangString ConfigFileError ${LANG_ENGLISH} "You must specify a valid configuration file location from which files can be copied during the install" - - LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the config files." - -; Upgrade/re-install strings - LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade Kerberos Client" - LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install Kerberos Client" - LangString DOWNGRADE_CLIENT ${LANG_ENGLISH} "Downgrade Kerberos Client" - - LangString UPGRADE_SDK ${LANG_ENGLISH} "Upgrade Kerberos SDK" - LangString REINSTALL_SDK ${LANG_ENGLISH} "Re-install Kerberos SDK" - LangString DOWNGRADE_SDK ${LANG_ENGLISH} "Downgrade Kerberos SDK" - - LangString UPGRADE_DOCS ${LANG_ENGLISH} "Upgrade Kerberos Documentation" - LangString REINSTALL_DOCS ${LANG_ENGLISH} "Re-install Kerberos Documentation" - LangString DOWNGRADE_DOCS ${LANG_ENGLISH} "Downgrade Kerberos Documentation" - - ReserveFile "${KFW_CONFIG_DIR}\sample\krb.con" - ReserveFile "${KFW_CONFIG_DIR}\sample\krbrealm.con" - ReserveFile "${KFW_CONFIG_DIR}\sample\krb5.ini" - !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in - !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog - -;-------------------------------- -;Reserve Files - - ;Things that need to be extracted on first (keep these lines before any File command!) - ;Only useful for BZIP2 compression - !insertmacro MUI_RESERVEFILE_LANGDLL - -;-------------------------------- -; Load Macros -!include "utils.nsi" - -;-------------------------------- -;Installer Sections - -;---------------------- -; Kerberos for Windows CLIENT -Section "KfW Client" secClient - - SetShellVarContext all - ; Stop any running services or we can't replace the files - ; Stop the running processes - GetTempFileName $R0 - File /oname=$R0 "Killer.exe" - nsExec::Exec '$R0 netidmgr.exe' - nsExec::Exec '$R0 leash32.exe' - nsExec::Exec '$R0 krbcc32s.exe' - nsExec::Exec '$R0 k95.exe' - nsExec::Exec '$R0 k95g.exe' - nsExec::Exec '$R0 krb5.exe' - nsExec::Exec '$R0 gss.exe' - nsExec::Exec '$R0 afscreds.exe' - - RMDir /r "$INSTDIR\bin" - - ; Do client components - SetOutPath "$INSTDIR\bin" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\comerr32.dll" "$INSTDIR\bin\comerr32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss.exe" "$INSTDIR\bin\gss.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe" "$INSTDIR\bin\gss-client.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe" "$INSTDIR\bin\gss-server.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi32.dll" "$INSTDIR\bin\gssapi32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe" "$INSTDIR\bin\k524init.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kclnt32.dll" "$INSTDIR\bin\kclnt32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe" "$INSTDIR\bin\kdestroy.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe" "$INSTDIR\bin\kinit.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\klist.exe" "$INSTDIR\bin\klist.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kpasswd.exe" "$INSTDIR\bin\kpasswd.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe" "$INSTDIR\bin\kvno.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_32.dll" "$INSTDIR\bin\krb5_32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt32.dll" "$INSTDIR\bin\k5sprt32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll" "$INSTDIR\bin\krb524.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc32.dll" "$INSTDIR\bin\krbcc32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc32s.exe" "$INSTDIR\bin\krbcc32s.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbv4w32.dll" "$INSTDIR\bin\krbv4w32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.chm" "$INSTDIR\bin\netidmgr.chm" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb4cred.dll" "$INSTDIR\bin\krb4cred.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred.dll" "$INSTDIR\bin\krb5cred.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb4cred_en_us.dll" "$INSTDIR\bin\krb4cred_en_us.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred_en_us.dll" "$INSTDIR\bin\krb5cred_en_us.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\leashw32.dll" "$INSTDIR\bin\leashw32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\ms2mit.exe" "$INSTDIR\bin\ms2mit.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\mit2ms.exe" "$INSTDIR\bin\mit2ms.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kcpytkt.exe" "$INSTDIR\bin\kcpytkt.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdeltkt.exe" "$INSTDIR\bin\kdeltkt.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\wshelp32.dll" "$INSTDIR\bin\wshelp32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\xpprof32.dll" "$INSTDIR\bin\xpprof32.dll" "$INSTDIR" - - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" nid_inst2000 - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\nidmgr32.dll" "$INSTDIR\bin\nidmgr32.dll" "$INSTDIR" - goto nid_done -nid_inst2000: - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\nidmgr32.dll" "$INSTDIR\bin\nidmgr32.dll" "$INSTDIR" -nid_done: - -!ifdef DEBUG -!IFDEF CL_1400 - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr80d.dll" "$INSTDIR\bin\msvcr80d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp80d.dll" "$INSTDIR\bin\msvcp80d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc80d.dll" "$INSTDIR\bin\mfc80d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHS.DLL" "$INSTDIR\bin\MFC80CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHT.DLL" "$INSTDIR\bin\MFC80CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80DEU.DLL" "$INSTDIR\bin\MFC80DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ENU.DLL" "$INSTDIR\bin\MFC80ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ESP.DLL" "$INSTDIR\bin\MFC80ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80FRA.DLL" "$INSTDIR\bin\MFC80FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ITA.DLL" "$INSTDIR\bin\MFC80ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80JPN.DLL" "$INSTDIR\bin\MFC80JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80KOR.DLL" "$INSTDIR\bin\MFC80KOR.DLL" "$INSTDIR" -!ELSE -!IFDEF CL_1310 - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\bin\msvcr71d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\bin\msvcp71d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\bin\mfc71d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" -!ELSE -!IFDEF CL_1300 - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\bin\msvcr70d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\bin\msvcp70d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\bin\mfc70d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" -!ELSE - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\bin\mfc42d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\bin\msvcp60d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\bin\msvcrtd.dll" "$INSTDIR" -!ENDIF -!ENDIF -!ENDIF -!ELSE -!IFDEF CL_1400 - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc80.dll" "$INSTDIR\bin\mfc80.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr80.dll" "$INSTDIR\bin\msvcr80.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp80.dll" "$INSTDIR\bin\msvcp80.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHS.DLL" "$INSTDIR\bin\MFC80CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80CHT.DLL" "$INSTDIR\bin\MFC80CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80DEU.DLL" "$INSTDIR\bin\MFC80DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ENU.DLL" "$INSTDIR\bin\MFC80ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ESP.DLL" "$INSTDIR\bin\MFC80ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80FRA.DLL" "$INSTDIR\bin\MFC80FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80ITA.DLL" "$INSTDIR\bin\MFC80ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80JPN.DLL" "$INSTDIR\bin\MFC80JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC80KOR.DLL" "$INSTDIR\bin\MFC80KOR.DLL" "$INSTDIR" -!ELSE -!IFDEF CL_1310 - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\bin\mfc71.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\bin\msvcr71.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\bin\msvcp71.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" -!ELSE -!IFDEF CL_1300 - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\bin\mfc70.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\bin\msvcr70.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\bin\msvcp70.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" -!ELSE - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\bin\mfc42.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\bin\msvcp60.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\bin\msvcrt.dll" "$INSTDIR" -!ENDIF -!ENDIF -!ENDIF -!ENDIF - !insertmacro ReplaceDLL "${SYSTEMDIR}\psapi.dll" "$INSTDIR\bin\psapi.dll" "$INSTDIR" - - ; Do WINDOWSDIR components - ;SetOutPath "$WINDOWSDIR" -!ifdef DEBUG -!endif - - ; Do Windows SYSDIR (Control panel) - SetOutPath "$SYSDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kfwlogon.dll" "$SYSDIR\kfwlogon.dll" "$INSTDIR" - File "${KFW_BIN_DIR}\kfwcpcc.exe" - - ; Get Kerberos config files - Call kfw.GetConfigFiles - - Call KFWCommon.Install - - ; KfW Reg entries - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - - ; Daemon entries - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" "" "" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "ProviderPath" "$SYSDIR\kfwlogon.dll" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "AuthentProviderPath" "$SYSDIR\kfwlogon.dll" - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Class" 2 - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "VerboseLogging" 10 - - ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder - ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order - ; to also include the service name. - Call AddProvider - ReadINIStr $R0 $1 "Field 7" "State" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Name" "MIT Kerberos" - - ; WinLogon Event Notification - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Asynchronous" 0 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Impersonate" 0 - WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "DLLName" "kfwlogon.dll" - WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Logon" "KFW_Logon_Event" - - ; NetIdMgr Reg entries - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "ImagePath" "$INSTDIR\bin\krb5cred.dll" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "PluginList" "Krb5Cred,Krb5Ident" - - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Module" "MITKrb5" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Description" "Kerberos v5 Credentials Provider" - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Type" 1 - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Flags" 0 - - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Module" "MITKrb5" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Description" "Kerberos v5 Identity Provider" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Dependencies" "Krb5Cred" - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Type" 2 - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Flags" 0 - - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb4" "ImagePath" "$INSTDIR\bin\krb4cred.dll" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb4" "PluginList" "Krb4Cred" - - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb4Cred" "Module" "MITKrb4" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb4Cred" "Description" "Kerberos v4 Credentials Provider" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb4Cred" "Dependencies" "Krb5Cred" - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb4Cred" "Type" 1 - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb4Cred" "Flags" 0 - - ;Write start menu entries - CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" - SetOutPath "$INSTDIR\bin" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" "$INSTDIR\Uninstall.exe" - - ReadINIStr $R0 $1 "Field 2" "State" ; startup - - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" - -startshort: - StrCmp $R0 "0" nostart - CreateShortCut "$SMSTARTUP\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 0 SW_SHOWMINIMIZED - goto checkconflicts - -nostart: - Delete "$SMSTARTUP\Network Identity Manager.lnk" - -checkconflicts: - Call GetSystemPath - Push "krb5_32.dll" - Call SearchPath - Pop $R0 - StrCmp $R0 "" addpath - - Push $R0 - Call GetParent - Pop $R0 - StrCmp $R0 "$INSTDIR\bin" addpath - MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "A previous installation of MIT Kerberos for Windows binaries has been found in folder $R0. This may interfere with the use of the current installation." - -addpath: - ; Add kfw bin to path - Push "$INSTDIR\bin" - Call AddToSystemPath - - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2003" addAllowTgtKey - StrCmp $R0 "2000" addAllowTgtKey - StrCmp $R0 "XP" addAllowTgtKey - goto skipAllowTgtKey - -addAllowTgtKey: - ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" $R0 - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" "1" - ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" $R0 - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" "1" -skipAllowTgtKey: - - ; The following are keys added for Terminal Server compatibility - ; http://support.microsoft.com/default.aspx?scid=kb;EN-US;186499 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" "Flags" 0x408 - -SectionEnd - -Section "Debug Symbols" secDebug - - SetOutPath "$INSTDIR\bin" - File "${KFW_BIN_DIR}\comerr32.pdb" - File "${KFW_BIN_DIR}\gss.pdb" - File "${KFW_BIN_DIR}\gss-client.pdb" - File "${KFW_BIN_DIR}\gss-server.pdb" - File "${KFW_BIN_DIR}\gssapi32.pdb" - File "${KFW_BIN_DIR}\k524init.pdb" - File "${KFW_BIN_DIR}\kclnt32.pdb" - File "${KFW_BIN_DIR}\kdestroy.pdb" - File "${KFW_BIN_DIR}\kinit.pdb" - File "${KFW_BIN_DIR}\klist.pdb" - File "${KFW_BIN_DIR}\kpasswd.pdb" - File "${KFW_BIN_DIR}\kvno.pdb" - File "${KFW_BIN_DIR}\krb5_32.pdb" - File "${KFW_BIN_DIR}\k5sprt32.pdb" - File "${KFW_BIN_DIR}\krb524.pdb" - File "${KFW_BIN_DIR}\krbcc32.pdb" - File "${KFW_BIN_DIR}\krbcc32s.pdb" - File "${KFW_BIN_DIR}\krbv4w32.pdb" - File "${KFW_BIN_DIR}\leashw32.pdb" - File "${KFW_BIN_DIR}\krb4cred.pdb" - File "${KFW_BIN_DIR}\krb5cred.pdb" - File "${KFW_BIN_DIR}\ms2mit.pdb" - File "${KFW_BIN_DIR}\mit2ms.pdb" - File "${KFW_BIN_DIR}\kcpytkt.pdb" - File "${KFW_BIN_DIR}\kdeltkt.pdb" - File "${KFW_BIN_DIR}\wshelp32.pdb" - File "${KFW_BIN_DIR}\xpprof32.pdb" - - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" nidpdb_inst2000 - File "${KFW_BIN_DIR}\netidmgr.pdb" - File "${KFW_BIN_DIR}\nidmgr32.pdb" - goto nidpdb_done -nidpdb_inst2000: - File "${KFW_BIN_DIR}\W2K\netidmgr.pdb" - File "${KFW_BIN_DIR}\W2K\nidmgr32.pdb" -nidpdb_done: - -!IFDEF DEBUG -!IFDEF CL_1400 - File "${SYSTEMDIR}\msvcr80d.pdb" - File "${SYSTEMDIR}\msvcp80d.pdb" - File "${SYSTEMDIR}\mfc80d.pdb" -!ELSE -!IFDEF CL_1310 - File "${SYSTEMDIR}\msvcr71d.pdb" - File "${SYSTEMDIR}\msvcp71d.pdb" - File "${SYSTEMDIR}\mfc71d.pdb" -!ELSE -!IFDEF CL_1300 - File "${SYSTEMDIR}\msvcr70d.pdb" - File "${SYSTEMDIR}\msvcp70d.pdb" - File "${SYSTEMDIR}\mfc70d.pdb" -!ELSE - File "${SYSTEMDIR}\mfc42d.pdb" - File "${SYSTEMDIR}\msvcp60d.pdb" - File "${SYSTEMDIR}\msvcrtd.pdb" -!ENDIF -!ENDIF -!ENDIF -!ENDIF - - SetOutPath "$SYSDIR" - File "${KFW_BIN_DIR}\kfwlogon.pdb" - File "${KFW_BIN_DIR}\kfwcpcc.pdb" - -SectionEnd - -;---------------------- -; Kerberos for Windows SDK -Section "KfW SDK" secSDK - - RMDir /r "$INSTDIR\inc" - RMDir /r "$INSTDIR\lib" - RMDir /r "$INSTDIR\install" - RMDir /r "$INSTDIR\sample" - - SetOutPath "$INSTDIR\doc" - File /r "${KFW_DOC_DIR}\netiddev.chm" - - SetOutPath "$INSTDIR\inc\kclient" - File /r "${KFW_INC_DIR}\kclient\*" - - SetOutPath "$INSTDIR\inc\krb4" - File /r "${KFW_INC_DIR}\krb4\*" - - SetOutPath "$INSTDIR\inc\krb5" - File /r "${KFW_INC_DIR}\krb5\*" - - SetOutPath "$INSTDIR\inc\krbcc" - File /r "${KFW_INC_DIR}\krbcc\*" - - SetOutPath "$INSTDIR\inc\leash" - File /r "${KFW_INC_DIR}\leash\*" - - SetOutPath "$INSTDIR\inc\loadfuncs" - File /r "${KFW_INC_DIR}\loadfuncs\*" - - SetOutPath "$INSTDIR\inc\netidmgr" - File /r "${KFW_INC_DIR}\netidmgr\*" - - SetOutPath "$INSTDIR\inc\wshelper" - File /r "${KFW_INC_DIR}\wshelper\*" - - SetOutPath "$INSTDIR\lib\i386" - File /r "${KFW_LIB_DIR}\*" - - SetOutPath "$INSTDIR\install" - File /r "${KFW_INSTALL_DIR}\*" - - SetOutPath "$INSTDIR\sample" - File /r "${KFW_SAMPLE_DIR}\*" - - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" "$INSTDIR\bin\netiddev.chm" - - Call KFWCommon.Install - - ; KfW Reg entries - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - -SectionEnd - -;---------------------- -; Kerberos for Windows Documentation -Section "KfW Documentation" secDocs - - RMDir /r "$INSTDIR\doc" - - SetOutPath "$INSTDIR\doc" - File "${KFW_DOC_DIR}\relnotes.html" - File "${KFW_DOC_DIR}\netidmgr_userdoc.pdf" - - Call KFWCommon.Install - - ; KfW Reg entries - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - - ;Write start menu entries - CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" - SetOutPath "$INSTDIR\doc" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" "$INSTDIR\doc\relnotes.html" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" "$INSTDIR\doc\netidmgr_userdoc.pdf" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager Documentation.lnk" "$INSTDIR\bin\netidmgr.chm" -SectionEnd - -;Display the Finish header -;Insert this macro after the sections if you are not using a finish page -;!insertmacro MUI_SECTIONS_FINISHHEADER - -;-------------------------------- -;Installer Functions - -Function .onInit - !insertmacro MUI_LANGDLL_DISPLAY - - ; Set the default install options - Push $0 - - Call IsUserAdmin - Pop $R0 - StrCmp $R0 "true" checkVer - - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software." - Abort - -checkVer: - ; Check Version of Windows. Do not install onto Windows 95 - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "95" wrongVersion - StrCmp $R0 "98" wrongVersion - StrCmp $R0 "ME" wrongVersion - StrCmp $R0 "NT 4.0" wrongVersion - goto checkIPHLPAPI - -wrongVersion: - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Microsoft Windows 2000 or higher." - Abort - -checkIPHLPAPI: - ClearErrors - ReadEnvStr $R0 "WinDir" - GetDLLVersion "$R0\System32\iphlpapi.dll" $R1 $R2 - IfErrors +1 +3 - GetDLLVersion "$R0\System\iphlpapi.dll" $R1 $R2 - IfErrors iphlperror - IntOp $R3 $R2 / 0x00010000 - IntCmpU $R3 1952 iphlpwarning checkprevious checkprevious - -iphlperror: - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Internet Explorer version 5.01 or higher. IPHLPAPI.DLL is missing." - Abort - -iphlpwarning: - MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "IPHLPAPI.DLL must be upgraded. Please install Internet Explorer 5.01 or higher." - -checkprevious: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ - "DisplayVersion" - IfErrors testWIX - StrCmp $R0 "${KFW_VERSION}" contInstall - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this upgrade or downgrade." \ - IDOK uninstNSIS - Abort - -;Run the uninstaller -uninstNSIS: - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ - "UninstallString" - ClearErrors - ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -testWIX: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}" \ - "DisplayVersion" - IfErrors testSWRT - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this installation." \ - IDOK uninstMSI1 - Abort - -;Run the uninstaller -uninstMSI1: - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" uninstMSI1_2000 - - ClearErrors - ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -uninstMSI1_2000: - ClearErrors - ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -testSWRT: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\{61211594-AAA1-4A98-A299-757326763CC7}" \ - "DisplayVersion" - IfErrors testPismere - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this installation." \ - IDOK uninstMSI2 - Abort - -;Run the uninstaller -uninstMSI2: - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" uninstMSI2_2000 - - ClearErrors - ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -uninstMSI2_2000: - ClearErrors - ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -testPismere: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\{83977767-388D-4DF8-BB08-3BF2401635BD}" \ - "DisplayVersion" - IfErrors contInstall - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this installation." \ - IDOK uninstPismere - Abort - -;Run the uninstaller -uninstPismere: - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" uninstPismere_2000 - - ClearErrors - ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -uninstPismere_2000: - ClearErrors - ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - - -Restart: - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Please reboot and then restart the installer." - Abort - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Abort failed" - -DoNotRestart: -no_remove_uninstaller: - -contInstall: - ; Never install debug symbols unless explicitly selected, except in DEBUG mode -!IFNDEF DEBUG - SectionGetFlags ${secDebug} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secDebug} $0 -!ELSE - SectionGetFlags ${secDebug} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDebug} $0 -!ENDIF - - ; Our logic should be like this. - ; 1) If no KfW components are installed, we do a clean install with default options. (Client/Docs) - ; 2) If existing modules are installed, we keep them selected - ; 3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install - ; TODO: Downgrade? - Call IsAnyKfWInstalled - Pop $R0 - StrCmp $R0 "0" DefaultOptions - - Call ShouldClientInstall - Pop $R2 - - StrCmp $R2 "0" NoClient - StrCmp $R2 "1" ReinstallClient - StrCmp $R2 "2" UpgradeClient - StrCmp $R2 "3" DowngradeClient - - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - ;# !insertmacro SelectSection ${secClient} - goto skipClient -NoClient: - ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now... - SectionGetFlags ${secClient} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secClient} $0 - goto skipClient -UpgradeClient: - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - SectionSetText ${secClient} $(UPGRADE_CLIENT) - goto skipClient -ReinstallClient: - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - SectionSetText ${secClient} $(REINSTALL_CLIENT) - goto skipClient -DowngradeClient: - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - SectionSetText ${secClient} $(DOWNGRADE_CLIENT) - goto skipClient - - -skipClient: - - Call ShouldSDKInstall - Pop $R2 - StrCmp $R2 "0" NoSDK - StrCmp $R2 "1" ReinstallSDK - StrCmp $R2 "2" UpgradeSDK - StrCmp $R2 "3" DowngradeSDK - - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - ;# !insertmacro UnselectSection ${secSDK} - goto skipSDK - -UpgradeSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - SectionSetText ${secSDK} $(UPGRADE_SDK) - goto skipSDK - -ReinstallSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - SectionSetText ${secSDK} $(REINSTALL_SDK) - goto skipSDK - -DowngradeSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - SectionSetText ${secSDK} $(DOWNGRADE_SDK) - goto skipSDK - -NoSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secSDK} $0 - ;# !insertmacro UnselectSection ${secSDK} - goto skipSDK - -skipSDK: - - Call ShouldDocumentationInstall - Pop $R2 - StrCmp $R2 "0" NoDocumentation - StrCmp $R2 "1" ReinstallDocumentation - StrCmp $R2 "2" UpgradeDocumentation - StrCmp $R2 "3" DowngradeDocumentation - - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - ;# !insertmacro UnselectSection ${secDocs} - goto skipDocumentation - -UpgradeDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - SectionSetText ${secDocs} $(UPGRADE_DOCS) - goto skipDocumentation - -ReinstallDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - SectionSetText ${secDocs} $(REINSTALL_DOCS) - goto skipDocumentation - -DowngradeDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - SectionSetText ${secDocs} $(DOWNGRADE_DOCS) - goto skipDocumentation - -NoDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secDocs} $0 - ;# !insertmacro UnselectSection ${secDocs} - goto skipDocumentation - -skipDocumentation: - goto end - -DefaultOptions: - ; Client Selected - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - - ; SDK NOT selected - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secSDK} $0 - - ; Documentation selected - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - goto end - -end: - Pop $0 - - Push $R0 - - ; See if we can set a default installation path... - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" - StrCmp $R0 "" TrySDK - StrCpy $INSTDIR $R0 - goto Nope - -TrySDK: - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" - StrCmp $R0 "" TryDocs - StrCpy $INSTDIR $R0 - goto Nope - -TryDocs: - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" - StrCmp $R0 "" TryRoot - StrCpy $INSTDIR $R0 - goto Nope - -TryRoot: - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}" "InstallDir" - StrCmp $R0 "" Nope - StrCpy $INSTDIR $R0 - -Nope: - Pop $R0 - - GetTempFilename $0 - File /oname=$0 KfWConfigPage.ini - GetTempFilename $1 - File /oname=$1 KfWConfigPage2.ini - -FunctionEnd - - -;-------------------------------- -; These are our cleanup functions -Function .onInstFailed -Delete $0 -Delete $1 -FunctionEnd - -Function .onInstSuccess -Delete $0 -Delete $1 -FunctionEnd - - -;-------------------------------- -;Descriptions - - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient) - !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK) - !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs) - !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them! - IfSilent StartRemove ; New in v2.0b4 - MessageBox MB_YESNO "Are you sure you want to remove MIT ${PROGRAM_NAME} from this machine?" IDYES StartRemove - abort - -StartRemove: - - SetShellVarContext all - ; Stop the running processes - GetTempFileName $R0 - File /oname=$R0 "Killer.exe" - nsExec::Exec '$R0 netidmgr.exe' - nsExec::Exec '$R0 krbcc32s.exe' - - Push "$INSTDIR\bin" - Call un.RemoveFromSystemPath - - ; Delete documentation - Delete "$INSTDIR\doc\relnotes.html" - Delete "$INSTDIR\doc\netidmgr_userdoc.pdf" - Delete "$INSTDIR\doc\netiddev.chm" - - Delete /REBOOTOK "$INSTDIR\bin\comerr32.dll" - Delete /REBOOTOK "$INSTDIR\bin\gss.exe" - Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe" - Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe" - Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll" - Delete /REBOOTOK "$INSTDIR\bin\k524init.exe" - Delete /REBOOTOK "$INSTDIR\bin\kclnt32.dll" - Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe" - Delete /REBOOTOK "$INSTDIR\bin\kinit.exe" - Delete /REBOOTOK "$INSTDIR\bin\klist.exe" - Delete /REBOOTOK "$INSTDIR\bin\kpasswd.exe" - Delete /REBOOTOK "$INSTDIR\bin\kvno.exe" - Delete /REBOOTOK "$INSTDIR\bin\krb5_32.dll" - Delete /REBOOTOK "$INSTDIR\bin\k5sprt32.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb524.dll" - Delete /REBOOTOK "$INSTDIR\bin\krbcc32.dll" - Delete /REBOOTOK "$INSTDIR\bin\krbcc32s.exe" - Delete /REBOOTOK "$INSTDIR\bin\krbv4w32.dll" - Delete /REBOOTOK "$INSTDIR\bin\netidmgr.exe" - Delete /REBOOTOK "$INSTDIR\bin\netidmgr.chm" - Delete /REBOOTOK "$INSTDIR\bin\nidmgr32.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb4cred.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb5cred.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb4cred_en_us.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb5cred_en_us.dll" - Delete /REBOOTOK "$INSTDIR\bin\leashw32.dll" - Delete /REBOOTOK "$INSTDIR\bin\ms2mit.exe" - Delete /REBOOTOK "$INSTDIR\bin\mit2ms.exe" - Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.exe" - Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.exe" - Delete /REBOOTOK "$INSTDIR\bin\wshelp32.dll" - Delete /REBOOTOK "$INSTDIR\bin\xpprof32.dll" - Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.dll" - Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.exe" - - Delete /REBOOTOK "$INSTDIR\bin\comerr32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gss.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kclnt32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb" - Delete /REBOOTOK "$INSTDIR\bin\klist.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kpasswd.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\k5sprt32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krbcc32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krbcc32s.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krbv4w32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\netidmgr.pdb" - Delete /REBOOTOK "$INSTDIR\bin\nidmgr32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb4cred.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb5cred.pdb" - Delete /REBOOTOK "$INSTDIR\bin\leashw32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\ms2mit.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mit2ms.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.pdb" - Delete /REBOOTOK "$INSTDIR\bin\wshelp32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\xpprof32.pdb" - Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.pdb" - Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.pdb" - -!IFDEF DEBUG -!IFDEF CL_1400 - Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb" -!ELSE -!IFDEF CL_1310 - Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb" -!ELSE -!IFDEF CL_1300 - Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb" -!ELSE - Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb" -!ENDIF -!ENDIF -!ENDIF -!ELSE -!IFDEF CL_1400 - Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll" - Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL" -!ELSE -!IFDEF CL_1310 - Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll" - Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL" -!ELSE -!IFDEF CL_1300 - Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll" - Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL" -!ELSE - Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll" -!ENDIF -!ENDIF -!ENDIF -!ENDIF - Delete /REBOOTOK "$INSTDIR\bin\psapi.dll" - - RMDir "$INSTDIR\bin" - RmDir "$INSTDIR\doc" - RmDir "$INSTDIR\lib" - RmDir "$INSTDIR\inc" - RmDir "$INSTDIR\install" - RMDir "$INSTDIR" - - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" - RmDir "$SMPROGRAMS\${PROGRAM_NAME}" - Delete "$SMSTARTUP\Network Identity Manager.lnk" - - IfSilent SkipAsk -; IfFileExists "$WINDIR\krb5.ini" CellExists SkipDelAsk -; RealmExists: - MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel - SkipAsk: - Delete "$WINDIR\krb5.ini" - Delete "$WINDIR\krb.con" - Delete "$WINDIR\krbrealm.con" - - SkipDel: - Delete "$INSTDIR\Uninstall.exe" - - ; Restore previous value of AllowTGTSessionKey - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" $R0 - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" $R0 - - ; The following are keys added for Terminal Server compatibility - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK" - DeleteRegKey /ifempty HKLM "${KFW_REGKEY_ROOT}" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" - - ; NIM Registry Keys - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb5" - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb4" - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Cred" - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Ident" - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb4Cred" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}" - - ; WinLogon Event Notification - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MIT_KFW" - DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" - - RMDir "$INSTDIR" - -SectionEnd - -;-------------------------------- -;Uninstaller Functions - -Function un.onInit - - ;Get language from registry - ReadRegStr $LANGUAGE ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" - -FunctionEnd - -Function un.onUninstSuccess - - MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software" - -FunctionEnd - -;------------------------------ -; Get the Configurations files from the Internet - -Function kfw.GetConfigFiles - -;Check if we should download Config Files -ReadINIStr $R0 $0 "Field 4" "State" -StrCmp $R0 "1" DoDownload - -;Do nothing if we're keeping the existing file -ReadINIStr $R0 $0 "Field 2" "State" -StrCmp $R0 "1" done - -ReadINIStr $R0 $0 "Field 3" "State" -StrCmp $R0 "1" UsePackaged - -; If none of these, grab file from other location -goto CheckOther - -DoDownload: - ReadINIStr $R0 $0 "Field 5" "State" - NSISdl::download "$R0/krb5.ini" "$WINDIR\krb5.ini" - NSISdl::download "$R0/krb.con" "$WINDIR\krb.con" - NSISdl::download "$R0/krbrealm.con" "$WINDIR\krbrealm.con" - Pop $R0 ;Get the return value - StrCmp $R0 "success" done - MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0" - goto done - -UsePackaged: - SetOutPath "$WINDIR" - File "${KFW_CONFIG_DIR}\sample\krb5.ini" - File "${KFW_CONFIG_DIR}\sample\krb.con" - File "${KFW_CONFIG_DIR}\sample\krbrealm.con" - goto done - -CheckOther: - ReadINIStr $R0 $0 "Field 7" "State" - StrCmp $R0 "" done - CopyFiles "$R0\krb5.ini" "$WINDIR\krb5.ini" - CopyFiles "$R0\krb.con" "$WINDIR\krb.con" - CopyFiles "$R0\krbrealm.con" "$WINDIR\krbrealm.con" - -done: - -FunctionEnd - - - -;------------------------------- -;Do the page to get the Config files - -Function KFWPageGetConfigFiles - ; Skip this page if we are not installing the client - SectionGetFlags ${secClient} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - StrCmp $R0 "0" Skip - - ; Set the install options here - -startOver: - WriteINIStr $0 "Field 2" "Flags" "DISABLED" - WriteINIStr $0 "Field 3" "State" "1" - WriteINIStr $0 "Field 4" "State" "0" - WriteINIStr $0 "Field 6" "State" "0" - WriteINIStr $0 "Field 3" "Text" "Use packaged configuration files for the ${SAMPLE_CONFIG_REALM} realm." - WriteINIStr $0 "Field 5" "State" "${HTTP_CONFIG_URL}" - - ; If there is an existing krb5.ini file, allow the user to choose it and make it default - IfFileExists "$WINDIR\krb5.ini" +1 notpresent - WriteINIStr $0 "Field 2" "Flags" "ENABLED" - WriteINIStr $0 "Field 2" "State" "1" - WriteINIStr $0 "Field 3" "State" "0" - - notpresent: - - !insertmacro MUI_HEADER_TEXT "Kerberos Configuration" "Please choose a method for installing the Kerberos Configuration files:" - InstallOptions::dialog $0 - Pop $R1 - StrCmp $R1 "cancel" exit - StrCmp $R1 "back" done - StrCmp $R1 "success" done -exit: Quit -done: - - ; Check that if a file is set, a valid filename is entered... - ReadINIStr $R0 $0 "Field 6" "State" - StrCmp $R0 "1" CheckFileName - - ;Check if a URL is specified, one *IS* specified - ReadINIStr $R0 $0 "Field 4" "State" - StrCmp $R0 "1" CheckURL Skip - - CheckURL: - ReadINIStr $R0 $0 "Field 5" "State" - StrCmp $R0 "" +1 Skip - MessageBox MB_OK|MB_ICONSTOP $(URLError) - WriteINIStr $0 "Field 4" "State" "0" - goto startOver - - CheckFileName: - ReadINIStr $R0 $0 "Field 7" "State" - IfFileExists "$R0\krb5.ini" Skip - - MessageBox MB_OK|MB_ICONSTOP $(ConfigFileError) - WriteINIStr $0 "Field 6" "State" "0" - goto startOver - - Skip: - -FunctionEnd - - -;------------------------------- -;Do the page to get the Startup Configuration - -Function KFWPageGetStartupConfig - ; Skip this page if we are not installing the client - SectionGetFlags ${secClient} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - StrCmp $R0 "0" Skip - - ; Set the install options here - - !insertmacro MUI_HEADER_TEXT "Network Identity Manager Setup" "Please select Network Identity ticket manager setup options:" - InstallOptions::dialog $1 - Pop $R1 - StrCmp $R1 "cancel" exit - StrCmp $R1 "back" done - StrCmp $R1 "success" done -exit: - Quit -done: -skip: - -FunctionEnd - - -;------------- -; Common install routines for each module -Function KFWCommon.Install - - WriteRegStr HKLM "${KFW_REGKEY_ROOT}" "InstallDir" $INSTDIR - - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayName" "${PROGRAM_NAME}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "UninstallString" "$INSTDIR\uninstall.exe" -!ifndef DEBUG - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION}" -!else - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION} Checked/Debug" -!endif - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "URLInfoAbout" "http://web.mit.edu/kerberos/" - -!ifdef DEBUG - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" 1 - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" 1 -!else - ; Delete the DEBUG string - DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" - DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" -!endif - - WriteUninstaller "$INSTDIR\Uninstall.exe" -FunctionEnd - - -;------------------------------- -; Check if the client should be checked for default install -Function ShouldClientInstall - Push $R0 - StrCpy $R2 "Client" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - ; Now we see if it's an older or newer version - - Call GetInstalledVersionMajor - Pop $R0 - IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionMinor - Pop $R0 - IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionPatch - Pop $R0 - IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade - -Reinstall: - StrCpy $R0 "1" - Exch $R0 - goto end - -Upgrade: - StrCpy $R0 "2" - Exch $R0 - goto end - -Downgrade: - StrCpy $R0 "3" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - -;------------------------------- -; Check how the Documentation options should be set -Function ShouldDocumentationInstall - Push $R0 - StrCpy $R2 "Documentation" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - ; Now we see if it's an older or newer version - - Call GetInstalledVersionMajor - Pop $R0 - IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionMinor - Pop $R0 - IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionPatch - Pop $R0 - IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade - -Reinstall: - StrCpy $R0 "1" - Exch $R0 - goto end - -Upgrade: - StrCpy $R0 "2" - Exch $R0 - goto end - -Downgrade: - StrCpy $R0 "3" - Exch $R0 - goto end - - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - -;------------------------------- -; Check how the SDK options should be set -Function ShouldSDKInstall - Push $R0 - StrCpy $R2 "SDK" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - ; Now we see if it's an older or newer version - - Call GetInstalledVersionMajor - Pop $R0 - IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionMinor - Pop $R0 - IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionPatch - Pop $R0 - IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade - -Reinstall: - StrCpy $R0 "1" - Exch $R0 - goto end - -Upgrade: - StrCpy $R0 "2" - Exch $R0 - goto end - -Downgrade: - StrCpy $R0 "3" - Exch $R0 - goto end - - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - -; See if KfW SDK is installed -; Returns: "1" if it is, 0 if it is not (on the stack) -Function IsSDKInstalled - Push $R0 - StrCpy $R2 "SDK" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - - StrCpy $R0 "1" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - -; See if KfW Client is installed -; Returns: "1" if it is, 0 if it is not (on the stack) -Function IsClientInstalled - Push $R0 - StrCpy $R2 "Client" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - - StrCpy $R0 "1" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - - -; See if KfW Documentation is installed -; Returns: "1" if it is, 0 if it is not (on the stack) -Function IsDocumentationInstalled - Push $R0 - StrCpy $R2 "Documentation" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - - StrCpy $R0 "1" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - - -;Check to see if any KfW component is installed -;Returns: Value on stack: "1" if it is, "0" if it is not -Function IsAnyKfWInstalled - Push $R0 - Push $R1 - Push $R2 - Call IsClientInstalled - Pop $R0 - Call IsSDKInstalled - Pop $R1 - Call IsDocumentationInstalled - Pop $R2 - ; Now we must see if ANY of the $Rn values are 1 - StrCmp $R0 "1" SomethingInstalled - StrCmp $R1 "1" SomethingInstalled - StrCmp $R2 "1" SomethingInstalled - ;Nothing installed - StrCpy $R0 "0" - goto end -SomethingInstalled: - StrCpy $R0 "1" -end: - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -;-------------------------------- -;Handle what must and what must not be installed -Function .onSelChange - ; If they install the SDK, they MUST install the client - SectionGetFlags ${secSDK} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - StrCmp $R0 "1" MakeClientSelected - goto end - -MakeClientSelected: - SectionGetFlags ${secClient} $R0 - IntOp $R0 $R0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $R0 - -end: -FunctionEnd - -Function AddProvider - Push $R0 - Push $R1 - ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" - Push $R0 - StrCpy $R0 "MIT Kerberos" - Push $R0 - Call StrStr - Pop $R0 - StrCmp $R0 "" DoOther +1 - ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" - StrCpy $R0 "$R1,MIT Kerberos" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0 -DoOther: - ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" - Push $R0 - StrCpy $R0 "MIT Kerberos" - Push $R0 - Call StrStr - Pop $R0 - StrCmp $R0 "" +1 End - ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" - StrCpy $R0 "$R1,MIT Kerberos" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0 -End: - Pop $R1 - Pop $R0 -FunctionEnd - -Function un.RemoveProvider - Push $R0 - StrCpy $R0 "MIT Kerberos" - Push $R0 - StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" - Call un.RemoveFromProvider - StrCpy $R0 "MIT Kerberos" - Push $R0 - StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" - Call un.RemoveFromProvider - Pop $R0 -FunctionEnd - -Function un.RemoveFromProvider - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - - ReadRegStr $1 HKLM "$R0" "ProviderOrder" - StrCpy $5 $1 1 -1 # copy last char - StrCmp $5 "," +2 # if last char != , - StrCpy $1 "$1," # append , - Push $1 - Push "$0," - Call un.StrStr ; Find `$0,` in $1 - Pop $2 ; pos of our dir - StrCmp $2 "" unRemoveFromPath_done - ; else, it is in path - # $0 - path to add - # $1 - path var - StrLen $3 "$0," - StrLen $4 $2 - StrCpy $5 $1 -$4 # $5 is now the part before the path to remove - StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove - StrCpy $3 $5$6 - - StrCpy $5 $3 1 -1 # copy last char - StrCmp $5 "," 0 +2 # if last char == , - StrCpy $3 $3 -1 # remove last char - - WriteRegStr HKLM "$R0" "ProviderOrder" $3 - - unRemoveFromPath_done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd diff --git a/src/windows/installer/nsis/kfw.ico b/src/windows/installer/nsis/kfw.ico deleted file mode 100644 index 8dcb29e7a6..0000000000 Binary files a/src/windows/installer/nsis/kfw.ico and /dev/null differ diff --git a/src/windows/installer/nsis/kfw.nsi b/src/windows/installer/nsis/kfw.nsi deleted file mode 100644 index a6f2733e17..0000000000 --- a/src/windows/installer/nsis/kfw.nsi +++ /dev/null @@ -1,16 +0,0 @@ -;KfW Install Script for NSIS -; -; Written by Jeffrey Altman -; based on the OpenAFS installer written by Rob Murawski -; -;Based on: -;NSIS Modern User Interface version 1.63 -;MultiLanguage Example Script -;Written by Joost Verburg -; -; This version compiles with NSIS v2.0b4 - -!include site-local.nsi -!include "MUI.nsh" -!include Sections.nsh -!include "kfw-fixed.nsi" diff --git a/src/windows/installer/nsis/killer.cpp b/src/windows/installer/nsis/killer.cpp deleted file mode 100644 index 7ba27fc203..0000000000 --- a/src/windows/installer/nsis/killer.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/* - Process Killer for NSIS script - - Rob Murawski - - Released under terms of IBM Open Source agreement for OpenAFS - - */ - - -#include -#include -#include -#include - -char strProcessName[256]; - -typedef BOOL (CALLBACK *PROCENUMPROC)(DWORD, WORD, LPSTR, LPARAM); - -typedef struct { - DWORD dwPID; - PROCENUMPROC lpProc; - DWORD lParam; - BOOL bEnd; -} EnumInfoStruct; - -BOOL WINAPI EnumProcs(PROCENUMPROC lpProc, LPARAM lParam); - -BOOL WINAPI Enum16(DWORD dwThreadId, WORD hMod16, WORD hTask16, - PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined); - -// -// The EnumProcs function takes a pointer to a callback function -// that will be called once per process with the process filename -// and process ID. -// -// lpProc -- Address of callback routine. -// -// lParam -- A user-defined LPARAM value to be passed to -// the callback routine. -// -// Callback function definition: -// BOOL CALLBACK Proc(DWORD dw, WORD w, LPCSTR lpstr, LPARAM lParam); -// -BOOL WINAPI EnumProcs(PROCENUMPROC lpProc, LPARAM lParam) { - - OSVERSIONINFO osver; - HINSTANCE hInstLib = NULL; - HINSTANCE hInstLib2 = NULL; - HANDLE hSnapShot = NULL; - LPDWORD lpdwPIDs = NULL; - PROCESSENTRY32 procentry; - BOOL bFlag; - DWORD dwSize; - DWORD dwSize2; - DWORD dwIndex; - HMODULE hMod; - HANDLE hProcess; - char szFileName[MAX_PATH]; - EnumInfoStruct sInfo; - - // ToolHelp Function Pointers. - HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD, DWORD); - BOOL (WINAPI *lpfProcess32First)(HANDLE, LPPROCESSENTRY32); - BOOL (WINAPI *lpfProcess32Next)(HANDLE, LPPROCESSENTRY32); - - // PSAPI Function Pointers. - BOOL (WINAPI *lpfEnumProcesses)(DWORD *, DWORD, DWORD *); - BOOL (WINAPI *lpfEnumProcessModules)(HANDLE, HMODULE *, DWORD, - LPDWORD); - DWORD (WINAPI *lpfGetModuleBaseName)(HANDLE, HMODULE, LPTSTR, DWORD); - - // VDMDBG Function Pointers. - INT (WINAPI *lpfVDMEnumTaskWOWEx)(DWORD, TASKENUMPROCEX, LPARAM); - - // Retrieve the OS version - osver.dwOSVersionInfoSize = sizeof(osver); - if (!GetVersionEx(&osver)) - return FALSE; - - // If Windows NT 4.0 - if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT - && osver.dwMajorVersion == 4) { - - __try { - - // Get the procedure addresses explicitly. We do - // this so we don't have to worry about modules - // failing to load under OSes other than Windows NT 4.0 - // because references to PSAPI.DLL can't be resolved. - hInstLib = LoadLibraryA("PSAPI.DLL"); - if (hInstLib == NULL) - __leave; - - hInstLib2 = LoadLibraryA("VDMDBG.DLL"); - if (hInstLib2 == NULL) - __leave; - - // Get procedure addresses. - lpfEnumProcesses = (BOOL (WINAPI *)(DWORD *, DWORD, DWORD*)) - GetProcAddress(hInstLib, "EnumProcesses"); - - lpfEnumProcessModules = (BOOL (WINAPI *)(HANDLE, HMODULE *, - DWORD, LPDWORD)) GetProcAddress(hInstLib, - "EnumProcessModules"); - - lpfGetModuleBaseName = (DWORD (WINAPI *)(HANDLE, HMODULE, - LPTSTR, DWORD)) GetProcAddress(hInstLib, - "GetModuleBaseNameA"); - - lpfVDMEnumTaskWOWEx = (INT (WINAPI *)(DWORD, TASKENUMPROCEX, - LPARAM)) GetProcAddress(hInstLib2, "VDMEnumTaskWOWEx"); - - if (lpfEnumProcesses == NULL - || lpfEnumProcessModules == NULL - || lpfGetModuleBaseName == NULL - || lpfVDMEnumTaskWOWEx == NULL) - __leave; - - // - // Call the PSAPI function EnumProcesses to get all of the - // ProcID's currently in the system. - // - // NOTE: In the documentation, the third parameter of - // EnumProcesses is named cbNeeded, which implies that you - // can call the function once to find out how much space to - // allocate for a buffer and again to fill the buffer. - // This is not the case. The cbNeeded parameter returns - // the number of PIDs returned, so if your buffer size is - // zero cbNeeded returns zero. - // - // NOTE: The "HeapAlloc" loop here ensures that we - // actually allocate a buffer large enough for all the - // PIDs in the system. - // - dwSize2 = 256 * sizeof(DWORD); - do { - - if (lpdwPIDs) { - HeapFree(GetProcessHeap(), 0, lpdwPIDs); - dwSize2 *= 2; - } - - lpdwPIDs = (LPDWORD) HeapAlloc(GetProcessHeap(), 0, - dwSize2); - if (lpdwPIDs == NULL) - __leave; - - if (!lpfEnumProcesses(lpdwPIDs, dwSize2, &dwSize)) - __leave; - - } while (dwSize == dwSize2); - - // How many ProcID's did we get? - dwSize /= sizeof(DWORD); - - // Loop through each ProcID. - for (dwIndex = 0; dwIndex < dwSize; dwIndex++) { - - szFileName[0] = 0; - - // Open the process (if we can... security does not - // permit every process in the system to be opened). - hProcess = OpenProcess( - PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, - FALSE, lpdwPIDs[dwIndex]); - if (hProcess != NULL) { - - // Here we call EnumProcessModules to get only the - // first module in the process. This will be the - // EXE module for which we will retrieve the name. - if (lpfEnumProcessModules(hProcess, &hMod, - sizeof(hMod), &dwSize2)) { - - // Get the module name - if (!lpfGetModuleBaseName(hProcess, hMod, - szFileName, sizeof(szFileName))) - szFileName[0] = 0; - } - CloseHandle(hProcess); - } - // Regardless of OpenProcess success or failure, we - // still call the enum func with the ProcID. - if (!lpProc(lpdwPIDs[dwIndex], 0, szFileName, lParam)) - break; - - // Did we just bump into an NTVDM? - if (_stricmp(szFileName, "NTVDM.EXE") == 0) { - - // Fill in some info for the 16-bit enum proc. - sInfo.dwPID = lpdwPIDs[dwIndex]; - sInfo.lpProc = lpProc; - sInfo.lParam = (DWORD) lParam; - sInfo.bEnd = FALSE; - - // Enum the 16-bit stuff. - lpfVDMEnumTaskWOWEx(lpdwPIDs[dwIndex], - (TASKENUMPROCEX) Enum16, (LPARAM) &sInfo); - - // Did our main enum func say quit? - if (sInfo.bEnd) - break; - } - } - - } __finally { - - if (hInstLib) - FreeLibrary(hInstLib); - - if (hInstLib2) - FreeLibrary(hInstLib2); - - if (lpdwPIDs) - HeapFree(GetProcessHeap(), 0, lpdwPIDs); - } - - // If any OS other than Windows NT 4.0. - } else if (osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS - || (osver.dwPlatformId == VER_PLATFORM_WIN32_NT - && osver.dwMajorVersion > 4)) { - - __try { - - hInstLib = LoadLibraryA("Kernel32.DLL"); - if (hInstLib == NULL) - __leave; - - // If NT-based OS, load VDMDBG.DLL. - if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) { - hInstLib2 = LoadLibraryA("VDMDBG.DLL"); - if (hInstLib2 == NULL) - __leave; - } - - // Get procedure addresses. We are linking to - // these functions explicitly, because a module using - // this code would fail to load under Windows NT, - // which does not have the Toolhelp32 - // functions in KERNEL32.DLL. - lpfCreateToolhelp32Snapshot = - (HANDLE (WINAPI *)(DWORD,DWORD)) - GetProcAddress(hInstLib, "CreateToolhelp32Snapshot"); - - lpfProcess32First = - (BOOL (WINAPI *)(HANDLE,LPPROCESSENTRY32)) - GetProcAddress(hInstLib, "Process32First"); - - lpfProcess32Next = - (BOOL (WINAPI *)(HANDLE,LPPROCESSENTRY32)) - GetProcAddress(hInstLib, "Process32Next"); - - if (lpfProcess32Next == NULL - || lpfProcess32First == NULL - || lpfCreateToolhelp32Snapshot == NULL) - __leave; - - if (osver.dwPlatformId == VER_PLATFORM_WIN32_NT) { - lpfVDMEnumTaskWOWEx = (INT (WINAPI *)(DWORD, TASKENUMPROCEX, - LPARAM)) GetProcAddress(hInstLib2, "VDMEnumTaskWOWEx"); - if (lpfVDMEnumTaskWOWEx == NULL) - __leave; - } - - // Get a handle to a Toolhelp snapshot of all processes. - hSnapShot = lpfCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if (hSnapShot == INVALID_HANDLE_VALUE) { - FreeLibrary(hInstLib); - return FALSE; - } - - // Get the first process' information. - procentry.dwSize = sizeof(PROCESSENTRY32); - bFlag = lpfProcess32First(hSnapShot, &procentry); - - // While there are processes, keep looping. - while (bFlag) { - - // Call the enum func with the filename and ProcID. - if (lpProc(procentry.th32ProcessID, 0, - procentry.szExeFile, lParam)) { - - // Did we just bump into an NTVDM? - if (_stricmp(procentry.szExeFile, "NTVDM.EXE") == 0) { - - // Fill in some info for the 16-bit enum proc. - sInfo.dwPID = procentry.th32ProcessID; - sInfo.lpProc = lpProc; - sInfo.lParam = (DWORD) lParam; - sInfo.bEnd = FALSE; - - // Enum the 16-bit stuff. - lpfVDMEnumTaskWOWEx(procentry.th32ProcessID, - (TASKENUMPROCEX) Enum16, (LPARAM) &sInfo); - - // Did our main enum func say quit? - if (sInfo.bEnd) - break; - } - - procentry.dwSize = sizeof(PROCESSENTRY32); - bFlag = lpfProcess32Next(hSnapShot, &procentry); - - } else - bFlag = FALSE; - } - - } __finally { - - if (hInstLib) - FreeLibrary(hInstLib); - - if (hInstLib2) - FreeLibrary(hInstLib2); - } - - } else - return FALSE; - - // Free the library. - FreeLibrary(hInstLib); - - return TRUE; -} - - -BOOL WINAPI Enum16(DWORD dwThreadId, WORD hMod16, WORD hTask16, - PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined) { - - BOOL bRet; - - EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined; - - bRet = psInfo->lpProc(psInfo->dwPID, hTask16, pszFileName, - psInfo->lParam); - - if (!bRet) - psInfo->bEnd = TRUE; - - return !bRet; -} - - -BOOL CALLBACK MyProcessEnumerator(DWORD dwPID, WORD wTask, - LPCSTR szProcess, LPARAM lParam) { - - /*if (wTask == 0) - printf("%5u %s\n", dwPID, szProcess); - else - printf(" %5u %s\n", wTask, szProcess);*/ - - if(stricmp(szProcess,strProcessName)==0) - { - HANDLE hProcess=OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPID); - if(hProcess!=NULL) - TerminateProcess(hProcess,0); - CloseHandle(hProcess); - } - - return TRUE; -} - - -void main(int argc, char *argv[]) -{ - if(argc<2) - { - printf("Please specify the process name to kill\n"); - - return; - } - - if(strlen((argv[1]))<255) - strcpy(strProcessName,(argv[1])); - else - return; - - EnumProcs((PROCENUMPROC) MyProcessEnumerator, 0); - -} diff --git a/src/windows/installer/nsis/licenses.rtf b/src/windows/installer/nsis/licenses.rtf deleted file mode 100644 index 91dd9070e2..0000000000 --- a/src/windows/installer/nsis/licenses.rtf +++ /dev/null @@ -1,98 +0,0 @@ -{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fmodern\fprq1\fcharset0 Courier New;}{\f1\froman\fprq2\fcharset0 Times New Roman;}} -{\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\tx916\tx1832\tx2748\tx3664\tx4580\tx5496\tx6412\tx7328\tx8244\tx9160\tx10076\tx10992\tx11908\tx12824\tx13740\tx14656\f0\fs20 Copyright Notice and Legal Administrivia\par -----------------------------------------\par -\par -Copyright (C) 1985-2006 by the Massachusetts Institute of Technology.\par -\par -All rights reserved.\par -\par -Export of this software from the United States of America may require a specific license from the United States Government. It is the responsibility of any person or organization contemplating export to obtain such a license before exporting.\par -\par -WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and\par -this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Furthermore if you modify this software you must label your software as modified software and not distribute it in such a fashion that it might be confused with the original MIT software. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.\par -\par -THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\par -\par -Individual source code files are copyright MIT, Cygnus Support, OpenVision, Oracle, Sun Soft, FundsXpress, and others.\par -\par -Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira, and Zephyr are trademarks of the Massachusetts Institute of Technology (MIT). No commercial use of these trademarks may be made without prior written permission of MIT.\par -\par -"Commercial use" means use of a name in a product or other for-profit manner. It does NOT prevent a commercial firm from referring to the MIT trademarks in order to convey information (although in doing so, recognition of their trademark status should be given).\par -\par -----\par -\par -The following copyright and permission notice applies to the OpenVision Kerberos Administration system located in kadmin/create, kadmin/dbutil, kadmin/passwd, kadmin/server, lib/kadm5, and portions of lib/rpc:\par -\par -Copyright, OpenVision Technologies, Inc., 1996, All Rights Reserved\par -\par -WARNING: Retrieving the OpenVision Kerberos Administration system source code, as described below, indicates your acceptance of the following terms. If you do not agree to the following terms, do not retrieve the OpenVision Kerberos administration system.\par -\par -You may freely use and distribute the Source Code and Object Code compiled from it, with or without modification, but this Source Code is provided to you "AS IS" EXCLUSIVE OF ANY WARRANTY, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, OR ANY OTHER WARRANTY, WHETHER EXPRESS OR IMPLIED. IN NO EVENT WILL OPENVISION HAVE ANY LIABILITY FOR ANY LOST PROFITS, LOSS OF DATA OR COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, INCLUDING, WITHOUT LIMITATION, THOSE RESULTING FROM THE USE OF THE SOURCE CODE, OR THE FAILURE OF THE SOURCE CODE TO PERFORM, OR FOR ANY OTHER REASON.\par -\par -OpenVision retains all copyrights in the donated Source Code. OpenVision also retains copyright to derivative works of the Source Code, whether created by OpenVision or by a third party. The OpenVision copyright notice must be preserved if derivative works are made based on the donated Source Code.\par -\par -OpenVision Technologies, Inc. has donated this Kerberos Administration system to MIT for inclusion in the standard Kerberos 5 distribution. This donation underscores our commitment to continuing Kerberos technology development and our gratitude for the valuable work which has been performed by MIT and the Kerberos community.\par -\par -----\par -\par -Portions contributed by Matt Crawford were work performed at Fermi National Accelerator Laboratory, which is operated by Universities Research Association, Inc., under contract DE-AC02-76CHO3000 with the U.S. Department of Energy.\par -\par ----- The implementation of the Yarrow pseudo-random number generator in src/lib/crypto/yarrow has the following copyright:\par -\par -Copyright 2000 by Zero-Knowledge Systems, Inc.\par -\par -Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Zero-Knowledge Systems, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. Zero-Knowledge Systems, Inc. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.\par -\par -ZERO-KNOWLEDGE SYSTEMS, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ZERO-KNOWLEDGE SYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\par -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\par -\par ----- The implementation of the AES encryption algorithm in src/lib/crypto/aes has the following copyright:\par -\par -Copyright (c) 2001, Dr Brian Gladman , Worcester, UK.\par -All rights reserved.\par -\par -LICENSE TERMS\par -\par -The free distribution and use of this software in both source and binary form is allowed (with or without changes) provided that:\par -\par -1. distributions of this source code include the above copyright notice, this list of conditions and the following disclaimer;\par -\par -2. distributions in binary form include the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other associated materials;\par -\par -3. the copyright holder's name is not used to endorse products built using this software without specific written permission. \par -\par -DISCLAIMER\par -\par -This software is provided 'as is' with no explcit or implied warranties in respect of any properties, including, but not limited to, correctness and fitness for purpose.\par -\par -\par -\par -Acknowledgements\par -----------------\par -\par -Appreciation Time!!!! There are far too many people to try to thank them all; many people have contributed to the development of Kerberos V5. This is only a partial listing....\par -\par -Thanks to Paul Vixie and the Internet Software Consortium for funding the work of Barry Jaspan. This funding was invaluable for the OV administration server integration, as well as the 1.0 release preparation process.\par -\par -Thanks to John Linn, Scott Foote, and all of the folks at OpenVision Technologies, Inc., who donated their administration server for use in the MIT release of Kerberos.\par -\par -Thanks to Jeff Bigler, Mark Eichin, Marc Horowitz, Nancy Gilman, Ken Raeburn, and all of the folks at Cygnus Support, who provided innumerable bug fixes and portability enhancements to the Kerberos V5 tree. Thanks especially to Jeff Bigler, for the new user and system administrator's documentation.\par -\par -Thanks to Doug Engert from ANL for providing many bug fixes, as well as testing to ensure DCE interoperability.\par -\par -Thanks to Ken Hornstein at NRL for providing many bug fixes and suggestions, and for working on SAM preauthentication.\par -\par -Thanks to Matt Crawford at FNAL for bugfixes and enhancements.\par -\par -Thanks to Sean Mullan and Bill Sommerfeld from Hewlett Packard for their many suggestions and bug fixes.\par -\par -Thanks to Nalin Dahyabhai of RedHat and Chris Evans for locating and providing patches for numerous buffer overruns.\par -\par -Thanks to Christopher Thompson and Marcus Watts for discovering the ftpd security bug.\par -\par -Thanks to Paul Nelson of Thursby Software Systems for implementing the Microsoft set password protocol.\par -\par -Thanks to the members of the Kerberos V5 development team at MIT, both past and present: Danilo Almeida, Jeffrey Altman, Jay Berkenbilt, Richard Basch, Mitch Berger, John Carr, Don Davis, Alexandra Ellwood, Nancy Gilman, Matt Hancher, Sam Hartman, Paul Hill, Marc Horowitz, Eva Jacobus, Miroslav Jurisic, Barry Jaspan, Geoffrey King, John Kohl, Peter Litwack, Scott McGuire, Kevin Mitchell, Cliff Neuman, Paul Park, Ezra Peisach, Chris Provenzano, Ken Raeburn, Jon Rochlis, Jeff Schiller, Jen Selby, Brad Thompson, Harry Tsai, Ted Ts'o, Marshall Vale, Tom Yu.\par -\pard\f1\fs24\par -} - \ No newline at end of file diff --git a/src/windows/installer/nsis/nsi-includes-tagged.nsi b/src/windows/installer/nsis/nsi-includes-tagged.nsi deleted file mode 100644 index 01bd299860..0000000000 --- a/src/windows/installer/nsis/nsi-includes-tagged.nsi +++ /dev/null @@ -1,8 +0,0 @@ -!define KFW_TARGETDIR %BUILDDIR%\target -!define KFW_EXTRADIR "%BUILDDIR%\target" -!define KFW_VERSION %VERSION_MAJOR%.%VERSION_MINOR% -!define KFW_MAJORVERSION %VERSION_MAJOR% -!define KFW_MINORVERSION %VERSION_MINOR% -!define KFW_PATCHLEVEL %VERSION_PATCH% -!define CL_1310 - diff --git a/src/windows/installer/nsis/site-local-tagged.nsi b/src/windows/installer/nsis/site-local-tagged.nsi deleted file mode 100644 index 614a27af90..0000000000 --- a/src/windows/installer/nsis/site-local-tagged.nsi +++ /dev/null @@ -1,13 +0,0 @@ -!define KFW_TARGETDIR %TARGETDIR% -!define KFW_CONFIG_DIR %CONFIGDIR-NSI% -!define KFW_MAJORVERSION %VERSION_MAJOR% -!define KFW_MINORVERSION %VERSION_MINOR% -!define KFW_PATCHLEVEL %VERSION_PATCH% -!define CL_1310 - -!define RELEASE -!define NOT_DEBUG -!define BETA 1 -!define SAMPLE_CONFIG_REALM "ATHENA.MIT.EDU" -!define HTTP_CONFIG_URL "[Obtain a URL from your Kerberos administrator]" - diff --git a/src/windows/installer/nsis/utils.nsi b/src/windows/installer/nsis/utils.nsi deleted file mode 100644 index e9f98c04ed..0000000000 --- a/src/windows/installer/nsis/utils.nsi +++ /dev/null @@ -1,825 +0,0 @@ -;----------------------------------------------- -; Common Utility functions not specific to KFW - -;------------------- -; Get the currently installed version and place it on the stack -; Modifies: Nothing -Function GetInstalledVersion - Push $R0 - Push $R1 - Push $R4 - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\$R2\CurrentVersion" "VersionString" - StrCmp $R0 "" done - -done: - Pop $R4 - Pop $R1 - Exch $R0 -FunctionEnd - -; Functions to get each component of the version number -Function GetInstalledVersionMajor - Push $R0 - Push $R1 - Push $R4 - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\$R2\CurrentVersion" "MajorVersion" - StrCmp $R0 "" done - -done: - Pop $R4 - Pop $R1 - Exch $R0 -FunctionEnd - -Function GetInstalledVersionMinor - Push $R0 - Push $R1 - Push $R4 - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\$R2\CurrentVersion" "MinorVersion" - StrCmp $R0 "" done - -done: - Pop $R4 - Pop $R1 - Exch $R0 -FunctionEnd - -Function GetInstalledVersionPatch - Push $R0 - Push $R1 - Push $R4 - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\$R2\CurrentVersion" "PatchLevel" - StrCmp $R0 "" done - -done: - Pop $R4 - Pop $R1 - Exch $R0 -FunctionEnd - - -;-------------------------------- -; Macros - -;-------------------------------- -; Macros -; Macro - Upgrade DLL File -; Written by Joost Verburg -; ------------------------ -; -; Parameters: -; LOCALFILE - Location of the new DLL file (on the compiler system) -; DESTFILE - Location of the DLL file that should be upgraded -; (on the user's system) -; TEMPBASEDIR - Directory on the user's system to store a temporary file -; when the system has to be rebooted. -; For Win9x support, this should be on the same volume as the -; DESTFILE! -; The Windows temp directory could be located on any volume, -; so you cannot use this directory. -; -; Define REPLACEDLL_NOREGISTER if you want to upgrade a DLL that does not -; have to be registered. -; -; Note: If you want to support Win9x, you can only use -; short filenames (8.3). -; -; Example of usage: -; !insertmacro ReplaceDLL "dllname.dll" "$SYSDIR\dllname.dll" "$SYSDIR" -; - -!macro ReplaceDLL LOCALFILE DESTFILE TEMPBASEDIR - - Push $R0 - Push $R1 - Push $R2 - Push $R3 - Push $R4 - Push $R5 - - ;------------------------ - ;Unique number for labels - - !define REPLACEDLL_UNIQUE ${__LINE__} - - ;------------------------ - ;Copy the parameters used on run-time to a variable - ;This allows the usage of variables as paramter - - StrCpy $R4 "${DESTFILE}" - StrCpy $R5 "${TEMPBASEDIR}" - - ;------------------------ - ;Check file and version - ; - IfFileExists $R4 0 replacedll.copy_${REPLACEDLL_UNIQUE} - - ;ClearErrors - ; GetDLLVersionLocal "${LOCALFILE}" $R0 $R1 - ; GetDLLVersion $R4 $R2 $R3 - ;IfErrors replacedll.upgrade_${REPLACEDLL_UNIQUE} - ; - ;IntCmpU $R0 $R2 0 replacedll.done_${REPLACEDLL_UNIQUE} \ - ; replacedll.upgrade_${REPLACEDLL_UNIQUE} - ;IntCmpU $R1 $R3 replacedll.done_${REPLACEDLL_UNIQUE} \ - ; replacedll.done_${REPLACEDLL_UNIQUE} \ - ; replacedll.upgrade_${REPLACEDLL_UNIQUE} - - ;------------------------ - ;Let's replace the DLL! - - SetOverwrite try - - ;replacedll.upgrade_${REPLACEDLL_UNIQUE}: - !ifndef REPLACEDLL_NOREGISTER - ;Unregister the DLL - UnRegDLL $R4 - !endif - - ;------------------------ - ;Try to copy the DLL directly - - ClearErrors - StrCpy $R0 $R4 - Call :replacedll.file_${REPLACEDLL_UNIQUE} - IfErrors 0 replacedll.noreboot_${REPLACEDLL_UNIQUE} - - ;------------------------ - ;DLL is in use. Copy it to a temp file and Rename it on reboot. - - GetTempFileName $R0 $R5 - Call :replacedll.file_${REPLACEDLL_UNIQUE} - Rename /REBOOTOK $R0 $R4 - - ;------------------------ - ;Register the DLL on reboot - - !ifndef REPLACEDLL_NOREGISTER - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" \ - "Register $R4" 'rundll32.exe "$R4",DllRegisterServer' - !endif - - Goto replacedll.done_${REPLACEDLL_UNIQUE} - - ;------------------------ - ;DLL does not exist - just extract - - replacedll.copy_${REPLACEDLL_UNIQUE}: - StrCpy $R0 $R4 - Call :replacedll.file_${REPLACEDLL_UNIQUE} - - ;------------------------ - ;Register the DLL - - replacedll.noreboot_${REPLACEDLL_UNIQUE}: - !ifndef REPLACEDLL_NOREGISTER - RegDLL $R4 - !endif - - ;------------------------ - ;Done - - replacedll.done_${REPLACEDLL_UNIQUE}: - - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Pop $R1 - Pop $R0 - - ;------------------------ - ;End - - Goto replacedll.end_${REPLACEDLL_UNIQUE} - - ;------------------------ - ;Called to extract the DLL - - replacedll.file_${REPLACEDLL_UNIQUE}: - File /oname=$R0 "${LOCALFILE}" - Return - - replacedll.end_${REPLACEDLL_UNIQUE}: - - ;------------------------ - ;Restore settings - - SetOverwrite lastused - - !undef REPLACEDLL_UNIQUE - -!macroend - - -; GetParameters -; input, none -; output, top of stack (replaces, with e.g. whatever) -; modifies no other variables. - -Function GetParameters - Push $R0 - Push $R1 - Push $R2 - StrCpy $R0 $CMDLINE 1 - StrCpy $R1 '"' - StrCpy $R2 1 - StrCmp $R0 '"' loop - StrCpy $R1 ' ' ; we're scanning for a space instead of a quote - loop: - StrCpy $R0 $CMDLINE 1 $R2 - StrCmp $R0 $R1 loop2 - StrCmp $R0 "" loop2 - IntOp $R2 $R2 + 1 - Goto loop - loop2: - IntOp $R2 $R2 + 1 - StrCpy $R0 $CMDLINE 1 $R2 - StrCmp $R0 " " loop2 - StrCpy $R0 $CMDLINE "" $R2 - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - - -!verbose 3 -!include "WinMessages.NSH" -!verbose 4 - -Function GetSystemPath - Push $0 - - Call IsNT - Pop $0 - StrCmp $0 1 GetPath_NT - ReadEnvStr $0 PATH - goto HavePath -GetPath_NT: - ReadRegStr $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" -HavePath: - - Exch $0 -FunctionEnd - -;==================================================== -; AddToSystemPath - Adds the given dir to the search path. -; Input - head of the stack -; Note - Win9x systems requires reboot -;==================================================== -Function AddToSystemPath - Exch $0 - Push $1 - Push $2 - Push $3 - - # don't add if the path doesn't exist - IfFileExists $0 "" AddToPath_done - - Call GetSystemPath - Pop $1 - Push "$1;" - Push "$0;" - Call StrStr - Pop $2 - StrCmp $2 "" 0 AddToPath_done - Push "$1;" - Push "$0\;" - Call StrStr - Pop $2 - StrCmp $2 "" 0 AddToPath_done - GetFullPathName /SHORT $3 $0 - Push "$1;" - Push "$3;" - Call StrStr - Pop $2 - StrCmp $2 "" 0 AddToPath_done - Push "$1;" - Push "$3\;" - Call StrStr - Pop $2 - StrCmp $2 "" 0 AddToPath_done - - Call IsNT - Pop $1 - StrCmp $1 1 AddToPath_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" a - FileSeek $1 -1 END - FileReadByte $1 $2 - IntCmp $2 26 0 +2 +2 # DOS EOF - FileSeek $1 -1 END # write over EOF - FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" - FileClose $1 - SetRebootFlag true - Goto AddToPath_done - - AddToPath_NT: - ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - StrCpy $2 $1 1 -1 # copy last char - StrCmp $2 ";" 0 +2 # if last char == ; - StrCpy $1 $1 -1 # remove last char - StrCmp $1 "" AddToPath_NTdoIt - StrCpy $0 "$1;$0" - AddToPath_NTdoIt: - WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $0 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - AddToPath_done: - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -;==================================================== -; RemoveFromPath - Remove a given dir from the path -; Input: head of the stack -;==================================================== -Function un.RemoveFromSystemPath - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - - IntFmt $6 "%c" 26 # DOS EOF - - Call un.IsNT - Pop $1 - StrCmp $1 1 unRemoveFromPath_NT - ; Not on NT - StrCpy $1 $WINDIR 2 - FileOpen $1 "$1\autoexec.bat" r - GetTempFileName $4 - FileOpen $2 $4 w - GetFullPathName /SHORT $0 $0 - StrCpy $0 "SET PATH=%PATH%;$0" - Goto unRemoveFromPath_dosLoop - - unRemoveFromPath_dosLoop: - FileRead $1 $3 - StrCpy $5 $3 1 -1 # read last char - StrCmp $5 $6 0 +2 # if DOS EOF - StrCpy $3 $3 -1 # remove DOS EOF so we can compare - StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine - StrCmp $3 "" unRemoveFromPath_dosLoopEnd - FileWrite $2 $3 - Goto unRemoveFromPath_dosLoop - unRemoveFromPath_dosLoopRemoveLine: - SetRebootFlag true - Goto unRemoveFromPath_dosLoop - - unRemoveFromPath_dosLoopEnd: - FileClose $2 - FileClose $1 - StrCpy $1 $WINDIR 2 - Delete "$1\autoexec.bat" - CopyFiles /SILENT $4 "$1\autoexec.bat" - Delete $4 - Goto unRemoveFromPath_done - - unRemoveFromPath_NT: - ReadRegStr $1 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" - StrCpy $5 $1 1 -1 # copy last char - StrCmp $5 ";" +2 # if last char != ; - StrCpy $1 "$1;" # append ; - Push $1 - Push "$0;" - Call un.StrStr ; Find `$0;` in $1 - Pop $2 ; pos of our dir - StrCmp $2 "" unRemoveFromPath_done - ; else, it is in path - # $0 - path to add - # $1 - path var - StrLen $3 "$0;" - StrLen $4 $2 - StrCpy $5 $1 -$4 # $5 is now the part before the path to remove - StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove - StrCpy $3 $5$6 - - StrCpy $5 $3 1 -1 # copy last char - StrCmp $5 ";" 0 +2 # if last char == ; - StrCpy $3 $3 -1 # remove last char - - WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "PATH" $3 - SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 - - unRemoveFromPath_done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd - -;==================================================== -; IsNT - Returns 1 if the current system is NT, 0 -; otherwise. -; Output: head of the stack -;==================================================== -!macro IsNT un -Function ${un}IsNT - Push $0 - ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - StrCmp $0 "" 0 IsNT_yes - ; we are not NT. - Pop $0 - Push 0 - Return - - IsNT_yes: - ; NT!!! - Pop $0 - Push 1 -FunctionEnd -!macroend -!insertmacro IsNT "" -!insertmacro IsNT "un." - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Uninstall stuff -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;==================================================== -; StrStr - Finds a given string in another given string. -; Returns -1 if not found and the pos if found. -; Input: head of the stack - string to find -; second in the stack - string to find in -; Output: head of the stack -;==================================================== -!macro StrStr un -Function ${un}StrStr -Exch $R1 ; st=haystack,old$R1, $R1=needle - Exch ; st=old$R1,haystack - Exch $R2 ; st=old$R1,old$R2, $R2=haystack - Push $R3 - Push $R4 - Push $R5 - StrLen $R3 $R1 - StrCpy $R4 0 - ; $R1=needle - ; $R2=haystack - ; $R3=len(needle) - ; $R4=cnt - ; $R5=tmp - loop: - StrCpy $R5 $R2 $R3 $R4 - StrCmp $R5 $R1 done - StrCmp $R5 "" done - IntOp $R4 $R4 + 1 - Goto loop -done: - StrCpy $R1 $R2 "" $R4 - Pop $R5 - Pop $R4 - Pop $R3 - Pop $R2 - Exch $R1 -FunctionEnd -!macroend -!insertmacro StrStr "" -!insertmacro StrStr "un." - - -!ifdef ADDSHAREDDLLUSED -; AddSharedDLL - ; - ; Increments a shared DLLs reference count. - ; Use by passing one item on the stack (the full path of the DLL). - ; - ; Usage: - ; Push $SYSDIR\myDll.dll - ; Call AddSharedDLL - ; - - Function AddSharedDLL - Exch $R1 - Push $R0 - ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 - IntOp $R0 $R0 + 1 - WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 - Pop $R0 - Pop $R1 - FunctionEnd - - -; un.RemoveSharedDLL - ; - ; Decrements a shared DLLs reference count, and removes if necessary. - ; Use by passing one item on the stack (the full path of the DLL). - ; Note: for use in the main installer (not the uninstaller), rename the - ; function to RemoveSharedDLL. - ; - ; Usage: - ; Push $SYSDIR\myDll.dll - ; Call un.RemoveSharedDLL - ; - - Function un.RemoveSharedDLL - Exch $R1 - Push $R0 - ReadRegDword $R0 HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 - StrCmp $R0 "" remove - IntOp $R0 $R0 - 1 - IntCmp $R0 0 rk rk uk - rk: - DeleteRegValue HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 - goto Remove - uk: - WriteRegDWORD HKLM Software\Microsoft\Windows\CurrentVersion\SharedDLLs $R1 $R0 - Goto noremove - remove: - Delete /REBOOTOK $R1 - noremove: - Pop $R0 - Pop $R1 - FunctionEnd -!endif - - -; GetWindowsVersion -; -; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ -; Updated by Joost Verburg -; -; Returns on top of stack -; -; Windows Version (95, 98, ME, NT x.x, 2000, XP, 2003) -; or -; '' (Unknown Windows Version) -; -; Usage: -; Call GetWindowsVersion -; Pop $R0 -; ; at this point $R0 is "NT 4.0" or whatnot - -Function GetWindowsVersion - - Push $R0 - Push $R1 - - ClearErrors - - ReadRegStr $R0 HKLM \ - "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion - - IfErrors 0 lbl_winnt - - ; we are not NT - ReadRegStr $R0 HKLM \ - "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber - - StrCpy $R1 $R0 1 - StrCmp $R1 '4' 0 lbl_error - - StrCpy $R1 $R0 3 - - StrCmp $R1 '4.0' lbl_win32_95 - StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 - - lbl_win32_95: - StrCpy $R0 '95' - Goto lbl_done - - lbl_win32_98: - StrCpy $R0 '98' - Goto lbl_done - - lbl_win32_ME: - StrCpy $R0 'ME' - Goto lbl_done - - lbl_winnt: - - StrCpy $R1 $R0 1 - - StrCmp $R1 '3' lbl_winnt_x - StrCmp $R1 '4' lbl_winnt_x - - StrCpy $R1 $R0 3 - - StrCmp $R1 '5.0' lbl_winnt_2000 - StrCmp $R1 '5.1' lbl_winnt_XP - StrCmp $R1 '5.2' lbl_winnt_2003 lbl_error - - lbl_winnt_x: - StrCpy $R0 "NT $R0" 6 - Goto lbl_done - - lbl_winnt_2000: - Strcpy $R0 '2000' - Goto lbl_done - - lbl_winnt_XP: - Strcpy $R0 'XP' - Goto lbl_done - - lbl_winnt_2003: - Strcpy $R0 '2003' - Goto lbl_done - - lbl_error: - Strcpy $R0 '' - lbl_done: - - Pop $R1 - Exch $R0 - -FunctionEnd - - -; Author: Lilla (lilla@earthlink.net) 2003-06-13 -; function IsUserAdmin uses plugin \NSIS\PlusgIns\UserInfo.dll -; This function is based upon code in \NSIS\Contrib\UserInfo\UserInfo.nsi -; This function was tested under NSIS 2 beta 4 (latest CVS as of this writing). -; -; Usage: -; Call IsUserAdmin -; Pop $R0 ; at this point $R0 is "true" or "false" -; -Function IsUserAdmin -Push $R0 -Push $R1 -Push $R2 - -ClearErrors -UserInfo::GetName -IfErrors Win9x -Pop $R1 -UserInfo::GetAccountType -Pop $R2 - -StrCmp $R2 "Admin" 0 Continue -; Observation: I get here when running Win98SE. (Lilla) -; The functions UserInfo.dll looks for are there on Win98 too, -; but just don't work. So UserInfo.dll, knowing that admin isn't required -; on Win98, returns admin anyway. (per kichik) -; MessageBox MB_OK 'User "$R1" is in the Administrators group' -StrCpy $R0 "true" -Goto Done - -Continue: -; You should still check for an empty string because the functions -; UserInfo.dll looks for may not be present on Windows 95. (per kichik) -StrCmp $R2 "" Win9x -StrCpy $R0 "false" -;MessageBox MB_OK 'User "$R1" is in the "$R2" group' -Goto Done - -Win9x: -; comment/message below is by UserInfo.nsi author: -; This one means you don't need to care about admin or -; not admin because Windows 9x doesn't either -;MessageBox MB_OK "Error! This DLL can't run under Windows 9x!" -StrCpy $R0 "false" - -Done: -;MessageBox MB_OK 'User= "$R1" AccountType= "$R2" IsUserAdmin= "$R0"' - -Pop $R2 -Pop $R1 -Exch $R0 -FunctionEnd - -Function RestartRequired -Push $R1 ;Original Variable -Push $R2 -Push $R3 ;Counter Variable - -StrCpy $R1 "0" 1 ;initialize variable with 0 -StrCpy $R3 "0" 0 ;Counter Variable - -;First Check Current User RunOnce Key -EnumRegValue $R2 HKCU "Software\Microsoft\Windows\CurrentVersion\RunOnce" $R3 -StrCmp $R2 "" 0 FoundRestart - -;Next Check Local Machine RunOnce Key -EnumRegValue $R2 HKLM "Software\Microsoft\Windows\CurrentVersion\RunOnce" $R3 -StrCmp $R2 "" 0 FoundRestart - -EnumRegValue $R2 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\FileRenameOperations" $R3 -StrCmp $R2 "" 0 FoundRestart - -NextValue: -EnumRegValue $R2 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager" $R3 -StrCmp $R2 "" ExitFunc 0 -StrCmp $R2 "PendingFileRenameOperations" FoundRestart 0 -IntOp $R3 $R3 + 1 -Goto NextValue - -FoundRestart: -StrCpy $R1 "1" 1 - -ExitFunc: -Pop $R3 -Pop $R2 -Exch $R1 -FunctionEnd - -; GetParent - ; input, top of stack (e.g. C:\Program Files\Poop) - ; output, top of stack (replaces, with e.g. C:\Program Files) - ; modifies no other variables. - ; - ; Usage: - ; Push "C:\Program Files\Directory\Whatever" - ; Call GetParent - ; Pop $R0 - ; ; at this point $R0 will equal "C:\Program Files\Directory" - -Function GetParent - - Exch $R0 - Push $R1 - Push $R2 - Push $R3 - - StrCpy $R1 0 - StrLen $R2 $R0 - - loop: - IntOp $R1 $R1 + 1 - IntCmp $R1 $R2 get 0 get - StrCpy $R3 $R0 1 -$R1 - StrCmp $R3 "\" get - Goto loop - - get: - StrCpy $R0 $R0 -$R1 - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 - -FunctionEnd - -; SearchPath (path, filename) -; input: -; top of stack is the filename -; top of stack minus one is the path -; output: -; top of stack is a fully qualified path or the number "0" -; -; Usage: -; Push "semicolon delimited path" -; Push "filename" -; Call SearchPath -; Pop $R0 ; fqpn -; StrCmp $R0 "" failed -; -; -Function SearchPath - Exch $R0 ; input - filename - Exch - Exch $R1 ; input - semicolon delimited path - Push $R3 ; worker - index to current end character - Push $R4 ; worker - length of $R1 - Push $R5 ; worker - copy of directory string/fqpn to search for - Push $R6 ; worker - single charcter copy or find handle - - StrCpy $R3 0 ; init character index - StrLen $R4 $R1 ; determine length of semicolon delimited path - StrCpy $R5 "" ; init return value - - findDir: ; find a semi-colon or end of string - IntCmp $R3 $R4 exit 0 exit ; we are done if no unprocessed string left - - loop: - StrCpy $R6 $R1 1 $R3 ; get the next character - StrCmp $R6 ";" foundDir ; if it is semi-colon, we have found a dir - IntOp $R3 $R3 + 1 ; increment index - IntCmp $R3 $R4 foundDir ; if we are at end of string, we have a dir - Goto loop ; still more chars in this dir - - foundDir: - StrCpy $R5 $R1 $R3 ; copy the dir to $R5 - StrCpy $R5 "$R5\$R0" ; construct fqpn - IfFileExists $R5 exit ; if file exists we are done - StrCpy $R5 "" ; reset return value to null string - IntOp $R4 $R4 - $R3 ; compute maxlen of new delimited path - IntCmp $R4 0 exit ; no more path left, exit - IntOp $R3 $R3 + 1 ; Increment $R3 past the semi-colon - StrCpy $R1 $R1 $R4 $R3 ; remove dir from the delimited path - StrCpy $R3 0 ; index back to start of new delimited path - goto findDir ; get another directory to look in - - exit: - Pop $R6 - Exch $R5 ; output - fully qualified pathname - Exch - Pop $R4 - Exch - Pop $R3 - Exch - Pop $R1 - Exch - Pop $R0 -FunctionEnd diff --git a/src/windows/installer/wix/site-local-tagged.wxi b/src/windows/installer/wix/site-local-tagged.wxi deleted file mode 100644 index 26d6d7ede2..0000000000 --- a/src/windows/installer/wix/site-local-tagged.wxi +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/windows/leash/Krb4AddToDomainRealmList.cpp b/src/windows/leash/Krb4AddToDomainRealmList.cpp deleted file mode 100644 index 9f119bdbed..0000000000 --- a/src/windows/leash/Krb4AddToDomainRealmList.cpp +++ /dev/null @@ -1,107 +0,0 @@ -// File: Krb4AddToDomainRealmList.cpp -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: CPP file for Krb4AddToDomainRealmList.h. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#include "stdafx.h" -#include "leash.h" -#include "Krb4AddToDomainRealmList.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CKrb4AddToDomainRealmList dialog - - -CKrb4AddToDomainRealmList::CKrb4AddToDomainRealmList(CWnd* pParent /*=NULL*/) - : CDialog(CKrb4AddToDomainRealmList::IDD, pParent) -{ - m_newRealm = _T(""); - m_newDomainHost = _T(""); - m_startup = TRUE; - - - //{{AFX_DATA_INIT(CKrb4AddToDomainRealmList) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CKrb4AddToDomainRealmList::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CKrb4AddToDomainRealmList) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CKrb4AddToDomainRealmList, CDialog) - //{{AFX_MSG_MAP(CKrb4AddToDomainRealmList) - ON_WM_SHOWWINDOW() - ON_EN_CHANGE(IDC_EDIT_DOMAINHOSTNAME, OnChangeEditDomainhostname) - ON_EN_CHANGE(IDC_EDIT_DOMAINREALMNAME, OnChangeEditDomainrealmname) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CKrb4AddToDomainRealmList message handlers - -void CKrb4AddToDomainRealmList::OnChangeEditDomainhostname() -{ - if (!m_startup) - GetDlgItemText(IDC_EDIT_DOMAINHOSTNAME, m_newDomainHost); -} - -void CKrb4AddToDomainRealmList::OnChangeEditDomainrealmname() -{ - if (!m_startup) - GetDlgItemText(IDC_EDIT_DOMAINREALMNAME, m_newRealm); -} - -void CKrb4AddToDomainRealmList::OnOK() -{ - //if (m_newRealm.IsEmpty) - - m_newRealm.TrimLeft(); - m_newRealm.TrimRight(); - m_newDomainHost.TrimLeft(); - m_newDomainHost.TrimRight(); - - if (m_newRealm.IsEmpty() || m_newDomainHost.IsEmpty()) - { // stay - MessageBox("OnOK::Both Realm and Domain-Host fields must be filled in!", - "Leash", MB_OK); - } - else if (-1 != m_newRealm.Find(' ') || -1 != m_newDomainHost.Find(' ')) - { // stay - MessageBox("OnOK::Illegal space found!", "Leash", MB_OK); - } - else - CDialog::OnOK(); // exit -} - -void CKrb4AddToDomainRealmList::OnCancel() -{ - - CDialog::OnCancel(); -} - -void CKrb4AddToDomainRealmList::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialog::OnShowWindow(bShow, nStatus); - m_startup = FALSE; -} diff --git a/src/windows/leash/Krb4AddToDomainRealmList.h b/src/windows/leash/Krb4AddToDomainRealmList.h deleted file mode 100644 index 8148c0d1f2..0000000000 --- a/src/windows/leash/Krb4AddToDomainRealmList.h +++ /dev/null @@ -1,73 +0,0 @@ -// File: Krb4AddToDomainRealmList.h -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: H file for Krb4AddToDomainRealmList.cpp. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#if !defined(AFX_KRB4ADDTODOMAINREALMLIST_H__F4D41683_96A4_11D2_94E2_0000861B8A3C__INCLUDED_) -#define AFX_KRB4ADDTODOMAINREALMLIST_H__F4D41683_96A4_11D2_94E2_0000861B8A3C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// Krb4AddToDomainRealmList.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CKrb4AddToDomainRealmList dialog - -class CKrb4AddToDomainRealmList : public CDialog -{ -// Construction -private: - CString m_newRealm; - CString m_newDomainHost; - BOOL m_newAdmin; - BOOL m_startup; - -public: - CKrb4AddToDomainRealmList(CWnd* pParent = NULL); // standard constructor - - CString GetNewRealm() {return m_newRealm;} - CString GetNewDomainHost() {return m_newDomainHost;} - -// Dialog Data - //{{AFX_DATA(CKrb4AddToDomainRealmList) - enum { IDD = IDD_KRB4_ADD_DOMAINREALMNAME }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKrb4AddToDomainRealmList) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CKrb4AddToDomainRealmList) - virtual void OnOK(); - virtual void OnCancel(); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - afx_msg void OnChangeEditDomainhostname(); - afx_msg void OnChangeEditDomainrealmname(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_KRB4ADDTODOMAINREALMLIST_H__F4D41683_96A4_11D2_94E2_0000861B8A3C__INCLUDED_) diff --git a/src/windows/leash/Krb4AddToRealmHostList.cpp b/src/windows/leash/Krb4AddToRealmHostList.cpp deleted file mode 100644 index e012aea026..0000000000 --- a/src/windows/leash/Krb4AddToRealmHostList.cpp +++ /dev/null @@ -1,121 +0,0 @@ -// File: Krb4AddToRealmHostList.cpp -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: CPP file for Krb4AddToRealmHostList.h. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#include "stdafx.h" -#include "leash.h" -#include "Krb4AddToRealmHostList.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CKrb4AddToRealmHostList dialog - - -CKrb4AddToRealmHostList::CKrb4AddToRealmHostList(CWnd* pParent /*=NULL*/) -: CDialog(CKrb4AddToRealmHostList::IDD, pParent) -{ - m_newRealm = _T(""); - m_newHost = _T(""); - m_newAdmin = TRUE; - m_startup = TRUE; - - //{{AFX_DATA_INIT(CKrb4AddToRealmHostList) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CKrb4AddToRealmHostList::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CKrb4AddToRealmHostList) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CKrb4AddToRealmHostList, CDialog) - //{{AFX_MSG_MAP(CKrb4AddToRealmHostList) - ON_EN_CHANGE(IDC_EDIT_DEFAULT_REALM, OnChangeEditDefaultRealm) - ON_EN_CHANGE(IDC_EDIT_REALM_HOSTNAME, OnChangeEditRealmHostname) - ON_WM_SHOWWINDOW() - ON_BN_CLICKED(IDC_RADIO_ADMIN_SERVER, OnRadioAdminServer) - ON_BN_CLICKED(IDC_RADIO_NO_ADMIN_SERVER, OnRadioNoAdminServer) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CKrb4AddToRealmHostList message handlers - -void CKrb4AddToRealmHostList::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialog::OnShowWindow(bShow, nStatus); - m_startup = FALSE; -} - -void CKrb4AddToRealmHostList::OnChangeEditDefaultRealm() -{ - if (!m_startup) - GetDlgItemText(IDC_EDIT_DEFAULT_REALM, m_newRealm); -} - -void CKrb4AddToRealmHostList::OnChangeEditRealmHostname() -{ - if (!m_startup) - GetDlgItemText(IDC_EDIT_REALM_HOSTNAME, m_newHost); -} - -void CKrb4AddToRealmHostList::OnRadioAdminServer() -{ - m_newAdmin = TRUE; -} - -void CKrb4AddToRealmHostList::OnRadioNoAdminServer() -{ - m_newAdmin = FALSE; -} - -void CKrb4AddToRealmHostList::OnOK() -{ - m_newRealm.TrimLeft(); - m_newRealm.TrimRight(); - m_newHost.TrimLeft(); - m_newHost.TrimRight(); - - if (m_newRealm.IsEmpty() || m_newHost.IsEmpty()) - { // stay - MessageBox("OnOK::Both Realm and Host fields must be filled in!", - "Leash", MB_OK); - } - else if (-1 != m_newRealm.Find(' ') || -1 != m_newHost.Find(' ')) - { // stay - MessageBox("OnOK::Illegal space found!", "Leash", MB_OK); - } - - else - CDialog::OnOK(); // exit -} - -BOOL CKrb4AddToRealmHostList::OnInitDialog() -{ - CDialog::OnInitDialog(); - - CheckRadioButton(IDC_RADIO_ADMIN_SERVER, IDC_RADIO_NO_ADMIN_SERVER, IDC_RADIO_ADMIN_SERVER); - - return TRUE; -} diff --git a/src/windows/leash/Krb4AddToRealmHostList.h b/src/windows/leash/Krb4AddToRealmHostList.h deleted file mode 100644 index 1c813670bc..0000000000 --- a/src/windows/leash/Krb4AddToRealmHostList.h +++ /dev/null @@ -1,75 +0,0 @@ -// ************************************************************************************** -// File: Krb4AddToRealmHostList.h -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: H file for Krb4AddToRealmHostList.cpp Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#if !defined(AFX_ADDTOREALMHOSTLIST_H__26A1E1F3_9117_11D2_94D0_0000861B8A3C__INCLUDED_) -#define AFX_ADDTOREALMHOSTLIST_H__26A1E1F3_9117_11D2_94D0_0000861B8A3C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// AddToRealmHostList.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CKrb4AddToRealmHostList dialog - -class CKrb4AddToRealmHostList : public CDialog -{ -// Construction - CString m_newRealm; - CString m_newHost; - BOOL m_newAdmin; - BOOL m_startup; - -public: - CKrb4AddToRealmHostList(CWnd* pParent = NULL); // standard constructor - - CString GetNewRealm() {return m_newRealm;} - CString GetNewHost() {return m_newHost;} - BOOL GetNewAdmin() {return m_newAdmin;} - -// Dialog Data - //{{AFX_DATA(CKrb4AddToRealmHostList) - enum { IDD = IDD_KRB4_ADD_REALM }; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKrb4AddToRealmHostList) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CKrb4AddToRealmHostList) - afx_msg void OnChangeEditDefaultRealm(); - afx_msg void OnChangeEditRealmHostname(); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - afx_msg void OnRadioAdminServer(); - afx_msg void OnRadioNoAdminServer(); - virtual void OnOK(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_ADDTOREALMHOSTLIST_H__26A1E1F3_9117_11D2_94D0_0000861B8A3C__INCLUDED_) diff --git a/src/windows/leash/Krb4DomainRealmMaintenance.cpp b/src/windows/leash/Krb4DomainRealmMaintenance.cpp deleted file mode 100644 index 466b31a4bf..0000000000 --- a/src/windows/leash/Krb4DomainRealmMaintenance.cpp +++ /dev/null @@ -1,268 +0,0 @@ -// ************************************************************************************** -// File: Krb4DomainRealmMaintenance.cpp -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: CPP file for Krb4DomainRealmMaintenance.h. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - -#include "stdafx.h" -#include "leash.h" -#include "KrbProperties.h" -#include "Krb4Properties.h" -#include "Krb4AddToDomainRealmList.h" -#include "Krb4EditDomainRealmList.h" -#include "Krb4DomainRealmMaintenance.h" -#include "lglobals.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CKrb4DomainRealmMaintenance dialog - - -IMPLEMENT_DYNCREATE(CKrb4DomainRealmMaintenance, CPropertyPage) - -CKrb4DomainRealmMaintenance::CKrb4DomainRealmMaintenance() : - CPropertyPage(CKrb4DomainRealmMaintenance ::IDD) -{ - m_defectiveLines = 0; -} - -CKrb4DomainRealmMaintenance::~CKrb4DomainRealmMaintenance() -{ -} - -void CKrb4DomainRealmMaintenance::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CKrb4DomainRealmMaintenance) - DDX_Control(pDX, IDC_LIST_DOMAINREALM, m_realmDomainList); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CKrb4DomainRealmMaintenance, CPropertyPage) - //{{AFX_MSG_MAP(CKrb4DomainRealmMaintenance) - ON_BN_CLICKED(IDC_BUTTON_REALM_HOST_ADD, OnButtonRealmHostAdd) - ON_BN_CLICKED(ID_BUTTON_REALM_HOST_REMOVE, OnButtonRealmHostRemove) - ON_BN_CLICKED(IDC_BUTTON_REALM_HOST_EDIT, OnButtonRealmHostEdit) - ON_LBN_SELCHANGE(IDC_LIST_DOMAINREALM, OnSelchangeListDomainrealm) - ON_LBN_DBLCLK(IDC_LIST_DOMAINREALM, OnDblclkListDomainrealm) - ON_BN_CLICKED(IDC_BUTTON_HOSTMAINT_HELP, OnButtonHostmaintHelp) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CKrb4DomainRealmMaintenance message handlers - -BOOL CKrb4DomainRealmMaintenance::OnApply() -{ - CStdioFile krbrealmCon; - if (!krbrealmCon.Open(CKrbProperties::m_krbrealmPath, CFile::modeCreate | - CFile::modeNoTruncate | - CFile::modeReadWrite)) - { - LeashErrorBox("OnApply::Can't open Configuration File", - CKrbProperties::m_krbrealmPath); - return TRUE; - } - - memset(lineBuf, '\0', sizeof(lineBuf)); - krbrealmCon.SetLength(0); - krbrealmCon.WriteString(lineBuf); - for (INT maxItems = m_realmDomainList.GetCount(), item = 0; item < maxItems; item++) - { - memset(lineBuf, '\0', sizeof(lineBuf)); - if (!m_realmDomainList.GetText(item, lineBuf)) - break; - - krbrealmCon.WriteString(lineBuf); - krbrealmCon.WriteString("\n"); - } - - krbrealmCon.Close(); - - return TRUE; -} - -BOOL CKrb4DomainRealmMaintenance::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - CStdioFile krbrealmCon; - - if (!krbrealmCon.Open(CKrbProperties::m_krbrealmPath, CFile::modeReadWrite)) - { // can't find file, so lets set some defaults - CString defaultStr; - defaultStr.Format("%s %s", "MIT.EDU", KRB_REALM); - m_realmDomainList.AddString(defaultStr); - } - else - { - while (TRUE) - { - if (!krbrealmCon.ReadString(lineBuf, sizeof(lineBuf))) - break; - - *(lineBuf + strlen(lineBuf) - 1) = 0; - - if (!strchr(lineBuf, ' ') && !strchr(lineBuf, '\t')) - { // found a defective line - m_defectiveLines++; - } - - if (LB_ERR == m_realmDomainList.AddString(lineBuf)) - { - LeashErrorBox("OnInitDialog::Can't read Configuration File", - CKrbProperties::m_krbrealmPath); - krbrealmCon.Close(); - return FALSE; - } - } - - krbrealmCon.Close(); - } - - m_realmDomainList.SetCurSel(0); - - if (!m_realmDomainList.GetCount()) - { - GetDlgItem(ID_BUTTON_REALM_HOST_REMOVE)->EnableWindow(FALSE); - GetDlgItem(IDC_BUTTON_REALM_HOST_EDIT)->EnableWindow(FALSE); - } - - return TRUE; -} - -void CKrb4DomainRealmMaintenance::OnButtonRealmHostAdd() -{ - CKrb4AddToDomainRealmList addToDomainRealmList; - if (IDOK == addToDomainRealmList.DoModal()) - { - if (addToDomainRealmList.GetNewRealm().IsEmpty()) - ASSERT(0); - - CString newLine; - newLine = addToDomainRealmList.GetNewDomainHost() + " " + addToDomainRealmList.GetNewRealm(); - - // We don't want duplicate items in Listbox - CString ckDups; - for (INT item = 0; item < m_realmDomainList.GetCount(); item++) - { - m_realmDomainList.GetText(item, ckDups); - if (0 == ckDups.CompareNoCase(newLine)) - { // found duplicate item in Listbox - LeashErrorBox("OnButtonRealmHostAdd::Found a Duplicate Item\nCan't add to List", - ckDups); - return; - } - } - - m_realmDomainList.InsertString(0, newLine); - m_realmDomainList.SetCurSel(0); - SetModified(TRUE); - - if (1 == m_realmDomainList.GetCount()) - { - GetDlgItem(ID_BUTTON_REALM_HOST_REMOVE)->EnableWindow();GetDlgItem(IDC_BUTTON_REALM_HOST_EDIT)->EnableWindow(); - } - } -} - -void CKrb4DomainRealmMaintenance::OnButtonRealmHostRemove() -{ - if (IDYES != AfxMessageBox("Your about to remove an item from the list!\n\nContinue?", - MB_YESNO)) - return; - - INT curSel = m_realmDomainList.GetCurSel(); - m_realmDomainList.DeleteString(curSel); // Single Sel Listbox - - if (-1 == m_realmDomainList.SetCurSel(curSel)) - m_realmDomainList.SetCurSel(curSel - 1); - - if (!m_realmDomainList.GetCount()) - { - GetDlgItem(ID_BUTTON_REALM_HOST_REMOVE)->EnableWindow(FALSE); - GetDlgItem(IDC_BUTTON_REALM_HOST_EDIT)->EnableWindow(FALSE); - } - - SetModified(TRUE); -} - -void CKrb4DomainRealmMaintenance::OnButtonRealmHostEdit() -{ - INT selItemIndex = m_realmDomainList.GetCurSel(); - LPSTR pSelItem = new char[m_realmDomainList.GetTextLen(selItemIndex) + 1]; - if (!pSelItem) - ASSERT(0); - - CString selItem; - m_realmDomainList.GetText(selItemIndex, selItem); - strcpy(pSelItem, selItem); - - CKrb4EditDomainRealmList editDomainRealmList(pSelItem); - delete [] pSelItem; - - if (IDOK == editDomainRealmList.DoModal()) - { - CString editedItem = editDomainRealmList.GetEditedItem(); - if (0 != selItem.CompareNoCase(editedItem) && - LB_ERR != m_realmDomainList.FindStringExact(-1, editedItem)) - { - LeashErrorBox("OnButtonRealmHostEdit::Found a Duplicate!\nCan't add to List", - editedItem); - - return; - } - - m_realmDomainList.DeleteString(selItemIndex); - m_realmDomainList.InsertString(selItemIndex, editDomainRealmList.GetEditedItem()); - m_realmDomainList.SetCurSel(selItemIndex); - SetModified(TRUE); - } -} - -void CKrb4DomainRealmMaintenance::OnSelchangeListDomainrealm() -{ - //SetModified(TRUE); -} - -void CKrb4DomainRealmMaintenance::OnDblclkListDomainrealm() -{ - OnButtonRealmHostEdit(); -} - -BOOL CKrb4DomainRealmMaintenance::PreTranslateMessage(MSG* pMsg) -{ - if (m_defectiveLines) - { - if (m_defectiveLines == 1) - LeashErrorBox("Found a defective entry in file", - CKrbProperties::m_krbrealmPath, "Warning"); - else if (m_defectiveLines > 1) - LeashErrorBox("Found more then one defective entry in file", - CKrbProperties::m_krbrealmPath, "Warning"); - } - - m_defectiveLines = 0; - return CPropertyPage::PreTranslateMessage(pMsg); -} - - - - -void CKrb4DomainRealmMaintenance::OnButtonHostmaintHelp() -{ - MessageBox("No Help Available!", "Leash", MB_OK); -} diff --git a/src/windows/leash/Krb4DomainRealmMaintenance.h b/src/windows/leash/Krb4DomainRealmMaintenance.h deleted file mode 100644 index 6bdba77c3a..0000000000 --- a/src/windows/leash/Krb4DomainRealmMaintenance.h +++ /dev/null @@ -1,76 +0,0 @@ -// ************************************************************************************** -// File: Krb4DomainRealmMaintenance.h -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: H file for Krb4DomainRealmMaintenance.cpp. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#if !defined(AFX_REALMNAMEMAINTENANCE_H__9CA36918_8FC0_11D2_94CC_0000861B8A3C__INCLUDED_) -#define AFX_REALMNAMEMAINTENANCE_H__9CA36918_8FC0_11D2_94CC_0000861B8A3C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// RealmNameMaintenance.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CKrb4DomainRealmMaintenance dialog - -class CKrb4DomainRealmMaintenance : public CPropertyPage -{ -// Construction -private: - DECLARE_DYNCREATE(CKrb4DomainRealmMaintenance) - CHAR lineBuf[MAXLINE]; - INT m_defectiveLines; - -public: - CKrb4DomainRealmMaintenance(); // standard constructor - virtual ~CKrb4DomainRealmMaintenance(); - -// Dialog Data - //{{AFX_DATA(CKrb4DomainRealmMaintenance) - enum { IDD = IDD_KRB4_DOMAINREALM_MAINT }; - CDragListBox m_realmDomainList; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKrb4DomainRealmMaintenance) - public: - virtual BOOL PreTranslateMessage(MSG* pMsg); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CKrb4DomainRealmMaintenance) - virtual BOOL OnInitDialog(); - virtual BOOL OnApply(); - afx_msg void OnButtonRealmHostAdd(); - afx_msg void OnButtonRealmHostRemove(); - afx_msg void OnButtonRealmHostEdit(); - afx_msg void OnSelchangeListDomainrealm(); - afx_msg void OnDblclkListDomainrealm(); - afx_msg void OnButtonHostmaintHelp(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_REALMNAMEMAINTENANCE_H__9CA36918_8FC0_11D2_94CC_0000861B8A3C__INCLUDED_) diff --git a/src/windows/leash/Krb4EditDomainRealmList.cpp b/src/windows/leash/Krb4EditDomainRealmList.cpp index e2773bf0f4..722718ab23 100644 --- a/src/windows/leash/Krb4EditDomainRealmList.cpp +++ b/src/windows/leash/Krb4EditDomainRealmList.cpp @@ -15,7 +15,6 @@ #include "stdafx.h" #include "leash.h" -#include "Krb4Properties.h" #include "Krb4EditDomainRealmList.h" #include "lglobals.h" diff --git a/src/windows/leash/Krb4EditRealmHostList.cpp b/src/windows/leash/Krb4EditRealmHostList.cpp deleted file mode 100644 index 840f6262e0..0000000000 --- a/src/windows/leash/Krb4EditRealmHostList.cpp +++ /dev/null @@ -1,193 +0,0 @@ -// ************************************************************************************** -// File: Krb4EditRealmHostList.cpp -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: CPP file for Krb4EditRealmHostList.h. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#include "stdafx.h" -#include "leash.h" -#include "Krb4Properties.h" -#include "Krb4EditRealmHostList.h" -#include "lglobals.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CKrb4EditRealmHostList dialog - -CKrb4EditRealmHostList::CKrb4EditRealmHostList(LPSTR editItem, CWnd* pParent) - : CDialog(CKrb4EditRealmHostList::IDD, pParent) -{ - m_startup = TRUE; - m_editItem = _T(""); - -/* - // Parse the passed in item - LPSTR pEditItem = editItem; - LPSTR findSpace = strchr(editItem, ' '); - if (findSpace) - *findSpace = 0; - else - { - LeashErrorBox("This is a defective entry in file", - CKrb4ConfigFileLocation::m_krbFile); - ASSERT(0); - m_initRealm = m_newRealm = editItem; - m_initHost = m_newHost = _T(""); - } - - m_initRealm = m_newRealm = editItem; // first token - - pEditItem = strchr(editItem, '\0'); - if (pEditItem) - { - pEditItem++; - findSpace++; - } - else - ASSERT(0); - - findSpace = strchr(pEditItem, ' '); - if (findSpace) - { - *findSpace = 0; - } - else - { - m_initAdmin = m_newAdmin = FALSE; - m_initHost = m_newHost = pEditItem; // second token - return; - } - - m_initHost = m_newHost = pEditItem; // second token - - findSpace++; - pEditItem = findSpace; - if (pEditItem) - { - if (strstr(pEditItem, "admin server")) - m_initAdmin = m_newAdmin = TRUE; - //else - //; It must be something else??? :( - } - else - ASSERT(0); -*/ - //{{AFX_DATA_INIT(CKrb4EditRealmHostList) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - -void CKrb4EditRealmHostList::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CKrb4EditRealmHostList) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CKrb4EditRealmHostList, CDialog) - //{{AFX_MSG_MAP(CKrb4EditRealmHostList) - ON_WM_SHOWWINDOW() - ON_EN_CHANGE(IDC_EDIT_DEFAULT_REALM, OnChangeEditDefaultRealm) - ON_EN_CHANGE(IDC_EDIT_REALM_HOSTNAME, OnChangeEditRealmHostname) - ON_BN_CLICKED(IDC_RADIO_ADMIN_SERVER, OnRadioAdminServer) - ON_BN_CLICKED(IDC_RADIO_NO_ADMIN_SERVER, OnRadioNoAdminServer) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CKrb4EditRealmHostList message handlers - -BOOL CKrb4EditRealmHostList::OnInitDialog() -{ - CDialog::OnInitDialog(); - - SetDlgItemText(IDC_EDIT_DEFAULT_REALM, m_newRealm); - SetDlgItemText(IDC_EDIT_REALM_HOSTNAME, m_newHost); - - if (m_initAdmin) - { // has Admin Server - CheckRadioButton(IDC_RADIO_ADMIN_SERVER, IDC_RADIO_NO_ADMIN_SERVER, IDC_RADIO_ADMIN_SERVER); - } - else - { // no Admin Server - CheckRadioButton(IDC_RADIO_ADMIN_SERVER, IDC_RADIO_NO_ADMIN_SERVER, IDC_RADIO_NO_ADMIN_SERVER); - } - - //GetDlgItem(IDC_EDIT_DEFAULT_REALM)->EnableWindow(); - //GetDlgItem(IDC_EDIT_DEFAULT_REALM)->SetFocus(); - - return TRUE; -} - -void CKrb4EditRealmHostList::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CDialog::OnShowWindow(bShow, nStatus); - m_startup = FALSE; -} - -void CKrb4EditRealmHostList::OnChangeEditDefaultRealm() -{ - if (!m_startup) - GetDlgItemText(IDC_EDIT_DEFAULT_REALM, m_newRealm); -} - -void CKrb4EditRealmHostList::OnChangeEditRealmHostname() -{ - if (!m_startup) - GetDlgItemText(IDC_EDIT_REALM_HOSTNAME, m_newHost); -} - -void CKrb4EditRealmHostList::OnRadioAdminServer() -{ - m_newAdmin = TRUE; -} - -void CKrb4EditRealmHostList::OnRadioNoAdminServer() -{ - m_newAdmin = FALSE; -} - -void CKrb4EditRealmHostList::OnOK() -{ - m_newRealm.TrimLeft(); - m_newRealm.TrimRight(); - m_newHost.TrimLeft(); - m_newHost.TrimRight(); - - if (m_newRealm.IsEmpty() || m_newHost.IsEmpty()) - { // stay - MessageBox("OnOK::Both Realm and Host fields must be filled in!", - "Leash", MB_OK); - } - else if (-1 != m_newRealm.Find(' ') || -1 != m_newHost.Find(' ')) - { // stay - MessageBox("OnOK::Illegal space found!", "Leash", MB_OK); - } - - else - CDialog::OnOK(); // exit - - m_editItem = m_newRealm + " " + m_newHost; - - if (m_newAdmin) - { - m_editItem += " "; - m_editItem += ADMIN_SERVER; - } -} diff --git a/src/windows/leash/Krb4EditRealmHostList.h b/src/windows/leash/Krb4EditRealmHostList.h deleted file mode 100644 index 5ed3864736..0000000000 --- a/src/windows/leash/Krb4EditRealmHostList.h +++ /dev/null @@ -1,79 +0,0 @@ -// ************************************************************************************** -// File: Krb4EditRealmHostList.h -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: H file for Krb4EditRealmHostList.cpp. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - - -#if !defined(AFX_EDITREALMHOSTLIST_H__26A1E1F7_9117_11D2_94D0_0000861B8A3C__INCLUDED_) -#define AFX_EDITREALMHOSTLIST_H__26A1E1F7_9117_11D2_94D0_0000861B8A3C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// EditRealmHostList.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CKrb4EditRealmHostList dialog - -class CKrb4EditRealmHostList : public CDialog -{ -// Construction -private: - CString m_editItem; - CString m_initRealm; - CString m_newRealm; - CString m_initHost; - CString m_newHost; - BOOL m_initAdmin; - BOOL m_newAdmin; - BOOL m_startup; - -public: - CKrb4EditRealmHostList(LPSTR editItem, CWnd* pParent = NULL); - CString GetEditedItem() {return m_editItem;} - CString GetNewRealm() {return m_newRealm;} - -// Dialog Data - //{{AFX_DATA(CKrb4EditRealmHostList) - enum { IDD = IDD_KRB4_EDIT_REALM }; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKrb4EditRealmHostList) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CKrb4EditRealmHostList) - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - afx_msg void OnChangeEditDefaultRealm(); - afx_msg void OnChangeEditRealmHostname(); - afx_msg void OnRadioAdminServer(); - afx_msg void OnRadioNoAdminServer(); - virtual void OnOK(); - virtual BOOL OnInitDialog(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_EDITREALMHOSTLIST_H__26A1E1F7_9117_11D2_94D0_0000861B8A3C__INCLUDED_) diff --git a/src/windows/leash/Krb4Properties.cpp b/src/windows/leash/Krb4Properties.cpp deleted file mode 100644 index a26d585e5f..0000000000 --- a/src/windows/leash/Krb4Properties.cpp +++ /dev/null @@ -1,390 +0,0 @@ -// ************************************************************************************** -// File: Krb4Properties.cpp -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: CPP file for KrbProperties.h. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - - -#include "stdafx.h" -#include "Leash.h" -#include "Krb4Properties.h" -#include "LeashFileDialog.h" -#include "LeashMessageBox.h" -#include "wshelper.h" -#include "lglobals.h" -#include -#include -#include "reminder.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -/////////////////////////////////////////////////////////////////////// -// CKrb4ConfigFileLocation property page - -IMPLEMENT_DYNCREATE(CKrb4ConfigFileLocation, CPropertyPage) - -CString CKrb4ConfigFileLocation::m_newKrbFile; -CString CKrb4ConfigFileLocation::m_newKrbrealmFile; - -CKrb4ConfigFileLocation::CKrb4ConfigFileLocation() : CPropertyPage(CKrb4ConfigFileLocation::IDD) -{ - m_newTicketFile = _T(""); - m_newKrbFile = _T(""); - m_newKrbrealmFile = _T(""); - m_initKrbFile = _T(""); - m_initKrbrealmFile = _T(""); - m_initTicketFile = _T(""); - m_noKrbrealmFileStartupWarning = FALSE; - m_noKrbFileStartupWarning = FALSE; - - m_startupPage1 = TRUE; - - //{{AFX_DATA_INIT(CKrb4ConfigFileLocation) - //}}AFX_DATA_INIT -} - -CKrb4ConfigFileLocation::~CKrb4ConfigFileLocation() -{ -} - -BOOL CKrb4ConfigFileLocation::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - INT krbCreate = 0; - INT krbrealmCreate = 0; - CHAR krb_path[MAX_PATH]; - CHAR krbrealm_path[MAX_PATH]; - CHAR ticketName[MAX_PATH]; - unsigned int krb_path_sz = sizeof(krb_path); - unsigned int krbrealm_path_sz = sizeof(krbrealm_path); - CString strMessage; - - - // Set KRB.CON - memset(krb_path, '\0', sizeof(krb_path)); - if (!pkrb_get_krbconf2(krb_path, &krb_path_sz)) - { // Error has happened - m_noKrbFileStartupWarning = TRUE; - } - else - { // normal find - m_initKrbFile = krb_path; - m_newKrbFile = m_initKrbFile; - SetDlgItemText(IDC_EDIT_KRB_LOC, m_initKrbFile); - } - - // Set KRBREALM.CON - memset(krbrealm_path, '\0', sizeof(krbrealm_path)); - if (!pkrb_get_krbrealm2(krbrealm_path, &krbrealm_path_sz)) - { - // Error has happened - m_noKrbrealmFileStartupWarning = TRUE; - } - else - { - // normal find - m_initKrbrealmFile = krbrealm_path; - m_newKrbrealmFile = m_initKrbrealmFile; - SetDlgItemText(IDC_EDIT_KRBREALM_LOC, m_initKrbrealmFile); - } - - if (pLeash_get_lock_file_locations() || - getenv("KRB4_KRB.REALMS") || getenv("KRB4_KRB.CONF") || getenv("KRB4_CONFIG")) - { - GetDlgItem(IDC_EDIT_KRB_LOC)->EnableWindow(FALSE); - GetDlgItem(IDC_EDIT_KRBREALM_LOC)->EnableWindow(FALSE); - GetDlgItem(IDC_BUTTON_KRB_BROWSE)->EnableWindow(FALSE); - GetDlgItem(IDC_BUTTON_KRBREALM_BROWSE)->EnableWindow(FALSE); - } - else if ( !(getenv("KRB4_KRB.REALMS") || getenv("KRB4_KRB.CONF") || getenv("KRB4_CONFIG")) ) - { - GetDlgItem(IDC_STATIC_CONFILES)->ShowWindow(FALSE); - } - - - // Set TICKET.KRB file Editbox - *ticketName = NULL; - pkrb_set_tkt_string(0); - - char *pticketName = ptkt_string(); - if (pticketName) - strcpy(ticketName, pticketName); - - if (!*ticketName) - { - LeashErrorBox("OnInitDialog::Can't locate ticket file", TICKET_FILE); - } - else - { - m_initTicketFile = m_newTicketFile = ticketName; - m_ticketEditBox.ReplaceSel(m_initTicketFile); - } - - if (getenv("KRBTKFILE")) - GetDlgItem(IDC_EDIT_TICKET_FILE)->EnableWindow(FALSE); - else - GetDlgItem(IDC_STATIC_TXT)->ShowWindow(FALSE); - - return FALSE; -} - -BOOL CKrb4ConfigFileLocation::OnApply() -{ - // Krb.con - if (0 != m_initKrbFile.CompareNoCase(m_newKrbFile)) - { - // Commit changes - if (SetRegistryVariable("krb.conf", m_newKrbFile, - "Software\\MIT\\Kerberos4")) - { - MessageBox("Failed to set \"Krb.conf\"!", "Error", MB_OK); - } - - m_initKrbFile = m_newKrbFile; - } - - // Krbrealms.con - if (0 != m_initKrbrealmFile.CompareNoCase(m_newKrbrealmFile)) - { - // Commit changes - if (SetRegistryVariable("krb.realms", m_newKrbrealmFile, - "Software\\MIT\\Kerberos4")) - { - MessageBox("Failed to set \"krb.realms\"!", "Error", MB_OK); - } - - m_initKrbrealmFile = m_newKrbrealmFile; - } - - // Ticket file - if (0 != m_initTicketFile.CompareNoCase(m_newTicketFile)) - { - if (getenv("KRBTKFILE")) - { - // Just in case they set (somehow) KRBTKFILE while this box is up - MessageBox("OnApply::Ticket file is set in your System's\ - Environment!\nYou must first remove it.", - "Error", MB_OK); - - return TRUE; - } - - // Commit changes - if (SetRegistryVariable("ticketfile", m_newTicketFile, - "Software\\MIT\\Kerberos4")) - { - MessageBox("Failed to set \"ticketfile\"!", "Error", MB_OK); - } - - m_initTicketFile = m_newTicketFile; - } - - return TRUE; -} - -VOID CKrb4ConfigFileLocation::OnOK() -{ - CPropertyPage::OnOK(); -} - -VOID CKrb4ConfigFileLocation::DoDataExchange(CDataExchange* pDX) -{ - TRACE("Entering CKrb4ConfigFileLocation::DoDataExchange -- %d\n", - pDX->m_bSaveAndValidate); - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CKrb4ConfigFileLocation) - DDX_Control(pDX, IDC_EDIT_TICKET_FILE, m_ticketEditBox); - //}}AFX_DATA_MAP -} - - -VOID CKrb4ConfigFileLocation::OnButtonKrbBrowse() -{ - CString msg; - msg.Format("Select %s Location", KRB_FILE); - - CString krb_path = "*.*"; - CLeashFileDialog dlgFile(TRUE, NULL, krb_path, "Kerbereos Four Config. File (.con)"); - dlgFile.m_ofn.lpstrTitle = msg; - - if (IDOK == dlgFile.DoModal()) - { - //m_newKrbFile = dlgFile.GetSelectedFileName(); - m_newKrbFile= dlgFile.GetPathName(); - SetDlgItemText(IDC_EDIT_KRB_LOC, m_newKrbFile); - SetModified(TRUE); - } -} - -VOID CKrb4ConfigFileLocation::OnButtonKrbrealmBrowse() -{ - CString msg; - msg.Format("Select %s Location", KRBREALM_FILE); - - CString krbrealm_path = "*.*"; - CLeashFileDialog dlgFile(TRUE, NULL, krbrealm_path, "Kerbereos Four Config. File (.con)"); - dlgFile.m_ofn.lpstrTitle = msg; - - if (IDOK == dlgFile.DoModal()) - { - //m_krbrealmFile = dlgFile.GetSelectedFileName(); - m_newKrbrealmFile = dlgFile.GetPathName(); - SetDlgItemText(IDC_EDIT_KRB_KRBREALM_LOC, m_newKrbrealmFile); - SetModified(TRUE); - } -} - -/* -VOID CKrb4ConfigFileLocation::OnButtonTicketfileBrowse() -{ - CString ticketPath = *.*"; - CLeashFileDialog dlgFile(TRUE, NULL, ticketPath, "Kerberos Four Ticket File (.con)"); - CString msg; - msg.Format("Select Location/Ticket File (Default file = %s)", TICKET_FILE); - dlgFile.m_ofn.lpstrTitle = msg; - while (TRUE) - { - if (IDOK == dlgFile.DoModal()) - { - m_newTicketFile = dlgFile.GetPathName(); - SetDlgItemText(IDC_EDIT_TICKET_FILE, m_newTicketFile); - SetModified(TRUE); - break; - } - else - break; - } -} -*/ - -void CKrb4ConfigFileLocation::OnChangeEditKrbLoc() -{ - if (!m_startupPage1) - { - GetDlgItemText(IDC_EDIT_KRB_LOC, m_newKrbFile); - SetModified(TRUE); - } -} - -void CKrb4ConfigFileLocation::OnChangeEditKrbrealmLoc() -{ - if (!m_startupPage1) - { - GetDlgItemText(IDC_EDIT_KRBREALM_LOC, m_newKrbrealmFile); - SetModified(TRUE); - } -} - -void CKrb4ConfigFileLocation::OnChangeEditTicketFile() -{ - if (!m_startupPage1) - { - GetDlgItemText(IDC_EDIT_TICKET_FILE, m_newTicketFile); - SetModified(TRUE); - } -} - -VOID CKrb4ConfigFileLocation::OnShowWindow(BOOL bShow, UINT nStatus) -{ - CPropertyPage::OnShowWindow(bShow, nStatus); -} - -VOID CKrb4ConfigFileLocation::OnCancel() -{ - CPropertyPage::OnCancel(); -} - -void CKrb4ConfigFileLocation::OnHelp() -{ -#ifdef CALL_HTMLHELP - AfxGetApp()->HtmlHelp(HID_KRB4_PROPERTIES_COMMAND); -#else - AfxGetApp()->WinHelp(HID_KRB4_PROPERTIES_COMMAND); -#endif -} - -BOOL CKrb4ConfigFileLocation::PreTranslateMessage(MSG* pMsg) -{ - // TODO: Add your specialized code here and/or call the base class - CString wmsg; - if (m_startupPage1) - { - if (m_noKrbFileStartupWarning) - { - wmsg.Format("OnInitDialog::Can't locate configuration file: %s.", - KRB_FILE); - MessageBox(wmsg, "Leash", MB_OK); - m_noKrbFileStartupWarning = FALSE; - } - - if (m_noKrbrealmFileStartupWarning) - { - wmsg.Format("OnInitDialog::Can't locate configuration file: %s.", - KRBREALM_FILE); - MessageBox(wmsg, "Leash", MB_OK); - m_noKrbrealmFileStartupWarning = FALSE; - } - } - - m_startupPage1 = FALSE; - return CPropertyPage::PreTranslateMessage(pMsg); -} - - -BEGIN_MESSAGE_MAP(CKrb4ConfigFileLocation, CPropertyPage) - //{{AFX_MSG_MAP(CKrb4ConfigFileLocation) - ON_BN_CLICKED(IDC_BUTTON_KRB_BROWSE, OnButtonKrbBrowse) - ON_BN_CLICKED(IDC_BUTTON_KRBREALM_BROWSE, OnButtonKrbrealmBrowse) - ON_WM_SHOWWINDOW() - ON_EN_CHANGE(IDC_EDIT_TICKET_FILE, OnChangeEditTicketFile) - ON_COMMAND(ID_HELP, OnHelp) - ON_EN_CHANGE(IDC_EDIT_KRB_LOC, OnChangeEditKrbLoc) - ON_EN_CHANGE(IDC_EDIT_KRBREALM_LOC, OnChangeEditKrbrealmLoc) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - - -/////////////////////////////////////////////////////////////////////// -// CKrb4Properties - -IMPLEMENT_DYNAMIC(CKrb4Properties, CPropertySheet) -CKrb4Properties::CKrb4Properties(UINT nIDCaption, CWnd* pParentWnd, - UINT iSelectPage) -:CPropertySheet(nIDCaption, pParentWnd, iSelectPage) -{ -} - -CKrb4Properties::CKrb4Properties(LPCTSTR pszCaption, CWnd* pParentWnd, - UINT iSelectPage) -:CPropertySheet(pszCaption, pParentWnd, iSelectPage) -{ - AddPage(&m_fileLocation); -} - -CKrb4Properties::~CKrb4Properties() -{ -} - - -BEGIN_MESSAGE_MAP(CKrb4Properties, CPropertySheet) - //{{AFX_MSG_MAP(CKrb4Properties) - // NOTE - the ClassWizard will add and remove mapping macros here. - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -/////////////////////////////////////////////////////////////////////// -// CKrb4Properties message handlers diff --git a/src/windows/leash/Krb4Properties.h b/src/windows/leash/Krb4Properties.h deleted file mode 100644 index 016badc25f..0000000000 --- a/src/windows/leash/Krb4Properties.h +++ /dev/null @@ -1,138 +0,0 @@ -// ************************************************************************************** -// File: Krb4Properties.h -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: H file for KrbProperties.cpp. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#if !defined(AFX_PROPERTY_H__CD702F99_7495_11D0_8FDC_00C04FC2A0C2__INCLUDED_) -#define AFX_PROPERTY_H__CD702F99_7495_11D0_8FDC_00C04FC2A0C2__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 -// Krb4Properties.h : header file -// - -#include "Resource.h" -//#include "Krb4RealmHostMaintenance.h" -//#include "Krb4DomainRealmMaintenance.h" - -/////////////////////////////////////////////////////////////////////// -// CKrb4ConfigFileLocation dialog - -class CKrb4ConfigFileLocation : public CPropertyPage -{ -// Construction -private: - DECLARE_DYNCREATE(CKrb4ConfigFileLocation) - CString m_ticketFile; - CString m_newTicketFile; - static CString m_newKrbFile; - static CString m_newKrbrealmFile; // static for the CKrb4EditDomainRealmList class - CString m_initKrbFile; - CString m_initKrbrealmFile; - CString m_initTicketFile; - - BOOL m_noKrbFileStartupWarning; - BOOL m_noKrbrealmFileStartupWarning; - BOOL m_startupPage1; - -public: - CKrb4ConfigFileLocation(); - ~CKrb4ConfigFileLocation(); - -// Dialog Data - //{{AFX_DATA(CKrb4ConfigFileLocation) - enum { IDD = IDD_KRB4_PROP_LOCATION }; - CEdit m_ticketEditBox; - //}}AFX_DATA - - -// Overrides - // ClassWizard generate virtual function overrides - //{{AFX_VIRTUAL(CKrb4ConfigFileLocation) - public: - virtual VOID OnCancel(); - virtual BOOL PreTranslateMessage(MSG* pMsg); - protected: - virtual VOID DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - - virtual VOID OnOK(); - virtual BOOL OnApply(); - -// Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CKrb4ConfigFileLocation) - virtual BOOL OnInitDialog(); - afx_msg VOID OnButtonKrbBrowse(); - afx_msg VOID OnButtonKrbrealmBrowse(); - afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); - afx_msg void OnChangeEditTicketFile(); - afx_msg void OnHelp(); - afx_msg void OnChangeEditKrbLoc(); - afx_msg void OnChangeEditKrbrealmLoc(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -}; - - -////////////////////////////////////////////////////////////////////// -// CKrb4Properties - -class CKrb4Properties : public CPropertySheet -{ -private: - DECLARE_DYNAMIC(CKrb4Properties) - -public: - CKrb4ConfigFileLocation m_fileLocation; - - static BOOL applyButtonEnabled; - -// Construction -public: - CKrb4Properties(UINT nIDCaption, CWnd* pParentWnd = NULL, - UINT iSelectPage = 0); - CKrb4Properties(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, - UINT iSelectPage = 0); - -// Attributes -public: - -// Operations -public: - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKrb4Properties) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CKrb4Properties(); - - // Generated message map functions -protected: - //{{AFX_MSG(CKrb4Properties) - // NOTE - the ClassWizard will add and remove member functions here. - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -///////////////////////////////////////////////////////////////////////////// -//{{AFX_INSERT_LOCATION}} -// Microsoft Developer Studio will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_PROPERTY_H__CD702F99_7495_11D0_8FDC_00C04FC2A0C2__INCLUDED_) diff --git a/src/windows/leash/Krb4RealmHostMaintenance.cpp b/src/windows/leash/Krb4RealmHostMaintenance.cpp deleted file mode 100644 index 7e8ad4f07a..0000000000 --- a/src/windows/leash/Krb4RealmHostMaintenance.cpp +++ /dev/null @@ -1,373 +0,0 @@ -// ************************************************************************************** -// File: Krb4RealmHostMaintenance.cpp -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: CPP file for Krb4RealmHostMaintenance.h. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#include "stdafx.h" -#include "leash.h" -#include "KrbProperties.h" -#include "Krb4Properties.h" -#include "Krb4AddToRealmHostList.h" -#include "Krb4RealmHostMaintenance.h" -#include "Krb4EditRealmHostList.h" -#include "lglobals.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CKrb4RealmHostMaintenance dialog - - -IMPLEMENT_DYNCREATE(CKrb4RealmHostMaintenance, CPropertyPage) - -CKrb4RealmHostMaintenance::CKrb4RealmHostMaintenance() : CPropertyPage(CKrb4RealmHostMaintenance::IDD) -{ - m_defectiveLines = 0; - m_initDnsKdcLookup = m_newDnsKdcLookup = 0; -} - -CKrb4RealmHostMaintenance::~CKrb4RealmHostMaintenance() -{ -} - -void CKrb4RealmHostMaintenance::DoDataExchange(CDataExchange* pDX) -{ - CPropertyPage::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CKrb4RealmHostMaintenance) - DDX_Control(pDX, IDC_LIST_KRB4_REALM_HOST, m_RealmHostList); - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CKrb4RealmHostMaintenance, CPropertyPage) - //{{AFX_MSG_MAP(CKrb4RealmHostMaintenance) - ON_BN_CLICKED(IDC_BUTTON_KRB4_REALM_HOST_ADD, OnButtonRealmHostAdd) - ON_BN_CLICKED(IDC_BUTTON_KRB4_REALM_HOST_EDIT, OnButtonRealmHostEdit) - ON_BN_CLICKED(ID_BUTTON_KRB4_REALM_HOST_REMOVE, OnButtonRealmHostRemove) - ON_LBN_SELCHANGE(IDC_LIST_KRB4_REALM_HOST, OnSelchangeListRemoveHost) - ON_LBN_DBLCLK(IDC_LIST_KRB4_REALM_HOST, OnDblclkListRemoveHost) - ON_BN_CLICKED(IDC_BUTTON_REALMHOST_MAINT_HELP2, OnButtonRealmhostMaintHelp2) - ON_BN_CLICKED(IDC_KRB4_DNS_KDC, OnCheckDnsKdcLookup) - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CKrb4RealmHostMaintenance message handlers - -BOOL CKrb4RealmHostMaintenance::OnInitDialog() -{ - CPropertyPage::OnInitDialog(); - - CStdioFile krbCon; - if (!krbCon.Open(CKrbProperties::m_krbPath, CFile::modeReadWrite)) - { // can't find file, so lets set some defaults - - m_RealmHostList.AddString(KRB_REALM " " KRB_MASTER); - } - else - { - memset(lineBuf, '\0', sizeof(lineBuf)); - krbCon.ReadString(lineBuf, sizeof(lineBuf)); - while (TRUE) - { - if (!krbCon.ReadString(lineBuf, sizeof(lineBuf))) - break; - - *(lineBuf + strlen(lineBuf) - 1) = 0; - - if (!strchr(lineBuf, ' ') && !strchr(lineBuf, '\t')) - { // found a defective line - m_defectiveLines++; - } - - if ( !strncmp(".KERBEROS.OPTION.",lineBuf,17) ) { - char * p = &lineBuf[17]; - while (isspace(*p)) - p++; - if (!strcmp("dns",p)) - m_initDnsKdcLookup = m_newDnsKdcLookup = 1; - } else { - if (LB_ERR == m_RealmHostList.AddString(lineBuf)) - { - LeashErrorBox("OnInitDialog::Can't read Configuration File", - CKrbProperties::m_krbPath); - krbCon.Close(); - return FALSE; - } - } - } - - krbCon.Close(); - } - - m_RealmHostList.SetCurSel(0); - - if (!m_RealmHostList.GetCount()) - { - GetDlgItem(ID_BUTTON_KRB4_REALM_HOST_REMOVE)->EnableWindow(FALSE); - GetDlgItem(IDC_BUTTON_KRB4_REALM_HOST_EDIT)->EnableWindow(FALSE); - } - - return TRUE; -} - -BOOL CKrb4RealmHostMaintenance::OnApply() -{ - CStdioFile krbCon; - if (!krbCon.Open(CKrbProperties::m_krbPath, CFile::modeCreate | - CFile::modeNoTruncate | - CFile::modeReadWrite)) - { - LeashErrorBox("OnApply::Can't open Configuration File", - CKrbProperties::m_krbPath); - return TRUE; - } - - memset(lineBuf, '\0', sizeof(lineBuf)); - if (!krbCon.ReadString(lineBuf, sizeof(lineBuf))) - { -//-----ADL----///strcpy(lineBuf, CKrb4ConfigOptions::m_newDefaultRealm); - strcat(lineBuf, "\n"); - } - - krbCon.SetLength(0); - krbCon.WriteString(lineBuf); - for (INT maxItems = m_RealmHostList.GetCount(), item = 0; item < maxItems; item++) - { - memset(lineBuf, '\0', sizeof(lineBuf)); - if (!m_RealmHostList.GetText(item, lineBuf)) - break; - - krbCon.WriteString(lineBuf); - krbCon.WriteString("\n"); - } - - if ( m_newDnsKdcLookup ) - krbCon.WriteString(".KERBEROS.OPTION. dns\n"); - - krbCon.Close(); - return TRUE; -} - -void CKrb4RealmHostMaintenance::OnOK() -{ - CPropertyPage::OnOK(); -} - -void CKrb4RealmHostMaintenance::OnCancel() -{ - CPropertyPage::OnCancel(); -} - -void CKrb4RealmHostMaintenance::OnCheckDnsKdcLookup() -{ - m_newDnsKdcLookup = (BOOL)IsDlgButtonChecked(IDC_KRB4_DNS_KDC); - SetModified(TRUE); -} - -void CKrb4RealmHostMaintenance::ResetDefaultRealmComboBox() -{ // krb4 is loaded without krb5 - CHAR lineBuf[REALM_SZ + MAX_HSTNM + 20]; - - int maxItems = m_RealmHostList.GetCount(); - - CKrbConfigOptions::m_krbRealmEditbox.ResetContent(); - - for (int xItems = 0; xItems < maxItems; xItems++) - { - m_RealmHostList.GetText(xItems, lineBuf); - - LPSTR space = strchr(lineBuf, ' '); - if (space) - *space = 0; - else - ASSERT(0); - - if (CB_ERR == CKrbConfigOptions::m_krbRealmEditbox.FindStringExact(-1, lineBuf)) - { // no dups - if (LB_ERR == CKrbConfigOptions::m_krbRealmEditbox.AddString(lineBuf)) - { - MessageBox("OnInitDialog::Can't add to Kerberos Realm Combobox", - "Leash", MB_OK); - return; - } - } - } - - CHAR krbhst[MAX_HSTNM + 1]; - CHAR krbrlm[REALM_SZ + 1]; - - strcpy(krbrlm, CKrbConfigOptions::m_newDefaultRealm); - memset(krbhst, '\0', sizeof(krbhst)); - - // Check for Host - // don't use KRB4 - krb_get_krbhst - would have to re-logon, on file location - // change, to use this function - extern int krb_get_krbhst(char* h, char* r, int n); - if (KFAILURE == krb_get_krbhst(krbhst, krbrlm, 1)) - { - MessageBox("We can't find the Host Server for your Default Realm!!!", - "Leash", MB_OK); - return; - } - - CKrbConfigOptions::m_hostServer = krbhst; -} - -void CKrb4RealmHostMaintenance::OnButtonRealmHostAdd() -{ - CKrb4AddToRealmHostList addToRealmHostList; - - if (IDOK == addToRealmHostList.DoModal()) - { - if (addToRealmHostList.GetNewRealm().IsEmpty()) - ASSERT(0); - - CString newLine; - newLine = addToRealmHostList.GetNewRealm() + " " + addToRealmHostList.GetNewHost(); - - if (addToRealmHostList.GetNewAdmin()) - newLine += " admin server"; - - // We don't want duplicate items in Listbox - if (LB_ERR != m_RealmHostList.FindStringExact(-1, newLine)) - { // found duplicate item in Listbox - LeashErrorBox("OnButtonRealmHostAdd::Found a Duplicate Item!\nCan't add to List", - newLine); - return; - } - - - m_RealmHostList.InsertString(0, newLine); - m_RealmHostList.SetCurSel(0); - SetModified(TRUE); - - ResetDefaultRealmComboBox(); - - if (1 == m_RealmHostList.GetCount()) - { - GetDlgItem(ID_BUTTON_KRB4_REALM_HOST_REMOVE)->EnableWindow(); - GetDlgItem(IDC_BUTTON_KRB4_REALM_HOST_EDIT)->EnableWindow(); - } - } -} - -void CKrb4RealmHostMaintenance::OnButtonRealmHostEdit() -{ - INT selItemIndex = m_RealmHostList.GetCurSel(); - LPSTR pSelItem = new char[m_RealmHostList.GetTextLen(selItemIndex) + 1]; - if (!pSelItem) - ASSERT(0); - - CString selItem; - m_RealmHostList.GetText(selItemIndex, selItem); - strcpy(pSelItem, selItem); - - CKrb4EditRealmHostList editRealmHostList(pSelItem); - delete [] pSelItem; - - if (IDOK == editRealmHostList.DoModal()) - { - CString editedItem = editRealmHostList.GetEditedItem(); - if (0 != selItem.CompareNoCase(editedItem) && - LB_ERR != m_RealmHostList.FindStringExact(-1, editedItem)) - { - LeashErrorBox("OnButtonRealmHostEdit::Found a Duplicate!\nCan't add to List", - editedItem); - - return; - } - - m_RealmHostList.DeleteString(selItemIndex); - m_RealmHostList.InsertString(selItemIndex, editRealmHostList.GetEditedItem()); - m_RealmHostList.SetCurSel(selItemIndex); - SetModified(TRUE); - - ResetDefaultRealmComboBox(); - } -} - -void CKrb4RealmHostMaintenance::OnButtonRealmHostRemove() -{ - if (IDYES != AfxMessageBox("You are about to remove an item from the list!\n\nContinue?", - MB_YESNO)) - return; - - INT curSel = m_RealmHostList.GetCurSel(); - m_RealmHostList.DeleteString(curSel); // Single Sel Listbox - - if (-1 == m_RealmHostList.SetCurSel(curSel)) - m_RealmHostList.SetCurSel(curSel - 1); - - SetModified(TRUE); - - ResetDefaultRealmComboBox(); - - if (!m_RealmHostList.GetCount()) - { - GetDlgItem(ID_BUTTON_KRB4_REALM_HOST_REMOVE)->EnableWindow(FALSE); - GetDlgItem(IDC_BUTTON_KRB4_REALM_HOST_EDIT)->EnableWindow(FALSE); - } - - /* For Mult. Sel Listbox - const LONG MAX_SEL_BUF = m_RealmHostList.GetSelCount(); - LPINT selectBuf = new INT[MAX_SEL_BUF]; - - for (INT maxSelected = m_RealmHostList.GetSelItems(MAX_SEL_BUF, selectBuf), del=0, sel=0; - sel < maxSelected; sel++) - { - if (LB_ERR == m_RealmHostList.DeleteString(*(selectBuf + sel) - del)) - MessageBox("Help", "Error", MB_OK); - else - del++; - } - - delete selectBuf; - */ -} - -void CKrb4RealmHostMaintenance::OnSelchangeListRemoveHost() -{ - //SetModified(TRUE); -} - - -void CKrb4RealmHostMaintenance::OnDblclkListRemoveHost() -{ - OnButtonRealmHostEdit(); -} - -BOOL CKrb4RealmHostMaintenance::PreTranslateMessage(MSG* pMsg) -{ - if (m_defectiveLines) - { - if (m_defectiveLines == 1) - LeashErrorBox("Found a defective entry in file", - CKrbProperties::m_krbPath, "Warning"); - else if (m_defectiveLines > 1) - LeashErrorBox("Found more then one defective entry in file", - CKrbProperties::m_krbPath, "Warning"); - } - - m_defectiveLines = 0; - return CPropertyPage::PreTranslateMessage(pMsg); -} - -void CKrb4RealmHostMaintenance::OnButtonRealmhostMaintHelp2() -{ - MessageBox("No Help Available!", "Note", MB_OK); -} diff --git a/src/windows/leash/Krb4RealmHostMaintenance.h b/src/windows/leash/Krb4RealmHostMaintenance.h deleted file mode 100644 index 26881c6d49..0000000000 --- a/src/windows/leash/Krb4RealmHostMaintenance.h +++ /dev/null @@ -1,86 +0,0 @@ -// ************************************************************************************** -// File: Krb4RealmHostMaintenance.h -// By: Arthur David Leather -// Created: 12/02/98 -// Copyright @1998 Massachusetts Institute of Technology - All rights reserved. -// Description: H file for Krb4RealmHostMaintenance.cpp. Contains variables and functions -// for Kerberos Four Properties -// -// History: -// -// MM/DD/YY Inits Description of Change -// 12/02/98 ADL Original -// ************************************************************************************** - - -#if !defined(AFX_REAMLHOSTMAINT_H__2FE711C3_8E9A_11D2_94C5_0000861B8A3C__INCLUDED_) -#define AFX_REAMLHOSTMAINT_H__2FE711C3_8E9A_11D2_94C5_0000861B8A3C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// RemoveHostNameList.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CKrb4RealmHostMaintenance dialog - -#define MAXLINE 256 - -class CKrb4RealmHostMaintenance : public CPropertyPage -{ -// Construction -private: - DECLARE_DYNCREATE(CKrb4RealmHostMaintenance) - CHAR lineBuf[MAXLINE]; - INT m_defectiveLines; - BOOL m_initDnsKdcLookup; - BOOL m_newDnsKdcLookup; - - void ResetDefaultRealmComboBox(); - -public: - //CKrb4RealmHostMaintenance(CWnd* pParent = NULL); // standard constructor - CKrb4RealmHostMaintenance(); - virtual ~CKrb4RealmHostMaintenance(); - -// Dialog Data - //{{AFX_DATA(CKrb4RealmHostMaintenance) - enum { IDD = IDD_KRB4_REALMHOST_MAINT2 }; - CDragListBox m_RealmHostList; - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CKrb4RealmHostMaintenance) - public: - virtual BOOL PreTranslateMessage(MSG* pMsg); - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CKrb4RealmHostMaintenance) - virtual BOOL OnInitDialog(); - virtual BOOL OnApply(); - virtual void OnOK(); - virtual void OnCancel(); - afx_msg void OnButtonRealmHostAdd(); - afx_msg void OnButtonRealmHostEdit(); - afx_msg void OnButtonRealmHostRemove(); - afx_msg void OnSelchangeListRemoveHost(); - afx_msg void OnDblclkListRemoveHost(); - afx_msg void OnButtonRealmhostMaintHelp2(); - afx_msg void OnCheckDnsKdcLookup(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_REAMLHOSTMAINT_H__2FE711C3_8E9A_11D2_94C5_0000861B8A3C__INCLUDED_) diff --git a/src/windows/leash/KrbDomainRealmMaintenance.cpp b/src/windows/leash/KrbDomainRealmMaintenance.cpp index da9e883cc7..a216a2387e 100644 --- a/src/windows/leash/KrbDomainRealmMaintenance.cpp +++ b/src/windows/leash/KrbDomainRealmMaintenance.cpp @@ -4,7 +4,6 @@ #include "stdafx.h" #include "leash.h" #include "KrbDomainRealmMaintenance.h" -#include "Krb4AddToDomainRealmList.h" #include "Krb4EditDomainRealmList.h" #include "KrbProperties.h" diff --git a/src/windows/leash/KrbEditHostServer.cpp b/src/windows/leash/KrbEditHostServer.cpp index 4245c2b558..5fe27c5dd1 100644 --- a/src/windows/leash/KrbEditHostServer.cpp +++ b/src/windows/leash/KrbEditHostServer.cpp @@ -15,7 +15,6 @@ #include "stdafx.h" #include "leash.h" -#include "Krb4Properties.h" #include "KrbEditHostServer.h" #include "lglobals.h" diff --git a/src/windows/leash/KrbEditRealm.cpp b/src/windows/leash/KrbEditRealm.cpp index caa1e15532..d7d04bd48c 100644 --- a/src/windows/leash/KrbEditRealm.cpp +++ b/src/windows/leash/KrbEditRealm.cpp @@ -15,7 +15,6 @@ #include "stdafx.h" #include "leash.h" -#include "Krb4Properties.h" #include "KrbEditRealm.h" #include "lglobals.h" diff --git a/src/windows/leash/KrbProperties.cpp b/src/windows/leash/KrbProperties.cpp index 0a64142530..9885b14881 100644 --- a/src/windows/leash/KrbProperties.cpp +++ b/src/windows/leash/KrbProperties.cpp @@ -14,7 +14,6 @@ #include "stdafx.h" #include "KrbProperties.h" -#include "Krb4Properties.h" #include "Leash.h" #include "wshelper.h" diff --git a/src/windows/leash/KrbRealmHostMaintenance.cpp b/src/windows/leash/KrbRealmHostMaintenance.cpp index a39af3450c..bbe97d6056 100644 --- a/src/windows/leash/KrbRealmHostMaintenance.cpp +++ b/src/windows/leash/KrbRealmHostMaintenance.cpp @@ -16,7 +16,6 @@ #include "stdafx.h" #include "leash.h" #include "KrbProperties.h" -#include "Krb4Properties.h" #include "KrbAddRealm.h" #include "KrbAddHostServer.h" #include "KrbRealmHostMaintenance.h" diff --git a/src/windows/leash/LeashControlPanel.cpp b/src/windows/leash/LeashControlPanel.cpp deleted file mode 100644 index 47273a0775..0000000000 --- a/src/windows/leash/LeashControlPanel.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// LeashControlPanel.cpp : implementation file -// - -#include "stdafx.h" -#include "leash.h" -#include "LeashControlPanel.h" - -#ifdef _DEBUG -#define new DEBUG_NEW -#undef THIS_FILE -static char THIS_FILE[] = __FILE__; -#endif - -///////////////////////////////////////////////////////////////////////////// -// CLeashControlPanel dialog - - -CLeashControlPanel::CLeashControlPanel(CWnd* pParent /*=NULL*/) - : CDialog(CLeashControlPanel::IDD, pParent) -{ - //{{AFX_DATA_INIT(CLeashControlPanel) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT -} - - -void CLeashControlPanel::DoDataExchange(CDataExchange* pDX) -{ - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CLeashControlPanel) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP -} - - -BEGIN_MESSAGE_MAP(CLeashControlPanel, CDialog) - //{{AFX_MSG_MAP(CLeashControlPanel) - // NOTE: the ClassWizard will add message map macros here - //}}AFX_MSG_MAP -END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CLeashControlPanel message handlers diff --git a/src/windows/leash/LeashControlPanel.h b/src/windows/leash/LeashControlPanel.h deleted file mode 100644 index 173dd6e783..0000000000 --- a/src/windows/leash/LeashControlPanel.h +++ /dev/null @@ -1,46 +0,0 @@ -#if !defined(AFX_LEASHCONTROLPANEL_H__940146F3_6857_11D2_943C_0000861B8A3C__INCLUDED_) -#define AFX_LEASHCONTROLPANEL_H__940146F3_6857_11D2_943C_0000861B8A3C__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 -// LeashControlPanel.h : header file -// - -///////////////////////////////////////////////////////////////////////////// -// CLeashControlPanel dialog - -class CLeashControlPanel : public CDialog -{ -// Construction -public: - CLeashControlPanel(CWnd* pParent = NULL); // standard constructor - -// Dialog Data - //{{AFX_DATA(CLeashControlPanel) - enum { IDD = IDD_LEASH_CONTROL_PANEL }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CLeashControlPanel) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation -protected: - - // Generated message map functions - //{{AFX_MSG(CLeashControlPanel) - // NOTE: the ClassWizard will add member functions here - //}}AFX_MSG - DECLARE_MESSAGE_MAP() -}; - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_LEASHCONTROLPANEL_H__940146F3_6857_11D2_943C_0000861B8A3C__INCLUDED_) diff --git a/src/windows/leash/LeashView.cpp b/src/windows/leash/LeashView.cpp index 253ae3f066..5115a1eb8d 100644 --- a/src/windows/leash/LeashView.cpp +++ b/src/windows/leash/LeashView.cpp @@ -24,7 +24,6 @@ #include "LeashDebugWindow.h" #include "LeashMessageBox.h" #include "LeashAboutBox.h" -#include "Krb4Properties.h" #include "Krb5Properties.h" #include "LeashProperties.h" #include "KrbProperties.h" diff --git a/src/windows/lib/gic.c b/src/windows/lib/gic.c deleted file mode 100644 index fe586c6fce..0000000000 --- a/src/windows/lib/gic.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (C) 1997 Cygnus Solutions. - * - * Author: Michael Graff - */ - -#include -#include - -#include -#include -#include - -#include "krb5.h" - -#include "vardlg.h" -#include "gic.h" - -/* - * Steps performed: - * - * 1) Create the dialog with all the windows we will need - * later. This is done by calling vardlg_build() from - * gic_prompter(). - * - * 2) Run the dialog from within gic_prompter(). If the return - * value of the dialog is -1 or IDCANCEL, return an error. - * Otherwise, return success. - * - * 3) From within the dialog initialization code, call - * vardlg_config(), which will: - * - * a) Set all the label strings in all the entry labels and - * the banner. - * - * b) Set the maximum input lengths on the entry fields. - * - * c) Calculate the size of the text used within the banner. - * - * d) Calculate the longest string of text used as a label. - * - * e) Resize each label and each entry within the dialog - * to "look nice." - * - * f) Place the OK and perhaps the Cancel buttons at the bottom - * of the dialog. - * - * 4) When the OK button is clicked, copy all the values from the - * input fields and store them in the pointers we are given. - * Also, set the actual lengths to what we collected from the - * entries. Finally, call EndDialog(IDOK) to end the dialog. - */ - -/* - * Yes, a global. It is a PITA to not use them in windows. - */ -gic_data *gd; - - -/* - * initialize the dialog - */ -static BOOL -gic_dialog_init(HWND hwnd, HWND hwndFocus, LPARAM lParam) -{ - vardlg_config(hwnd, gd->width, gd->banner, gd->num_prompts, - gd->prompts, (WORD)(gd->id)); - - return FALSE; -} - -/* - * process dialog "commands" - */ -static void -gic_dialog_command(HWND hwnd, int cid, HWND hwndCtl, UINT codeNotify) -{ - - int n; - WORD id; - - /* - * We are only interested in button clicks, and then only of - * type IDOK or IDCANCEL. - */ - if (codeNotify != BN_CLICKED) - return; - if (cid != IDOK && cid != IDCANCEL) - return; - - /* - * If we are canceled, wipe all the fields and return IDCANCEL. - */ - if (cid == IDCANCEL) { - EndDialog(hwnd, IDCANCEL); - return; - } - - /* - * must be IDOK... - */ - id = (gd->id + 2); - for (n = 0 ; n < gd->num_prompts ; n++) { - Edit_GetText(GetDlgItem(hwnd, id), gd->prompts[n].reply->data, - gd->prompts[n].reply->length); - gd->prompts[n].reply->length = (unsigned)strlen(gd->prompts[n].reply->data); - id += 2; - } - - EndDialog(hwnd, IDOK); -} - -/* - * The dialog callback. - */ -static INT_PTR CALLBACK -gic_dialog(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) { - HANDLE_MSG(hwnd, WM_INITDIALOG, gic_dialog_init); - - HANDLE_MSG(hwnd, WM_COMMAND, gic_dialog_command); - } - - return FALSE; -} - - -/* - * All the disgusting code to use the get_init_creds() functions in a - * broken environment - */ -krb5_error_code KRB5_CALLCONV -gic_prompter(krb5_context ctx, void *data, const char *name, - const char *banner, int num_prompts, krb5_prompt prompts[]) -{ - int rc; - void *dlg; - - gd = data; - - gd->banner = banner; - gd->num_prompts = num_prompts; - gd->prompts = prompts; - if (gd->width == 0) - gd->width = 450; - - dlg = vardlg_build((WORD)(gd->width), name, gd->banner, - (WORD)num_prompts, prompts, (WORD)(gd->id)); - - rc = DialogBoxIndirect(gd->hinstance, (LPDLGTEMPLATE)dlg, gd->hwnd, gic_dialog); - - if (rc != IDOK) - return 1; - - return 0; -} diff --git a/src/windows/lib/gic.h b/src/windows/lib/gic.h deleted file mode 100644 index 23213163d0..0000000000 --- a/src/windows/lib/gic.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 1997 Cygnus Solutions - * - * Author: Michael Graff - */ - -#ifndef _WINDOWS_LIB_GIC_H -#define _WINDOWS_LIB_GIC_H - -#include -#include - -#include "krb5.h" - -typedef struct { - HINSTANCE hinstance; /* application instance */ - HWND hwnd; /* parent window */ - WORD id; /* starting ID */ - WORD width; /* max width of the dialog box */ - const char *banner; /* the banner */ - WORD num_prompts; /* the number of prompts we were passed */ - krb5_prompt *prompts; /* the prompts themselves */ -} gic_data; - -krb5_error_code KRB5_CALLCONV gic_prompter(krb5_context, void *, const char *, - const char *, int, krb5_prompt []); - -#endif /* _WINDOWS_LIB_GIC_H */ diff --git a/src/windows/lib/registry.c b/src/windows/lib/registry.c deleted file mode 100644 index be4ef894d5..0000000000 --- a/src/windows/lib/registry.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) 1997 Cygnus Solutions - * - * Author: Michael Graff - */ - -#include -#include -#include - -#include "registry.h" - -HKEY -registry_open(HKEY hkey, char *base, REGSAM sam) -{ - HKEY k = INVALID_HANDLE_VALUE; - DWORD err; - - /* - * if the base path is null, return the already open key in hkey - */ - if (base == NULL) - return hkey; - - err = RegOpenKeyEx(hkey, base, 0, sam, &hkey); - if (err != ERROR_SUCCESS) - return INVALID_HANDLE_VALUE; - - return hkey; -} - -void -registry_close(HKEY hkey) -{ - CloseHandle(hkey); -} - -HKEY -registry_key_create(HKEY hkey, char *sub, REGSAM sam) -{ - HKEY key; - DWORD err; - DWORD disp; - - err = RegCreateKeyEx(hkey, sub, 0, 0, REG_OPTION_NON_VOLATILE, sam, - NULL, &key, &disp); - if (err != ERROR_SUCCESS) - return INVALID_HANDLE_VALUE; - - return key; -} - -int -registry_key_delete(HKEY hkey, char *sub) -{ - DWORD err; - - err = RegDeleteKey(hkey, sub); - if (err != ERROR_SUCCESS) - return -1; - - return 0; -} - -int -registry_string_get(HKEY hkey, char *sub, char **val) -{ - DWORD err; - DWORD type; - DWORD datasize; - - err = RegQueryValueEx(hkey, sub, 0, &type, 0, &datasize); - if (err != ERROR_SUCCESS || type != REG_SZ) { - *val = NULL; - return -1; - } - - *val = malloc(datasize); - if (*val == NULL) - return -1; - - err = RegQueryValueEx(hkey, sub, 0, &type, *val, &datasize); - if (err != ERROR_SUCCESS) { - free(*val); - *val = NULL; - return -1; - } - - return 0; -} - -int -registry_dword_get(HKEY hkey, char *sub, DWORD *val) -{ - DWORD err; - DWORD type; - DWORD datasize; - - err = RegQueryValueEx(hkey, sub, 0, &type, 0, &datasize); - if (err != ERROR_SUCCESS || type != REG_DWORD) { - *val = 0; - return -1; - } - - err = RegQueryValueEx(hkey, sub, 0, &type, (BYTE *)val, &datasize); - if (err != ERROR_SUCCESS) { - *val = 0; - return -1; - } - - return 0; -} - -int -registry_string_set(HKEY hkey, char *sub, char *x) -{ - DWORD err; - - err = RegSetValueEx(hkey, sub, 0, REG_SZ, (BYTE *)x, (DWORD)strlen(x) + 1); - if (err != ERROR_SUCCESS) - return -1; - - return 0; -} - -int -registry_dword_set(HKEY hkey, char *sub, DWORD x) -{ - DWORD err; - - err = RegSetValueEx(hkey, sub, 0, REG_DWORD, (CONST BYTE *)&x, sizeof(DWORD)); - if (err != ERROR_SUCCESS) - return -1; - - return 0; -} - -int -registry_keyval_dword_set(HKEY hkey, char *base, char *sub, DWORD val) -{ - HKEY k; - int err; - - k = registry_open(hkey, base, KEY_WRITE); - if (k == INVALID_HANDLE_VALUE) - return -1; - - err = registry_dword_set(k, sub, val); - - registry_close(k); - - return err; -} - -int -registry_keyval_dword_get(HKEY hkey, char *base, char *sub, DWORD *val) -{ - HKEY k; - int err; - - k = registry_open(hkey, base, KEY_READ); - if (k == INVALID_HANDLE_VALUE) - return -1; - - err = registry_dword_get(k, sub, val); - - registry_close(k); - - return err; -} - -int -registry_keyval_string_get(HKEY hkey, char *base, char *sub, char **val) -{ - HKEY k; - int err; - - k = registry_open(hkey, base, KEY_READ); - if (k == INVALID_HANDLE_VALUE) { - *val = NULL; - return -1; - } - - err = registry_string_get(k, sub, val); - - registry_close(k); - - return err; -} - -int -registry_keyval_string_set(HKEY hkey, char *base, char *sub, char *val) -{ - HKEY k; - int err; - - k = registry_open(hkey, base, KEY_WRITE); - if (k == INVALID_HANDLE_VALUE) - return -1; - - err = registry_string_set(k, sub, val); - - registry_close(k); - - return err; -} - -int -registry_value_delete(HKEY hkey, char *sub) -{ - if (RegDeleteValue(hkey, sub)) - return -1; - - return 0; -} - -int -registry_keyval_delete(HKEY hkey, char *base, char *sub) -{ - HKEY k; - int err; - - k = registry_open(hkey, base, KEY_WRITE); - if (k == INVALID_HANDLE_VALUE) - return -1; - - err = registry_value_delete(k, sub); - - registry_close(k); - - return err; -} diff --git a/src/windows/lib/registry.h b/src/windows/lib/registry.h deleted file mode 100644 index d628d2bcb0..0000000000 --- a/src/windows/lib/registry.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1997 Cygnus Solutions - * - * Author: Michael Graff - */ - -#ifndef LIB_WINDOWS_REGISTRY_H -#define LIB_WINDOWS_REGISTRY_H - -#include -#include - -HKEY registry_open(HKEY, char *, REGSAM); -void registry_close(HKEY); -HKEY registry_key_create(HKEY, char *, REGSAM); -int registry_key_delete(HKEY, char *); -int registry_string_get(HKEY, char *, char **); -int registry_dword_get(HKEY, char *, DWORD *); -int registry_string_set(HKEY, char *, char *); -int registry_dword_set(HKEY, char *, DWORD); -int registry_keyval_dword_set(HKEY, char *, char *, DWORD); -int registry_keyval_dword_get(HKEY, char *, char *, DWORD *); -int registry_keyval_string_get(HKEY, char *, char *, char **); -int registry_keyval_string_set(HKEY, char *, char *, char *); -int registry_value_delete(HKEY, char *); -int registry_keyval_delete(HKEY, char *, char *); - -#define CYGNUS_SOLUTIONS "SOFTWARE\\Cygnus Solutions" - -#define KERBNET_SANS_VERSION CYGNUS_SOLUTIONS "\\Kerbnet" -#define KERBNET_BASE KERBNET_SANS_VERSION "\\1" - -#define KERBNET_TELNET_BASE KERBNET_BASE "\\telnet" -#define KERBNET_TELNET_HOST KERBNET_TELNET_BASE "\\hosts" - -#define KERBNET_CNS_BASE KERBNET_BASE "\\cns" - -#define KERBNET_HOME "KERBNET_HOME" - -#endif /* LIB_WINDOWS_REGISTRY_H */ diff --git a/src/windows/lib/vardlg.c b/src/windows/lib/vardlg.c deleted file mode 100644 index 91a6bf4b55..0000000000 --- a/src/windows/lib/vardlg.c +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (C) 1997 Cygnus Solutions. - * - * Author: Michael Graff - */ -/* - * Dialog box building for various numbers of (label, entry) fields. - * - * This code is somewhat hardcoded to build boxes for the krb5_get_init_creds() - * function. - */ - -#include -#include - -#include -#include -#include - -#include "krb5.h" -#include "vardlg.h" - -/* - * a hack, I know... No error checking below, either. - */ -static unsigned char dlg[DLG_BUF]; - -/* - * Add a WORD (16-bit int) to the buffer. Return the number of characters - * added. - */ -static int -ADD_WORD(unsigned char *p, WORD w) -{ - *((WORD *)p) = w; - - return 2; -} - -static int -ADD_DWORD(unsigned char *p, DWORD dw) -{ - *((DWORD *)p) = dw; - - return 4; -} - -static size_t -ADD_UNICODE_STRING(unsigned char *p, const char *s) -{ - WORD *w; - size_t i; - size_t len; - - w = (WORD *)p; - - len = strlen(s) + 1; /* copy the null, too */ - - for (i = 0 ; i < len ; i++) - *w++ = *s++; - - return (len * 2); -} - -#define DWORD_ALIGN(p) { while ((DWORD)p % 4) *p++ = 0x00; } - -static size_t -ADD_DLGTEMPLATE(unsigned char *dlg, short x, short y, short cx, short cy, - const char *caption, const char *fontname, WORD fontsize, - WORD n) -{ - unsigned char *p; - DLGTEMPLATE dlt; - - p = dlg; - - dlt.style = (DS_MODALFRAME | WS_POPUP); - if (caption != NULL) - dlt.style |= WS_CAPTION; - if (fontname != NULL) - dlt.style |= DS_SETFONT; - dlt.dwExtendedStyle = 0; - dlt.cdit = n; - dlt.x = x; - dlt.y = y; - dlt.cx = cx; - dlt.cy = cy; - memcpy(p, &dlt, sizeof(dlt)); - p += sizeof(dlt); - - p += ADD_WORD(p, 0x0000); /* menu == none */ - - p += ADD_WORD(p, 0x0000); /* class == default? */ - - if (caption != NULL) - p += ADD_UNICODE_STRING(p, caption); - else - p += ADD_WORD(p, 0x0000); - - if (fontname != NULL) { - p += ADD_WORD(p, fontsize); - p += ADD_UNICODE_STRING(p, fontname); - } - - DWORD_ALIGN(p); - - return (p - dlg); -} - -static size_t -ADD_DLGITEM(unsigned char *dlg, short x, short y, short cx, short cy, - const char *label, WORD id, WORD type, DWORD style) -{ - unsigned char *p; - DLGITEMTEMPLATE dit; - - p = dlg; - - dit.style = style; - dit.dwExtendedStyle = 0; - dit.x = x; - dit.y = y; - dit.cx = cx; - dit.cy = cy; - dit.id = id; - memcpy(p, &dit, sizeof(dit)); - p += sizeof(dit); - - p += ADD_WORD(p, 0xffff); - p += ADD_WORD(p, type); - - p += ADD_UNICODE_STRING(p, label); - - /* - * creation data? For now, just make this empty, like the resource - * compiler does. - */ - p += ADD_WORD(p, 0x0000); - - DWORD_ALIGN(p); - - return (p - dlg); -} - -#define ADD_DLGITEM_defpushbutton(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0080, 0x50010001); - -#define ADD_DLGITEM_pushbutton(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0080, 0x50010000); - -#define ADD_DLGITEM_left_static(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0082, 0x50020000); - -#define ADD_DLGITEM_centered_static(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0082, 0x50020001); - -#define ADD_DLGITEM_right_static(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0082, 0x50020002); - -#define ADD_DLGITEM_entry(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0081, 0x50810080); - -#define ADD_DLGITEM_hidden_entry(a, b, c, d, e, f, g) \ - ADD_DLGITEM((a), (b), (c), (d), (e), (f), (g), 0x0081, 0x508100a0); - - -/* - * "build" the dialog box. In this bit of code, we create the dialog box, - * create the OK button, and a static label for the banner text. - * - * If there are items, we also create a Cancel button and one (label, entry) - * fields for each item. - */ -void * -vardlg_build(WORD cx, const char *name, const char *banner, - WORD n, krb5_prompt prompts[], WORD id) -{ - unsigned char *p; - WORD i; - - p = dlg; /* global */ - - if (cx < MIN_WIDTH) - cx = MIN_WIDTH; - if (cx > MAX_WIDTH) - cx = MAX_WIDTH; - - /* - * Store the dialog template - */ - p += ADD_DLGTEMPLATE(p, 0, 0, cx, 0, name ? - strlen(name) < 30 ? name : "Kerberos V5" : - "Kerberos V5", - "MS Sans Serif", 8, - (WORD)(n * 2 + 3)); - - /* - * Create a label for the banner. This will be ID (id). - */ - p += ADD_DLGITEM_left_static(p, 0, 0, 0, 0, "", id++); - - /* - * Each label field is ID (id + 1) + (item * 2), and each entry field - * is (id + 2) + (item * 2) - */ - for (i = 0 ; i < n ; i++) { - p += ADD_DLGITEM_right_static(p, 0, 0, 0, 0, "", id++); - if (prompts[i].hidden) { - p += ADD_DLGITEM_hidden_entry(p, 0, 0, 0, 0, "", id++); - } else { - p += ADD_DLGITEM_entry(p, 0, 0, 0, 0, "", id++); - } - } - - /* - * Create the OK and Cancel buttons. - */ - p += ADD_DLGITEM_defpushbutton(p, 0, 0, 0, 0, - "OK", IDOK); - if (n != 0) - p += ADD_DLGITEM_pushbutton(p, 0, 0, 0, 0, - "Cancel", IDCANCEL); - - return dlg; -} - -#define SPACE_Y 4 /* logical units */ -#define SPACE_X 4 /* logical units */ -#define ENTRY_PX 120 /* pixels */ -#define BUTTON_PX 70 /* pixels */ -#define BUTTON_PY 30 /* pixels */ - -void -vardlg_config(HWND hwnd, WORD width, const char *banner, WORD num_prompts, - krb5_prompt *prompts, WORD id) -{ - int n; - WORD cid; - HDC hdc; - SIZE csize; - SIZE maxsize; - LONG cx, cy; - LONG ccx, ccy; - LONG space_x, space_y; - LONG max_x, max_y; - LONG banner_y; - RECT rect; - int done; - const char *p; - - /* - * First, set the banner's text. - */ - Static_SetText(GetDlgItem(hwnd, id), banner); - - /* - * Next, run through the items and set their static text. - * Also, set the corresponding edit string and set the - * maximum input length. - */ - cid = (id + 1); - - for (n = 0 ; n < num_prompts ; n++) { - Static_SetText(GetDlgItem(hwnd, cid), prompts[n].prompt); - cid++; - Edit_SetText(GetDlgItem(hwnd, cid), ""); - Edit_LimitText(GetDlgItem(hwnd, cid), prompts[n].reply->length); - cid++; - } - - /* - * Now run through the entry fields and find the longest string. - */ - maxsize.cx = maxsize.cy = 0; - cid = (id + 1); - hdc = GetDC(GetDlgItem(hwnd, cid)); /* assume one label is the same as all the others */ - - for (n = 0 ; n < num_prompts ; n++) { - GetTextExtentPoint32(hdc, prompts[n].prompt, (int)strlen(prompts[n].prompt), &csize); - if (csize.cx > maxsize.cx) - maxsize.cx = csize.cx; - if (csize.cy > maxsize.cy) - maxsize.cy = csize.cy; - } - -#if 0 - /* - * convert the maximum values into pixels. Ugh. - */ - rect.left = 0; - rect.top = 0; - rect.right = maxsize.cx; - rect.bottom = maxsize.cy; - MapDialogRect(hwnd, &rect); - - max_x = rect.right; - max_y = rect.bottom; -#else - max_x = maxsize.cx; - max_y = (long)(((double)maxsize.cy) * 1.5); -#endif - - /* - * convert the spacing values, too. Ugh. Ugh. - */ - rect.left = 0; - rect.top = 0; - rect.right = SPACE_X; - rect.bottom = SPACE_Y; - MapDialogRect(hwnd, &rect); - - space_x = rect.right; - space_y = rect.bottom; - - /* - * Now we know the maximum length of the string for the entry labels. Guestimate - * that the entry fields should be ENTRY_PX pixels long and resize the dialog - * window to fit the longest string plus the entry fields (plus a little for the - * spacing between the edges of the windows and the static and edit fields, and - * between the static and edit fields themselves.) - */ - cx = max_x + ENTRY_PX + (space_x * 3); - cy = (max_y + space_y) * num_prompts; - - /* - * resize the dialog box itself (take 1) - */ - SetWindowPos(hwnd, HWND_TOPMOST, - 0, 0, - cx + 10, cy + 30, - SWP_NOMOVE); - - /* - * position the dialog items. First, the banner. (take 1) - */ - SetWindowPos(GetDlgItem(hwnd, id), HWND_BOTTOM, - space_x, space_y, - (cx - space_x * 2), max_y, - 0); - - /* - * Now that the window for the banner is in place, convert the width into logical units - * and find out how many lines we need to reserve room for. - */ - done = 0; - p = banner; - banner_y = 0; - - do { - int nFit; - int pDx[128]; - - hdc = GetDC(GetDlgItem(hwnd, id)); - - GetTextExtentExPoint(hdc, p, (int)strlen(p), cx, &nFit, - pDx, &csize); - - banner_y += csize.cy; - - p += nFit; - - } while (*p != 0); - - banner_y += space_y; - - /* - * position the banner (take 2) - */ - SetWindowPos(GetDlgItem(hwnd, id), HWND_BOTTOM, - space_x, space_y, - (cx - space_x * 2), banner_y, - 0); - - /* - * Don't forget to include the banner estimate and the buttons, too. Once again, - * assume the buttons are BUTTON_PY pixels high. The extra three space_y's are - * for between the top of the dialog and the banner, between the banner and the - * first label, and between the buttons and the bottom of the screen. - */ - cy += banner_y + BUTTON_PY + (space_y * 3); - - /* - * resize the dialog box itself (Again... ugh!) - */ - SetWindowPos(hwnd, HWND_TOPMOST, - 0, 0, - cx + 10, cy + 30, - SWP_NOMOVE); - - cid = (id + 1); - ccy = banner_y + (space_y * 2); - ccx = max_x + (space_x * 2); /* where the edit fields start */ - - for (n = 0 ; n < num_prompts ; n++) { - SetWindowPos(GetDlgItem(hwnd, cid), HWND_BOTTOM, - space_x, ccy, - max_x, max_y, 0); - cid++; - SetWindowPos(GetDlgItem(hwnd, cid), HWND_BOTTOM, - ccx, ccy, - ENTRY_PX, max_y - 3, 0); - cid++; - ccy += (max_y + space_y); - } - - /* - * Now the buttons. If there are any entries we will have both an OK and a - * Cancel button. If we don't have any entries, we will have only an OK. - */ - if (num_prompts == 0) { - SetWindowPos(GetDlgItem(hwnd, IDOK), HWND_BOTTOM, - (cx / 2), cy - space_y - BUTTON_PY, - BUTTON_PX, BUTTON_PY, 0); - } else { - SetWindowPos(GetDlgItem(hwnd, IDOK), HWND_BOTTOM, - space_x, cy - space_y - BUTTON_PY, - BUTTON_PX, BUTTON_PY, 0); - SetWindowPos(GetDlgItem(hwnd, IDCANCEL), HWND_BOTTOM, - cx - space_x - BUTTON_PX, cy - space_y - BUTTON_PY, - BUTTON_PX, BUTTON_PY, 0); - } - - return; -} - -/* - * To use these functions, first create the dialog box and entries. - * You will always get an OK button. If there are at least one item, - * you will also get a cancel button. The OK button is IDOK, and the cancel - * button is IDCANCEL, as usual. - * - * After calling bld_dlg, the banner will have ID "id", and the labels - * will be "1 + id + i * 2" (i is the entry number, starting with zero) and - * the entries will be "2 + id + i * 2". - * - * unsigned char *dlg = vardlg_build(minwidth, banner, num_prompts, - * krb5_prompt[], id); - * - * Then, "run" the dialog using: - * - * rc = DialogBoxIndirect(hinstance, (LPDLGTEMPLATE)dlg, - * HWND_DESKTOP, myDialogProc); - * - * Note that the vardlg_build function uses a static data area and so cannot - * be used more than once before the DialogBoxIndirect() procedure is called. - * I assume windows won't need that area after that call is complete. - * - * In the dialog's _initialization_ procedure, call - * - * vardlg_config(hwnd, banner, num_prompts, krb5_prompt[], id); - * - * This function will resize the various elements of the dialog and fill in the - * labels. - */ diff --git a/src/windows/lib/vardlg.h b/src/windows/lib/vardlg.h deleted file mode 100644 index e609d4a1d2..0000000000 --- a/src/windows/lib/vardlg.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 1997 Cygnus Solutions - * - * Author: Michael Graff - */ - -#ifndef _WINDOWS_LIB_VARDLG_H -#define _WINDOWS_LIB_VARDLG_H - -#include -#include - -#define DLG_BUF 4096 - -/* - * The minimum and maximum dialog box widths we will allow. - */ -#define MIN_WIDTH 350 -#define MAX_WIDTH 600 - -/* - * "build" the dialog box. In this bit of code, we create the dialog box, - * create the OK button, and a static label for the banner text. - * - * If there are items, we also create a Cancel button and one (label, entry) - * fields for each item. - */ -void *vardlg_build(WORD, const char *, const char *, WORD, krb5_prompt *, WORD); - -void vardlg_config(HWND, WORD, const char *, WORD, krb5_prompt *, WORD); - -#endif /* _WINDOWS_LIB_VARDLG_H */ diff --git a/src/windows/wintel/Makefile.in b/src/windows/wintel/Makefile.in deleted file mode 100644 index 06367f8d69..0000000000 --- a/src/windows/wintel/Makefile.in +++ /dev/null @@ -1,46 +0,0 @@ -# Makefile for the Kerberos for Windows telnet client -# Works for both k4 and k5 releases. -# -OBJS = $(OUTPRE)telnet.obj $(OUTPRE)negotiat.obj $(OUTPRE)auth.obj \ - $(OUTPRE)edit.obj $(OUTPRE)emul.obj $(OUTPRE)font.obj \ - $(OUTPRE)intern.obj $(OUTPRE)screen.obj $(OUTPRE)encrypt.obj \ - $(OUTPRE)genget.obj - -##### Options -# Set NODEBUG if building release instead of debug -!IF ! defined(KVERSION) -KRBOPT =-DFORWARD -DAUTHENTICATION -DENCRYPTION -DDES_ENCRYPTION -KVERSION= 5 -!endif -KRB = KRB$(KVERSION) - -BUILDTOP=..\.. -LOCALINCLUDES= /I$(BUILDTOP) /I$(BUILDTOP)\include /I$(BUILDTOP)\include\krb5 \ - /I$(BUILDTOP)\lib\crypto\des -RESFILE = $(OUTPRE)telnet.res -XOBJS = $(RESFILE) $(OUTPRE)k5stream.obj $(OUTPRE)enc_des.obj - -DEFINES = /D$(KRB)=1 $(KRBOPT) -RFLAGS = $(LOCALINCLUDES) -RCFLAGS = $(RFLAGS) -D_WIN32 -DTELNET_APP - -##### Linker -LINK = link -LIBS = $(KLIB) $(CLIB) $(WLIB) -SYSLIBS = kernel32.lib ws2_32.lib user32.lib gdi32.lib comdlg32.lib -LFLAGS = /nologo $(LOPTS) - -all: Makefile $(OUTPRE)telnet.exe - -$(OUTPRE)telnet.exe: telnet.def $(OBJS) $(XOBJS) $(LIBS) - $(LINK) $(LFLAGS) /map:$*.map /out:$@ $(OBJS) $(XOBJS) \ - $(LIBS) $(SYSLIBS) - $(_VC_MANIFEST_EMBED_EXE) - -install: - copy $(OUTPRE)telnet.exe $(DESTDIR) - -clean: - $(RM) $(OUTPRE)*.exe $(OUTPRE)*.res $(OUTPRE)*.map - -$(RESFILE): ..\version.rc diff --git a/src/windows/wintel/auth.c b/src/windows/wintel/auth.c deleted file mode 100644 index 433bce38c3..0000000000 --- a/src/windows/wintel/auth.c +++ /dev/null @@ -1,867 +0,0 @@ -/* - * Implements Kerberos 4 authentication - */ - -#ifdef KRB4 -#include -#include -#include -#include "winsock.h" -#include "kerberos.h" -#endif -#ifdef KRB5 -#include -#include -#include "krb5.h" -#include "com_err.h" -#endif - -#include "telnet.h" -#include "telnet_arpa.h" - -#ifdef ENCRYPTION -#include "encrypt.h" -#endif - -/* - * Constants - */ -#ifdef KRB4 -#define KRB_AUTH 0 -#define KRB_REJECT 1 -#define KRB_ACCEPT 2 -#define KRB_CHALLENGE 3 -#define KRB_RESPONSE 4 -#endif -#ifdef KRB5 -#define KRB_AUTH 0 /* Authentication data follows */ -#define KRB_REJECT 1 /* Rejected (reason might follow) */ -#define KRB_ACCEPT 2 /* Accepted */ -#define KRB_RESPONSE 3 /* Response for mutual auth. */ - -#define KRB_FORWARD 4 /* Forwarded credentials follow */ -#define KRB_FORWARD_ACCEPT 5 /* Forwarded credentials accepted */ -#define KRB_FORWARD_REJECT 6 /* Forwarded credentials rejected */ -#endif - -#ifndef KSUCCESS /* Let K5 use K4 constants */ -#define KSUCCESS 0 -#define KFAILURE 255 -#endif - -/* - * Globals - */ -#ifdef KRB4 -static CREDENTIALS cred; -static KTEXT_ST auth; - -#define KRB_SERVICE_NAME "rcmd" -#define KERBEROS_VERSION KERBEROS_V4 - -static int auth_how; -static int k4_auth_send(kstream); -static int k4_auth_reply(kstream, unsigned char *, int); -#endif - -#ifdef KRB5 -static krb5_data auth; -static int auth_how; -static krb5_auth_context auth_context; -krb5_keyblock *session_key = NULL; -#ifdef FORWARD -void kerberos5_forward(kstream); -#endif - -#define KRB_SERVICE_NAME "host" -#define KERBEROS_VERSION AUTHTYPE_KERBEROS_V5 - -static int k5_auth_send(kstream, int); -static int k5_auth_reply(kstream, int, unsigned char *, int); -#endif - -static int Data(kstream, int, void *, int); - -#ifdef ENCRYPTION -BOOL encrypt_flag = 1; -#endif -#ifdef FORWARD -BOOL forward_flag = 1; /* forward tickets? */ -BOOL forwardable_flag = 1; /* get forwardable tickets to forward? */ -BOOL forwarded_tickets = 0; /* were tickets forwarded? */ -#endif - -static unsigned char str_data[1024] = { IAC, SB, TELOPT_AUTHENTICATION, 0, - AUTHTYPE_KERBEROS_V5, }; - -static int -Data(kstream ks, int type, void *d, int c) -{ - unsigned char *p = str_data + 4; - unsigned char *cd = (unsigned char *)d; - - if (c == -1) - c = strlen((char *)cd); - - *p++ = AUTHTYPE_KERBEROS_V5; - *p = AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL; -#ifdef ENCRYPTION - *p |= AUTH_ENCRYPT_ON; -#endif - p++; - *p++ = type; - while (c-- > 0) { - if ((*p++ = *cd++) == IAC) - *p++ = IAC; - } - *p++ = IAC; - *p++ = SE; - - return(TelnetSend(ks, (LPSTR)str_data, p - str_data, 0)); -} - -#ifdef ENCRYPTION -/* - * Function: Enable or disable the encryption process. - * - * Parameters: - * enable - TRUE to enable, FALSE to disable. - */ -static void -auth_encrypt_enable(BOOL enable) -{ - encrypt_flag = enable; -} -#endif - -/* - * Function: Abort the authentication process - * - * Parameters: - * ks - kstream to send abort message to. - */ -static void -auth_abort(kstream ks, char *errmsg, long r) -{ - char buf[9]; - - wsprintf(buf, "%c%c%c%c%c%c%c%c", IAC, SB, TELOPT_AUTHENTICATION, - TELQUAL_IS, AUTHTYPE_NULL, - AUTHTYPE_NULL, IAC, SE); - TelnetSend(ks, (LPSTR)buf, 8, 0); - - if (errmsg != NULL) { - strTmp[sizeof(strTmp) - 1] = '\0'; - strncpy(strTmp, errmsg, sizeof(strTmp) - 1); - - if (r != KSUCCESS) { - strncat(strTmp, "\n", sizeof(strTmp) - 1 - strlen(strTmp)); -#ifdef KRB4 - lstrcat(strTmp, krb_get_err_text((int)r)); -#endif -#ifdef KRB5 - lstrcat(strTmp, error_message(r)); -#endif - } - - MessageBox(HWND_DESKTOP, strTmp, "Kerberos authentication failed!", - MB_OK | MB_ICONEXCLAMATION); - } -} - - -/* - * Function: Copy data to buffer, doubling IAC character if present. - * - * Parameters: - * kstream - kstream to send abort message to. - */ -static int -copy_for_net(unsigned char *to, unsigned char *from, int c) -{ - int n; - - n = c; - - while (c-- > 0) { - if ((*to++ = *from++) == IAC) { - n++; - *to++ = IAC; - } - } - - return n; -} - - -/* - * Function: Parse authentication send command - * - * Parameters: - * ks - kstream to send abort message to. - * - * parsedat - the sub-command data. - * - * end_sub - index of the character in the 'parsedat' array which - * is the last byte in a sub-negotiation - * - * Returns: Kerberos error code. - */ -static int -auth_send(kstream ks, unsigned char *parsedat, int end_sub) -{ - char buf[2048]; /* be sure that this is > auth.length+9 */ - char *pname; - int plen; - int r; - int i; - - auth_how = -1; - - for (i = 2; i+1 <= end_sub; i += 2) { - if (parsedat[i] == KERBEROS_VERSION) - if ((parsedat[i+1] & AUTH_WHO_MASK) == AUTH_WHO_CLIENT) { - auth_how = parsedat[i+1] & AUTH_HOW_MASK; - break; - } - } - - if (auth_how == -1) { - auth_abort(ks, NULL, 0); - return KFAILURE; - } - -#ifdef KRB4 - r = k4_auth_send(ks); -#endif /* KRB4 */ - -#ifdef KRB5 - r = k5_auth_send(ks, auth_how); -#endif /* KRB5 */ - - if (!r) - return KFAILURE; - - plen = strlen(szUserName); /* Set by k#_send if needed */ - pname = szUserName; - - wsprintf(buf, "%c%c%c%c", IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_NAME); - memcpy(&buf[4], pname, plen); - wsprintf(&buf[plen + 4], "%c%c", IAC, SE); - TelnetSend(ks, (LPSTR)buf, lstrlen(pname)+6, 0); - - wsprintf(buf, "%c%c%c%c%c%c%c", IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_IS, - KERBEROS_VERSION, auth_how | AUTH_WHO_CLIENT, KRB_AUTH); - -#if KRB4 - auth.length = copy_for_net(&buf[7], auth.dat, auth.length); -#endif /* KRB4 */ -#if KRB5 - auth.length = copy_for_net(&buf[7], auth.data, auth.length); -#endif /* KRB5 */ - - wsprintf(&buf[auth.length+7], "%c%c", IAC, SE); - - TelnetSend(ks, (LPSTR)buf, auth.length+9, 0); - - return KSUCCESS; -} - -/* - * Function: Parse authentication reply command - * - * Parameters: - * ks - kstream to send abort message to. - * - * parsedat - the sub-command data. - * - * end_sub - index of the character in the 'parsedat' array which - * is the last byte in a sub-negotiation - * - * Returns: Kerberos error code. - */ -static int -auth_reply(kstream ks, unsigned char *parsedat, int end_sub) -{ - int n; - -#ifdef KRB4 - n = k4_auth_reply(ks, parsedat, end_sub); -#endif - -#ifdef KRB5 - n = k5_auth_reply(ks, auth_how, parsedat, end_sub); -#endif - - return n; -} - -/* - * Function: Parse the athorization sub-options and reply. - * - * Parameters: - * ks - kstream to send abort message to. - * - * parsedat - sub-option string to parse. - * - * end_sub - last charcter position in parsedat. - */ -void -auth_parse(kstream ks, unsigned char *parsedat, int end_sub) -{ - if (parsedat[1] == TELQUAL_SEND) - auth_send(ks, parsedat, end_sub); - - if (parsedat[1] == TELQUAL_REPLY) - auth_reply(ks, parsedat, end_sub); -} - - -/* - * Function: Initialization routine called kstream encryption system. - * - * Parameters: - * str - kstream to send abort message to. - * - * data - user data. - */ -int -auth_init(kstream str, kstream_ptr data) -{ -#ifdef ENCRYPTION - encrypt_init(str, data); -#endif - return 0; -} - - -/* - * Function: Destroy routine called kstream encryption system. - * - * Parameters: - * str - kstream to send abort message to. - * - * data - user data. - */ -void -auth_destroy(kstream str) -{ -} - - -/* - * Function: Callback to encrypt a block of characters - * - * Parameters: - * out - return as pointer to converted buffer. - * - * in - the buffer to convert - * - * str - the stream being encrypted - * - * Returns: number of characters converted. - */ -int -auth_encrypt(struct kstream_data_block *out, - struct kstream_data_block *in, - kstream str) -{ - out->ptr = in->ptr; - - out->length = in->length; - - return(out->length); -} - - -/* - * Function: Callback to decrypt a block of characters - * - * Parameters: - * out - return as pointer to converted buffer. - * - * in - the buffer to convert - * - * str - the stream being encrypted - * - * Returns: number of characters converted. - */ -int -auth_decrypt(struct kstream_data_block *out, - struct kstream_data_block *in, - kstream str) -{ - out->ptr = in->ptr; - - out->length = in->length; - - return(out->length); -} - -#ifdef KRB4 -/* - * - * K4_auth_send - gets authentication bits we need to send to KDC. - * - * Result is left in auth - * - * Returns: 0 on failure, 1 on success - */ -static int -k4_auth_send(kstream ks) -{ - int r; /* Return value */ - char instance[INST_SZ]; - char *realm; - char buf[256]; - - memset(instance, 0, sizeof(instance)); - - if (realm = krb_get_phost(szHostName)) - lstrcpy(instance, realm); - - realm = krb_realmofhost(szHostName); - - if (!realm) { - strcpy(buf, "Can't find realm for host \""); - strncat(buf, szHostName, sizeof(buf) - 1 - strlen(buf)); - strncat(buf, "\"", sizeof(buf) - 1 - strlen(buf)); - auth_abort(ks, buf, 0); - return KFAILURE; - } - - r = krb_mk_req(&auth, KRB_SERVICE_NAME, instance, realm, 0); - - if (r == 0) - r = krb_get_cred(KRB_SERVICE_NAME, instance, realm, &cred); - - if (r) { - strcpy(buf, "Can't get \""); - strncat(buf, KRB_SERVICE_NAME, sizeof(buf) - 1 - strlen(buf)); - if (instance[0] != 0) { - strncat(buf, ".", sizeof(buf) - 1 - strlen(buf)); - lstrcat(buf, instance); - } - strncat(buf, "@", sizeof(buf) - 1 - strlen(buf)); - lstrcat(buf, realm); - strncat(buf, "\" ticket", sizeof(buf) - 1 - strlen(buf)); - auth_abort(ks, buf, r); - - return r; - } - - if (!szUserName[0]) /* Copy if not there */ - strcpy(szUserName, cred.pname); - - return(1); -} - -/* - * Function: K4 parse authentication reply command - * - * Parameters: - * ks - kstream to send abort message to. - * - * parsedat - the sub-command data. - * - * end_sub - index of the character in the 'parsedat' array which - * is the last byte in a sub-negotiation - * - * Returns: Kerberos error code. - */ -static int -k4_auth_reply(kstream ks, unsigned char *parsedat, int end_sub) -{ - time_t t; - int x; - char buf[512]; - int i; - des_cblock session_key; - des_key_schedule sched; - static des_cblock challenge; - - if (end_sub < 4) - return KFAILURE; - - if (parsedat[2] != KERBEROS_V4) - return KFAILURE; - - if (parsedat[4] == KRB_REJECT) { - buf[0] = 0; - - for (i = 5; i <= end_sub; i++) { - if (parsedat[i] == IAC) - break; - buf[i-5] = parsedat[i]; - buf[i-4] = 0; - } - - if (!buf[0]) - strcpy(buf, "Authentication rejected by remote machine!"); - MessageBox(HWND_DESKTOP, buf, NULL, MB_OK | MB_ICONEXCLAMATION); - - return KFAILURE; - } - - if (parsedat[4] == KRB_ACCEPT) { - if ((parsedat[3] & AUTH_HOW_MASK) == AUTH_HOW_ONE_WAY) - return KSUCCESS; - - if ((parsedat[3] & AUTH_HOW_MASK) != AUTH_HOW_MUTUAL) - return KFAILURE; - - des_key_sched(cred.session, sched); - - t = time(NULL); - memcpy(challenge, &t, 4); - memcpy(&challenge[4], &t, 4); - des_ecb_encrypt(&challenge, &session_key, sched, 1); - - /* - * Increment the challenge by 1, and encrypt it for - * later comparison. - */ - for (i = 7; i >= 0; --i) { - x = (unsigned int)challenge[i] + 1; - challenge[i] = x; /* ignore overflow */ - if (x < 256) /* if no overflow, all done */ - break; - } - - des_ecb_encrypt(&challenge, &challenge, sched, 1); - - wsprintf(buf, "%c%c%c%c%c%c%c", IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_IS, - KERBEROS_V4, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL, KRB_CHALLENGE); - memcpy(&buf[7], session_key, 8); - wsprintf(&buf[15], "%c%c", IAC, SE); - TelnetSend(ks, (LPSTR)buf, 17, 0); - - return KSUCCESS; - } - - if (parsedat[4] == KRB_RESPONSE) { - if (end_sub < 12) - return KFAILURE; - - if (memcmp(&parsedat[5], challenge, sizeof(challenge)) != 0) { - MessageBox(HWND_DESKTOP, "Remote machine is being impersonated!", - NULL, MB_OK | MB_ICONEXCLAMATION); - - return KFAILURE; - } - - return KSUCCESS; - } - - return KFAILURE; - -} - -#endif /* KRB4 */ - -#ifdef KRB5 - -/* - * - * K5_auth_send - gets authentication bits we need to send to KDC. - * - * Code lifted from telnet sample code in the appl directory. - * - * Result is left in auth - * - * Returns: 0 on failure, 1 on success - * - */ - -static int -k5_auth_send(kstream ks, int how) -{ - krb5_error_code r; - krb5_ccache ccache; - krb5_creds creds; - krb5_creds * new_creds; - extern krb5_flags krb5_kdc_default_options; - krb5_flags ap_opts; - char type_check[2]; - krb5_data check_data; - int len; -#ifdef ENCRYPTION - krb5_keyblock *newkey = 0; -#endif - - if (r = krb5_cc_default(k5_context, &ccache)) { - com_err(NULL, r, "while authorizing."); - return(0); - } - - memset((char *)&creds, 0, sizeof(creds)); - if (r = krb5_sname_to_principal(k5_context, szHostName, KRB_SERVICE_NAME, - KRB5_NT_SRV_HST, &creds.server)) { - com_err(NULL, r, "while authorizing."); - return(0); - } - - if (r = krb5_cc_get_principal(k5_context, ccache, &creds.client)) { - com_err(NULL, r, "while authorizing."); - krb5_free_cred_contents(k5_context, &creds); - return(0); - } - if (szUserName[0] == '\0') { /* Get user name now */ - len = krb5_princ_component(k5_context, creds.client, 0)->length; - memcpy(szUserName, - krb5_princ_component(k5_context, creds.client, 0)->data, - len); - szUserName[len] = '\0'; - } - - if (r = krb5_get_credentials(k5_context, 0, - ccache, &creds, &new_creds)) { - com_err(NULL, r, "while authorizing."); - krb5_free_cred_contents(k5_context, &creds); - return(0); - } - - ap_opts = 0; - if ((how & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) - ap_opts = AP_OPTS_MUTUAL_REQUIRED; - -#ifdef ENCRYPTION - ap_opts |= AP_OPTS_USE_SUBKEY; -#endif - - if (auth_context) { - krb5_auth_con_free(k5_context, auth_context); - auth_context = 0; - } - if ((r = krb5_auth_con_init(k5_context, &auth_context))) { - com_err(NULL, r, "while initializing auth context"); - return(0); - } - - krb5_auth_con_setflags(k5_context, auth_context, - KRB5_AUTH_CONTEXT_RET_TIME); - - type_check[0] = AUTHTYPE_KERBEROS_V5; - type_check[1] = AUTH_WHO_CLIENT| (how & AUTH_HOW_MASK); -#ifdef ENCRYPTION - type_check[1] |= AUTH_ENCRYPT_ON; -#endif - check_data.magic = KV5M_DATA; - check_data.length = 2; - check_data.data = (char *)&type_check; - - r = krb5_mk_req_extended(k5_context, &auth_context, ap_opts, - NULL, new_creds, &auth); - -#ifdef ENCRYPTION - krb5_auth_con_getlocalsubkey(k5_context, auth_context, &newkey); - if (session_key) { - krb5_free_keyblock(k5_context, session_key); - session_key = 0; - } - - if (newkey) { - /* - * keep the key in our private storage, but don't use it - * yet---see kerberos5_reply() below - */ - if ((newkey->enctype != ENCTYPE_DES_CBC_CRC) && - (newkey-> enctype != ENCTYPE_DES_CBC_MD5)) { - if ((new_creds->keyblock.enctype == ENCTYPE_DES_CBC_CRC) || - (new_creds->keyblock.enctype == ENCTYPE_DES_CBC_MD5)) - /* use the session key in credentials instead */ - krb5_copy_keyblock(k5_context, &new_creds->keyblock, &session_key); - else - ; /* What goes here? XXX */ - } else { - krb5_copy_keyblock(k5_context, newkey, &session_key); - } - krb5_free_keyblock(k5_context, newkey); - } -#endif /* ENCRYPTION */ - - krb5_free_cred_contents(k5_context, &creds); - krb5_free_creds(k5_context, new_creds); - - if (r) { - com_err(NULL, r, "while authorizing."); - return(0); - } - - return(1); -} - -/* - * - * K5_auth_reply -- checks the reply for mutual authentication. - * - * Code lifted from telnet sample code in the appl directory. - * - */ -static int -k5_auth_reply(kstream ks, int how, unsigned char *data, int cnt) -{ -#ifdef ENCRYPTION - Session_Key skey; -#endif - static int mutual_complete = 0; - - data += 4; /* Point to status byte */ - - switch (*data++) { - case KRB_REJECT: - if (cnt > 0) { - char *s; - wsprintf(strTmp, "Kerberos V5 refuses authentication because\n\t"); - s = strTmp + strlen(strTmp); - strncpy(s, data, cnt); - s[cnt] = 0; - } else - wsprintf(strTmp, "Kerberos V5 refuses authentication"); - MessageBox(HWND_DESKTOP, strTmp, "", MB_OK | MB_ICONEXCLAMATION); - - return KFAILURE; - - case KRB_ACCEPT: - if (!mutual_complete) { - if ((how & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL && !mutual_complete) { - wsprintf(strTmp, - "Kerberos V5 accepted you, but didn't provide" - " mutual authentication"); - MessageBox(HWND_DESKTOP, strTmp, "", MB_OK | MB_ICONEXCLAMATION); - return KFAILURE; - } -#ifdef ENCRYPTION - if (session_key) { - skey.type = SK_DES; - skey.length = 8; - skey.data = session_key->contents; - encrypt_session_key(&skey, 0); - } -#endif - } - -#ifdef FORWARD - if (forward_flag) - kerberos5_forward(ks); -#endif - - return KSUCCESS; - break; - - case KRB_RESPONSE: - if ((how & AUTH_HOW_MASK) == AUTH_HOW_MUTUAL) { - /* the rest of the reply should contain a krb_ap_rep */ - krb5_ap_rep_enc_part *reply; - krb5_data inbuf; - krb5_error_code r; - - inbuf.length = cnt; - inbuf.data = (char *)data; - - if (r = krb5_rd_rep(k5_context, auth_context, &inbuf, &reply)) { - com_err(NULL, r, "while authorizing."); - return KFAILURE; - } - krb5_free_ap_rep_enc_part(k5_context, reply); - -#ifdef ENCRYPTION - if (encrypt_flag && session_key) { - skey.type = SK_DES; - skey.length = 8; - skey.data = session_key->contents; - encrypt_session_key(&skey, 0); - } -#endif - mutual_complete = 1; - } - return KSUCCESS; - -#ifdef FORWARD - case KRB_FORWARD_ACCEPT: - forwarded_tickets = 1; - return KSUCCESS; - - case KRB_FORWARD_REJECT: - forwarded_tickets = 0; - if (cnt > 0) { - char *s; - - wsprintf(strTmp, - "Kerberos V5 refuses forwarded credentials because\n\t"); - s = strTmp + strlen(strTmp); - strncpy(s, data, cnt); - s[cnt] = 0; - } else - wsprintf(strTmp, "Kerberos V5 refuses forwarded credentials"); - - MessageBox(HWND_DESKTOP, strTmp, "", MB_OK | MB_ICONEXCLAMATION); - return KFAILURE; -#endif /* FORWARD */ - - default: - return KFAILURE; /* Unknown reply type */ - } -} - -#ifdef FORWARD -void -kerberos5_forward(kstream ks) -{ - krb5_error_code r; - krb5_ccache ccache; - krb5_principal client = 0; - krb5_principal server = 0; - krb5_data forw_creds; - - forw_creds.data = 0; - - if ((r = krb5_cc_default(k5_context, &ccache))) { - com_err(NULL, r, "Kerberos V5: could not get default ccache"); - return; - } - - if ((r = krb5_cc_get_principal(k5_context, ccache, &client))) { - com_err(NULL, r, "Kerberos V5: could not get default principal"); - goto cleanup; - } - - if ((r = krb5_sname_to_principal(k5_context, szHostName, KRB_SERVICE_NAME, - KRB5_NT_SRV_HST, &server))) { - com_err(NULL, r, "Kerberos V5: could not make server principal"); - goto cleanup; - } - - if ((r = krb5_auth_con_genaddrs(k5_context, auth_context, ks->fd, - KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR))) { - com_err(NULL, r, "Kerberos V5: could not gen local full address"); - goto cleanup; - } - - if (r = krb5_fwd_tgt_creds(k5_context, auth_context, 0, client, server, - ccache, forwardable_flag, &forw_creds)) { - com_err(NULL, r, "Kerberos V5: error getting forwarded creds"); - goto cleanup; - } - - /* Send forwarded credentials */ - if (!Data(ks, KRB_FORWARD, forw_creds.data, forw_creds.length)) { - MessageBox(HWND_DESKTOP, - "Not enough room for authentication data", "", - MB_OK | MB_ICONEXCLAMATION); - } - -cleanup: - if (client) - krb5_free_principal(k5_context, client); - if (server) - krb5_free_principal(k5_context, server); -#if 0 /* XXX */ - if (forw_creds.data) - free(forw_creds.data); -#endif - krb5_cc_close(k5_context, ccache); -} -#endif /* FORWARD */ - -#endif /* KRB5 */ diff --git a/src/windows/wintel/auth.h b/src/windows/wintel/auth.h deleted file mode 100644 index e0f60ec401..0000000000 --- a/src/windows/wintel/auth.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Implements Kerberos 4 authentication and ecryption - */ - -#ifndef WINTEL_AUTH_H -#define WINTEL_AUTH_H - -void auth_parse(kstream, unsigned char *, int); - -int auth_init(kstream, kstream_ptr); - -void auth_destroy(kstream); - -int auth_encrypt(struct kstream_data_block *, struct kstream_data_block *, - kstream); - -int auth_decrypt(struct kstream_data_block *, struct kstream_data_block *, - kstream); - -extern BOOL forward_flag; -extern BOOL forwardable_flag; -extern BOOL forwarded_tickets; - -#ifdef ENCRYPTION -extern BOOL encrypt_flag; -#endif - -#endif /* WINTEL_AUTH_H */ diff --git a/src/windows/wintel/dialog.h b/src/windows/wintel/dialog.h deleted file mode 100644 index c95ec0491b..0000000000 --- a/src/windows/wintel/dialog.h +++ /dev/null @@ -1,42 +0,0 @@ -#define IDM_SHOWCONSOLE 700 - -#define IDM_OPENTELNETDLG 200 -#define TEL_CONNECT_NAME 201 -#define TEL_USEDEFAULTS 202 -#define TEL_MANUALCONFIGURE 203 -#define TEL_OK 204 -#define TEL_CANCEL 206 -#define IDC_FORWARD 207 -#define IDC_FORWARDFORWARD 208 -#define IDC_ENCRYPT 210 -#define TEL_CONNECT_USERID 211 - -#define IDM_SEND_IP 800 -#define IDM_SEND_AYT 801 -#define IDM_SEND_ABORT 802 - -#define CON_SESSIONNAME 302 -#define CON_WINDOWTITLE 304 -#define CON_COLUMNS132 305 -#define CON_COLUMNS80 306 -#define CON_BACKSPACE 307 -#define CON_DELETE 308 -#define CON_CRLF 309 -#define CON_CRNUL 310 -#define CON_BUFFERS 311 -#define CON_SENDS 312 -#define CON_OK 320 -#define CON_USEDEFAULTS 321 -#define CONFIGDLG 300 -#define CON_SCRLBCK 317 -#define CON_NUMLINES 318 - -#define PRINTQUEUE 400 - -#define IDM_PRINTQUEUE 500 - -#define TEL_PUSH1 601 -#define TEL_PUSH2 602 -#define TEL_PUSH3 603 -#define TEL_PUSH4 604 -#define TEL_PUSH5 605 diff --git a/src/windows/wintel/edit.c b/src/windows/wintel/edit.c deleted file mode 100644 index b275850343..0000000000 --- a/src/windows/wintel/edit.c +++ /dev/null @@ -1,444 +0,0 @@ -/* edit.c */ - -#include -#include -#include -#include -#include "screen.h" - -char *cInvertedArray; -int bMouseDown = FALSE; -int bSelection; - -static int iLocStart; -static int iLocEnd; - -void Edit_LbuttonDown( - HWND hWnd, - LPARAM lParam) -{ - SCREEN *pScr; - HMENU hMenu; - int iTmp; - int iXlocStart; - int iYlocStart; - HDC hDC; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - hDC = GetDC(hWnd); - for (iTmp = 0; iTmp < pScr->width * pScr->height; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, iTmp % pScr->width * pScr->cxChar, - (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - bSelection = FALSE; - hMenu = GetMenu(hWnd); - EnableMenuItem(hMenu, IDM_COPY, MF_GRAYED); - ReleaseDC(hWnd, hDC); - iXlocStart = (int) LOWORD(lParam) / pScr->cxChar; - if (iXlocStart >= pScr->width) - iXlocStart = pScr->width - 1; - iYlocStart = (int) HIWORD(lParam) / pScr->cyChar; - if (iYlocStart >= pScr->height) - iYlocStart = pScr->height - 1; - iLocStart = iXlocStart + iYlocStart * pScr->width; - bMouseDown = TRUE; - -} /* Edit_LbuttonDown */ - - -void Edit_LbuttonUp( - HWND hWnd, - LPARAM lParam) -{ - SCREEN *pScr; - int iTmp; - int iTmp2; - HMENU hMenu; - - bMouseDown = FALSE; - if (bSelection) - return; - bSelection = TRUE; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - iTmp = (int) LOWORD(lParam) / pScr->cxChar; - if (iTmp >= pScr->width) - iTmp = pScr->width - 1; - iTmp2 = (int) HIWORD(lParam) / pScr->cyChar; - if (iTmp2 >= pScr->height) - iTmp2 = pScr->height - 1; - iLocEnd = iTmp + iTmp2 * pScr->width; - if (iLocEnd == iLocStart) { - bSelection = FALSE; - } - else { - hMenu = GetMenu(hWnd); - EnableMenuItem(hMenu, IDM_COPY, MF_ENABLED); - } - -} /* Edit_LbuttonUp */ - - -void Edit_MouseMove(HWND hWnd, LPARAM lParam){ - SCREEN *pScr; - int iTmp; - int iTmp2; - int iXlocCurr; - int iYlocCurr; - int iLocCurr; - int iX; - int iX2; - int iY; - int iY2; - SCREENLINE *pScrLine; - HDC hDC; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - hDC = GetDC(hWnd); - iXlocCurr = (int) LOWORD(lParam) / pScr->cxChar; - if (iXlocCurr >= pScr->width) - iXlocCurr = pScr->width - 1; - iYlocCurr = (int) HIWORD(lParam) / pScr->cyChar; - if (iYlocCurr >= pScr->height) - iYlocCurr = pScr->height - 1; - iLocCurr = iXlocCurr + (iYlocCurr * pScr->width); - if (iLocCurr > iLocStart) { - for (iTmp=0; iTmp < iLocStart; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, - (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - iX = iLocStart % pScr->width; - iY = (int) (iLocStart / pScr->width); - iX2 = iLocCurr % pScr->width; - iY2 = (int) (iLocCurr / pScr->width); - if (iY == iY2) { - pScrLine = GetScreenLineFromY(pScr, iY); - for (iTmp2 = iX; iTmp2 < iX2; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iY)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iY * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iY)] = pScrLine->text[iTmp2]; - } - } - } - else { - pScrLine = GetScreenLineFromY(pScr, iY); - - for (iTmp2 = iX; iTmp2 < pScr->width; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iY)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iY * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iY)] = pScrLine->text[iTmp2]; - } - } - - for (iTmp = iY + 1; iTmp < iY2; iTmp++) { - pScrLine = GetScreenLineFromY(pScr, iTmp); - for (iTmp2 = 0; iTmp2 < pScr->width; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iTmp)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iTmp * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iTmp)] = pScrLine->text[iTmp2]; - } - } - } - - if (iY2 != iY) { - pScrLine = GetScreenLineFromY(pScr, iY2); - for (iTmp2 = 0; iTmp2 < iX2; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iY2)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iY2 * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iY2)] = pScrLine->text[iTmp2]; - } - } - } - } - - for (iTmp = iLocCurr; iTmp < pScr->width * pScr->height; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - } - else { /* going backwards */ - for (iTmp = 0; iTmp < iLocCurr; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - iX = iLocCurr % pScr->width; - iY = (int) (iLocCurr / pScr->width); - iX2 = (iLocStart % pScr->width); - iY2 = (int) (iLocStart / pScr->width); - if (iY == iY2) { - pScrLine = GetScreenLineFromY(pScr, iY); - for (iTmp2= iX; iTmp2 < iX2; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iY)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iY * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iY)] = pScrLine->text[iTmp2]; - } - } - } - else { - pScrLine = GetScreenLineFromY(pScr, iY); - for (iTmp2 = iX; iTmp2 < pScr->width; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iY)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iY * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iY)] = pScrLine->text[iTmp2]; - } - } - for (iTmp = iY + 1; iTmp < iY2; iTmp++) { - pScrLine = GetScreenLineFromY(pScr, iTmp); - for (iTmp2 = 0; iTmp2 < pScr->width; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iTmp)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iTmp * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iTmp)] = pScrLine->text[iTmp2]; - } - } - } - if (iY2 != iY) { - pScrLine = GetScreenLineFromY(pScr, iY2); - for (iTmp2 = 0; iTmp2 < iX2; iTmp2++) { - if ((!cInvertedArray[iTmp2 + (pScr->width * iY2)]) && pScrLine->text[iTmp2]) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iY2 * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (pScr->width * iY2)] = pScrLine->text[iTmp2]; - } - } - } - } - for (iTmp = iLocStart; iTmp < pScr->width * pScr->height; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - } - ReleaseDC(hWnd, hDC); -} /* Edit_MouseMove */ - - -void Edit_ClearSelection( - SCREEN *pScr) -{ - int iTmp; - HDC hDC; - HMENU hMenu; - - hDC = GetDC(pScr->hWnd); - for (iTmp = 0; iTmp < pScr->width * pScr->height; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, - (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - bSelection = FALSE; - hMenu=GetMenu(pScr->hWnd); - EnableMenuItem(hMenu, IDM_COPY, MF_GRAYED); - ReleaseDC(pScr->hWnd, hDC); -} /* Edit_ClearSelection */ - - -void Edit_Copy( - HWND hWnd) -{ - int iTmp,iIdx; - HGLOBAL hCutBuffer; - LPSTR lpCutBuffer; - SCREEN *pScr; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - hCutBuffer= GlobalAlloc(GHND, (DWORD) (pScr->width * pScr->height + 1)); - lpCutBuffer= GlobalLock(hCutBuffer); - - if (iLocStart > iLocEnd) { /* swap variables */ - iTmp = iLocStart; - iLocStart = iLocEnd; - iLocEnd = iLocStart; - } - iTmp = iLocStart; - iIdx = 0; - while (iTmp < iLocEnd) { - if (!cInvertedArray[iTmp]) { - lpCutBuffer[iIdx++] = '\r'; - lpCutBuffer[iIdx++] = '\n'; - iTmp = (((int) (iTmp / pScr->width)) + 1) * pScr->width; - continue; - } - lpCutBuffer[iIdx++] = cInvertedArray[iTmp++]; - } - lpCutBuffer[iIdx] = 0; - GlobalUnlock(hCutBuffer); - OpenClipboard(hWnd); - EmptyClipboard(); - SetClipboardData(CF_TEXT, hCutBuffer); - CloseClipboard(); - -} /* Edit_Copy */ - - -void Edit_Paste( - HWND hWnd) -{ - HGLOBAL hClipMemory; - static HGLOBAL hMyClipBuffer; - LPSTR lpClipMemory; - LPSTR lpMyClipBuffer; - SCREEN *pScr; - - if (hMyClipBuffer) - GlobalFree(hMyClipBuffer); - OpenClipboard(hWnd); - hClipMemory = GetClipboardData(CF_TEXT); - hMyClipBuffer = GlobalAlloc(GHND, GlobalSize(hClipMemory)); - lpMyClipBuffer = GlobalLock(hMyClipBuffer); - lpClipMemory= GlobalLock(hClipMemory); - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - lstrcpy(lpMyClipBuffer, lpClipMemory); -#if 0 - OutputDebugString(lpMyClipBuffer); -#endif - PostMessage(pScr->hwndTel, WM_MYSCREENBLOCK, (WPARAM) hMyClipBuffer, (LPARAM) pScr); - CloseClipboard(); - GlobalUnlock(hClipMemory); - GlobalUnlock(hMyClipBuffer); - -} /* Edit_Paste */ - - -void Edit_LbuttonDblclk( - HWND hWnd, - LPARAM lParam) -{ - HDC hDC; - SCREEN *pScr; - int iTmp; - int iTmp2; - int iXlocStart; - int iYloc; - SCREENLINE *pScrLine; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - hDC = GetDC(hWnd); - for (iTmp = 0; iTmp < pScr->width * pScr->height; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, - (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - bSelection = FALSE; - iXlocStart = (int) LOWORD(lParam) / pScr->cxChar; - if (iXlocStart >= pScr->width) - iXlocStart = pScr->width - 1; - iYloc = (int) HIWORD(lParam) / pScr->cyChar; - if (iYloc >= pScr->height) - iYloc = pScr->height - 1; - iLocStart = iXlocStart + (iYloc * pScr->width); - - pScrLine = GetScreenLineFromY(pScr, iYloc); - - iTmp = iXlocStart; - while (isalnum((int) pScrLine->text[iTmp])) { - PatBlt(hDC, iTmp * pScr->cxChar, iYloc * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp + (iYloc * pScr->width)] = pScrLine->text[iTmp]; - iTmp++; - } - iTmp2 = iXlocStart - 1; - while (isalnum((int) pScrLine->text[iTmp2])) { - PatBlt(hDC, iTmp2 * pScr->cxChar, iYloc * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp2 + (iYloc * pScr->width)] = pScrLine->text[iTmp2]; - iTmp2--; - } - iLocStart = (iTmp2 + 1) + (iYloc * pScr->width); - iLocEnd = iTmp + (iYloc * pScr->width); - - bSelection = TRUE; - ReleaseDC(hWnd, hDC); - -} /* Edit_LbuttonDblclk */ - - -void Edit_TripleClick( - HWND hWnd, - LPARAM lParam) -{ - HDC hDC; - SCREEN *pScr; - int iTmp; - int iYloc; - SCREENLINE *pScrLine; - -#if 0 - OutputDebugString("Triple Click \r\n"); -#endif - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - hDC = GetDC(hWnd); - for (iTmp = 0; iTmp < pScr->width * pScr->height; iTmp++) { - if (cInvertedArray[iTmp]) { - PatBlt(hDC, (iTmp % pScr->width) * pScr->cxChar, - (int) (iTmp / pScr->width) * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp] = 0; - } - } - bSelection = FALSE; - iYloc = (int) HIWORD(lParam) / pScr->cyChar; - if (iYloc >= pScr->height) - iYloc = pScr->height - 1; - iLocStart = iYloc * pScr->width; - - pScrLine = GetScreenLineFromY(pScr, iYloc); - - for (iTmp = 0; iTmp < pScr->width; iTmp++) { - if (pScrLine->text[iTmp]) { - PatBlt(hDC, iTmp * pScr->cxChar, iYloc * pScr->cyChar, - pScr->cxChar, pScr->cyChar, DSTINVERT); - cInvertedArray[iTmp + (iYloc * pScr->width)] = pScrLine->text[iTmp]; - } - else - break; - } - iLocEnd = iTmp + (iYloc * pScr->width); - - bSelection = TRUE; - ReleaseDC(hWnd, hDC); - -} /* Edit_TripleClick */ diff --git a/src/windows/wintel/emul.c b/src/windows/wintel/emul.c deleted file mode 100644 index 2a7ef4cd05..0000000000 --- a/src/windows/wintel/emul.c +++ /dev/null @@ -1,766 +0,0 @@ -/* emul.c */ - -#include "windows.h" -#include "screen.h" - - -static int -ScreenEmChars(SCREEN *pScr, char *c, int len) -{ - /* - * Function: Send a string of characters to the screen. Placement - * continues as long as the stream of characters does not contain any - * control chracters or cause wrapping to another line. When a control - * character is encountered or wrapping occurs, display stops and a - * count of the number of characters is returned. - * - * Parameters: - * pScr - the screen to place the characters on. - * c - the string of characters to place on the screen. - * len - the number of characters contained in the string - * - * Returns: The number of characters actually placed on the screen. - */ - - int insert; - int ocount; - int attrib; - int extra; - int nchars; - char *acurrent; /* place to put attributes */ - char *current; /* place to put characters */ - char *start; - SCREENLINE *pScrLine; - - if (len <= 0) - return(0); - - if (pScr->x != pScr->width - 1) - pScr->bWrapPending = FALSE; - else { - if (pScr->bWrapPending) { - pScr->x = 0; - pScr->bWrapPending = FALSE; - ScreenIndex(pScr); - } - } - - pScrLine = GetScreenLineFromY(pScr, pScr->y); - if (pScrLine == NULL) - return(0); - - current = &pScrLine->text[pScr->x]; - acurrent = &pScrLine->attrib[pScr->x]; - start = current; - ocount = pScr->x; - extra = 0; - - attrib = pScr->attrib; - insert = pScr->IRM; - - for (nchars = 0; nchars < len && *c >= 32; nchars++) { - if (insert) - ScreenInsChar(pScr, 1); - - *current = *c; - *acurrent = (char) attrib; - c++; - if (pScr->x < pScr->width - 1) { - acurrent++; - current++; - pScr->x++; - } - else { - extra = 1; - if (pScr->DECAWM) { - pScr->bWrapPending = TRUE; - nchars++; - break; - } - } - } - - ScreenDraw(pScr, ocount, pScr->y, pScr->attrib, - pScr->x - ocount + extra, start); - - return(nchars); -} - - -void -ScreenEm(LPSTR c, int len, SCREEN *pScr) -{ - int escflg; /* vt100 escape level */ - RECT rc; - unsigned int ic; - char stat[20]; - int i; - int nchars; - - if (pScr->screen_bottom != pScr->buffer_bottom) { - ScreenUnscroll(pScr); - InvalidateRect(pScr->hWnd, NULL, TRUE); - SetScrollPos(pScr->hWnd, SB_VERT, pScr->numlines, TRUE); - } - - ScreenCursorOff(pScr); - escflg = pScr->escflg; - -#ifdef UM - if (pScr->localprint && len > 0) { /* see if printer needs anything */ - pcount = send_localprint(c, len); - len -= pcount; - c += pcount; - } -#endif - - while (len > 0) { - /* - * look at first character in the vt100 string, if it is a - * non-printable ascii code - */ - while((*c < 32) && (escflg == 0) && (len > 0)) { - switch(*c) { - - case 0x1b: /* ESC found (begin vt100 control sequence) */ - escflg++; - break; - - case -1: /* IAC from telnet session */ - escflg = 6; - break; - -#ifdef CISB - case 0x05: /* CTRL-E found (answerback) */ - bp_ENQ(); - break; -#endif - - case 0x07: /* CTRL-G found (bell) */ - ScreenBell(pScr); - break; - - case 0x08: /* CTRL-H found (backspace) */ - ScreenBackspace(pScr); - break; - - case 0x09: /* CTRL-I found (tab) */ - ScreenTab(pScr); /* Later change for versatile tabbing */ - break; - - case 0x0a: /* CTRL-J found (line feed) */ - case 0x0b: /* CTRL-K found (treat as line feed) */ - case 0x0c: /* CTRL-L found (treat as line feed) */ - ScreenIndex(pScr); - break; - - case 0x0d: /* CTRL-M found (carriage feed) */ - ScreenCarriageFeed(pScr); - break; - -#if 0 - case 0x0e: /* CTRL-N found (invoke Graphics (G1) character set) */ - if (pScr->G1) - pScr->attrib = VSgraph(pScr->attrib); - else - pScr->attrib = VSnotgraph(pScr->attrib); - pScr->charset = 1; - break; - - case 0x0f: /* CTRL-O found (invoke 'normal' (G0) character set) */ - if(pScr->G0) - pScr->attrib = VSgraph(pScr->attrib); - else - pScr->attrib = VSnotgraph(pScr->attrib); - pScr->charset = 0; - break; -#endif - -#ifdef CISB - case 0x10: /* CTRL-P found (undocumented in vt100) */ - bp_DLE(c, len); - len = 0; - break; -#endif - -#if 0 - case 0x11: /* CTRL-Q found (XON) (unused presently) */ - case 0x13: /* CTRL-S found (XOFF) (unused presently) */ - case 0x18: /* CTRL-X found (CAN) (unused presently) */ - case 0x1a: /* CTRL-Z found (SUB) (unused presently) */ - break; -#endif - } - - c++; /* advance to the next character in the string */ - len--; /* decrement the counter */ - } - - if (escflg == 0) { /* check for normal character to print */ - nchars = ScreenEmChars(pScr, c, len); - c += nchars; - len -= nchars; - } - - while ((len > 0) && (escflg == 1)) { /* ESC character was found */ - switch(*c) { - - case 0x08: /* CTRL-H found (backspace) */ - ScreenBackspace(pScr); - break; - - /* - * mostly cursor movement options, and DEC private stuff following - */ - case '[': - ScreenApClear(pScr); - escflg = 2; - break; - - case '#': /* various screen adjustments */ - escflg = 3; - break; - - case '(': /* G0 character set options */ - escflg = 4; - break; - - case ')': /* G1 character set options */ - escflg = 5; - break; - - case '>': /* keypad numeric mode (DECKPAM) */ - pScr->DECPAM = 0; - escflg = 0; - break; - - case '=': /* keypad application mode (DECKPAM) */ - pScr->DECPAM = 1; - escflg = 0; - break; - - case '7': /* save cursor (DECSC) */ - ScreenSaveCursor(pScr); - escflg = 0; - break; - - case '8': /* restore cursor (DECRC) */ - ScreenRestoreCursor(pScr); - escflg = 0; - break; - -#if 0 - case 'c': /* reset to initial state (RIS) */ - ScreenReset(pScr); - escflg = 0; - break; -#endif - - case 'D': /* index (move down one line) (IND) */ - ScreenIndex(pScr); - escflg = 0; - break; - - case 'E': /* next line (move down one line and to first column) (NEL) */ - pScr->x = 0; - ScreenIndex(pScr); - escflg = 0; - break; - - case 'H': /* horizontal tab set (HTS) */ - pScr->tabs[pScr->x] = 'x'; - escflg = 0; - break; - -#ifdef CISB - case 'I': /* undoumented in vt100 */ - bp_ESC_I(); - break; -#endif - - case 'M': /* reverse index (move up one line) (RI) */ - ScreenRevIndex(pScr); - escflg = 0; - break; - - case 'Z': /* identify terminal (DECID) */ - escflg = 0; - break; - - default: - /* put the ESC character into the Screen */ - ScreenEmChars(pScr, "\033", 1); - /* put the next character into the Screen */ - ScreenEmChars(pScr, c, 1); - escflg = 0; - break; - - } /* end switch */ - - c++; - len--; - } - - while((escflg == 2) && (len > 0)) { /* '[' handling */ - switch(*c) { - - case 0x08: /* backspace */ - ScreenBackspace(pScr); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': /* numeric parameters */ - if (pScr->parms[pScr->parmptr] < 0) - pScr->parms[pScr->parmptr] = 0; - pScr->parms[pScr->parmptr] *= 10; - pScr->parms[pScr->parmptr] += *c - '0'; - break; - - case '?': /* vt100 mode change */ - pScr->parms[pScr->parmptr++] = -2; - break; - - case ';': /* parameter divider */ - pScr->parmptr++; - break; - - case 'A': /* cursor up (CUU) */ - pScr->bWrapPending = FALSE; - rc.left = pScr->x * pScr->cxChar; - rc.right = (pScr->x + 1) * pScr->cxChar; - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - if (pScr->parms[0] < 1) - pScr->y--; - else - pScr->y -= pScr->parms[0]; - if(pScr->y < pScr->top) - pScr->y = pScr->top; - ScreenRange(pScr); - escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); - break; - - case 'B': /* cursor down (CUD) */ - pScr->bWrapPending = FALSE; - rc.left = pScr->x * pScr->cxChar; - rc.right = (pScr->x + 1) * pScr->cxChar; - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - if (pScr->parms[0] < 1) - pScr->y++; - else - pScr->y += pScr->parms[0]; - if (pScr->y > pScr->bottom) - pScr->y = pScr->bottom; - ScreenRange(pScr); - escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); - break; - - case 'C': /* cursor forward (right) (CUF) */ - pScr->bWrapPending = FALSE; - rc.left = pScr->x * pScr->cxChar; - rc.right = (pScr->x + 1) * pScr->cxChar; - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y +1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - if(pScr->parms[0] < 1) - pScr->x++; - else - pScr->x += pScr->parms[0]; - ScreenRange(pScr); - if (pScr->x > pScr->width) - pScr->x = pScr->width; - escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); - break; - - case 'D': /* cursor backward (left) (CUB) */ - pScr->bWrapPending = FALSE; - rc.left = pScr->x * pScr->cxChar; - rc.right = (pScr->x + 1) * pScr->cxChar; - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - if(pScr->parms[0] < 1) - pScr->x--; - else - pScr->x -= pScr->parms[0]; - ScreenRange(pScr); - escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); - break; - - case 'f': /* horizontal & vertical position (HVP) */ - case 'H': /* cursor position (CUP) */ - pScr->bWrapPending = FALSE; - rc.left = pScr->x * pScr->cxChar; - rc.right = (pScr->x + 1) * pScr->cxChar; - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - pScr->x = pScr->parms[1] - 1; - pScr->y = pScr->parms[0] - 1; - ScreenRange(pScr); /* make certain the cursor position is valid */ - escflg = 0; - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); - break; - - case 'J': /* erase in display (ED) */ - switch(pScr->parms[0]) { - - case -1: - case 0: /* erase from active position to end of screen */ - ScreenEraseToEndOfScreen(pScr); - break; - case 1: /* erase from start of screen to active position */ -#if 0 - ScreenEraseToPosition(pScr); -#endif - break; - - case 2: /* erase whole screen */ - ScreenEraseScreen(pScr); - break; - - default: - break; - } - - escflg = 0; - break; - - case 'K': /* erase in line (EL) */ - switch(pScr->parms[0]) { - case -1: - case 0: /* erase to end of line */ - ScreenEraseToEOL(pScr); - break; - - case 1: /* erase to beginning of line */ - ScreenEraseToBOL(pScr); - break; - - case 2: /* erase whole line */ - ScreenEraseLine(pScr, -1); - break; - - default: - break; - } - - escflg = 0; - break; - - case 'L': /* insert n lines preceding current line (IL) */ - if (pScr->parms[0] < 1) - pScr->parms[0] = 1; - ScreenInsLines(pScr, pScr->parms[0], -1); - escflg = 0; - break; - - case 'M': /* delete n lines from current position downward (DL) */ - if (pScr->parms[0] < 1) - pScr->parms[0] = 1; - ScreenDelLines(pScr, pScr->parms[0], -1); - escflg = 0; - break; - - case 'P': /* delete n chars from cursor to the left (DCH) */ - if (pScr->parms[0] < 1) - pScr->parms[0] = 1; - ScreenDelChars(pScr, pScr->parms[0]); - escflg = 0; - break; - -#if 0 - case 'R': /* receive cursor position status from host */ - break; -#endif - -#if 0 - case 'c': /* device attributes (DA) */ - ScreenSendIdent(); - escflg = 0; - break; -#endif - - case 'g': /* tabulation clear (TBC) */ - if (pScr->parms[0] == 3)/* clear all tabs */ - ScreenTabClear(pScr); - else - if (pScr->parms[0] <= 0) /* clear tab stop at active position */ - pScr->tabs[pScr->x] = ' '; - escflg = 0; - break; - - case 'h': /* set mode (SM) */ - ScreenSetOption(pScr,1); - escflg = 0; - break; - - case 'i': /* toggle printer */ -#if 0 - if(pScr->parms[pScr->parmptr] == 5) - pScr->localprint = 1; - else if (pScr->parms[pScr->parmptr] == 4) - pScr->localprint = 0; -#endif - escflg = 0; - break; - - case 'l': /* reset mode (RM) */ - ScreenSetOption(pScr,0); - escflg = 0; - break; - - case 'm': /* select graphics rendition (SGR) */ - { - int temp = 0; - - while (temp <= pScr->parmptr) { - if (pScr->parms[temp] < 1) - pScr->attrib &= 128; - else - pScr->attrib |= 1 << (pScr->parms[temp] - 1); - temp++; - } - } - escflg = 0; - break; - - case 'n': /* device status report (DSR) */ - switch (pScr->parms[0]) { -#if 0 - case 0: /* response from vt100; ready, no malfunctions */ - case 3: /* response from vt100; malfunction, retry */ -#endif - case 5: /* send status */ - case 6: /* send active position */ - wsprintf(stat, "\033[%d;%dR", pScr->y + 1, pScr->x + 1); - for (i = 0; stat[i]; i++) - SendMessage(pScr->hwndTel, WM_MYSCREENCHAR, - stat[i], (LPARAM) pScr); - break; - } /* end switch */ - escflg = 0; - break; - - case 'q': /* load LEDs (unsupported) (DECLL) */ - escflg = 0; - break; - - case 'r': /* set top & bottom margins (DECSTBM) */ - if (pScr->parms[0] < 0) - pScr->top = 0; - else - pScr->top = pScr->parms[0] - 1; - if (pScr->parms[1] < 0) - pScr->bottom = pScr->height - 1; - else - pScr->bottom = pScr->parms[1] - 1; - if (pScr->top < 0) - pScr->top = 0; - if (pScr->top > pScr->height-1) - pScr->top = pScr->height-1; - if (pScr->bottom < 1) - pScr->bottom = pScr->height; - if (pScr->bottom >= pScr->height) - pScr->bottom = pScr->height - 1; - if (pScr->top >= pScr->bottom) {/* check for valid scrolling region */ - if (pScr->bottom >= 1) /* - * assume the bottom value has - * precedence, unless it is as the - * top of the screen - */ - pScr->top = pScr->bottom - 1; - else /* totally psychotic case, bottom of screen set to the very top line, move the bottom to below the top */ - pScr->bottom = pScr->top + 1; - } - pScr->x = 0; - pScr->y = 0; -#if 0 - if (pScr->DECORG) - pScr->y = pScr->top; /* origin mode relative */ -#endif - escflg = 0; - break; - -#if 0 - case 'x': /* request/report terminal parameters - (DECREQTPARM/DECREPTPARM) */ - case 'y': /* invoke confidence test (DECTST) */ - break; -#endif - - default: - escflg = 0; - break; - - } - - c++; - len--; - -#if 0 - if (pScr->localprint && (len > 0)) { /* see if printer needs anything */ - pcount = send_localprint(c, len); - len -= pcount; - c += pcount; - } -#endif - } - - while ((escflg == 3) && (len > 0)) { /* # Handling */ - switch (*c) { - case 0x08: /* backspace */ - ScreenBackspace(pScr); - break; - -#if 0 - case '3': /* top half of double line (DECDHL) */ - case '4': /* bottom half of double line (DECDHL) */ - case '5': /* single width line (DECSWL) */ - case '6': /* double width line (DECDWL) */ - break; -#endif - - case '8': /* screen alignment display (DECALN) */ - ScreenAlign(pScr); - escflg = 0; - break; - - default: - escflg = 0; - break; - - } - - c++; - len--; - } - - while ((escflg == 4) && (len > 0)) { /* ( Handling (GO character set) */ - switch (*c) { - - case 0x08: /* backspace */ - ScreenBackspace(pScr); - break; - -#if 0 - case 'A': /* united kingdom character set (unsupported) */ - case 'B': /* ASCII character set */ - case '1': /* choose standard graphics (same as ASCII) */ - pScr->G0 = 0; - if (!pScr->charset) - pScr->attrib = ScreenNotGraph(pScr->attrib); - escflg = 0; - break; - - case '0': /* choose special graphics set */ - case '2': /* alternate character set (special graphics) */ - pScr->G0 = 1; - if(!pScr->charset) - pScr->attrib = ScreenGraph(pScr->attrib); - escflg = 0; - break; -#endif - - default: - escflg = 0; - break; - } - - c++; - len--; - - } /* end while */ - - while((escflg == 5) && (len > 0)) { /* ) Handling (G1 handling) */ - switch (*c) { - - case 0x08: /* backspace */ - ScreenBackspace(pScr); - break; - -#if 0 - case 'A': /* united kingdom character set (unsupported) */ - case 'B': /* ASCII character set */ - case '1': /* choose standard graphics (same as ASCII) */ - pScr->G1 = 0; - if (pScr->charset) - pScr->attrib = ScreenNotGraph(pScr->attrib); - escflg = 0; - break; - - case '0': /* choose special graphics set */ - case '2': /* alternate character set (special graphics) */ - pScr->G1 = 1; - if(pScr->charset) - pScr->attrib = ScreenGraph(pScr->attrib); - escflg = 0; - break; -#endif - - default: - escflg = 0; - break; - } /* end switch */ - - c++; - len--; - } /* end while */ - - while ((escflg >= 6) && (escflg <= 10) && (len > 0)) { /* Handling IAC */ - ic = (unsigned char) *c; - switch (escflg) { - - case 6: /* Handling IAC xx */ - if (ic == 255) /* if IAC */ - escflg = 0; - else if (ic == 250) /* if SB */ - escflg = 7; - else - escflg = 9; - break; - - case 7: /* Handling IAC SB xx */ - if (ic == 255) /* if IAC */ - escflg = 8; - break; - - case 8: /* Handling IAC SB IAC xx */ - if (ic == 255) /* if IAC IAC */ - escflg = 7; - else if (ic == 240) /* if IAC SE */ - escflg = 0; - break; - - case 9: /* IAC xx xx */ - escflg = 0; - break; - } - c++; /* advance to the next character in the string */ - len--; /* decrement the counter */ - } - - if (escflg > 2 && escflg < 6 && len > 0) { - escflg = 0; - c++; - len--; - } - } - pScr->escflg = escflg; - ScreenCursorOn(pScr); -} diff --git a/src/windows/wintel/enc_des.c b/src/windows/wintel/enc_des.c deleted file mode 100644 index 33472ecd67..0000000000 --- a/src/windows/wintel/enc_des.c +++ /dev/null @@ -1,725 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - */ - -/* based on @(#)enc_des.c 8.1 (Berkeley) 6/4/93 */ - -#ifdef ENCRYPTION - -#include "telnet_arpa.h" -#include -#include - -#include "telnet.h" - -#include "encrypt.h" - -#define CFB 0 -#define OFB 1 - -#define NO_SEND_IV 1 -#define NO_RECV_IV 2 -#define NO_KEYID 4 -#define IN_PROGRESS (NO_SEND_IV|NO_RECV_IV|NO_KEYID) -#define SUCCESS 0 -#define xFAILED -1 - - -struct fb { - Block krbdes_key; - Schedule krbdes_sched; - Block temp_feed; - unsigned char fb_feed[64]; - int need_start; - int state[2]; - int keyid[2]; - int once; - struct stinfo { - Block str_output; - Block str_feed; - Block str_iv; - Block str_ikey; - Schedule str_sched; - int str_index; - int str_flagshift; - } streams[2]; -}; - -static struct fb fb[2]; - -struct keyidlist { - char *keyid; - int keyidlen; - char *key; - int keylen; - int flags; -} keyidlist [] = { - { "\0", 1, 0, 0, 0 }, /* default key of zero */ - { 0, 0, 0, 0, 0 } -}; - -#define KEYFLAG_MASK 03 - -#define KEYFLAG_NOINIT 00 -#define KEYFLAG_INIT 01 -#define KEYFLAG_OK 02 -#define KEYFLAG_BAD 03 - -#define KEYFLAG_SHIFT 2 - -#define SHIFT_VAL(a,b) (KEYFLAG_SHIFT*((a)+((b)*2))) - -#define FB64_IV 1 -#define FB64_IV_OK 2 -#define FB64_IV_BAD 3 - -extern kstream EncryptKSGlobalHack; - -void fb64_stream_iv (Block, struct stinfo *); -void fb64_init (struct fb *); -static int fb64_start (struct fb *, int, int); -int fb64_is (unsigned char *, int, struct fb *); -int fb64_reply (unsigned char *, int, struct fb *); -static void fb64_session (Session_Key *, int, struct fb *); -void fb64_stream_key (Block, struct stinfo *); -int fb64_keyid (int, unsigned char *, int *, struct fb *); - - void -cfb64_init(server) - int server; -{ - fb64_init(&fb[CFB]); - fb[CFB].fb_feed[4] = ENCTYPE_DES_CFB64; - fb[CFB].streams[0].str_flagshift = SHIFT_VAL(0, CFB); - fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, CFB); -} - - void -ofb64_init(server) - int server; -{ - fb64_init(&fb[OFB]); - fb[OFB].fb_feed[4] = ENCTYPE_DES_OFB64; - fb[CFB].streams[0].str_flagshift = SHIFT_VAL(0, OFB); - fb[CFB].streams[1].str_flagshift = SHIFT_VAL(1, OFB); -} - - void -fb64_init(fbp) - register struct fb *fbp; -{ - memset((void *)fbp, 0, sizeof(*fbp)); - fbp->state[0] = fbp->state[1] = xFAILED; - fbp->fb_feed[0] = IAC; - fbp->fb_feed[1] = SB; - fbp->fb_feed[2] = TELOPT_ENCRYPT; - fbp->fb_feed[3] = ENCRYPT_IS; -} - -/* - * Returns: - * -1: some error. Negotiation is done, encryption not ready. - * 0: Successful, initial negotiation all done. - * 1: successful, negotiation not done yet. - * 2: Not yet. Other things (like getting the key from - * Kerberos) have to happen before we can continue. - */ - int -cfb64_start(dir, server) - int dir; - int server; -{ - return(fb64_start(&fb[CFB], dir, server)); -} - int -ofb64_start(dir, server) - int dir; - int server; -{ - return(fb64_start(&fb[OFB], dir, server)); -} - - static int -fb64_start(fbp, dir, server) - struct fb *fbp; - int dir; - int server; -{ - int x; - unsigned char *p; - register int state; - - switch (dir) { - case DIR_DECRYPT: - /* - * This is simply a request to have the other side - * start output (our input). He will negotiate an - * IV so we need not look for it. - */ - state = fbp->state[dir-1]; - if (state == xFAILED) - state = IN_PROGRESS; - break; - - case DIR_ENCRYPT: - state = fbp->state[dir-1]; - if (state == xFAILED) - state = IN_PROGRESS; - else if ((state & NO_SEND_IV) == 0) - break; - - if (!VALIDKEY(fbp->krbdes_key)) { - fbp->need_start = 1; - break; - } - state &= ~NO_SEND_IV; - state |= NO_RECV_IV; - /* - * Create a random feed and send it over. - */ - des_new_random_key(fbp->temp_feed); - des_ecb_encrypt(fbp->temp_feed, fbp->temp_feed, - fbp->krbdes_sched, 1); - p = fbp->fb_feed + 3; - *p++ = ENCRYPT_IS; - p++; - *p++ = FB64_IV; - for (x = 0; x < sizeof(Block); ++x) { - if ((*p++ = fbp->temp_feed[x]) == IAC) - *p++ = IAC; - } - *p++ = IAC; - *p++ = SE; -#ifdef DEBUG - printsub('>', &fbp->fb_feed[2], p - &fbp->fb_feed[2]); -#endif - TelnetSend(EncryptKSGlobalHack, fbp->fb_feed, p - fbp->fb_feed, 0); - break; - default: - return(xFAILED); - } - return(fbp->state[dir-1] = state); -} - -/* - * Returns: - * -1: some error. Negotiation is done, encryption not ready. - * 0: Successful, initial negotiation all done. - * 1: successful, negotiation not done yet. - */ - int -cfb64_is(data, cnt) - unsigned char *data; - int cnt; -{ - return(fb64_is(data, cnt, &fb[CFB])); -} - int -ofb64_is(data, cnt) - unsigned char *data; - int cnt; -{ - return(fb64_is(data, cnt, &fb[OFB])); -} - - int -fb64_is(data, cnt, fbp) - unsigned char *data; - int cnt; - struct fb *fbp; -{ - unsigned char *p; - register int state = fbp->state[DIR_DECRYPT-1]; - - if (cnt-- < 1) - goto failure; - - switch (*data++) { - case FB64_IV: - if (cnt != sizeof(Block)) { -#ifdef DEBUG - if (encrypt_debug_mode) - printf("CFB64: initial vector failed on size\r\n"); -#endif - state = xFAILED; - goto failure; - } - -#ifdef DEBUG - if (encrypt_debug_mode) { - printf("CFB64: initial vector received\r\n"); - printf("Initializing Decrypt stream\r\n"); - } -#endif - fb64_stream_iv((void *)data, &fbp->streams[DIR_DECRYPT-1]); - - p = fbp->fb_feed + 3; - *p++ = ENCRYPT_REPLY; - p++; - *p++ = FB64_IV_OK; - *p++ = IAC; - *p++ = SE; -#ifdef DEBUG - printsub('>', &fbp->fb_feed[2], p - &fbp->fb_feed[2]); -#endif - TelnetSend(EncryptKSGlobalHack, fbp->fb_feed, p - fbp->fb_feed, 0); - - state = fbp->state[DIR_DECRYPT-1] = IN_PROGRESS; - break; - - default: -#if 0 - if (encrypt_debug_mode) { - printf("Unknown option type: %d\r\n", *(data-1)); - printd(data, cnt); - printf("\r\n"); - } -#endif - /* FALL THROUGH */ - failure: - /* - * We failed. Send an FB64_IV_BAD option - * to the other side so it will know that - * things failed. - */ - p = fbp->fb_feed + 3; - *p++ = ENCRYPT_REPLY; - p++; - *p++ = FB64_IV_BAD; - *p++ = IAC; - *p++ = SE; -#ifdef DEBUG - printsub('>', &fbp->fb_feed[2], p - &fbp->fb_feed[2]); -#endif - TelnetSend(EncryptKSGlobalHack, fbp->fb_feed, p - fbp->fb_feed, 0); - - break; - } - return(fbp->state[DIR_DECRYPT-1] = state); -} - -/* - * Returns: - * -1: some error. Negotiation is done, encryption not ready. - * 0: Successful, initial negotiation all done. - * 1: successful, negotiation not done yet. - */ - int -cfb64_reply(data, cnt) - unsigned char *data; - int cnt; -{ - return(fb64_reply(data, cnt, &fb[CFB])); -} - int -ofb64_reply(data, cnt) - unsigned char *data; - int cnt; -{ - return(fb64_reply(data, cnt, &fb[OFB])); -} - - - int -fb64_reply(data, cnt, fbp) - unsigned char *data; - int cnt; - struct fb *fbp; -{ - register int state = fbp->state[DIR_ENCRYPT-1]; - - if (cnt-- < 1) - goto failure; - - switch (*data++) { - case FB64_IV_OK: - fb64_stream_iv(fbp->temp_feed, &fbp->streams[DIR_ENCRYPT-1]); - if (state == xFAILED) - state = IN_PROGRESS; - state &= ~NO_RECV_IV; - encrypt_send_keyid(DIR_ENCRYPT, (unsigned char *)"\0", 1, 1); - break; - - case FB64_IV_BAD: - memset(fbp->temp_feed, 0, sizeof(Block)); - fb64_stream_iv(fbp->temp_feed, &fbp->streams[DIR_ENCRYPT-1]); - state = xFAILED; - break; - - default: -#if 0 - if (encrypt_debug_mode) { - printf("Unknown option type: %d\r\n", data[-1]); - printd(data, cnt); - printf("\r\n"); - } -#endif - /* FALL THROUGH */ - failure: - state = xFAILED; - break; - } - return(fbp->state[DIR_ENCRYPT-1] = state); -} - - void -cfb64_session(key, server) - Session_Key *key; - int server; -{ - fb64_session(key, server, &fb[CFB]); -} - - void -ofb64_session(key, server) - Session_Key *key; - int server; -{ - fb64_session(key, server, &fb[OFB]); -} - - static void -fb64_session(key, server, fbp) - Session_Key *key; - int server; - struct fb *fbp; -{ - - if (!key || key->type != SK_DES) { -#ifdef DEBUG - if (encrypt_debug_mode) - printf("Can't set krbdes's session key (%d != %d)\r\n", - key ? key->type : -1, SK_DES); -#endif - return; - } - memcpy((void *)fbp->krbdes_key, (void *)key->data, sizeof(Block)); - - fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_ENCRYPT-1]); - fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]); - - if (fbp->once == 0) { - des_init_random_number_generator(fbp->krbdes_key); - fbp->once = 1; - } - des_key_sched(fbp->krbdes_key, fbp->krbdes_sched); - /* - * Now look to see if krbdes_start() was was waiting for - * the key to show up. If so, go ahead an call it now - * that we have the key. - */ - if (fbp->need_start) { - fbp->need_start = 0; - fb64_start(fbp, DIR_ENCRYPT, server); - } -} - -/* - * We only accept a keyid of 0. If we get a keyid of - * 0, then mark the state as SUCCESS. - */ - int -cfb64_keyid(dir, kp, lenp) - int dir, *lenp; - unsigned char *kp; -{ - return(fb64_keyid(dir, kp, lenp, &fb[CFB])); -} - - int -ofb64_keyid(dir, kp, lenp) - int dir, *lenp; - unsigned char *kp; -{ - return(fb64_keyid(dir, kp, lenp, &fb[OFB])); -} - - int -fb64_keyid(dir, kp, lenp, fbp) - int dir, *lenp; - unsigned char *kp; - struct fb *fbp; -{ - register int state = fbp->state[dir-1]; - - if (*lenp != 1 || (*kp != '\0')) { - *lenp = 0; - return(state); - } - - if (state == xFAILED) - state = IN_PROGRESS; - - state &= ~NO_KEYID; - - return(fbp->state[dir-1] = state); -} - -#if 0 - void -fb64_printsub(data, cnt, buf, buflen, type) - unsigned char *data, *buf, *type; - int cnt, buflen; -{ - char lbuf[32]; - register int i; - char *cp; - - buf[buflen-1] = '\0'; /* make sure it's NULL terminated */ - buflen -= 1; - - switch(data[2]) { - case FB64_IV: - sprintf(lbuf, "%s_IV", type); - cp = lbuf; - goto common; - - case FB64_IV_OK: - sprintf(lbuf, "%s_IV_OK", type); - cp = lbuf; - goto common; - - case FB64_IV_BAD: - sprintf(lbuf, "%s_IV_BAD", type); - cp = lbuf; - goto common; - - default: - sprintf(lbuf, " %d (unknown)", data[2]); - cp = lbuf; - common: - for (; (buflen > 0) && (*buf = *cp++); buf++) - buflen--; - for (i = 3; i < cnt; i++) { - sprintf(lbuf, " %d", data[i]); - for (cp = lbuf; (buflen > 0) && (*buf = *cp++); buf++) - buflen--; - } - break; - } -} - - void -cfb64_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; -{ - fb64_printsub(data, cnt, buf, buflen, "CFB64"); -} - - void -ofb64_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; -{ - fb64_printsub(data, cnt, buf, buflen, "OFB64"); -} -#endif - - void -fb64_stream_iv(seed, stp) - Block seed; - register struct stinfo *stp; -{ - - memcpy((void *)stp->str_iv, (void *)seed, sizeof(Block)); - memcpy((void *)stp->str_output, (void *)seed, sizeof(Block)); - - des_key_sched(stp->str_ikey, stp->str_sched); - - stp->str_index = sizeof(Block); -} - - void -fb64_stream_key(key, stp) - Block key; - register struct stinfo *stp; -{ - memcpy((void *)stp->str_ikey, (void *)key, sizeof(Block)); - des_key_sched(key, stp->str_sched); - - memcpy((void *)stp->str_output, (void *)stp->str_iv, sizeof(Block)); - - stp->str_index = sizeof(Block); -} - -/* - * DES 64 bit Cipher Feedback - * - * key --->+-----+ - * +->| DES |--+ - * | +-----+ | - * | v - * INPUT --(--------->(+)+---> DATA - * | | - * +-------------+ - * - * - * Given: - * iV: Initial vector, 64 bits (8 bytes) long. - * Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt). - * On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output. - * - * V0 = DES(iV, key) - * On = Dn ^ Vn - * V(n+1) = DES(On, key) - */ - - void -cfb64_encrypt(s, c) - register unsigned char *s; - int c; -{ - register struct stinfo *stp = &fb[CFB].streams[DIR_ENCRYPT-1]; - register int index; - - index = stp->str_index; - while (c-- > 0) { - if (index == sizeof(Block)) { - Block b; - des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1); - memcpy((void *)stp->str_feed,(void *)b,sizeof(Block)); - index = 0; - } - - /* On encryption, we store (feed ^ data) which is cypher */ - *s = stp->str_output[index] = (stp->str_feed[index] ^ *s); - s++; - index++; - } - stp->str_index = index; -} - - int -cfb64_decrypt(data) - int data; -{ - register struct stinfo *stp = &fb[CFB].streams[DIR_DECRYPT-1]; - int index; - - if (data == -1) { - /* - * Back up one byte. It is assumed that we will - * never back up more than one byte. If we do, this - * may or may not work. - */ - if (stp->str_index) - --stp->str_index; - return(0); - } - - index = stp->str_index++; - if (index == sizeof(Block)) { - Block b; - des_ecb_encrypt(stp->str_output, b, stp->str_sched, 1); - memcpy((void *)stp->str_feed, (void *)b, sizeof(Block)); - stp->str_index = 1; /* Next time will be 1 */ - index = 0; /* But now use 0 */ - } - - /* On decryption we store (data) which is cypher. */ - stp->str_output[index] = data; - return(data ^ stp->str_feed[index]); -} - -/* - * DES 64 bit Output Feedback - * - * key --->+-----+ - * +->| DES |--+ - * | +-----+ | - * +-----------+ - * v - * INPUT -------->(+) ----> DATA - * - * Given: - * iV: Initial vector, 64 bits (8 bytes) long. - * Dn: the nth chunk of 64 bits (8 bytes) of data to encrypt (decrypt). - * On: the nth chunk of 64 bits (8 bytes) of encrypted (decrypted) output. - * - * V0 = DES(iV, key) - * V(n+1) = DES(Vn, key) - * On = Dn ^ Vn - */ - void -ofb64_encrypt(s, c) - register unsigned char *s; - int c; -{ - register struct stinfo *stp = &fb[OFB].streams[DIR_ENCRYPT-1]; - register int index; - - index = stp->str_index; - while (c-- > 0) { - if (index == sizeof(Block)) { - Block b; - des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1); - memcpy((void *)stp->str_feed,(void *)b,sizeof(Block)); - index = 0; - } - *s++ ^= stp->str_feed[index]; - index++; - } - stp->str_index = index; -} - - int -ofb64_decrypt(data) - int data; -{ - register struct stinfo *stp = &fb[OFB].streams[DIR_DECRYPT-1]; - int index; - - if (data == -1) { - /* - * Back up one byte. It is assumed that we will - * never back up more than one byte. If we do, this - * may or may not work. - */ - if (stp->str_index) - --stp->str_index; - return(0); - } - - index = stp->str_index++; - if (index == sizeof(Block)) { - Block b; - des_ecb_encrypt(stp->str_feed, b, stp->str_sched, 1); - memcpy((void *)stp->str_feed, (void *)b, sizeof(Block)); - stp->str_index = 1; /* Next time will be 1 */ - index = 0; /* But now use 0 */ - } - - return(data ^ stp->str_feed[index]); -} - -#endif /* ENCRYPTION */ diff --git a/src/windows/wintel/enc_des.h b/src/windows/wintel/enc_des.h deleted file mode 100644 index b7f0f95fd5..0000000000 --- a/src/windows/wintel/enc_des.h +++ /dev/null @@ -1,120 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)enc-proto.h 8.1 (Berkeley) 6/4/93 - */ - -/* - * Copyright (C) 1990 by the Massachusetts Institute of Technology - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ -#ifdef ENCRYPTION -void encrypt_init (char *, int); -Encryptions *findencryption (int); -void encrypt_auto (int); -void decrypt_auto (int); -void encrypt_is (unsigned char *, int); -void encrypt_reply (unsigned char *, int); -void encrypt_start_input (int); -void encrypt_session_key (Session_Key *, int); -void encrypt_end_input (void); -void encrypt_start_output (int); -void encrypt_end_output (void); -void encrypt_send_request_start (void); -void encrypt_send_request_end (void); -void encrypt_send_end (void); -void encrypt_wait (void); -int encrypt_is_encrypting (void); -void encrypt_send_support (void); -void encrypt_send_keyid (int, unsigned char *, int, int); -int net_write (unsigned char *, int); - -#ifdef TELENTD -void encrypt_wait (void); -#else -int encrypt_cmd (int, char **); -void encrypt_display (void); -#endif - -void krbdes_encrypt (unsigned char *, int); -int krbdes_decrypt (int); -int krbdes_is (unsigned char *, int); -int krbdes_reply (unsigned char *, int); -void krbdes_init (int); -int krbdes_start (int, int); -void krbdes_session (Session_Key *, int); -void krbdes_printsub (unsigned char *, int, unsigned char *, int); - -void cfb64_encrypt (unsigned char *, int); -int cfb64_decrypt (int); -void cfb64_init (int); -int cfb64_start (int, int); -int cfb64_is (unsigned char *, int); -int cfb64_reply (unsigned char *, int); -void cfb64_session (Session_Key *, int); -int cfb64_keyid (int, unsigned char *, int *); -void cfb64_printsub (unsigned char *, int, unsigned char *, int); - -void ofb64_encrypt (unsigned char *, int); -int ofb64_decrypt (int); -void ofb64_init (int); -int ofb64_start (int, int); -int ofb64_is (unsigned char *, int); -int ofb64_reply (unsigned char *, int); -void ofb64_session (Session_Key *, int); -int ofb64_keyid (int, unsigned char *, int *); -void ofb64_printsub (unsigned char *, int, unsigned char *, int); - -int des_new_random_key (Block); -void des_set_random_generator_seed (Block); -void des_key_sched (Block, Schedule); -void des_ecb_encrypt (Block, Block, Schedule, int); -int des_string_to_key (char *, Block); -#endif /* ENCRYPTION */ diff --git a/src/windows/wintel/encrypt.c b/src/windows/wintel/encrypt.c deleted file mode 100644 index a26674d4ca..0000000000 --- a/src/windows/wintel/encrypt.c +++ /dev/null @@ -1,999 +0,0 @@ -/* - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - */ - -/* based on @(#)encrypt.c 8.1 (Berkeley) 6/4/93 */ - -/* - * Copyright (C) 1990 by the Massachusetts Institute of Technology - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ - -#ifdef ENCRYPTION - -#include - -#define isprefix(a, b) (!strncmp((a), (b), strlen(b))) - -#ifdef KRB4 -#include -#include -#include -#include "winsock.h" -#include "kerberos.h" -#endif -#ifdef KRB5 -#include -#include -#include "krb5.h" -#include "com_err.h" -#endif - -#include "telnet.h" -#include "encrypt.h" - -#define ENCRYPT_NAMES -#include "telnet_arpa.h" - -/* - * These function pointers point to the current routines - * for encrypting and decrypting data. - */ -void (*encrypt_output) (unsigned char *, int); -int (*decrypt_input) (int); - -#ifdef DEBUG -int encrypt_debug_mode = 1; -int encrypt_verbose = 1; -#else -int encrypt_verbose = 0; -#endif - -static char dbgbuf [10240]; - -static int decrypt_mode = 0; -static int encrypt_mode = 0; -static int autoencrypt = 1; -static int autodecrypt = 1; -static int havesessionkey = 0; - -kstream EncryptKSGlobalHack = NULL; - -#define typemask(x) ((x) > 0 ? 1 << ((x)-1) : 0) - -static long i_support_encrypt = - typemask(ENCTYPE_DES_CFB64) | typemask(ENCTYPE_DES_OFB64); -static long i_support_decrypt = - typemask(ENCTYPE_DES_CFB64) | typemask(ENCTYPE_DES_OFB64); -static long i_wont_support_encrypt = 0; -static long i_wont_support_decrypt = 0; -#define I_SUPPORT_ENCRYPT (i_support_encrypt & ~i_wont_support_encrypt) -#define I_SUPPORT_DECRYPT (i_support_decrypt & ~i_wont_support_decrypt) - -static long remote_supports_encrypt = 0; -static long remote_supports_decrypt = 0; - -static Encryptions encryptions[] = { - { "DES_CFB64", - ENCTYPE_DES_CFB64, - cfb64_encrypt, - cfb64_decrypt, - cfb64_init, - cfb64_start, - cfb64_is, - cfb64_reply, - cfb64_session, - cfb64_keyid, - NULL }, - { "DES_OFB64", - ENCTYPE_DES_OFB64, - ofb64_encrypt, - ofb64_decrypt, - ofb64_init, - ofb64_start, - ofb64_is, - ofb64_reply, - ofb64_session, - ofb64_keyid, - NULL }, - { 0, }, -}; - -static unsigned char str_send[64] = { IAC, SB, TELOPT_ENCRYPT, - ENCRYPT_SUPPORT }; -static unsigned char str_suplen = 0; -static unsigned char str_start[72] = { IAC, SB, TELOPT_ENCRYPT }; -static unsigned char str_end[] = { IAC, SB, TELOPT_ENCRYPT, 0, IAC, SE }; - -void encrypt_request_end(void); -void encrypt_request_start(unsigned char *, int); -void encrypt_enc_keyid(unsigned char *, int); -void encrypt_dec_keyid(unsigned char *, int); -void encrypt_support(unsigned char *, int); -void encrypt_start(unsigned char *, int); -void encrypt_end(void); - -int encrypt_ks_stream(struct kstream_data_block *, /* output */ - struct kstream_data_block *, /* input */ - struct kstream *); - -int decrypt_ks_stream(struct kstream_data_block *, /* output */ - struct kstream_data_block *, /* input */ - struct kstream *); - -int -encrypt_ks_stream(struct kstream_data_block *i, - struct kstream_data_block *o, - struct kstream *ks) -{ - - /* - * this is really quite bogus, since it does an in-place encryption... - */ - if (encrypt_output) { - encrypt_output(i->ptr, i->length); - return 1; - } - - return 0; -} - - -int -decrypt_ks_stream(struct kstream_data_block *i, - struct kstream_data_block *o, - struct kstream *ks) -{ - unsigned int len; - /* - * this is really quite bogus, since it does an in-place decryption... - */ - if (decrypt_input) { - for (len = 0 ; len < i->length ; len++) - ((unsigned char *)i->ptr)[len] - = decrypt_input(((unsigned char *)i->ptr)[len]); - return 1; - } - - return 0; -} - -int -decrypt_ks_hack(unsigned char *buf, int cnt) -{ - int len; - /* - * this is really quite bogus, since it does an in-place decryption... - */ - for (len = 0 ; len < cnt ; len++) - buf[len] = decrypt_input(buf[len]); - -#ifdef DEBUG - hexdump("hack:", buf, cnt); -#endif - return 1; -} - -#ifdef DEBUG -int -printsub(char c, unsigned char *s, size_t len) -{ - size_t i; - char *p = dbgbuf; - - *p++ = c; - - for (i = 0 ; (i < len) && (p - dbgbuf + 3 < sizeof(dbgbuf)) ; i++) - p += sprintf(p, "%02x ", s[i]); - dbgbuf[sizeof(dbgbuf) - 1] = '\0'; - - strncat(p, "\n", sizeof(dbgbuf) - 1 - (p - dbgbuf)); - - OutputDebugString(dbgbuf); - - return 0; -} -#endif - -/* - * parsedat[0] == the suboption we might be negoating, - */ -void -encrypt_parse(kstream ks, unsigned char *parsedat, int end_sub) -{ - char *p = dbgbuf; - -#ifdef DEBUG - printsub('<', parsedat, end_sub); -#endif - - switch(parsedat[1]) { - case ENCRYPT_START: - encrypt_start(parsedat + 2, end_sub - 2); - break; - case ENCRYPT_END: - encrypt_end(); - break; - case ENCRYPT_SUPPORT: - encrypt_support(parsedat + 2, end_sub - 2); - break; - case ENCRYPT_REQSTART: - encrypt_request_start(parsedat + 2, end_sub - 2); - break; - case ENCRYPT_REQEND: - /* - * We can always send an REQEND so that we cannot - * get stuck encrypting. We should only get this - * if we have been able to get in the correct mode - * anyhow. - */ - encrypt_request_end(); - break; - case ENCRYPT_IS: - encrypt_is(parsedat + 2, end_sub - 2); - break; - case ENCRYPT_REPLY: - encrypt_reply(parsedat + 2, end_sub - 2); - break; - case ENCRYPT_ENC_KEYID: - encrypt_enc_keyid(parsedat + 2, end_sub - 2); - break; - case ENCRYPT_DEC_KEYID: - encrypt_dec_keyid(parsedat + 2, end_sub - 2); - break; - default: - break; - } -} - -/* XXX */ -Encryptions * -findencryption(type) - int type; -{ - Encryptions *ep = encryptions; - - if (!(I_SUPPORT_ENCRYPT & remote_supports_decrypt & typemask(type))) - return(0); - while (ep->type && ep->type != type) - ++ep; - return(ep->type ? ep : 0); -} - -Encryptions * -finddecryption(int type) -{ - Encryptions *ep = encryptions; - - if (!(I_SUPPORT_DECRYPT & remote_supports_encrypt & typemask(type))) - return(0); - while (ep->type && ep->type != type) - ++ep; - return(ep->type ? ep : 0); -} - -#define MAXKEYLEN 64 - -static struct key_info { - unsigned char keyid[MAXKEYLEN]; - int keylen; - int dir; - int *modep; - Encryptions *(*getcrypt)(); -} ki[2] = { - { { 0 }, 0, DIR_ENCRYPT, &encrypt_mode, findencryption }, - { { 0 }, 0, DIR_DECRYPT, &decrypt_mode, finddecryption }, -}; - -void -encrypt_init(kstream iks, kstream_ptr data) -{ - Encryptions *ep = encryptions; - - i_support_encrypt = i_support_decrypt = 0; - remote_supports_encrypt = remote_supports_decrypt = 0; - encrypt_mode = 0; - decrypt_mode = 0; - encrypt_output = NULL; - decrypt_input = NULL; - - str_suplen = 4; - - EncryptKSGlobalHack = iks; - - while (ep->type) { -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>I will support %s\n", - ENCTYPE_NAME(ep->type)); - OutputDebugString(dbgbuf); - } -#endif - i_support_encrypt |= typemask(ep->type); - i_support_decrypt |= typemask(ep->type); - if ((i_wont_support_decrypt & typemask(ep->type)) == 0) - if ((str_send[str_suplen++] = ep->type) == IAC) - str_send[str_suplen++] = IAC; - if (ep->init) - (*ep->init)(0); - ++ep; - } - str_send[str_suplen++] = IAC; - str_send[str_suplen++] = SE; -} - -void -encrypt_send_support() -{ - if (str_suplen) { - /* - * If the user has requested that decryption start - * immediatly, then send a "REQUEST START" before - * we negotiate the type. - */ - if (autodecrypt) - encrypt_send_request_start(); - TelnetSend(EncryptKSGlobalHack, str_send, str_suplen, 0); - -#ifdef DEBUG - printsub('>', &str_send[2], str_suplen - 2); -#endif - - str_suplen = 0; - } -} - -/* - * Called when ENCRYPT SUPPORT is received. - */ -void -encrypt_support(typelist, cnt) - unsigned char *typelist; - int cnt; -{ - register int type, use_type = 0; - Encryptions *ep; - - /* - * Forget anything the other side has previously told us. - */ - remote_supports_decrypt = 0; - - while (cnt-- > 0) { - type = *typelist++; -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Remote supports %s (%d)\n", - ENCTYPE_NAME(type), type); - OutputDebugString(dbgbuf); - } -#endif - if ((type < ENCTYPE_CNT) && - (I_SUPPORT_ENCRYPT & typemask(type))) { - remote_supports_decrypt |= typemask(type); - if (use_type == 0) - use_type = type; - } - } - if (use_type) { - ep = findencryption(use_type); - if (!ep) - return; - type = ep->start ? (*ep->start)(DIR_ENCRYPT, 0) : 0; -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>(*ep->start)() %s returned %d (%s)\n", - ENCTYPE_NAME(use_type), type, ENCRYPT_NAME(type)); - OutputDebugString(dbgbuf); - } -#endif - if (type < 0) - return; - encrypt_mode = use_type; - if (type == 0) - encrypt_start_output(use_type); - } -} - -void -encrypt_is(data, cnt) - unsigned char *data; - int cnt; -{ - Encryptions *ep; - register int type, ret; - - if (--cnt < 0) - return; - type = *data++; - if (type < ENCTYPE_CNT) - remote_supports_encrypt |= typemask(type); - if (!(ep = finddecryption(type))) { -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>encrypt_reply: " - "Can't find type %s (%d) for initial negotiation\n", - ENCTYPE_NAME_OK(type) - ? ENCTYPE_NAME(type) : "(unknown)", - type); - OutputDebugString(dbgbuf); - } -#endif - return; - } - if (!ep->is) { -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>encrypt_reply: " - "No initial negotiation needed for type %s (%d)\n", - ENCTYPE_NAME_OK(type) - ? ENCTYPE_NAME(type) : "(unknown)", - type); - OutputDebugString(dbgbuf); - } -#endif - ret = 0; - } else { - ret = (*ep->is)(data, cnt); -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, "encrypt_reply: " - "(*ep->is)(%x, %d) returned %s(%d)\n", data, cnt, - (ret < 0) ? "FAIL " : - (ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret); - OutputDebugString(dbgbuf); - } -#endif - } - if (ret < 0) { - autodecrypt = 0; - } else { - decrypt_mode = type; - if (ret == 0 && autodecrypt) - encrypt_send_request_start(); - } -} - -void -encrypt_reply(data, cnt) - unsigned char *data; - int cnt; -{ - Encryptions *ep; - register int ret, type; - - if (--cnt < 0) - return; - type = *data++; - if (!(ep = findencryption(type))) { -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Can't find type %s (%d) for initial negotiation\n", - ENCTYPE_NAME_OK(type) - ? ENCTYPE_NAME(type) : "(unknown)", - type); - OutputDebugString(dbgbuf); - } -#endif - return; - } - if (!ep->reply) { -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>No initial negotiation needed for type %s (%d)\n", - ENCTYPE_NAME_OK(type) - ? ENCTYPE_NAME(type) : "(unknown)", - type); - OutputDebugString(dbgbuf); - } -#endif - ret = 0; - } else { - ret = (*ep->reply)(data, cnt); -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, "(*ep->reply)(%x, %d) returned %s(%d)\n", - data, cnt, - (ret < 0) ? "FAIL " : - (ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret); - OutputDebugString(dbgbuf); - } -#endif - } -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>encrypt_reply returned %d\n", ret); - OutputDebugString(dbgbuf); - } -#endif - if (ret < 0) { - autoencrypt = 0; - } else { - encrypt_mode = type; - if (ret == 0 && autoencrypt) - encrypt_start_output(type); - } -} - -/* - * Called when a ENCRYPT START command is received. - */ -void -encrypt_start(data, cnt) - unsigned char *data; - int cnt; -{ - Encryptions *ep; - - if (!decrypt_mode) { - /* - * Something is wrong. We should not get a START - * command without having already picked our - * decryption scheme. Send a REQUEST-END to - * attempt to clear the channel... - */ - /* printf("Warning, Cannot decrypt input stream!!!\n"); */ - encrypt_send_request_end(); - MessageBox(NULL, "Warning, Cannot decrypt input stream!!!", NULL, - MB_OK | MB_ICONEXCLAMATION); - return; - } - - if (ep = finddecryption(decrypt_mode)) { - extern BOOL encrypt_flag; - - decrypt_input = ep->input; - EncryptKSGlobalHack->decrypt = decrypt_ks_stream; - encrypt_flag = 2; /* XXX hack */ - - if (encrypt_verbose) { - sprintf(dbgbuf, "[ Input is now decrypted with type %s ]\n", - ENCTYPE_NAME(decrypt_mode)); - OutputDebugString(dbgbuf); - } -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Start to decrypt input with type %s\n", - ENCTYPE_NAME(decrypt_mode)); - OutputDebugString(dbgbuf); - } -#endif - } else { - char buf[1024]; - wsprintf(buf, "Warning, Cannot decrypt type %s (%d)!!!", - ENCTYPE_NAME_OK(decrypt_mode) - ? ENCTYPE_NAME(decrypt_mode) : "(unknown)", - decrypt_mode); - MessageBox(NULL, buf, NULL, MB_OK | MB_ICONEXCLAMATION); - encrypt_send_request_end(); - } -} - -void -encrypt_session_key(key, server) - Session_Key *key; - int server; -{ - Encryptions *ep = encryptions; - - havesessionkey = 1; - - while (ep->type) { - if (ep->session) - (*ep->session)(key, server); -#if defined(notdef) - if (!encrypt_output && autoencrypt && !server) - encrypt_start_output(ep->type); - if (!decrypt_input && autodecrypt && !server) - encrypt_send_request_start(); -#endif - ++ep; - } -} - -/* - * Called when ENCRYPT END is received. - */ -void -encrypt_end() -{ - decrypt_input = NULL; - EncryptKSGlobalHack->decrypt = NULL; -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Input is back to clear text\n"); - OutputDebugString(dbgbuf); - } -#endif - if (encrypt_verbose) { - sprintf(dbgbuf, "[ Input is now clear text ]\n"); - OutputDebugString(dbgbuf); - } -} - -/* - * Called when ENCRYPT REQUEST-END is received. - */ -void -encrypt_request_end() -{ - encrypt_send_end(); -} - -/* - * Called when ENCRYPT REQUEST-START is received. If we receive - * this before a type is picked, then that indicates that the - * other side wants us to start encrypting data as soon as we - * can. - */ -void -encrypt_request_start(data, cnt) - unsigned char *data; - int cnt; -{ - if (encrypt_mode == 0) { - return; - } - encrypt_start_output(encrypt_mode); -} - -static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT }; - -void -encrypt_keyid(); - -void -encrypt_enc_keyid(keyid, len) - unsigned char *keyid; - int len; -{ - encrypt_keyid(&ki[1], keyid, len); -} - -void -encrypt_dec_keyid(keyid, len) - unsigned char *keyid; - int len; -{ - encrypt_keyid(&ki[0], keyid, len); -} - -void -encrypt_keyid(kp, keyid, len) - struct key_info *kp; - unsigned char *keyid; - int len; -{ - Encryptions *ep; - int dir = kp->dir; - register int ret = 0; - - if (!(ep = (*kp->getcrypt)(*kp->modep))) { - if (len == 0) - return; - kp->keylen = 0; - } else if (len == 0) { - /* - * Empty option, indicates a failure. - */ - if (kp->keylen == 0) - return; - kp->keylen = 0; - if (ep->keyid) - (void)(*ep->keyid)(dir, kp->keyid, &kp->keylen); - - } else if ((len != kp->keylen) || (memcmp(keyid, kp->keyid, len) != 0)) { - /* - * Length or contents are different - */ - kp->keylen = len; - memcpy(kp->keyid, keyid, len); - if (ep->keyid) - (void)(*ep->keyid)(dir, kp->keyid, &kp->keylen); - } else { - if (ep->keyid) - ret = (*ep->keyid)(dir, kp->keyid, &kp->keylen); - if ((ret == 0) && (dir == DIR_ENCRYPT) && autoencrypt) - encrypt_start_output(*kp->modep); - return; - } - - encrypt_send_keyid(dir, kp->keyid, kp->keylen, 0); -} - -void -encrypt_send_keyid(dir, keyid, keylen, saveit) - int dir; - unsigned char *keyid; - int keylen; - int saveit; -{ - unsigned char *strp; - - str_keyid[3] = (dir == DIR_ENCRYPT) - ? ENCRYPT_ENC_KEYID : ENCRYPT_DEC_KEYID; - if (saveit) { - struct key_info *kp = &ki[(dir == DIR_ENCRYPT) ? 0 : 1]; - memcpy(kp->keyid, keyid, keylen); - kp->keylen = keylen; - } - - for (strp = &str_keyid[4]; keylen > 0; --keylen) { - if ((*strp++ = *keyid++) == IAC) - *strp++ = IAC; - } - *strp++ = IAC; - *strp++ = SE; - TelnetSend(EncryptKSGlobalHack, str_keyid, strp - str_keyid, 0); - -#ifdef DEBUG - printsub('>', &str_keyid[2], strp - str_keyid - 2); -#endif - -} - -void -encrypt_auto(on) - int on; -{ - if (on < 0) - autoencrypt ^= 1; - else - autoencrypt = on ? 1 : 0; -} - -void -decrypt_auto(on) - int on; -{ - if (on < 0) - autodecrypt ^= 1; - else - autodecrypt = on ? 1 : 0; -} - -void -encrypt_start_output(type) - int type; -{ - Encryptions *ep; - register unsigned char *p; - register int i; - - if (!(ep = findencryption(type))) { -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Can't encrypt with type %s (%d)\n", - ENCTYPE_NAME_OK(type) - ? ENCTYPE_NAME(type) : "(unknown)", - type); - OutputDebugString(dbgbuf); - } -#endif - return; - } - if (ep->start) { - i = (*ep->start)(DIR_ENCRYPT, 0); -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Encrypt start: %s (%d) %s\n", - (i < 0) ? "failed" : - "initial negotiation in progress", - i, ENCTYPE_NAME(type)); - OutputDebugString(dbgbuf); - } -#endif - if (i) - return; - } - p = str_start + 3; - *p++ = ENCRYPT_START; - for (i = 0; i < ki[0].keylen; ++i) { - if ((*p++ = ki[0].keyid[i]) == IAC) - *p++ = IAC; - } - *p++ = IAC; - *p++ = SE; - TelnetSend(EncryptKSGlobalHack, str_start, p - str_start, 0); -#ifdef DEBUG - printsub('>', &str_start[2], p - &str_start[2]); -#endif - - /* - * If we are already encrypting in some mode, then - * encrypt the ring (which includes our request) in - * the old mode, mark it all as "clear text" and then - * switch to the new mode. - */ - encrypt_output = ep->output; - EncryptKSGlobalHack->encrypt = encrypt_ks_stream; - encrypt_mode = type; -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Started to encrypt output with type %s\n", - ENCTYPE_NAME(type)); - OutputDebugString(dbgbuf); - } -#endif - if (encrypt_verbose) { - sprintf(dbgbuf, "[ Output is now encrypted with type %s ]\n", - ENCTYPE_NAME(type)); - OutputDebugString(dbgbuf); - } -} - -void -encrypt_send_end() -{ - if (!encrypt_output) - return; - - str_end[3] = ENCRYPT_END; - TelnetSend(EncryptKSGlobalHack, str_end, sizeof(str_end), 0); -#ifdef DEBUG - printsub('>', &str_end[2], sizeof(str_end) - 2); -#endif - - /* - * Encrypt the output buffer now because it will not be done by - * netflush... - */ - encrypt_output = 0; - EncryptKSGlobalHack->encrypt = NULL; -#ifdef DEBUG - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Output is back to clear text\n"); - OutputDebugString(dbgbuf); - } -#endif - if (encrypt_verbose) { - sprintf(dbgbuf, "[ Output is now clear text ]\n"); - OutputDebugString(dbgbuf); - } -} - -void -encrypt_send_request_start() -{ - register unsigned char *p; - register int i; - - p = &str_start[3]; - *p++ = ENCRYPT_REQSTART; - for (i = 0; i < ki[1].keylen; ++i) { - if ((*p++ = ki[1].keyid[i]) == IAC) - *p++ = IAC; - } - *p++ = IAC; - *p++ = SE; - TelnetSend(EncryptKSGlobalHack, str_start, p - str_start, 0); -#ifdef DEBUG - printsub('>', &str_start[2], p - &str_start[2]); - - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Request input to be encrypted\n"); - OutputDebugString(dbgbuf); - } -#endif -} - -void -encrypt_send_request_end() -{ - str_end[3] = ENCRYPT_REQEND; - TelnetSend(EncryptKSGlobalHack, str_end, sizeof(str_end), 0); -#ifdef DEBUG - printsub('>', &str_end[2], sizeof(str_end) - 2); - - if (encrypt_debug_mode) { - sprintf(dbgbuf, ">>>Request input to be clear text\n"); - OutputDebugString(dbgbuf); - } -#endif -} - -int encrypt_is_encrypting() -{ - if (encrypt_output && decrypt_input) - return 1; - return 0; -} - -#ifdef DEBUG -void -encrypt_debug(mode) - int mode; -{ - encrypt_debug_mode = mode; -} -#endif - -#if 0 -void -encrypt_gen_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; -{ - char tbuf[16], *cp; - - cnt -= 2; - data += 2; - buf[buflen-1] = '\0'; - buf[buflen-2] = '*'; - buflen -= 2;; - for (; cnt > 0; cnt--, data++) { - sprintf(tbuf, " %d", *data); - for (cp = tbuf; *cp && buflen > 0; --buflen) - *buf++ = *cp++; - if (buflen <= 0) - return; - } - *buf = '\0'; -} - -void -encrypt_printsub(data, cnt, buf, buflen) - unsigned char *data, *buf; - int cnt, buflen; -{ - Encryptions *ep; - register int type = data[1]; - - for (ep = encryptions; ep->type && ep->type != type; ep++) - ; - - if (ep->printsub) - (*ep->printsub)(data, cnt, buf, buflen); - else - encrypt_gen_printsub(data, cnt, buf, buflen); -} -#endif - -#endif /* ENCRYPTION */ diff --git a/src/windows/wintel/encrypt.h b/src/windows/wintel/encrypt.h deleted file mode 100644 index 4d7afb176f..0000000000 --- a/src/windows/wintel/encrypt.h +++ /dev/null @@ -1,178 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)encrypt.h 8.1 (Berkeley) 6/4/93 - */ - -/* - * Copyright (C) 1990 by the Massachusetts Institute of Technology - * - * Export of this software from the United States of America may - * require a specific license from the United States Government. - * It is the responsibility of any person or organization contemplating - * export to obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ - -#ifdef ENCRYPTION - -#ifndef __ENCRYPTION__ -#define __ENCRYPTION__ - -#define DIR_DECRYPT 1 -#define DIR_ENCRYPT 2 - -typedef unsigned char Block[8]; -typedef unsigned char *BlockT; -typedef struct { Block _; } Schedule[16]; - -#define VALIDKEY(key) ( key[0] | key[1] | key[2] | key[3] | key[4] | key[5] | key[6] | key[7]) - -#define SAMEKEY(k1, k2) (!memcmp((void *)k1, (void *)k2, sizeof(Block))) - -typedef struct { - short type; - int length; - unsigned char *data; -} Session_Key; - -#ifdef DEBUG -int printsub(char, unsigned char *, size_t); -#endif - -void encrypt_parse(kstream, unsigned char *, int); - -typedef struct { - char *name; - int type; - void (*output) (unsigned char *, int); - int (*input) (int); - void (*init) (int); - int (*start) (int, int); - int (*is) (unsigned char *, int); - int (*reply) (unsigned char *, int); - void (*session) (Session_Key *, int); - int (*keyid) (int, unsigned char *, int *); - void (*printsub) (unsigned char *, int, unsigned char *, int); -} Encryptions; - -#define SK_DES 1 /* Matched Kerberos v5 ENCTYPE_DES */ - -void encrypt_init (kstream, kstream_ptr); -Encryptions *findencryption (int); -void encrypt_auto (int); -void decrypt_auto (int); -void encrypt_is (unsigned char *, int); -void encrypt_reply (unsigned char *, int); -void encrypt_start_input (int); -void encrypt_session_key (Session_Key *, int); -void encrypt_end_input (void); -void encrypt_start_output (int); -void encrypt_end_output (void); -void encrypt_send_request_start (void); -void encrypt_send_request_end (void); -void encrypt_send_end (void); -void encrypt_wait (void); -int encrypt_is_encrypting (void); -void encrypt_send_support (void); -void encrypt_send_keyid (int, unsigned char *, int, int); -int net_write (unsigned char *, int); - -int encrypt_cmd (int, char **); -void encrypt_display (void); - -void krbdes_encrypt (unsigned char *, int); -int krbdes_decrypt (int); -int krbdes_is (unsigned char *, int); -int krbdes_reply (unsigned char *, int); -void krbdes_init (int); -int krbdes_start (int, int); -void krbdes_session (Session_Key *, int); -void krbdes_printsub (unsigned char *, int, unsigned char *, int); - -void cfb64_encrypt (unsigned char *, int); -int cfb64_decrypt (int); -void cfb64_init (int); -int cfb64_start (int, int); -int cfb64_is (unsigned char *, int); -int cfb64_reply (unsigned char *, int); -void cfb64_session (Session_Key *, int); -int cfb64_keyid (int, unsigned char *, int *); -void cfb64_printsub (unsigned char *, int, unsigned char *, int); - -void ofb64_encrypt (unsigned char *, int); -int ofb64_decrypt (int); -void ofb64_init (int); -int ofb64_start (int, int); -int ofb64_is (unsigned char *, int); -int ofb64_reply (unsigned char *, int); -void ofb64_session (Session_Key *, int); -int ofb64_keyid (int, unsigned char *, int *); -void ofb64_printsub (unsigned char *, int, unsigned char *, int); - -int KRB5_CALLCONV - des_new_random_key (Block); -void KRB5_CALLCONV - des_set_random_generator_seed (Block); -void KRB5_CALLCONV - des_key_sched (Block, Schedule); -void KRB5_CALLCONV - des_ecb_encrypt (Block, Block, Schedule, int); - -/* int des_string_to_key (char *, Block); */ - - -#ifdef DEBUG -extern int encrypt_debug_mode; -#endif - -extern int (*decrypt_input) (int); -extern void (*encrypt_output) (unsigned char *, int); - -int decrypt_ks_hack(unsigned char *, int); - -#endif /* __ENCRYPTION__ */ - -#endif /* ENCRYPTION */ diff --git a/src/windows/wintel/font.c b/src/windows/wintel/font.c deleted file mode 100644 index 9224c41f7b..0000000000 --- a/src/windows/wintel/font.c +++ /dev/null @@ -1,100 +0,0 @@ -/* font.c */ - -#include -#include -#include -#include "screen.h" -#include "ini.h" - -void ProcessFontChange( - HWND hWnd) -{ - static DWORD dwFontColor; /* Color of font if one has been selected */ - CHOOSEFONT cf; - HDC hDC; - SCREEN *pScr; - TEXTMETRIC tm; - char buf[16]; - char szStyle[LF_FACESIZE]; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert(pScr != NULL); - - cf.lStructSize = sizeof(cf); - cf.hwndOwner = hWnd; - cf.lpLogFont = (LPLOGFONT) &(pScr->lf); - cf.lpszStyle = szStyle; - cf.Flags = CF_INITTOLOGFONTSTRUCT; /* | CF_USESTYLE; */ - cf.Flags |= CF_SCREENFONTS; -#if 0 - cf.Flags |= CF_ANSIONLY; -#endif - cf.Flags |= CF_FORCEFONTEXIST; - cf.Flags |= CF_FIXEDPITCHONLY; - cf.Flags |= CF_NOSIMULATIONS; - - if (ChooseFont(&cf)) { - if (pScr->hSelectedFont) - DeleteObject(pScr->hSelectedFont); - - pScr->hSelectedFont = CreateFontIndirect(&(pScr->lf)); - pScr->lf.lfUnderline = TRUE; - pScr->hSelectedULFont = CreateFontIndirect(&(pScr->lf)); - pScr->lf.lfUnderline = FALSE; - hDC = GetDC(hWnd); - SelectObject(hDC, pScr->hSelectedFont); - GetTextMetrics(hDC, &tm); - pScr->cxChar = tm.tmAveCharWidth; - pScr->cyChar = tm.tmHeight + tm.tmExternalLeading; - ReleaseDC(hWnd, hDC); - SetWindowPos(hWnd, NULL, 0, 0, pScr->cxChar * pScr->width + - FRAME_WIDTH, pScr->cyChar * pScr->height + - FRAME_HEIGHT, SWP_NOMOVE | SWP_NOZORDER); - - dwFontColor = RGB(255, 255, 255); - InvalidateRect(hWnd, NULL, TRUE); - } - - WritePrivateProfileString(INI_FONT, "FaceName", pScr->lf.lfFaceName, TELNET_INI); - wsprintf(buf, "%d", (int) pScr->lf.lfHeight); - WritePrivateProfileString(INI_FONT, "Height", buf, TELNET_INI); - wsprintf(buf, "%d", (int) pScr->lf.lfWidth); - WritePrivateProfileString(INI_FONT, "Width", buf, TELNET_INI); - wsprintf(buf, "%d", (int) pScr->lf.lfEscapement); - WritePrivateProfileString(INI_FONT, "Escapement", buf, TELNET_INI); - wsprintf(buf, "%d", (int) pScr->lf.lfCharSet); - WritePrivateProfileString(INI_FONT, "CharSet", buf, TELNET_INI); - wsprintf(buf, "%d", (int) pScr->lf.lfPitchAndFamily); - WritePrivateProfileString(INI_FONT, "PitchAndFamily", buf, TELNET_INI); - - return; - -} /* ProcessFontChange */ - - -void InitializeStruct( - WORD wCommDlgType, - LPSTR lpStruct, - HWND hWnd) -{ - LPCHOOSEFONT lpFontChunk; - - if (wCommDlgType == IDC_FONT) { - lpFontChunk = (LPCHOOSEFONT) lpStruct; - - lpFontChunk->lStructSize = sizeof(CHOOSEFONT); - lpFontChunk->hwndOwner = hWnd; - lpFontChunk->Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY - | CF_INITTOLOGFONTSTRUCT | CF_APPLY; - lpFontChunk->rgbColors = RGB(0, 0, 255); - lpFontChunk->lCustData = 0L; - lpFontChunk->lpfnHook = NULL; - lpFontChunk->lpTemplateName = NULL; - lpFontChunk->hInstance = NULL; - lpFontChunk->lpszStyle = NULL; - lpFontChunk->nFontType = SCREEN_FONTTYPE; - lpFontChunk->nSizeMin = 0; - lpFontChunk->nSizeMax = 0; - } - -} /* InitialiseStruct */ diff --git a/src/windows/wintel/genget.c b/src/windows/wintel/genget.c deleted file mode 100644 index 4e760d72e1..0000000000 --- a/src/windows/wintel/genget.c +++ /dev/null @@ -1,101 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - */ - -/* based on @(#)genget.c 8.1 (Berkeley) 6/4/93 */ - -#include - -#define LOWER(x) (isupper(x) ? tolower(x) : (x)) -/* - * The prefix function returns 0 if *s1 is not a prefix - * of *s2. If *s1 exactly matches *s2, the negative of - * the length is returned. If *s1 is a prefix of *s2, - * the length of *s1 is returned. - */ - int -isprefix(s1, s2) - register char *s1, *s2; -{ - char *os1; - register char c1, c2; - - if (*s1 == '\0') - return(-1); - os1 = s1; - c1 = *s1; - c2 = *s2; - while (LOWER(c1) == LOWER(c2)) { - if (c1 == '\0') - break; - c1 = *++s1; - c2 = *++s2; - } - return(*s1 ? 0 : (*s2 ? (s1 - os1) : (os1 - s1))); -} - -static char *ambiguous; /* special return value for command routines */ - - char ** -genget(name, table, stlen) - char *name; /* name to match */ - char **table; /* name entry in table */ - int stlen; -{ - register char **c, **found; - register int n; - - if (name == 0) - return 0; - - found = 0; - for (c = table; *c != 0; c = (char **)((char *)c + stlen)) { - if ((n = isprefix(name, *c)) == 0) - continue; - if (n < 0) /* exact match */ - return(c); - if (found) - return(&ambiguous); - found = c; - } - return(found); -} - -/* - * Function call version of Ambiguous() - */ - int -Ambiguous(s) - char *s; -{ - return((char **)s == &ambiguous); -} diff --git a/src/windows/wintel/ini.h b/src/windows/wintel/ini.h deleted file mode 100644 index f26c162e37..0000000000 --- a/src/windows/wintel/ini.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Defines INI file vocabulary */ -#define TELNET_INI "kerberos.ini" - -#define INI_TELNET "Telnet" -#define INI_FONT "Font" -#define INI_WIDTH "Width" -#define INI_HEIGHT "Height" -#define INI_POSITION "Position" -#define INI_BACKSPACE "Backspace" -#define INI_BACKSPACE_BS "BS" -#define INI_BACKSPACE_DEL "DEL" - -#define INI_HOSTS "Telnet Hosts" -#define INI_HOST "Host" -#define INI_HOST_BS "BS" -#define INI_HOST_DEL "DEL" diff --git a/src/windows/wintel/intern.c b/src/windows/wintel/intern.c deleted file mode 100644 index 8ff8605569..0000000000 --- a/src/windows/wintel/intern.c +++ /dev/null @@ -1,815 +0,0 @@ -/* intern.c */ - -#include -#include -#include -#include "screen.h" - -#define ScreenClearAttrib 0 - -SCREENLINE * -GetScreenLineFromY(SCREEN *pScr, int y) -{ - SCREENLINE *pScrLine; - int idx; - - pScrLine = pScr->screen_top; - for (idx = 0; idx < pScr->height; idx++) { - if (idx == y) - return(pScrLine); - if (pScrLine == NULL) - return(NULL); - pScrLine = pScrLine->next; - } - - return(NULL); -} - - -SCREENLINE * -ScreenClearLine(SCREEN *pScr, SCREENLINE *pScrLine) -{ - memset(pScrLine->attrib, ScreenClearAttrib, pScr->width); - memset(pScrLine->text, ' ', pScr->width); - return(pScrLine); -} - - -void -ScreenUnscroll(SCREEN *pScr) -{ - int idx; - SCREENLINE *pScrLine; - - if (pScr->screen_bottom == pScr->buffer_bottom) - return; - - pScr->screen_bottom = pScr->buffer_bottom; - pScrLine = pScr->screen_bottom; - for (idx = 1; idx < pScr->height; idx++) { - if (pScrLine == NULL) - return; - pScrLine = pScrLine->prev; - } - pScr->screen_top = pScrLine; -} - - -void -ScreenCursorOn(SCREEN *pScr) -{ - int y; - int nlines; - - if (pScr->screen_bottom != pScr->buffer_bottom) - nlines = pScr->numlines - GetScrollPos(pScr->hWnd, SB_VERT); - else - nlines = 0; - - y = pScr->y + nlines; - SetCaretPos(pScr->x * pScr->cxChar, (y+1) * pScr->cyChar); - ShowCaret(pScr->hWnd); -} - - -void -ScreenCursorOff(SCREEN *pScr) -{ - HideCaret(pScr->hWnd); -} - - -void -ScreenELO(SCREEN *pScr, int s) -{ - SCREENLINE *pScrLine; - RECT rc; - - if (s < 0) - s = pScr->y; - - pScrLine = GetScreenLineFromY(pScr,s); - memset(pScrLine->attrib, ScreenClearAttrib, pScr->width); - memset(pScrLine->text, ' ', pScr->width); - rc.left = 0; - rc.right = pScr->width * pScr->cxChar; - rc.top = pScr->cyChar * s; - rc.bottom = pScr->cyChar * (s+1); - InvalidateRect(pScr->hWnd, &rc, TRUE); -} - -void -ScreenEraseScreen(SCREEN *pScr) -{ - int i; - int x1 = 0; - int y1 = 0; - int x2 = pScr->width; - int y2 = pScr->height; - int n = -1; - - for(i = 0; i < pScr->height; i++) - ScreenELO(pScr,i); - - InvalidateRect(pScr->hWnd, NULL, TRUE); - UpdateWindow(pScr->hWnd); -} - - -void -ScreenTabClear(SCREEN *pScr) -{ - int x = 0; - - while(x <= pScr->width) { - pScr->tabs[x] = ' '; - x++; - } -} - - -void -ScreenTabInit(SCREEN *pScr) -{ - int x = 0; - - ScreenTabClear(pScr); - - while(x <= pScr->width) { - pScr->tabs[x] = 'x'; - x += 8; - } - pScr->tabs[pScr->width] = 'x'; -} - - -void -ScreenReset(SCREEN *pScr) -{ - pScr->top = 0; - pScr->bottom = pScr->height-1; - pScr->parmptr = 0; - pScr->escflg = 0; - pScr->DECAWM = 1; - pScr->bWrapPending = FALSE; - pScr->DECCKM = 0; - pScr->DECPAM = 0; - /* pScr->DECORG = 0; */ - /* pScr->Pattrib = -1; */ - pScr->IRM = 0; - pScr->attrib = 0; - pScr->x = 0; - pScr->y = 0; - /* pScr->charset = 0; */ - ScreenEraseScreen(pScr); - ScreenTabInit(pScr); -#if 0 - /* - * QAK - 7/27/90: added because resetting the virtual screen's - * wrapping flag doesn't reset telnet window's wrapping - */ - set_vtwrap(pScrn, pScr->DECAWM); -#endif -} - - -void -ScreenListMove(SCREENLINE *TD, SCREENLINE *BD, SCREENLINE *TI, SCREENLINE *BI) -{ - if (TD->prev != NULL) - TD->prev->next = BD->next; /* Maintain circularity */ - - if (BD->next != NULL) - BD->next->prev = TD->prev; - - TD->prev = TI; /* Place the node in its new home */ - BD->next = BI; - - if (TI != NULL) - TI->next = TD; /* Ditto prev->prev */ - - if (BI != NULL) - BI->prev = BD; -} - - -void -ScreenDelLines(SCREEN *pScr, int n, int s) -{ - SCREENLINE *BI; - SCREENLINE *TI; - SCREENLINE *TD; - SCREENLINE *BD; - SCREENLINE *pLine; - int idx; - RECT rc; - HDC hDC; - - pScr->bWrapPending = FALSE; - - if (s < 0) - s = pScr->y; - - if (s + n - 1 > pScr->bottom) - n = pScr->bottom - s + 1; - - TD = GetScreenLineFromY(pScr, s); - BD = GetScreenLineFromY(pScr, s + n - 1); - TI = GetScreenLineFromY(pScr, pScr->bottom); - BI = TI->next; - - /* - * Adjust the top of the screen and buffer if they will move. - */ - if (TD == pScr->screen_top) { - if (pScr->screen_top == pScr->buffer_top) - pScr->buffer_top = BD->next; - pScr->screen_top = BD->next; - } - - /* - * Adjust the bottom of the screen and buffer if they will move. - */ - if (TI == pScr->screen_bottom) { - if (pScr->screen_bottom == pScr->buffer_bottom) - pScr->buffer_bottom = BD; - pScr->screen_bottom = BD; - } - - if (TI != BD) - ScreenListMove(TD, BD, TI, BI); - - /* - * Clear the lines moved from the deleted area to the - * bottom of the scrolling area. - */ - pLine = TI; - - for (idx = 0; idx < n; idx++) { - pLine = pLine->next; - ScreenClearLine(pScr, pLine); - } - - /* CheckScreen(pScr); */ - - /* - * Scroll the affected area on the screen. - */ - rc.left = 0; - rc.right = pScr->width * pScr->cxChar; - rc.top = s * pScr->cyChar; - rc.bottom = (pScr->bottom + 1) * pScr->cyChar; - - hDC = GetDC(pScr->hWnd); - - ScrollDC(hDC, 0, -pScr->cyChar * n, &rc, &rc, NULL, NULL); - - PatBlt(hDC, 0, (pScr->bottom - n + 1) * pScr->cyChar, - pScr->width * pScr->cxChar, n * pScr->cyChar, WHITENESS); - - ReleaseDC(pScr->hWnd, hDC); -} - - -void -ScreenInsertLine(SCREEN *pScr, int s) -{ - ScreenInsLines(pScr, 1, s); -} - - -void -ScreenInsLines(SCREEN *pScr, int n, int s) -{ - SCREENLINE *TI; - SCREENLINE *BI; - SCREENLINE *TD; - SCREENLINE *BD; - SCREENLINE *pLine; - int idx; - RECT rc; - HDC hDC; - - pScr->bWrapPending = FALSE; - - if (s < 0) - s = pScr->y; - - if (s + n - 1 > pScr->bottom) - n = pScr->bottom - s + 1; - - /* - * Determine the top and bottom of the insert area. Also determine - * the top and bottom of the area to be deleted and moved to the - * insert area. - */ - BI = GetScreenLineFromY(pScr, s); - TI = BI->prev; - TD = GetScreenLineFromY(pScr, pScr->bottom - n + 1); - BD = GetScreenLineFromY(pScr, pScr->bottom); - - /* - * Adjust the top of the screen and buffer if they will move. - */ - if (BI == pScr->screen_top) { - if (pScr->screen_top == pScr->buffer_top) - pScr->buffer_top = TD; - pScr->screen_top = TD; - } - - /* - * Adjust the bottom of the screen and buffer if they will move. - */ - if (BD == pScr->screen_bottom) { - if (pScr->screen_bottom == pScr->buffer_bottom) - pScr->buffer_bottom = TD->prev; - pScr->screen_bottom = TD->prev; - } - - /* - * Move lines from the bottom of the scrolling region to the insert area. - */ - if (TD != BI) - ScreenListMove(TD,BD,TI,BI); - - /* - * Clear the inserted lines - */ - pLine = GetScreenLineFromY(pScr, s); - - for (idx = 0; idx < n; idx++) { - ScreenClearLine(pScr, pLine); - pLine = pLine->next; - } - - /* CheckScreen(pScr); */ - - /* - * Scroll the affected area on the screen. - */ - rc.left = 0; - rc.right = pScr->width * pScr->cxChar; - rc.top = s * pScr->cyChar; - rc.bottom = (pScr->bottom + 1) * pScr->cyChar; - - hDC = GetDC(pScr->hWnd); - - ScrollDC(hDC, 0, pScr->cyChar * n, &rc, &rc, NULL, NULL); - - PatBlt(hDC, 0, s * pScr->cyChar, - pScr->width * pScr->cxChar, n * pScr->cyChar, WHITENESS); - - ReleaseDC(pScr->hWnd, hDC); -} - - -void -ScreenIndex(SCREEN * pScr) -{ - if (pScr->y >= pScr->bottom) - ScreenScroll(pScr); - else - pScr->y++; - - pScr->bWrapPending = FALSE; -} - - -void -ScreenWrapNow(SCREEN *pScr, int *xp, int *yp) -{ - if (pScr->bWrapPending && pScr->x >= pScr->width - 1) { - pScr->x = 0; - ScreenIndex(pScr); - } - - pScr->bWrapPending = FALSE; - - *xp = pScr->x; - *yp = pScr->y; -} - - -void -ScreenEraseToEOL(SCREEN *pScr) -{ - int x1 = pScr->x; - int y1 = pScr->y; - int x2 = pScr->width; - int y2 = pScr->y; - int n = -1; - SCREENLINE *pScrLine; - RECT rc; - - ScreenWrapNow(pScr, &x1, &y1); - - y2 = y1; -#if 0 - wsprintf(strTmp,"[EraseEOL:%d]",y2); - OutputDebugString(strTmp); -#endif - pScrLine = GetScreenLineFromY(pScr,y2); - memset(&pScrLine->attrib[x1], ScreenClearAttrib, pScr->width-x1+1); - memset(&pScrLine->text[x1], ' ', pScr->width - x1 + 1); - rc.left = x1 * pScr->cxChar; - rc.right = pScr->width * pScr->cxChar; - rc.top = pScr->cyChar * y1; - rc.bottom = pScr->cyChar * (y1 + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - UpdateWindow(pScr->hWnd); -} - - -void -ScreenDelChars(SCREEN *pScr, int n) -{ - int x = pScr->x; - int y = pScr->y; - int width; - SCREENLINE *pScrLine; - RECT rc; - - pScr->bWrapPending = FALSE; - - pScrLine = GetScreenLineFromY(pScr, y); - - width = pScr->width - x - n; - - if (width > 0) { - memmove(&pScrLine->attrib[x], &pScrLine->attrib[x + n], width); - memmove(&pScrLine->text[x], &pScrLine->text[x + n], width); - } - - memset(&pScrLine->attrib[pScr->width - n], ScreenClearAttrib, n); - memset(&pScrLine->text[pScr->width - n], ' ', n); - - rc.left = x * pScr->cxChar; - rc.right = pScr->width * pScr->cxChar; - rc.top = pScr->cyChar * y; - rc.bottom = pScr->cyChar * (y + 1); - - InvalidateRect(pScr->hWnd, &rc, TRUE); - - UpdateWindow(pScr->hWnd); -} - - -void -ScreenRevIndex(SCREEN *pScr) -{ - SCREENLINE *pScrLine; - SCREENLINE *pTopLine; - - pScr->bWrapPending = FALSE; - pScrLine = GetScreenLineFromY(pScr, pScr->y); - pTopLine = GetScreenLineFromY(pScr, pScr->top); - - if(pScrLine == pTopLine) - ScreenInsertLine(pScr, pScr->y); - else - pScr->y--; -} - - -void -ScreenEraseToBOL(SCREEN *pScr) -{ - int x1 = 0; - int y1 = pScr->y; - int x2 = pScr->x; - int y2 = pScr->y; - int n = -1; - SCREENLINE *pScrLine; - - pScrLine = GetScreenLineFromY(pScr, pScr->y); - - ScreenWrapNow(pScr, &x2, &y1); - y2 = y1; - memset(pScrLine->attrib, ScreenClearAttrib, x2); - memset(pScrLine->text, ' ', x2); -} - - -void -ScreenEraseLine(SCREEN *pScr, int s) -{ - int x1 = 0; - int y1 = s; - int x2 = pScr->width; - int y2 = s; - int n = -1; - SCREENLINE *pScrLine; - RECT rc; - - if (s < 0) { - ScreenWrapNow(pScr, &x1, &y1); - s = y2 = y1; - x1 = 0; - } - - pScrLine = GetScreenLineFromY(pScr,y1); - memset(pScrLine->attrib, ScreenClearAttrib, pScr->width); - memset(pScrLine->text, ' ', pScr->width); - rc.left = 0; - rc.right = pScr->width * pScr->cxChar; - rc.top = pScr->cyChar * y1; - rc.bottom = pScr->cyChar * (y1+1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); -} - - -void -ScreenEraseToEndOfScreen(SCREEN *pScr) -{ - int i; - int x1 = 0; - int y1 = pScr->y+1; - int x2 = pScr->width; - int y2 = pScr->height; - int n = -1; - - ScreenWrapNow(pScr, &x1, &y1); - y1++; - x1 = 0; - i = y1; - ScreenEraseToEOL(pScr); - while (i < pScr->height) { - ScreenELO(pScr, i); - ScreenEraseLine(pScr, i); - i++; - } -} - - -void -ScreenRange(SCREEN *pScr) -{ - if (pScr->x < 0) - pScr->x = 0; - - if (pScr->x >= pScr->width) - pScr->x = pScr->width - 1; - - if (pScr->y < 0) - pScr->y = 0; - - if (pScr->y >= pScr->height) - pScr->y = pScr->height - 1; -} - - -void -ScreenAlign(SCREEN *pScr) /* vt100 alignment, fill screen with 'E's */ -{ - char *tt; - int i; - int j; - SCREENLINE *pScrLine; - - pScrLine = GetScreenLineFromY(pScr, pScr->top); - ScreenEraseScreen(pScr); - - for(j = 0; j < pScr->height; j++) { - tt = &pScrLine->text[0]; - for(i = 0; i <= pScr->width; i++) - *tt++ = 'E'; - pScrLine = pScrLine->next; - } -} - - -void -ScreenApClear(SCREEN *pScr) -{ - /* - * reset all the ANSI parameters back to the default state - */ - for(pScr->parmptr=5; pScr->parmptr>=0; pScr->parmptr--) - pScr->parms[pScr->parmptr] = -1; - - pScr->parmptr = 0; -} - - -void -ScreenSetOption(SCREEN *pScr, int toggle) -{ - if (pScr->parms[0] == -2 && pScr->parms[1] == 1) - pScr->DECCKM = toggle; - -#if 0 - switch(pScr->parms[0]) { - - case -2: /* Set on the '?' char */ - switch(pScr->parms[1]) { - - case 1: /* set/reset cursor key mode */ - pScr->DECCKM = toggle; - break; - -#ifdef NOT_SUPPORTED - case 2: /* set/reset ANSI/vt52 mode */ - break; -#endif - - case 3: /* set/reset column mode */ - pScr->x = pScr->y = 0; /* Clear the screen, mama! */ - ScreenEraseScreen(pScr); -#if 0 /* removed for variable screen size */ - if (toggle) /* 132 column mode */ - pScr->width = pScr->allwidth; - else - pScr->width = 79; -#endif - break; - -#ifdef NOT_SUPPORTED - case 4: /* set/reset scrolling mode */ - case 5: /* set/reset screen mode */ - case 6: /* set/rest origin mode */ - pScr->DECORG = toggle; - break; -#endif - - case 7: /* set/reset wrap mode */ - pScr->DECAWM = toggle; -#if 0 - /* - * QAK - 7/27/90: added because resetting the virtual screen's - * wrapping flag doesn't reset telnet window's wrapping - */ - set_vtwrap(pScrn, fpScr->DECAWM); -#endif - break; - -#ifdef NOT_SUPPORTED - case 8: /* set/reset autorepeat mode */ - case 9: /* set/reset interlace mode */ - break; -#endif - - default: - break; - } /* end switch */ - break; - - case 4: - pScr->IRM=toggle; - break; - - default: - break; - - } /* end switch */ -#endif -} - - -#ifdef NOT_SUPPORTED -void -ScreenTab(SCREEN *pScr) -{ - if (pScr->x> = pScr->width) - pScr->x = pScr->width; - pScr->x++; - while (pScr->tabs[fpScr->x] != 'x' && pScr->x < pScr->width) - pScr->x++; -} -#endif - - -BOOL -ScreenInsChar(SCREEN *pScr, int x) -{ - int i; - SCREENLINE *pScrLine; - RECT rc; - - pScrLine = GetScreenLineFromY(pScr, pScr->y); - if (pScrLine == NULL) - return(FALSE); - - for(i = pScr->width - x; i >= pScr->x; i--) { - pScrLine->text[x+i] = pScrLine->text[i]; - pScrLine->attrib[x+i] = pScrLine->attrib[i]; - } - - memset(&pScrLine->attrib[pScr->x], ScreenClearAttrib, x); - memset(&pScrLine->text[pScr->x], ' ', x); - rc.left = pScr->cxChar * x; - rc.right = pScr->cxChar * (x + pScr->x); - rc.top = pScr->cyChar * (pScr->y - 1); - rc.bottom = pScr->cyChar * pScr->y; - InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); - return(TRUE); -} - - -void -ScreenSaveCursor(SCREEN *pScr) -{ - pScr->Px = pScr->x; - pScr->Py = pScr->y; - pScr->Pattrib = pScr->attrib; -} - - -void -ScreenRestoreCursor(SCREEN *pScr) -{ - pScr->x = pScr->Px; - pScr->y = pScr->Py; - ScreenRange(pScr); -} - - -void -ScreenDraw(SCREEN *pScr, int x, int y, int a, int len, char *c) -{ - int idx; - SCREENLINE *pScrLine; - RECT rc; - - pScrLine = GetScreenLineFromY(pScr, y); - assert(pScrLine != NULL); - - for(idx = x; idx < x + len; idx++) { - pScrLine->text[idx] = c[idx - x]; - pScrLine->attrib[idx - x] = a; - } - - rc.left = pScr->cxChar * x; - rc.right = pScr->cxChar * (x + len); - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - SendMessage(pScr->hWnd, WM_PAINT, 0, 0); -} - - -#if ! defined(NDEBUG) - -BOOL -CheckScreen(SCREEN *pScr) -{ - SCREENLINE *pLinePrev; - SCREENLINE *pLine; - int nscreen = 0; - int nbuffer = 0; - int topline = 0; - char buf[512]; - BOOL bBottom; - BOOL bOK; - - pLine = pScr->buffer_top; - - if (pLine == NULL) { - OutputDebugString("CheckScreen: buffer_top invalid"); - MessageBox(NULL, "buffer_top invalid", "CheckScreen", MB_OK); - return(FALSE); - } - - bBottom = FALSE; - while (TRUE) { - pLinePrev = pLine; - if (nscreen > 0 || pLine == pScr->screen_top) - if (!bBottom) - nscreen++; - nbuffer++; - if (pLine == pScr->screen_top) - topline = nbuffer - 1; - if (pLine == pScr->screen_bottom) - bBottom = TRUE; - pLine = pLine->next; - if (pLine == NULL) - break; - if (pLine->prev != pLinePrev) { - wsprintf(buf, - "Previous ptr of line %d does not match next ptr of line %d", - nbuffer, nbuffer - 1); - OutputDebugString(buf); - MessageBox(NULL, buf, "CheckScreen", MB_OK); - } - } - - if (pLinePrev == pScr->buffer_bottom && nscreen == pScr->height) - bOK = TRUE; - else { - OutputDebugString("CheckScreen: Invalid number of lines on screen"); - bOK = FALSE; - } - - wsprintf(buf, "screen.width = %d\nscreen.height = %d\nscreen.maxlines = %d\nscreen.numlines = %d\nscreen.x = %d\nscreen.y = %d\nscreen.top = %d\nscreen.bottom = %d\nActual top line = %d\nActual buffer lines = %d\nActual screen lines = %d\nBottom of buffer is %s", - pScr->width, pScr->height, pScr->maxlines, pScr->numlines, - pScr->x, pScr->y, pScr->top, pScr->bottom, - topline, nbuffer, nscreen, - (pLinePrev == pScr->buffer_bottom) ? "valid" : "invalid"); - - MessageBox(NULL, buf, "CheckScreen", MB_OK); - - return(bOK); -} - -#endif diff --git a/src/windows/wintel/k5stream.c b/src/windows/wintel/k5stream.c deleted file mode 100644 index f39daa8615..0000000000 --- a/src/windows/wintel/k5stream.c +++ /dev/null @@ -1,118 +0,0 @@ -/* - * - * K5stream - * - * Emulates the kstream package in Kerberos 4 - * - */ - -#include -#include -#include -#include "telnet.h" -#include "k5stream.h" -#include "auth.h" - -int -kstream_destroy(kstream ks) -{ - if (ks != NULL) { - auth_destroy(ks); /* Destroy authorizing */ - - closesocket(ks->fd); /* Close the socket??? */ - free(ks); - } - return 0; -} - -void -kstream_set_buffer_mode(kstream ks, int mode) -{ -} - - -kstream -kstream_create_from_fd(int fd, - const struct kstream_crypt_ctl_block *ctl, - kstream_ptr data) -{ - kstream ks; - int n; - BOOL on = 1; - - ks = malloc(sizeof(struct kstream_int)); - if (ks == NULL) - return NULL; - - ks->fd = fd; - - setsockopt(ks->fd, SOL_SOCKET, SO_OOBINLINE, (const char *)&on, sizeof(on)); - - n = auth_init(ks, data); /* Initialize authorizing */ - if (n) { - free(ks); - return NULL; - } - - ks->encrypt = NULL; - ks->decrypt = NULL; - - return ks; -} - -int -kstream_write(kstream ks, void *p_data, size_t p_len) -{ - int n; - struct kstream_data_block i; - -#ifdef DEBUG - hexdump("plaintext:", p_data, p_len); -#endif - - if (ks->encrypt) { - i.ptr = p_data; - i.length = p_len; - ks->encrypt(&i, NULL, NULL); -#ifdef DEBUG - hexdump("cyphertext:", p_data, p_len); -#endif - } - - n = send(ks->fd, p_data, p_len, 0); /* Write the data */ - - return n; /* higher layer does retries */ -} - - -int -kstream_read(kstream ks, void *p_data, size_t p_len) -{ - int n; - struct kstream_data_block i; - - n = recv(ks->fd, p_data, p_len, 0); /* read the data */ - - if (n < 0) - return n; - -#ifdef DEBUG - hexdump("input data:", p_data, n); -#endif - - if (ks->decrypt) { - extern int encrypt_flag; - - if (encrypt_flag == 2) - encrypt_flag = 1; - - i.ptr = p_data; - i.length = n; - ks->decrypt(&i, NULL, NULL); -#ifdef DEBUG - hexdump("decrypted data:", p_data, n); -#endif - } - - return n; /* higher layer does retries */ -} diff --git a/src/windows/wintel/k5stream.h b/src/windows/wintel/k5stream.h deleted file mode 100644 index 3a63ca1d8f..0000000000 --- a/src/windows/wintel/k5stream.h +++ /dev/null @@ -1,57 +0,0 @@ -/* Header file for encrypted-stream library. - * Written by Ken Raeburn (Raeburn@Cygnus.COM). - * Copyright (C) 1991, 1992, 1994 by Cygnus Support. - * - * Permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation. - * Cygnus Support makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ - -#ifndef K5STREAM_H -#define K5STREAM_H - -typedef struct kstream_int { /* Object we pass around */ - int fd; /* Open socket descriptor */ - int (*encrypt)(struct kstream_data_block *, /* output */ - struct kstream_data_block *, /* input */ - struct kstream *kstream); - int (*decrypt)(struct kstream_data_block *, /* output */ - struct kstream_data_block *, /* input */ - struct kstream *kstream); -} *kstream; - -typedef void *kstream_ptr; /* Data send on the kstream */ - -struct kstream_data_block { - kstream_ptr ptr; - size_t length; -}; - -struct kstream_crypt_ctl_block { - int (*encrypt)(struct kstream_data_block *, /* output */ - struct kstream_data_block *, /* input */ - kstream); - int (*decrypt)(struct kstream_data_block *, /* output */ - struct kstream_data_block *, /* input */ - kstream); - int (*init)(kstream, kstream_ptr); - void (*destroy)(kstream); -}; - - -/* Prototypes */ - -int kstream_destroy(kstream); -void kstream_set_buffer_mode(kstream, int); -kstream kstream_create_from_fd(int fd, - const struct kstream_crypt_ctl_block *, - kstream_ptr); -int kstream_write(kstream, void *, size_t); -int kstream_read(kstream, void *, size_t); - -#endif /* K5STREAM_H */ diff --git a/src/windows/wintel/ktelnet.doc b/src/windows/wintel/ktelnet.doc deleted file mode 100644 index 64e4f45269..0000000000 Binary files a/src/windows/wintel/ktelnet.doc and /dev/null differ diff --git a/src/windows/wintel/ktelnet.hlp b/src/windows/wintel/ktelnet.hlp deleted file mode 100644 index e44cebfe57..0000000000 Binary files a/src/windows/wintel/ktelnet.hlp and /dev/null differ diff --git a/src/windows/wintel/ktelnet.hpj b/src/windows/wintel/ktelnet.hpj deleted file mode 100644 index d69185cd81..0000000000 --- a/src/windows/wintel/ktelnet.hpj +++ /dev/null @@ -1,92 +0,0 @@ -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; Help Project File for KTELNET -; -; This file is maintained by RoboHELP. Do not modify this file directly. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - -[OPTIONS] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Options section contains the following information: -; -; The optional BMROOT= entry sets the directories in which the Help Compiler -; will look for graphics. -; -; The CONTENTS= tells WinHelp which topic contains the contents. -; -; The TITLE= is displayed in the Title Bar of WINHELP.EXE -; -; The BUILD= setting allows you to create different Help systems from -; the same source file. -; -; The COMPRESS= option tells the Help Compiler how much to compress -; the Help file. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -;BMROOT=C:\WINDOWS\DESKTOP\KERBEROS 5\WIN95 GUI\CNS HELP -TITLE=Kerb*Net Telnet for Windows -BUILD=WINDOWS -NOTES=1 - - -OLDKEYPHRASE=NO -OPTCDROM=0 -REPORT=YES -COMPRESS=12 -ERRORLOG=C:\windows\desktop\kerberos 5\win95 gui\cns help\KTELNET.ERR -[BUILDTAGS] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Build Tags section specifies to the Help Compiler the names -; of all the valid build tags used in this Help project. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -WINDOWS - - -[CONFIG] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Config section defines macros which will run at startup. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - - - -[FILES] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Files section specifies the RTF files for a project. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - -KTELNET.RTF -[ALIAS] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Alias section sets up aliases for Topic IDs in your Help system. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - -[MAP] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Map section specifies the project HH files. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - -[BITMAPS] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Bitmaps section specifies the referenced bitmaps used in -; your help system. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - - -[WINDOWS] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Windows section contains all of the information about the windows -; in a Help project. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -;Gloss = "Glossary",(100,100,350,350),0,(255,255,255),(255,255,255) -main=,,29188,, -(w95sec)=,,20740,(r14745599),(r14745599),f2 - - -[BAGGAGE] -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -; The Baggage section specifies any additional files. -;* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - diff --git a/src/windows/wintel/ncsa.ico b/src/windows/wintel/ncsa.ico deleted file mode 100644 index 8a6cb6a564..0000000000 Binary files a/src/windows/wintel/ncsa.ico and /dev/null differ diff --git a/src/windows/wintel/negotiat.c b/src/windows/wintel/negotiat.c deleted file mode 100644 index 28f23b1dea..0000000000 --- a/src/windows/wintel/negotiat.c +++ /dev/null @@ -1,865 +0,0 @@ -/* - * negotiat.c - * - * Telnet option negotiation functions - * - -/* - * Includes - */ - -/* #define USETEK */ -/* #define USERAS */ - -#ifdef DEBUG /* define this to print the raw network data to debuging monitor */ -#define NEGOTIATEDEBUG -#endif - -#if 0 -#define PRINT_EVERYTHING /* talk a lot */ -#endif - -#include -#include "telnet.h" -#include "telnet_arpa.h" -#include "auth.h" -#include "encrypt.h" - -#define STNORM 0 -#define NEGOTIATE 1 -#define ESCFOUND 5 -#define IACFOUND 6 - -unsigned char parsedat[256]; - -/* Local functions */ -static void parse_subnegotiat(kstream ks,int end_sub); - -/* Local variables */ -static char *telstates[]={ - "EOF", - "Suspend Process", - "Abort Process", - "Unknown (239)", - "Subnegotiation End", - "NOP", - "Data Mark", - "Break", - "Interrupt Process", - "Abort Output", - "Are You There", - "Erase Character", - "Erase Line", - "Go Ahead", - "Subnegotiate", - "Will", - "Won't", - "Do", - "Don't" -}; - -static char *teloptions[256]={ /* ascii strings for Telnet options */ - "Binary", /* 0 */ - "Echo", - "Reconnection", - "Supress Go Ahead", - "Message Size Negotiation", - "Status", /* 5 */ - "Timing Mark", - "Remote Controlled Trans and Echo", - "Output Line Width", - "Output Page Size", - "Output Carriage-Return Disposition", /* 10 */ - "Output Horizontal Tab Stops", - "Output Horizontal Tab Disposition", - "Output Formfeed Disposition", - "Output Vertical Tabstops", - "Output Vertical Tab Disposition", /* 15 */ - "Output Linefeed Disposition", - "Extended ASCII", - "Logout", - "Byte Macro", - "Data Entry Terminal", /* 20 */ - "SUPDUP", - "SUPDUP Output", - "Send Location", - "Terminal Type", - "End of Record", /* 25 */ - "TACACS User Identification", - "Output Marking", - "Terminal Location Number", - "3270 Regime", - "X.3 PAD", /* 30 */ - "Negotiate About Window Size", - "Terminal Speed", - "Toggle Flow Control", - "Linemode", - "X Display Location", /* 35 */ - "Environment", - "Authentication", - "Data Encryption", - "39", - "40","41","42","43","44","45","46","47","48","49", - "50","51","52","53","54","55","56","57","58","59", - "60","61","62","63","64","65","66","67","68","69", - "70","71","72","73","74","75","76","77","78","79", - "80","81","82","83","84","85","86","87","88","89", - "90","91","92","93","94","95","96","97","98","99", - "100","101","102","103","104","105","106","107","108","109", - "110","111","112","113","114","115","116","117","118","119", - "120","121","122","123","124","125","126","127","128","129", - "130","131","132","133","134","135","136","137","138","139", - "140","141","142","143","144","145","146","147","148","149", - "150","151","152","153","154","155","156","157","158","159", - "160","161","162","163","164","165","166","167","168","169", - "170","171","172","173","174","175","176","177","178","179", - "180","181","182","183","184","185","186","187","188","189", - "190","191","192","193","194","195","196","197","198","199", - "200","201","202","203","204","205","206","207","208","209", - "210","211","212","213","214","215","216","217","218","219", - "220","221","222","223","224","225","226","227","228","229", - "230","231","232","233","234","235","236","237","238","239", - "240","241","242","243","244","245","246","247","248","249", - "250","251","252","253","254", - "Extended Options List" /* 255 */ -}; - -static char *LMoptions[]={ /* ascii strings for Linemode sub-options */ - "None", "MODE", "FORWARDMASK", "SLC" -}; - -static char *ModeOptions[]={ /* ascii strings for Linemode edit options */ - "None", "EDIT", "TRAPSIG", "ACK", "SOFT TAB", "LIT ECHO" -}; - -static char *SLCoptions[]={ /* ascii strings for Linemode SLC characters */ - "None", "SYNCH", "BREAK", "IP", "ABORT OUTPUT", - "AYT", "EOR", "ABORT", "EOF", "SUSP", - "EC", "EL", "EW", "RP", "LNEXT", - "XON", "XOFF", "FORW1", "FORW2", "MCL", - "MCR", "MCWL", "MCWR", "MCBOL", "MCEOL", - "INSRT", "OVER", "ECR", "EWR", "EBOL", - "EEOL" -}; - -static char *SLCflags[]={ /* ascii strings for Linemode SLC flags */ - "SLC_NOSUPPORT", "SLC_CANTCHANGE", "SLC_VALUE", "SLC_DEFAULT" -}; - -/* Linemode default character for each function */ -static unsigned char LMdefaults[NTELOPTS + 1]={ - (unsigned char)-1, /* zero isn't used */ - (unsigned char)-1, /* we don't support SYNCH */ - 3, /* ^C is default for BRK */ - 3, /* ^C is default for IP */ - 15, /* ^O is default for AO */ - 25, /* ^Y is default for AYT */ /* 5 */ - (unsigned char)-1, /* we don't support EOR */ - 3, /* ^C is default for ABORT */ - 4, /* ^D is default for EOF */ - 26, /* ^Z is default for SUSP */ - 8, /* ^H is default for EC */ /* 10 */ - 21, /* ^U is default for EL */ - 23, /* ^W is default for EW */ - 18, /* ^R is default for RP */ - 22, /* ^V is default for LNEXT */ - 17, /* ^Q is default for XON */ /* 15 */ - 19, /* ^S is default for XOFF */ - 22, /* ^V is default for FORW1 */ - 5, /* ^E is default for FORW2 */ - (unsigned char)-1, /* we don't support MCL */ - (unsigned char)-1, /* we don't support MCR */ /* 20 */ - (unsigned char)-1, /* we don't support MCWL */ - (unsigned char)-1, /* we don't support MCWR */ - (unsigned char)-1, /* we don't support MCBOL */ - (unsigned char)-1, /* we don't support MCEOL */ - (unsigned char)-1, /* we don't support INSRT */ /* 25 */ - (unsigned char)-1, /* we don't support OVER */ - (unsigned char)-1, /* we don't support ECR */ - (unsigned char)-1, /* we don't support EWR */ - (unsigned char)-1, /* we don't support EBOL */ - (unsigned char)-1 /* we don't support EEOL */ /* 30 */ -}; - - -/* - * Function : start_negotiation() - * Purpose : Send the initial negotiations on the network and print - * the negotitations to the console screen. - * Parameters : - * dat - the port number to write to - * cvs - the console's virtual screen - * Returns : none - * Calls : tprintf(), netprintf() - * Called by : dosessions() - */ -void -start_negotiation(kstream ks) -{ - char buf[128]; - - /* Send the initial telnet negotiations */ -#ifdef ENCRYPTION /* XXX */ - if (encrypt_flag) - wsprintf(buf,"%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c", - IAC, WILL, TELOPT_AUTHENTICATION, - IAC, WILL, TELOPT_ENCRYPT, - IAC, DO, TELOPT_SGA, - IAC, DO, TELOPT_ECHO, - IAC, WILL, TELOPT_NAWS - ); - else -#endif - wsprintf(buf,"%c%c%c%c%c%c%c%c%c%c%c%c", - IAC, WILL, TELOPT_AUTHENTICATION, - IAC, DO, TELOPT_SGA, - IAC, DO, TELOPT_ECHO, - IAC, WILL, TELOPT_NAWS - ); - TelnetSend(ks,buf,lstrlen(buf),0); - -#ifdef NOT - /* check whether we are going to be output mapping */ - if(tw->mapoutput) { - netprintf(tw->pnum,"%c%c%c",IAC,DO,TELOPT_BINARY); - /* set the flag indicating we wanted server to start transmitting binary */ - tw->uwantbinary=1; - netprintf(tw->pnum,"%c%c%c",IAC,WILL,TELOPT_BINARY); - /* set the flag indicating we want to start transmitting binary */ - tw->iwantbinary=1; - } /* end if */ -#endif - - /* Print to the console what we just did */ -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n",telstates[DO - TELCMD_FIRST], - teloptions[TELOPT_ECHO]); - OutputDebugString(strTmp); - wsprintf(strTmp,"SEND: %s %s\r\n",telstates[DO - TELCMD_FIRST], - teloptions[TELOPT_SGA]); - OutputDebugString(strTmp); - wsprintf(strTmp,"SEND: %s %s\r\n",telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_NAWS]); - OutputDebugString(strTmp); - -#ifdef NOT - tprintf(cvs,"SEND: %s %s\r\n",telstates[DO - TELCMD_FIRST], - teloptions[BINARY]); - tprintf(cvs,"SEND: %s %s\r\n",telstates[WILL - TELCMD_FIRST], - teloptions[BINARY]); -#endif -#endif -} /* end start_negotiation() */ - -/* - * parse - * Do the telnet negotiation parsing. - * - * look at the string which has just come in from outside and - * check for special sequences that we are interested in. - * - * Tries to pass through routine strings immediately, waiting for special - * characters ESC and IAC to change modes. - */ -void -parse(CONNECTION *con,unsigned char *st,int cnt) -{ - static int sub_pos; /* the position we are in the subnegotiation parsing */ - static int end_sub; /* index of last byte in parsedat in a subnegotiation */ - unsigned char *mark, *orig; - char buf[256]; - kstream ks; - - ks = con->ks; - -#ifdef PRINT_EVERYTHING - hexdump("Options to process:", st, cnt); -#endif /* PRINT_EVERYTHING */ - - orig = st; /* remember beginning point */ - mark = st + cnt; /* set to end of input string */ - -#ifdef HUH - netpush(tw->pnum); -#endif - - /* - * traverse string, looking for any special characters which indicate that - * we need to change modes. - */ - while(st < mark) { - - while(con->telstate != STNORM && st < mark) { - switch(con->telstate) { - case IACFOUND: /* telnet option negotiation */ - if(*st == IAC) { /* real data=255 */ - st++; /* real 255 will get sent */ - con->telstate = STNORM; - break; - } /* end if */ - - if(*st > 239) { - con->telstate = *st++; /* by what the option is */ - break; - } /* end if */ - -#ifdef NEGOTIATEDEBUG - wsprintf(buf, "\r\n strange telnet option"); - OutputDebugString(buf); -#endif - orig=++st; - con->telstate=STNORM; - break; - - case EL: /* received a telnet erase line command */ - case EC: /* received a telnet erase character command */ - case AYT: /* received a telnet Are-You-There command */ - case AO: /* received a telnet Abort Output command */ - case IP: /* received a telnet Interrupt Process command */ - case BREAK: /* received a telnet Break command */ - case DM: /* received a telnet Data Mark command */ - case NOP: /* received a telnet No Operation command */ - case SE: /* received a telnet Subnegotiation End command */ - case ABORT: /* received a telnet Abort Process command */ - case SUSP: /* received a telnet Suspend Process command */ - case xEOF: /* received a telnet EOF command */ -#ifdef NEGOTIATEDEBUG - wsprintf(buf,"RECV: %s\r\n", - telstates[con->telstate-TELCMD_FIRST]); - OutputDebugString(buf); -#endif - con->telstate=STNORM; - orig=++st; - break; - - case GA: /* telnet go ahead option*/ -#ifdef NEGOTIATEDEBUG - wsprintf(buf,"RECV: %s\r\n", - telstates[con->telstate-TELCMD_FIRST]); - OutputDebugString(buf); -#endif - con->telstate=STNORM; - orig=++st; - break; - - case DO: /* received a telnet DO negotiation */ -#ifdef NEGOTIATEDEBUG - wsprintf(buf,"RECV: %s %s\r\n", - telstates[con->telstate-TELCMD_FIRST],teloptions[*st]); - OutputDebugString(buf); -#endif - switch(*st) { -#ifdef NOT - case TELOPT_BINARY: /* DO: binary transmission */ - if(!tw->ibinary) { /* binary */ - if(!tw->iwantbinary) { - netprintf(tw->pnum,"%c%c%c", - IAC,WILL,BINARY); - if(tw->condebug>0) - tprintf(cv,"SEND: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[BINARY]); - } /* end if */ - else - tw->iwantbinary=0; /* turn off this now */ - tw->ibinary=1; - } /* end if */ - else { - if(tw->condebug>0) - tprintf(cv,"NO REPLY NEEDED: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[BINARY]); - } /* end else */ - break; -#endif - - case TELOPT_SGA: /* DO: Suppress go-ahead */ - if(!con->igoahead) { /* suppress go-ahead */ - wsprintf(buf,"%c%c%c",IAC,WILL,TELOPT_SGA); - TelnetSend(ks,buf,lstrlen(buf),0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_SGA]); - OutputDebugString(strTmp); - OutputDebugString("igoahead"); -#endif - con->igoahead=1; - } /* end if */ - else { -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp, - "NO REPLY NEEDED: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_SGA]); - OutputDebugString(strTmp); -#endif - } /* end else */ - break; - - case TELOPT_TTYPE: /* DO: terminal type negotiation */ - if(!con->termsent) { - con->termsent=TRUE; - wsprintf(buf,"%c%c%c",IAC,WILL,TELOPT_TTYPE); - TelnetSend(ks,buf,lstrlen(buf),0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_TTYPE]); - OutputDebugString(strTmp); -#endif - } /* end if */ - else { -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"NO REPLY NEEDED: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_TTYPE]); - OutputDebugString(strTmp); -#endif - } /* end else */ - break; - -#ifdef LATER - case TELOPT_LINEMODE: /* DO: linemode negotiation */ - tw->lmflag=1; /* set the linemode flag */ - netprintf(tw->pnum,"%c%c%c",IAC,WILL,TELOPT_LINEMODE); - /* - * Tell the other side to send us - * its default character set - */ - netprintf(tw->pnum,"%c%c%c%c", - IAC,SB,TELOPT_LINEMODE,SLC,0,SLC_DEFAULT,0,IAC,SE); - if(tw->condebug>0) { - tprintf(cv,"SEND: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_LINEMODE]); - tprintf(cv, - "SEND: SB LINEMODE SLC 0 SLC_DEFAULT 0 IAC SE\r\n"); - } /* end if */ - break; -#endif - case TELOPT_NAWS: /* DO: Negotiate About Window Size */ - con->bResizeable=TRUE; - send_naws(con); - break; - - case TELOPT_AUTHENTICATION: /* DO: Authentication requested */ - wsprintf(buf, "%c%c%c", IAC, WILL, TELOPT_AUTHENTICATION); - TelnetSend(ks, buf, lstrlen(buf), 0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[WILL - TELCMD_FIRST], - teloptions[TELOPT_AUTHENTICATION]); - OutputDebugString(strTmp); -#endif - break; - -#ifdef ENCRYPTION - case TELOPT_ENCRYPT: /* DO: Remote is willing to receive encrypted */ - wsprintf(buf, "%c%c%c", IAC, - (encrypt_flag ? WILL : WONT), TELOPT_ENCRYPT); - TelnetSend(ks, buf, lstrlen(buf), 0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[(encrypt_flag ? WILL : WONT) - - TELCMD_FIRST], - teloptions[TELOPT_ENCRYPT]); - OutputDebugString(strTmp); -#endif - break; -#endif /* ENCRYPTION */ - - default: /* DO: */ - wsprintf(buf, "%c%c%c", IAC, WONT, *st); - TelnetSend(ks, buf, lstrlen(buf), 0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[WONT - TELCMD_FIRST], teloptions[*st]); - OutputDebugString(strTmp); -#endif - break; - - } /* end switch */ - con->telstate = STNORM; - orig = ++st; - break; - - case DONT: /* Received a telnet DONT option */ - switch (*st) { - case TELOPT_NAWS: - con->bResizeable=FALSE; -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"RECV: %s %s\r\n", - telstates[con->telstate-TELCMD_FIRST],teloptions[*st]); - OutputDebugString(strTmp); -#endif - break; - -#ifdef NOT - case BINARY: /* DONT: check for binary neg. */ - if(tw->ibinary) { /* binary */ - if(!tw->iwantbinary) { - netprintf(tw->pnum,"%c%c%c",IAC,WONT,BINARY); - if(tw->condebug>0) - tprintf(cv,"SEND: %s %s\r\n", - telstates[WONT-TELCMD_FIRST], - teloptions[BINARY]); - } /* end if */ - else - tw->iwantbinary=0; /* turn off this now */ - tw->ibinary=0; - tw->mapoutput=0; /* turn output mapping off */ - } /* end if */ -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"NO REPLY NEEDED: %s %s\r\n", - telstates[WONT-TELCMD_FIRST], - teloptions[BINARY]); - OutputDebugString(strTmp); -#endif - break; -#endif -#ifdef ENCRYPTION - case ENCRYPTION: - break; -#endif - } - - /* all these just fall through to here... */ - - con->telstate=STNORM; - orig=++st; - break; - - case WILL: /* received a telnet WILL option */ -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"RECV: %s %s\r\n", - telstates[con->telstate-TELCMD_FIRST], - teloptions[*st]); - OutputDebugString(strTmp); -#endif - switch(*st) { -#ifdef NOT - case TELOPT_BINARY: /* WILL: binary */ - if(!tw->ubinary) { /* binary */ - if(!tw->uwantbinary) { - netprintf(tw->pnum,"%c%c%c", - IAC,DO,TELOPT_BINARY); - if(tw->condebug>0) - tprintf(cv,"SEND: %s %s\r\n", - telstates[DO - TELCMD_FIRST], - teloptions[TELOPT_BINARY]); - } /* end if */ - else - tw->uwantbinary=0; /* turn off this now */ - tw->ubinary=1; - } /* end if */ - else { - if(tw->condebug>0) - tprintf(cv,"NO REPLY NEEDED: %s %s\r\n", - telstates[DO - TELCMD_FIRST], - teloptions[TELOPT_BINARY]); - } /* end else */ - break; -#endif - - case TELOPT_SGA: /* WILL: suppress go-ahead */ - if(!con->ugoahead) { - con->ugoahead=1; - wsprintf(buf,"%c%c%c",IAC,DO,TELOPT_SGA); /* ack */ - TelnetSend(ks,buf,lstrlen(buf),0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[DO - TELCMD_FIRST], - teloptions[TELOPT_SGA]); - OutputDebugString(strTmp); -#endif - } /* end if */ - break; - - case TELOPT_ECHO: /* WILL: echo */ - if(!con->echo) { - con->echo = 1; - wsprintf(buf, "%c%c%c", IAC, DO, TELOPT_ECHO); /* ack */ - TelnetSend(ks, buf, lstrlen(buf), 0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[DO - TELCMD_FIRST], - teloptions[TELOPT_ECHO]); - OutputDebugString(strTmp); -#endif - } /* end if */ - break; - - case TELOPT_TM: /* WILL: Timing mark */ - con->timing=0; - break; -#ifdef ENCRYPTION - case TELOPT_ENCRYPT: /* WILL: decrypt our input */ - wsprintf(buf, "%c%c%c", IAC, - (encrypt_flag ? DO : DONT), TELOPT_ENCRYPT); - TelnetSend(ks, buf, lstrlen(buf), 0); - if (encrypt_flag) - encrypt_send_support(); - -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[(encrypt_flag ? DO : DONT) - TELCMD_FIRST], - teloptions[TELOPT_ENCRYPT]); - OutputDebugString(strTmp); -#endif - break; -#endif - - default: - wsprintf(buf,"%c%c%c",IAC,DONT,*st); - TelnetSend(ks,buf,lstrlen(buf),0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[DONT-TELCMD_FIRST],teloptions[*st]); - OutputDebugString(strTmp); -#endif - break; - } /* end switch */ - con->telstate=STNORM; - orig=++st; - break; - - case WONT: /* Received a telnet WONT option */ -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"RECV: %s %s\r\n", - telstates[con->telstate-TELCMD_FIRST],teloptions[*st]); - OutputDebugString((LPSTR)strTmp); -#endif - con->telstate=STNORM; - switch(*st++) { /* which option? */ -#ifdef NOT - case BINARY: /* WONT: binary */ - if(tw->ubinary) { /* binary */ - if(!tw->uwantbinary) { - netprintf(tw->pnum,"%c%c%c", - IAC,DONT,BINARY); - if(tw->condebug>0) - tprintf(cv,"SEND: %s %s\r\n", - telstates[DONT-TELCMD_FIRST], - teloptions[BINARY]); - } /* end if */ - else - tw->uwantbinary=0; /* turn off this now */ - tw->ubinary=0; - tw->mapoutput=0; /* turn output mapping off */ - } /* end if */ - else { - if(tw->condebug>0) - tprintf(cv,"NO REPLY NEEDED: %s %s\r\n", - telstates[DONT-TELCMD_FIRST], - teloptions[BINARY]); - } /* end else */ - break; - -#endif - case TELOPT_ECHO: /* WONT: echo */ - if(con->echo) { - con->echo=0; - wsprintf(buf,"%c%c%c",IAC,DONT,TELOPT_ECHO); - TelnetSend(ks,buf,lstrlen(buf),0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SEND: %s %s\r\n", - telstates[DONT-TELCMD_FIRST], - teloptions[TELOPT_ECHO]); - OutputDebugString(strTmp); - OutputDebugString("Other side won't echo!"); -#endif - } /* end if */ - break; - - case TELOPT_TM: /* WONT: Telnet timing mark option */ - con->timing=0; - break; - -#ifdef ENCRYPTION - case TELOPT_ENCRYPT: /* WONT: don't encrypt our input */ - break; -#endif - - default: - break; - } /* end switch */ - orig=st; - break; - - case SB: /* telnet sub-options negotiation */ - con->telstate=NEGOTIATE; - orig=st; - end_sub=0; - sub_pos=con->substate=0; /* Defined for each */ -#ifdef OLD_WAY - break; -#endif - - case NEGOTIATE: - /* until we change sub-negotiation states, accumulate bytes */ - if(con->substate==0) { - if(*st==IAC) { /* check if we found an IAC byte */ - if(*(st+1)==IAC) { /* skip over double IAC's */ - st++; - parsedat[sub_pos++]=*st++; - } /* end if */ - else { - end_sub=sub_pos; - con->substate=*st++; - } /* end else */ - } /* end if */ - else /* otherwise, just stash the byte */ - parsedat[sub_pos++]=*st++; - } /* end if */ - else { - con->substate=*st++; - /* check if we've really ended the sub-negotiations */ - if(con->substate==SE) - parse_subnegotiat(ks,end_sub); - - orig=st; - /* - * XXX hack to decrypt the rest of the buffer - */ - if (encrypt_flag == 2) { - decrypt_ks_hack(orig, mark - orig); - encrypt_flag = 1; - } - - con->telstate=STNORM; - } /* end else */ - break; - - default: - con->telstate=STNORM; - break; - } /* end switch */ - } /* end while */ - - /* - * quick scan of the remaining string, skip chars while they are - * uninteresting - */ - if(con->telstate==STNORM && stubinary) - *st&=127; /* mask off high bit */ -#endif - st++; - } /* end while */ -#if 0 - if(!tw->timing) - parsewrite(tw,orig,st-orig); -#endif - orig=st; /* forget what we have sent already */ - if(sttelstate=IACFOUND; - st++; - break; - - default: -#ifdef NEGOTIATEDEBUG - wsprintf(buf," strange char>128 0x%x\r\n", *st); - OutputDebugString(buf); -#endif - st++; - break; - } /* end switch */ - } /* end if */ - } /* end while */ -} /* end parse() */ - -/* - * Function : parse_subnegotiat() - * Purpose : Parse the telnet sub-negotiations read into the parsedat - * array. - * Parameters : - * end_sub - index of the character in the 'parsedat' array which - * is the last byte in a sub-negotiation - * Returns : none - * Calls : - * Called by : parse() - */ -static void -parse_subnegotiat(kstream ks, int end_sub) -{ - char buf[128]; - - switch(parsedat[0]) { - case TELOPT_TTYPE: - if(parsedat[1]==1) { - /* QAK!!! */ wsprintf(buf,"%c%c%c%cvt100%c%c",IAC,SB,TELOPT_TTYPE, - 0,IAC,SE); - TelnetSend(ks,(LPSTR)buf,11,0); -#ifdef NEGOTIATEDEBUG - wsprintf(strTmp,"SB TERMINAL-TYPE SEND\r\n" - "SEND: SB TERMINAL-TYPE IS vt100 \r\n len=%d \r\n", - lstrlen((LPSTR)buf)); - OutputDebugString(strTmp); -#endif - } - break; - - case TELOPT_AUTHENTICATION: - auth_parse(ks, parsedat, end_sub); - break; -#ifdef ENCRYPTION - case TELOPT_ENCRYPT: - if (encrypt_flag) - encrypt_parse(ks, parsedat, end_sub); - break; -#endif - default: - break; - } /* end switch */ -} /* parse_subnegotiat */ - - -/* - * Function : send_naws - * Purpose : Send a window size sub-negotiation. - * Parameters : - * ks - the kstream to send to. - * Returns : none - */ -void -send_naws(CONNECTION *con) -{ - unsigned char buf[40]; - int len; - - wsprintf(buf, "%c%c%c", IAC, SB, TELOPT_NAWS); - len = 3; - - buf[len++] = HIBYTE(con->width); - if (buf[len-1] == IAC) buf[len++] = IAC; - - buf[len++] = LOBYTE(con->width); - if (buf[len-1] == IAC) buf[len++] = IAC; - - buf[len++] = HIBYTE(con->height); - if (buf[len-1] == IAC) buf[len++] = IAC; - - buf[len++] = LOBYTE(con->height); - if (buf[len-1] == IAC) buf[len++] = IAC; - - buf[len++] = IAC; - buf[len++] = SE; - - TelnetSend(con->ks, buf, len, 0); - -#ifdef NEGOTIATEDEBUG - wsprintf(buf, "SEND: SB NAWS %d %d %d %d IAC SE\r\n", - HIBYTE(con->width), LOBYTE(con->width), - HIBYTE(con->height), LOBYTE(con->height)); - OutputDebugString(buf); -#endif - -} /* send_naws */ diff --git a/src/windows/wintel/resource.h b/src/windows/wintel/resource.h deleted file mode 100644 index db79dee148..0000000000 --- a/src/windows/wintel/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by telnet.rc -// -#define IDD_DIALOG1 101 -#define IDC_STATIC -1 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40005 -#define _APS_NEXT_CONTROL_VALUE 1002 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/src/windows/wintel/screen.c b/src/windows/wintel/screen.c deleted file mode 100644 index 91de8dd8bd..0000000000 --- a/src/windows/wintel/screen.c +++ /dev/null @@ -1,1147 +0,0 @@ -/* screen.c */ - -#include -#include -#include -#include -#include -#include "telnet.h" -#include "ini.h" -#include "auth.h" - -extern char *encrypt_output; /* XXX hack... I wonder if this will work. These are */ -extern char *decrypt_input; /* XXX really functions... */ - -extern char *cInvertedArray; -extern int bMouseDown; -extern int bSelection; - -static SCREEN *ScreenList; -static HINSTANCE hInst; -static char szScreenClass[] = "ScreenWClass"; -static char szScreenMenu[] = "ScreenMenu"; -static char cursor_key[8][4] = { /* Send for cursor keys */ - "\x1B[D", "\x1B[A", "\x1B[C", "\x1B[B", /* Normal mode */ - "\x1BOD", "\x1BOA", "\x1BOC", "\x1BOB", /* Numpad on mode */ -}; - -void -ScreenInit(HINSTANCE hInstance) -{ - BOOL b; - WNDCLASS wc; - - hInst = hInstance; - - ScreenList = NULL; - - wc.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; /* Class style(s) */ - wc.lpfnWndProc = ScreenWndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = sizeof(long); - wc.hInstance = hInstance; - wc.hIcon = LoadIcon(hInstance, "TERMINAL"); - wc.hCursor = LoadCursor(NULL, IDC_IBEAM); - wc.hbrBackground = GetStockObject(WHITE_BRUSH); - wc.lpszMenuName = szScreenMenu; - wc.lpszClassName = szScreenClass; - - b = RegisterClass(&wc); - assert(b); -} - - -void -SetScreenInstance(HINSTANCE hInstance) -{ - hInst = hInstance; -} - -int -GetNewScreen(void) -{ - SCREEN *pScr; - static int id = 0; - - pScr = (SCREEN *) calloc(sizeof(SCREEN), 1); - if (pScr == NULL) - return(-1); - - if (ScreenList == NULL) { - pScr->next = NULL; - pScr->prev = NULL; - } - else { - if (ScreenList->next == NULL) { - ScreenList->next = ScreenList; - ScreenList->prev = ScreenList; - } - pScr->next = ScreenList; - pScr->prev = ScreenList->prev; - ScreenList->prev->next = pScr; - ScreenList->prev = pScr; - } - - ScreenList = pScr; - return(id++); -} - -SCREENLINE * -ScreenNewLine(void) -{ - SCREENLINE *pScrLine; - - pScrLine = calloc(sizeof(SCREENLINE) + 2*MAX_LINE_WIDTH, 1); - if (pScrLine == NULL) - return (NULL); - pScrLine->text = &pScrLine->buffer[0]; - pScrLine->attrib = &pScrLine->buffer[MAX_LINE_WIDTH]; - return(pScrLine); -} - -static void -MakeWindowTitle(char *host, int width, int height, char *title, int nchars) -{ - char buf[128]; - int hlen; - - hlen = strlen(host); - - title[0] = 0; - - if (hlen + 1 > nchars) - return; - - strcpy(title, host); - - wsprintf(buf, " (%dh x %dw)", height, width); - - if ((int) strlen(buf) + hlen + 1 > nchars) - return; - - strcat(title, buf); -} - - -SCREEN * -InitNewScreen(CONFIG *Config) -{ - TEXTMETRIC tm; - HMENU hMenu = NULL; - SCREEN *scr = NULL; - SCREENLINE *pScrLine; - SCREENLINE *pScrLineLast; - int id; - int idx = 0; - char title[128]; - HDC hDC; - HFONT hFont; - - id = GetNewScreen(); - if (id == -1) - return(0); - - scr = ScreenList; - assert(scr != NULL); - - hMenu = LoadMenu(hInst, szScreenMenu); - assert(hMenu != NULL); - - scr->title = Config->title; - MakeWindowTitle(Config->title, Config->width, Config->height, - title, sizeof(title)); - - scr->hwndTel = Config->hwndTel; /* save HWND of calling window */ - - if (Config->backspace) { - CheckMenuItem(hMenu, IDM_BACKSPACE, MF_CHECKED); - CheckMenuItem(hMenu, IDM_DELETE, MF_UNCHECKED); - } else { - CheckMenuItem(hMenu, IDM_BACKSPACE, MF_UNCHECKED); - CheckMenuItem(hMenu, IDM_DELETE, MF_CHECKED); - } - - hDC = GetDC(NULL); - assert(hDC != NULL); - - scr->lf.lfPitchAndFamily = FIXED_PITCH; - GetPrivateProfileString(INI_FONT, "FaceName", "Courier", scr->lf. - lfFaceName, LF_FACESIZE, TELNET_INI); - scr->lf.lfHeight = (int) GetPrivateProfileInt(INI_FONT, "Height", 0, TELNET_INI); - scr->lf.lfWidth = (int) GetPrivateProfileInt(INI_FONT, "Width", 0, TELNET_INI); - scr->lf.lfPitchAndFamily = (BYTE) GetPrivateProfileInt(INI_FONT, "PitchAndFamily", 0, TELNET_INI); - scr->lf.lfCharSet = (BYTE) GetPrivateProfileInt(INI_FONT, "CharSet", 0, TELNET_INI); - scr->lf.lfEscapement = (BYTE) GetPrivateProfileInt(INI_FONT, "Escapement", 0, TELNET_INI); - scr->lf.lfQuality = PROOF_QUALITY; - scr->hSelectedFont = CreateFontIndirect((LPLOGFONT) &(scr->lf)); - hFont = SelectObject(hDC, scr->hSelectedFont); - GetTextMetrics(hDC, (LPTEXTMETRIC) &tm); - SelectObject(hDC, hFont); - scr->cxChar = tm.tmAveCharWidth; - scr->cyChar = tm.tmHeight + tm.tmExternalLeading; - - ReleaseDC(NULL, hDC); - - scr->width = Config->width; - scr->height = Config->height; - scr->ID = id; - scr->x = 0; - scr->y = 0; - scr->Oldx = 0; - scr->Oldy = 0; - scr->attrib = 0; - scr->DECAWM = 1; - scr->bWrapPending = FALSE; - scr->top = 0; - scr->bottom = scr->height-1; - scr->parmptr = 0; - scr->escflg = 0; - scr->bAlert = FALSE; - scr->numlines = 0; - scr->maxlines = 150; - - cInvertedArray = calloc(scr->width * scr->height, 1); - - pScrLineLast = ScreenNewLine(); - if (pScrLineLast == NULL) - return(NULL); - scr->screen_top = scr->buffer_top = pScrLineLast; - - for (idx = 0; idx < scr->height - 1; idx++) { - pScrLine = ScreenNewLine(); - if (pScrLine == NULL) - return(NULL); - pScrLine->prev = pScrLineLast; - pScrLineLast->next = pScrLine; - pScrLineLast = pScrLine; - } - - scr->screen_bottom = scr->buffer_bottom = pScrLine; - - scr->hWnd = CreateWindow(szScreenClass, title, WS_OVERLAPPEDWINDOW | WS_VSCROLL, - CW_USEDEFAULT, CW_USEDEFAULT, - scr->cxChar * scr->width + FRAME_WIDTH, - scr->cyChar * scr->height + FRAME_HEIGHT, - NULL, hMenu, hInst, scr); - assert(scr->hWnd != NULL); - - ShowWindow(scr->hWnd, SW_SHOW); - - CreateCaret(scr->hWnd, NULL, scr->cxChar, 2); - SetCaretPos(scr->x*scr->cxChar, (scr->y+1) * scr->cyChar); - ShowCaret(scr->hWnd); - - return(ScreenList); -} - - -void DeleteTopLine( - SCREEN *pScr) -{ - assert(pScr->buffer_top != NULL); - - pScr->buffer_top = pScr->buffer_top->next; - assert(pScr->buffer_top != NULL); - - free(pScr->buffer_top->prev); - pScr->buffer_top->prev = NULL; - - pScr->numlines--; - -} /* DeleteTopLine */ - - -static void SetScreenScrollBar( - SCREEN *pScr) -{ - if (pScr->numlines <= 0) { - SetScrollRange(pScr->hWnd, SB_VERT, 0, 100, FALSE); - SetScrollPos(pScr->hWnd, SB_VERT, 0, TRUE); - EnableScrollBar(pScr->hWnd, SB_VERT, ESB_DISABLE_BOTH); - } - else { - SetScrollRange(pScr->hWnd, SB_VERT, 0, pScr->numlines, FALSE); - SetScrollPos(pScr->hWnd, SB_VERT, pScr->numlines, TRUE); - EnableScrollBar(pScr->hWnd, SB_VERT, ESB_ENABLE_BOTH); - } - -} /* SetScreenScrollBar */ - - -int ScreenScroll( - SCREEN *pScr) -{ - SCREENLINE *pScrLine; - SCREENLINE *pPrev; - SCREENLINE *pNext; - SCREENLINE *pScrollTop; - SCREENLINE *pScrollBottom; - BOOL bFullScreen = TRUE; - HDC hDC; - RECT rc; - - Edit_ClearSelection(pScr); - - pScrollTop = GetScreenLineFromY(pScr, pScr->top); - - pScrollBottom = GetScreenLineFromY(pScr, pScr->bottom); - - if (pScrollTop != pScr->screen_top) { - bFullScreen = FALSE; - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = pScr->cyChar * (pScr->top); - rc.bottom = pScr->cyChar * (pScr->bottom+1); - - pNext = pScrollTop->next; - pPrev = pScrollTop->prev; - - pPrev->next = pNext; - pNext->prev = pPrev; - - pScrLine = pScrollTop; - ScreenClearLine(pScr, pScrLine); - } - else { - pScr->numlines++; - pScrLine = ScreenNewLine(); - if (pScrLine == NULL) - return(0); - pScr->screen_top = pScrollTop->next; - } - - if (pScrLine == NULL) - return(0); - - pNext = pScrollBottom->next; - pScrollBottom->next = pScrLine; - pScrLine->next = pNext; - pScrLine->prev = pScrollBottom; - if (pNext != NULL) - pNext->prev = pScrLine; - - if (pScrollBottom != pScr->screen_bottom) { - bFullScreen = FALSE; - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = pScr->cyChar * pScr->top; - rc.bottom = pScr->cyChar * (pScr->bottom+1); - } - else { - if (pScr->screen_bottom == pScr->buffer_bottom) - pScr->buffer_bottom = pScrLine; - pScr->screen_bottom = pScrLine; - } - -#if 0 - CheckScreen(fpScr); -#endif - - pScr->y++; - - if (pScr->y > pScr->bottom) - pScr->y = pScr->bottom; - - hDC = GetDC(pScr->hWnd); - assert(hDC != NULL); - - if (bFullScreen) - ScrollDC(hDC, 0, -pScr->cyChar, NULL, NULL, NULL, NULL); - else - ScrollDC(hDC, 0, -pScr->cyChar, &rc, &rc, NULL, NULL); - - PatBlt(hDC, 0, pScr->bottom * pScr->cyChar, - pScr->width * pScr->cxChar, pScr->cyChar, WHITENESS); - - ReleaseDC(pScr->hWnd, hDC); - - if (pScr->numlines == pScr->maxlines) - DeleteTopLine(pScr); - else - SetScreenScrollBar(pScr); - - return(1); - -} /* ScreenScroll */ - - -int DrawTextScreen( - RECT rcInvalid, - SCREEN *pScr, - HDC hDC) -{ - SCREENLINE *pScrLineTmp; - SCREENLINE *pScrLine; - int x = 0; - int y = 0; - int left = 0; - int right = 0; - int i; - int len; - char attrib; -#define YPOS (y*pScr->cyChar) - - pScrLine = pScr->screen_top; - - for (y = 0; y < pScr->height; y++) { - if (!pScrLine) - continue; - - if (YPOS >= rcInvalid.top - pScr->cyChar && - YPOS <= rcInvalid.bottom + pScr->cyChar) { - - if (y < 0) - y = 0; - - if (y >= pScr->height) - y = pScr->height - 1; - - left = (rcInvalid.left / pScr->cxChar) - 1; - - right = (rcInvalid.right / pScr->cxChar) + 1; - - if (left < 0) - left = 0; - - if (right > pScr->width - 1) - right = pScr->width - 1; - - x = left; - - while (x <= right) { - if (!pScrLine->text[x]) { - x++; - continue; - } - - if (SCR_isrev(pScrLine->attrib[x])) { - SelectObject(hDC, pScr->hSelectedFont); - SetTextColor(hDC, RGB(255, 255, 255)); - SetBkColor(hDC, RGB(0, 0, 0)); - } - else if (SCR_isblnk(pScrLine->attrib[x])) { - SelectObject(hDC, pScr->hSelectedFont); - SetTextColor(hDC, RGB(255, 0, 0)); - SetBkColor(hDC, RGB(255, 255, 255)); - } - else if (SCR_isundl(pScrLine->attrib[x])) { - SetTextColor(hDC, RGB(255, 0, 0)); - SetBkColor(hDC, RGB(255, 255, 255)); - SelectObject(hDC, pScr->hSelectedULFont); - } - else { - SelectObject(hDC,pScr->hSelectedFont); - SetTextColor(hDC, RGB(0, 0, 0)); - SetBkColor(hDC, RGB(255, 255, 255)); - } - - len = 1; - attrib = pScrLine->attrib[x]; - for (i = x + 1; i <= right; i++) { - if (pScrLine->attrib[i] != attrib || !pScrLine->text[i]) - break; - len++; - } - - TextOut(hDC, x*pScr->cxChar, y*pScr->cyChar, &pScrLine->text[x], len); - x += len; - } - } - pScrLineTmp = pScrLine->next; - pScrLine = pScrLineTmp; - } - - return(0); - -} /* DrawTextScreen */ - - -static BOOL SetInternalScreenSize( - SCREEN *pScr, - int width, - int height) -{ - RECT rc; - char *p; - int idx; - int n; - int newlines; - SCREENLINE *pNewLine; - SCREENLINE *pTopLine; - SCREENLINE *pBottomLine; -#if 0 - int col; - int row; - int dydestbottom; -#endif - - GetClientRect(pScr->hWnd, &rc); - - width = (rc.right - rc.left) / pScr->cxChar; - height = (rc.bottom - rc.top) / pScr->cyChar; - - if (pScr->height == height && pScr->width == width) - return(FALSE); - - pScr->Oldx = 0; - pScr->Oldy = 0; - pScr->attrib = 0; - - /* - Reallocate the inverted array of bytes and copy the values - from the old screen to the new screen. - */ - p = calloc(width * height, 1); - - ScreenCursorOff(pScr); - -#if 0 /* Copy inversion array to desitination */ - for (col = 0; col < width; col++) { - for (row = 0; row < height; row++) { - dydestbottom = height - 1 - row; - if (col < pScr->width && dydestbottom < pScr->height - 1) - p[row * width + col] = - cInvertedArray[(pScr->height - 1 - dydestbottom) * pScr->width + col]; - } - } -#endif - - free(cInvertedArray); - cInvertedArray = p; - - /* - Append any new lines which need to be added to accomodate the new - screen size. - */ - pBottomLine = pScr->buffer_bottom; - newlines = height - (pScr->height + pScr->numlines); - - if (newlines > 0) { - pScr->y += pScr->numlines; - pScr->numlines = 0; - - for (idx = 0; idx < newlines; idx++) { - pNewLine = ScreenNewLine(); - if (pNewLine == NULL) - return(FALSE); - pNewLine->prev = pBottomLine; - if (pBottomLine == NULL) - return(FALSE); - pBottomLine->next = pNewLine; - pBottomLine = pNewLine; - } - } - - /* - If we already have plenty of lines, then we need to get rid of the - scrollback lines, if too many exist. The cursor should end up - the same distance from the bottom of the screen as is started out - in this instance. - */ - if (newlines < 0) { - pScr->y = (height - 1) - (pScr->bottom - pScr->y); - if (pScr->y < 0) - pScr->y = 0; - pScr->numlines = -newlines; - n = pScr->numlines - pScr->maxlines; - for (idx = 0; idx < n; idx++) - DeleteTopLine(pScr); - } - - /* - Calculate the position of the buffer relative to the screen. - */ - pScr->screen_bottom = pBottomLine; - pScr->buffer_bottom = pBottomLine; - - pTopLine = pBottomLine; - - for (idx = 1; idx < height; idx++) { - pTopLine = pTopLine->prev; - } - - pScr->screen_top = pTopLine; - pScr->width = width; - pScr->height = height; - pScr->top = 0; - pScr->bottom = height - 1; - - if (pScr->x >= width) - pScr->x = width - 1; - - if (pScr->y >= height) - pScr->y = height - 1; - - SetScreenScrollBar(pScr); - ScreenCursorOn(pScr); - return(TRUE); - -} /* SetInternalScreenSize */ - - -static int ScreenAdjustUp( - SCREEN *pScr, - int n) -{ - int idx; - SCREENLINE *pLine1; - SCREENLINE *pLine2; - - for (idx = 0; idx < n; idx++) { - if (pScr->screen_top == pScr->buffer_top) - return(-idx); - pLine1 = pScr->screen_top->prev; - if (pLine1 == NULL) - return(-idx); - pLine2 = pScr->screen_bottom->prev; - if (pLine2 == NULL) - return(-idx); - pScr->screen_top = pLine1; - pScr->screen_bottom = pLine2; - } - - return(idx); - -} /* ScreenAdjustUp */ - - -static int ScreenAdjustDown( - SCREEN *pScr, - int n) -{ - int idx; - SCREENLINE *pLine1; - SCREENLINE *pLine2; - - for (idx = 0; idx < n; idx++) { - if (pScr->screen_bottom == pScr->buffer_bottom) - return(-idx); - pLine1 = pScr->screen_top->next; - if (pLine1 == NULL) - return(-idx); - pLine2 = pScr->screen_bottom->next; - if (pLine2 == NULL) - return(-idx); - pScr->screen_top = pLine1; - pScr->screen_bottom = pLine2; - } - - return(idx); - -} /* ScreenAdjustDown */ - - -long PASCAL ScreenWndProc( - HWND hWnd, - UINT message, - WPARAM wParam, - LPARAM lParam) -{ - MINMAXINFO *lpmmi; - SCREEN *pScr; - HMENU hMenu; - PAINTSTRUCT ps; - int x = 0; - int y = 0; - int ScrollPos; - int tmpScroll = 0; - int idx; - HDC hDC; - RECT rc; - char title[128]; - static int bDoubleClick = FALSE; - - switch (message) { - - case WM_COMMAND: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - - switch (wParam) { - - case IDM_EXIT: - if (MessageBox(hWnd, "Terminate this connection?", "Telnet", MB_OKCANCEL) == IDOK) { - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - SendMessage(pScr->hwndTel, WM_MYSCREENCLOSE, 0, (LPARAM) pScr); - } - break; - - case IDM_BACKSPACE: - hMenu = GetMenu(hWnd); - CheckMenuItem(hMenu, IDM_BACKSPACE, MF_CHECKED); - CheckMenuItem(hMenu, IDM_DELETE, MF_UNCHECKED); - SendMessage(pScr->hwndTel, WM_MYSCREENCHANGEBKSP, VK_BACK, (LPARAM) pScr); - break; - - case IDM_DELETE: - hMenu = GetMenu(hWnd); - CheckMenuItem(hMenu, IDM_BACKSPACE, MF_UNCHECKED); - CheckMenuItem(hMenu, IDM_DELETE, MF_CHECKED); - SendMessage(pScr->hwndTel, WM_MYSCREENCHANGEBKSP, 0x7f, (LPARAM) pScr); - break; - - case IDM_FONT: - ScreenCursorOff(pScr); - ProcessFontChange(hWnd); - ScreenCursorOn(pScr); - break; - - case IDM_COPY: - Edit_Copy(hWnd); - hMenu=GetMenu(hWnd); - Edit_ClearSelection(pScr); - break; - - case IDM_PASTE: - Edit_Paste(hWnd); - break; - - case IDM_HELP_INDEX: - WinHelp(hWnd, HELP_FILE, HELP_INDEX, 0); - break; - - case IDM_ABOUT: -#ifdef CYGNUS -#ifdef KRB4 - strcpy(strTmp, " Kerberos 4 for Windows\n"); -#endif -#ifdef KRB5 - strcpy(strTmp, " KerbNet for Windows\n"); -#endif - strcat(strTmp, "\n Version 1.00\n\n"); - strcat(strTmp, " For support, contact:\n"); - strcat(strTmp, " Cygnus Support - (415) 903-1400\n"); -#else /* CYGNUS */ - strcpy(strTmp, " Kerberos 5 Telnet for Windows\n"); - strcat(strTmp, " ALPHA SNAPSHOT 2\n\n"); -#endif /* CYGNUS */ - if (encrypt_flag) { - strcat(strTmp, "\n[Encryption of output requested. State: "); - strcat(strTmp, (encrypt_output ? "encrypting]" : "INACTIVE]")); - strcat(strTmp, "\n[Decryption of input requested. State: "); - strcat(strTmp, (decrypt_input ? "decrypting]\n" : "INACTIVE]\n")); - } - MessageBox(NULL, strTmp, "Kerberos", MB_OK); - break; - -#if defined(DEBUG) - case IDM_DEBUG: - CheckScreen(pScr); - break; -#endif - } - - break; - - case WM_NCCREATE: - pScr = (SCREEN *) ((LPCREATESTRUCT) lParam)->lpCreateParams; - pScr->hWnd = hWnd; - SetWindowLong(hWnd, SCREEN_HANDLE, (LONG) pScr); - SetScrollRange(hWnd, SB_VERT, 0, 100, FALSE); - SetScrollPos(hWnd, SB_VERT, 0, TRUE); - EnableScrollBar(hWnd, SB_VERT, ESB_DISABLE_BOTH); - return(TRUE); - - case WM_VSCROLL: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - - ScreenCursorOff(pScr); - - switch(wParam) { - - case SB_LINEDOWN: - if (ScreenAdjustDown(pScr, 1) <= 0) - break; - hDC = GetDC(hWnd); - assert(hDC != NULL); - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = 0; - rc.bottom = pScr->cyChar * (pScr->bottom + 1); - ScrollDC(hDC, 0, -pScr->cyChar, &rc, &rc, NULL, NULL); - ReleaseDC(hWnd, hDC); - rc.top = pScr->cyChar * pScr->bottom; - InvalidateRect(hWnd, &rc, TRUE); - ScrollPos = GetScrollPos(hWnd, SB_VERT); - SetScrollPos(hWnd, SB_VERT, ScrollPos + 1, TRUE); - UpdateWindow(hWnd); - break; - - case SB_LINEUP: - if (ScreenAdjustUp(pScr, 1) <= 0) - break; - hDC = GetDC(hWnd); - assert(hDC != NULL); - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = 0; - rc.bottom = pScr->cyChar * (pScr->bottom + 1); - ScrollDC(hDC, 0, pScr->cyChar, &rc, &rc, NULL, NULL); - ReleaseDC(hWnd, hDC); - rc.bottom = pScr->cyChar; - InvalidateRect(hWnd, &rc, TRUE); - ScrollPos = GetScrollPos(pScr->hWnd, SB_VERT); - SetScrollPos(hWnd,SB_VERT, ScrollPos - 1, TRUE); - UpdateWindow(hWnd); - break; - - case SB_PAGEDOWN: - idx = abs(ScreenAdjustDown(pScr, pScr->height)); - hDC = GetDC(hWnd); - assert(hDC != NULL); - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = 0; - rc.bottom = pScr->cyChar * (pScr->bottom+1); - ScrollDC(hDC, 0, -idx * pScr->cyChar, &rc, &rc, NULL, NULL); - ReleaseDC(hWnd, hDC); - rc.top = pScr->cyChar * (pScr->bottom - idx + 1); - InvalidateRect(hWnd, &rc, TRUE); - ScrollPos=GetScrollPos(hWnd, SB_VERT); - SetScrollPos(hWnd, SB_VERT, ScrollPos + idx, TRUE); - break; - - case SB_PAGEUP: - idx = abs(ScreenAdjustUp(pScr, pScr->height)); - hDC = GetDC(hWnd); - assert(hDC != NULL); - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = 0; - rc.bottom = pScr->cyChar * (pScr->bottom + 1); - ScrollDC(hDC, 0, idx * pScr->cyChar, &rc, &rc, NULL, NULL); - ReleaseDC(hWnd, hDC); - rc.bottom = idx * pScr->cyChar; - InvalidateRect(hWnd, &rc, TRUE); - ScrollPos=GetScrollPos(hWnd, SB_VERT); - SetScrollPos(hWnd, SB_VERT, ScrollPos - idx, TRUE); - break; - - case SB_THUMBPOSITION: - case SB_THUMBTRACK: - ScrollPos = GetScrollPos(hWnd, SB_VERT); - tmpScroll = ScrollPos - LOWORD(lParam); - if (tmpScroll == 0) - break; - if (tmpScroll > 0) - ScreenAdjustUp(pScr, tmpScroll); - else - ScreenAdjustDown(pScr, -tmpScroll); - if (abs(tmpScroll) < pScr->height) { - hDC = GetDC(hWnd); - assert(hDC != NULL); - rc.left = 0; - rc.right = pScr->cxChar * pScr->width; - rc.top = 0; - rc.bottom = pScr->cyChar * (pScr->bottom + 1); - ScrollDC(hDC, 0, tmpScroll * pScr->cyChar, &rc, &rc, NULL, NULL); - ReleaseDC(hWnd, hDC); - if (tmpScroll > 0) { - rc.bottom = tmpScroll * pScr->cyChar; - InvalidateRect(hWnd, &rc, TRUE); - } - else { - rc.top = (pScr->bottom + tmpScroll + 1) * pScr->cyChar; - InvalidateRect(hWnd, &rc, TRUE); - } - } - else - InvalidateRect(hWnd, NULL, TRUE); - - SetScrollPos(hWnd, SB_VERT, LOWORD(lParam), TRUE); - UpdateWindow(hWnd); - break; - } - - ScreenCursorOn(pScr); - break; - - case WM_KEYDOWN: - if (wParam == VK_INSERT) { - if (GetKeyState(VK_SHIFT) < 0) - PostMessage(hWnd, WM_COMMAND, IDM_PASTE, 0); - else if (GetKeyState(VK_CONTROL) < 0) - PostMessage(hWnd, WM_COMMAND, IDM_COPY, 0); - break; - } - /* - ** Check for cursor keys. With control pressed, we treat as - ** keyboard equivalents to scrolling. Otherwise, we send - ** a WM_MYCURSORKEY message with the appropriate string - ** to be sent. Sending the actual string allows the upper - ** level to be ignorant of keyboard modes, etc. - */ - if (wParam < VK_PRIOR || wParam > VK_DOWN) /* Is it a cursor key? */ - break; - - if (GetKeyState (VK_CONTROL) >= 0) { /* No control key */ - if (wParam >= VK_LEFT && wParam <= VK_DOWN) { - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - wParam = wParam - VK_LEFT + (pScr->DECCKM ? 4 : 0); - SendMessage (pScr->hwndTel, WM_MYCURSORKEY, - strlen(cursor_key[wParam]), - (LPARAM) (char *) cursor_key[wParam]); - } - } else { /* Control is down */ - switch (wParam) { - case VK_PRIOR: /* Page up */ - SendMessage(hWnd, WM_VSCROLL, SB_PAGEUP, 0); - break; - case VK_NEXT: /* Page down */ - SendMessage(hWnd, WM_VSCROLL, SB_PAGEDOWN, 0); - break; - case VK_UP: /* Line up */ - SendMessage(hWnd, WM_VSCROLL, SB_LINEUP, 0); - break; - case VK_DOWN: /* Line down */ - SendMessage(hWnd, WM_VSCROLL, SB_LINEDOWN, 0); - break; - } - } - UpdateWindow(hWnd); - break; - - case WM_CHAR: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - SendMessage(pScr->hwndTel, WM_MYSCREENCHAR, wParam, (LPARAM) pScr); - break; - - case WM_INITMENU: - if (IsClipboardFormatAvailable(CF_TEXT)) - EnableMenuItem((HMENU) wParam, IDM_PASTE, MF_ENABLED); - else - EnableMenuItem((HMENU) wParam, IDM_PASTE, MF_GRAYED); - if (bSelection) - EnableMenuItem((HMENU) wParam, IDM_COPY, MF_ENABLED); - else - EnableMenuItem((HMENU) wParam, IDM_COPY, MF_GRAYED); - break; - - case WM_GETMINMAXINFO: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - if (pScr == NULL) /* Used on creation when window word not set */ - pScr = ScreenList; - lpmmi = (MINMAXINFO *) lParam; - if (FRAME_WIDTH + MAX_LINE_WIDTH * pScr->cxChar < lpmmi->ptMaxSize.x) - lpmmi->ptMaxSize.x = FRAME_WIDTH + MAX_LINE_WIDTH * pScr->cxChar; - lpmmi->ptMaxTrackSize.x = lpmmi->ptMaxSize.x; - lpmmi->ptMinTrackSize.x = FRAME_WIDTH + 20 * pScr->cxChar; - lpmmi->ptMinTrackSize.y = FRAME_HEIGHT + 4 * pScr->cyChar; - break; - - case WM_LBUTTONDOWN: - if (bDoubleClick) - Edit_TripleClick(hWnd, lParam); - else - Edit_LbuttonDown(hWnd, lParam); - break; - - case WM_LBUTTONUP: - Edit_LbuttonUp(hWnd, lParam); - break; - - case WM_LBUTTONDBLCLK: - bDoubleClick = TRUE; - SetTimer(hWnd, TIMER_TRIPLECLICK, GetDoubleClickTime(), NULL); - Edit_LbuttonDblclk(hWnd, lParam); - break; - - case WM_TIMER: - if (wParam == TIMER_TRIPLECLICK) - bDoubleClick = FALSE; - break; - - case WM_RBUTTONUP: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - Edit_Copy(hWnd); - Edit_ClearSelection(pScr); - Edit_Paste(hWnd); - break; - - case WM_MOUSEMOVE: - if (bMouseDown) - Edit_MouseMove(hWnd, lParam); - break; - - case WM_RBUTTONDOWN: -#if 0 - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - wsprintf(strTmp,"fp->x=%d fp->y=%d text=%s \r\n", - pScr->screen_top->x, pScr->screen_top->y, pScr->screen_top->text); - OutputDebugString(strTmp); -#endif - break; - - case WM_PAINT: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - BeginPaint (hWnd, &ps); - SelectObject(ps.hdc, pScr->hSelectedFont); - if (pScr->screen_bottom != NULL) - DrawTextScreen(ps.rcPaint, pScr, ps.hdc); - else - OutputDebugString("screen_bottom is NULL.\r\n"); - EndPaint(hWnd, &ps); - break; - - case WM_CLOSE: - if (MessageBox(hWnd, "Terminate this connection?", "Telnet", MB_OKCANCEL) == IDOK) { - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - SendMessage(pScr->hwndTel, WM_MYSCREENCLOSE, 0, (LPARAM) pScr); - return (DefWindowProc(hWnd, message, wParam, lParam)); - } - break; - - case WM_DESTROY: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - if (pScr != NULL) - DeleteObject(pScr->hSelectedFont); - return (DefWindowProc(hWnd, message, wParam, lParam)); - - case WM_ACTIVATE: - if (wParam != WA_INACTIVE) { - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - if (pScr->bAlert) { - char strTitle[128]; - int idx; - - GetWindowText(hWnd, strTitle, sizeof(strTitle)); - if (strTitle[0] == ALERT) { - idx = lstrlen(strTitle); - strTitle[idx - 2] = 0; - SetWindowText(hWnd, &strTitle[2]); - pScr->bAlert = FALSE; - } - } - } - return (DefWindowProc(hWnd, message, wParam, lParam)); - - case WM_SIZE: - if (wParam == SIZE_MINIMIZED) - break; - - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - - if (SetInternalScreenSize(pScr, LOWORD(lParam), HIWORD(lParam))) { - SendMessage(pScr->hwndTel, WM_MYSCREENSIZE, 0, - MAKELONG(pScr->width, pScr->height)); - } - MakeWindowTitle(pScr->title, pScr->width, pScr->height, - title, sizeof(title)); - SetWindowText(hWnd, title); - break; - - case WM_SETFOCUS: - pScr = (SCREEN *) GetWindowLong(hWnd, SCREEN_HANDLE); - assert (pScr != NULL); - CreateCaret(hWnd, NULL, pScr->cxChar, 2); - ScreenCursorOn(pScr); - break; - - case WM_KILLFOCUS: - DestroyCaret(); - break; - - default: - return(DefWindowProc(hWnd, message, wParam, lParam)); - } - - return(0); - -} /* ScreenWndProc */ - - -void ScreenBell( - SCREEN *pScr) -{ - char strTitle[128]; - int idx; - - MessageBeep(MB_ICONEXCLAMATION); - if (pScr->hWnd != GetActiveWindow()) { - FlashWindow(pScr->hWnd, TRUE); - if (!pScr->bAlert) { - strTitle[0] = ALERT; - strTitle[1] = SPACE; - GetWindowText(pScr->hWnd, &strTitle[2], sizeof(strTitle) - 2); - idx = lstrlen(strTitle); - strTitle[idx] = SPACE; - strTitle[idx+1] = ALERT; - strTitle[idx+2] = 0; - SetWindowText(pScr->hWnd, strTitle); - } - FlashWindow(pScr->hWnd, FALSE); - pScr->bAlert = TRUE; - } - -} /* ScreenBell */ - - -void ScreenBackspace(SCREEN *pScr) -{ - RECT rc; - - pScr->bWrapPending = FALSE; - rc.left = pScr->x * pScr->cxChar; - rc.right = (pScr->x + 1) * pScr->cxChar; - rc.top = pScr->cyChar * pScr->y; - rc.bottom = pScr->cyChar * (pScr->y + 1); - InvalidateRect(pScr->hWnd, &rc, TRUE); - pScr->x--; - if (pScr->x < 0) - pScr->x = 0; - UpdateWindow(pScr->hWnd); - -} /* ScreenBackspace */ - - -void ScreenTab( - SCREEN *pScr) -{ - int num_spaces; - int idx; - SCREENLINE *pScrLine; - int iTest = 0; - HDC hDC; - - num_spaces = TAB_SPACES - (pScr->x % TAB_SPACES); - if (pScr->x + num_spaces >= pScr->width) - num_spaces = pScr->width - pScr->x; - pScrLine = GetScreenLineFromY(pScr, pScr->y); - if (pScrLine == NULL) - return; - for (idx = 0; idx < num_spaces; idx++, pScr->x++) { - if (!pScrLine->text[pScr->x]) - iTest=1; - if (iTest) - pScrLine->text[pScr->x] = SPACE; - } - hDC = GetDC(pScr->hWnd); - assert(hDC != NULL); - SelectObject(hDC, pScr->hSelectedFont); - TextOut(hDC, (pScr->x - num_spaces) * pScr->cxChar, pScr->y * pScr->cyChar, - pScrLine->text + pScr->x - num_spaces, num_spaces); - ReleaseDC(pScr->hWnd, hDC); - if (pScr->x >= pScr->width) - pScr->x = pScr->width - 1; - pScr->bWrapPending = FALSE; - -} /* ScreenTab */ - - -void ScreenCarriageFeed( - SCREEN *pScr) -{ - pScr->bWrapPending = FALSE; - pScr->x = 0; - -} /* ScreenCarriageFeed */ diff --git a/src/windows/wintel/screen.h b/src/windows/wintel/screen.h deleted file mode 100644 index e3e7460c85..0000000000 --- a/src/windows/wintel/screen.h +++ /dev/null @@ -1,325 +0,0 @@ -extern long PASCAL ScreenWndProc(HWND,UINT,WPARAM,LPARAM); - -/* -* Definition of attribute bits in the Virtual Screen -* -* 0 - Bold -* 1 - -* 2 - -* 3 - Underline -* 4 - Blink -* 5 - -* 6 - Reverse -* 7 - Graphics character set -* -*/ -#define SCR_isbold(x) (x & 0x01) -#define SCR_isundl(x) (x & 0x08) -#define SCR_isblnk(x) (x & 0x10) -#define SCR_isrev(x) (x & 0x40) -#define SCR_setrev(x) (x ^= 0x40) -#define SCR_isgrph(x) (x & 0x80) -#define SCR_inattr(x) (x & 0xd9) -#define SCR_graph(x) (x | 0x80) -#define SCR_notgraph(x) (x & 0x7F) - -#define SCREEN_HANDLE 0 /* offset in extra window info */ - -#define WM_MYSCREENCHAR (WM_USER+1) -#define WM_MYSCREENBLOCK (WM_USER+2) -#define WM_MYSYSCHAR (WM_USER+3) -#define WM_MYSCREENCLOSE (WM_USER+4) -#define WM_MYSCREENCHANGEBKSP (WM_USER+5) -#define WM_MYSCREENSIZE (WM_USER+6) -#define WM_NETWORKEVENT (WM_USER+7) -#define WM_HOSTNAMEFOUND (WM_USER+8) -#define WM_MYCURSORKEY (WM_USER+9) - -#define FRAME_HEIGHT ((2* GetSystemMetrics(SM_CYFRAME))+GetSystemMetrics(SM_CYCAPTION)+GetSystemMetrics(SM_CYMENU)+3) -#define FRAME_WIDTH (2*GetSystemMetrics(SM_CXFRAME)+GetSystemMetrics(SM_CXVSCROLL)) -#define TAB_SPACES 8 -#define SPACE 32 -#define ALERT 0x21 -#define MAX_LINE_WIDTH 512 /* not restricted to 1 byte */ - -typedef struct SCREENLINE { - struct SCREENLINE *next; - struct SCREENLINE *prev; - int width; - char *text; - char *attrib; - char buffer[0]; -} SCREENLINE; - -typedef struct SCREEN { - LPSTR title; - HWND hWnd; - HWND hwndTel; - SCREENLINE *screen_top; - SCREENLINE *screen_bottom; - SCREENLINE *buffer_top; - SCREENLINE *buffer_bottom; - int ID; - int type; - int width; - int height; - int maxlines; /* Maximum number of scrollback lines */ - int numlines; /* Current number of scrollback lines */ - int savelines; /* Save lines off top? */ - int ESscroll; /* Scroll screen when ES received */ - int attrib; /* current attribute */ - int x; /* current cursor position */ - int y; /* current cursor position */ - int Oldx; /* internally used to redraw cursor */ - int Oldy; - int Px; /* saved cursor pos and attribute */ - int Py; - int Pattrib; - int VSIDC; /* Insert/Delete character mode 0=draw line */ - int DECAWM; /* AutoWrap mode 0=off */ - BOOL bWrapPending; /* AutoWrap mode is on - wrap on next character */ - int DECCKM; /* Cursor key mode */ - int DECPAM; /* keyPad Application mode */ - int IRM; /* Insert/Replace mode */ - int escflg; /* Current Escape level */ - int top; /* Vertical bounds of screen */ - int bottom; - int parmptr; - int cxChar; /* Width of the current font */ - int cyChar; /* Height of the current font */ - BOOL bAlert; - int parms[6]; /* Ansi Params */ - LOGFONT lf; - HFONT hSelectedFont; - HFONT hSelectedULFont; - char tabs[MAX_LINE_WIDTH]; - struct SCREEN *next; - struct SCREEN *prev; -} SCREEN; - -typedef struct CONFIG { - LPSTR title; - HWND hwndTel; - int ID; - int type; - int height; - int width; - int maxlines; /* Maximum number of scrollback lines */ - int backspace; - int ESscroll; /* Scroll screen when ES received */ - int VSIDC; /* Insert/Delete character mode 0=draw line */ - int DECAWM; /* AutoWrap mode 0=off */ - int IRM; /* Insert/Replace mode */ -} CONFIG; - -#define TELNET_SCREEN 0 -#define CONSOLE_SCREEN 1 - -#define IDM_FONT 100 -#define IDM_BACKSPACE 101 -#define IDM_DELETE 102 -#define IDM_ABOUT 103 -#define IDM_HELP_INDEX 104 -#define IDM_EXIT 105 - -#define HELP_FILE "ktelnet.hlp" - -#define IDM_COPY 200 -#define IDM_PASTE 201 -#define IDM_DEBUG 202 - -#define TIMER_TRIPLECLICK 1000 - -#define IDC_ALLOCFAIL 1 -#define IDC_LOCKFAIL 2 -#define IDC_LOADSTRINGFAIL 3 -#define IDC_FONT 6 - -#define DESIREDPOINTSIZE 12 - -/* -Prototypes -*/ - void NEAR InitializeStruct( - WORD wCommDlgType, - LPSTR lpStruct, - HWND hWnd); - - void ScreenInit( - HINSTANCE hInstance); - - void SetScreenInstance( - HINSTANCE hInstance); - - SCREENLINE *ScreenNewLine(); - - void ScreenBell( - SCREEN *pScr); - - void ScreenBackspace( - SCREEN *pScr); - - void ScreenTab( - SCREEN *pScr); - - void ScreenCarriageFeed( - SCREEN *pScr); - - int ScreenScroll( - SCREEN *pScr); - - void DeleteTopLine( - SCREEN *pScr); - -/* -emul.c -*/ - void ScreenEm( - LPSTR c, - int len, - SCREEN *pScr); - -/* -intern.c -*/ - SCREENLINE *GetScreenLineFromY( - SCREEN *pScr, - int y); - - SCREENLINE *ScreenClearLine( - SCREEN *pScr, - SCREENLINE *pScrLine); - - void ScreenUnscroll( - SCREEN *pScr); - - void ScreenELO( - SCREEN *pScr, - int s); - - void ScreenEraseScreen( - SCREEN *pScr); - - void ScreenTabClear( - SCREEN *pScr); - - void ScreenTabInit( - SCREEN *pScr); - - void ScreenReset( - SCREEN *pScr); - - void ScreenIndex( - SCREEN *pScr); - - void ScreenWrapNow( - SCREEN *pScr, - int *xp, - int *yp); - - void ScreenEraseToEOL( - SCREEN *pScr); - - void ScreenEraseToBOL( - SCREEN *pScr); - - void ScreenEraseLine( - SCREEN *pScr, - int s); - - void ScreenEraseToEndOfScreen( - SCREEN *pScr); - - void ScreenRange( - SCREEN *pScr); - - void ScreenAlign( - SCREEN *pScr); - - void ScreenApClear( - SCREEN *pScr); - - void ScreenSetOption( - SCREEN *pScr, - int toggle); - - BOOL ScreenInsChar( - SCREEN *pScr, - int x); - - void ScreenSaveCursor( - SCREEN *pScr); - - void ScreenRestoreCursor( - SCREEN *pScr); - - void ScreenDraw( - SCREEN *pScr, - int x, - int y, - int a, - int len, - char *c); - - void ScreenCursorOff( - SCREEN *pScr); - - void ScreenCursorOn( - SCREEN *pScr); - - void ScreenDelChars( - SCREEN *pScr, - int n); - - void ScreenRevIndex( - SCREEN *pScr); - - void ScreenDelLines( - SCREEN *pScr, - int n, - int s); - - void ScreenInsLines( - SCREEN *pScr, - int n, - int s); - - #if ! defined(NDEBUG) - BOOL CheckScreen( - SCREEN *pScr); - #endif - - void ProcessFontChange( - HWND hWnd); - - void Edit_LbuttonDown( - HWND hWnd, - LPARAM lParam); - - void Edit_LbuttonDblclk( - HWND hWnd, - LPARAM lParam); - - void Edit_LbuttonUp( - HWND hWnd, - LPARAM lParam); - - void Edit_TripleClick( - HWND hWnd, - LPARAM lParam); - - void Edit_MouseMove( - HWND hWnd, - LPARAM lParam); - - void Edit_ClearSelection( - SCREEN *pScr); - - void Edit_Copy( - HWND hWnd); - - void Edit_Paste( - HWND hWnd); - - SCREEN *InitNewScreen( - CONFIG *Config); diff --git a/src/windows/wintel/struct.h b/src/windows/wintel/struct.h deleted file mode 100644 index bc1cc49121..0000000000 --- a/src/windows/wintel/struct.h +++ /dev/null @@ -1,29 +0,0 @@ -#include "winsock.h" -#ifdef KRB4 - #include "kstream.h" -#endif -#ifdef KRB5 - #include "k5stream.h" -#endif - -#define HCONNECTION HGLOBAL - -typedef struct CONNECTION { - SCREEN *pScreen; /* handle to screen associated with connection */ - kstream ks; - SOCKET socket; - int pnum; /* port number associated with connection */ - int telstate; /* telnet state for this connection */ - int substate; /* telnet subnegotiation state */ - int termsent; - int echo; - int ugoahead; - int igoahead; - int timing; - int backspace; - int ctrl_backspace; - int termstate; /* terminal type for this connection */ - int width; - int height; - BOOL bResizeable; -} CONNECTION; diff --git a/src/windows/wintel/telnet.c b/src/windows/wintel/telnet.c deleted file mode 100644 index a2f5083ca5..0000000000 --- a/src/windows/wintel/telnet.c +++ /dev/null @@ -1,904 +0,0 @@ -/**************************************************************************** - - Program: telnet.c - - PURPOSE: Windows networking kernel - Telnet - - FUNCTIONS: - - WinMain() - calls initialization function, processes message loop - InitApplication() - initializes window data and registers window - InitInstance() - saves instance handle and creates main window - MainWndProc() - processes messages - About() - processes messages for "About" dialog box - - COMMENTS: - - Windows can have several copies of your application running at the - same time. The variable hInst keeps track of which instance this - application is so that processing will be to the correct window. - - ****************************************************************************/ - -#include -#include -#include -#include -#include "telnet.h" -#include "auth.h" - -static HANDLE hInst; -static HWND hWnd; -static CONFIG *tmpConfig; -static CONNECTION *con = NULL; -static char hostdata[MAXGETHOSTSTRUCT]; -static SCREEN *pScr; -static int debug = 1; - -char strTmp[1024]; /* Scratch buffer */ -BOOL bAutoConnection = FALSE; -short port_no = 23; -char szUserName[64]; /* Used in auth.c */ -char szHostName[64]; - -#ifdef KRB4 -#define WINDOW_CLASS "K4_telnetWClass" -#endif - -#ifdef KRB5 -krb5_context k5_context; -#define WINDOW_CLASS "K5_telnetWClass" -#endif - -/* - * - * FUNCTION: WinMain(HINSTANCE, HINSTANCE, LPSTR, int) - * - * PURPOSE: calls initialization function, processes message loop - * - * COMMENTS: - * - * Windows recognizes this function by name as the initial entry point - * for the program. This function calls the application initialization - * routine, if no other instance of the program is running, and always - * calls the instance initialization routine. It then executes a message - * retrieval and dispatch loop that is the top-level control structure - * for the remainder of execution. The loop is terminated when a WM_QUIT - * message is received, at which time this function exits the application - * instance by returning the value passed by PostQuitMessage(). - * - * If this function must abort before entering the message loop, it - * returns the conventional value NULL. - */ - -int PASCAL -WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) -{ - MSG msg; - - if (!hPrevInstance) - if (!InitApplication(hInstance)) - return(FALSE); - - /* - * Perform initializations that apply to a specific instance - */ - bAutoConnection = parse_cmdline(lpCmdLine); - - if (!InitInstance(hInstance, nCmdShow)) - return(FALSE); - -#ifdef _WIN32 - SetDebugErrorLevel(SLE_WARNING); -#endif - - /* - * Acquire and dispatch messages until a WM_QUIT message is received. - */ - while (GetMessage(&msg, NULL, 0, 0)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - - /* Process all non-network messages */ - while (PeekMessage(&msg, NULL, 0, WM_NETWORKEVENT-1, PM_REMOVE) || - PeekMessage(&msg, NULL, WM_NETWORKEVENT+1, (UINT)-1, PM_REMOVE)) - { - if (msg.message == WM_QUIT) // Special case: WM_QUIT -- return - return msg.wParam; // the value from PostQuitMessage - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } - - return (msg.wParam); /* Returns the value from PostQuitMessage */ -} - -/* - * FUNCTION: InitApplication(HINSTANCE) - * - * PURPOSE: Initializes window data and registers window class - * - * COMMENTS: - * - * This function is called at initialization time only if no other - * instances of the application are running. This function performs - * initialization tasks that can be done once for any number of running - * instances. - * - * In this case, we initialize a window class by filling out a data - * structure of type WNDCLASS and calling the Windows RegisterClass() - * function. Since all instances of this application use the same window - * class, we only need to do this when the first instance is initialized. - */ - -BOOL -InitApplication(HINSTANCE hInstance) -{ - WNDCLASS wc; - - ScreenInit(hInstance); - - /* - * Fill in window class structure with parameters that describe the - * main window. - */ - wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s). */ - wc.lpfnWndProc = MainWndProc; /* Function to retrieve messages for - * windows of this class. - */ - wc.cbClsExtra = 0; /* No per-class extra data. */ - wc.cbWndExtra = 0; /* No per-window extra data. */ - wc.hInstance = hInstance; /* Application that owns the class. */ - wc.hIcon = NULL; /* LoadIcon(hInstance, "NCSA"); */ - wc.hCursor = NULL; /* Cursor(NULL, IDC_ARROW); */ - wc.hbrBackground = NULL; /* GetStockObject(WHITE_BRUSH); */ - wc.lpszMenuName = NULL; /* Name of menu resource in .RC file. */ - wc.lpszClassName = WINDOW_CLASS; /* Name used in call to CreateWindow. */ - - return(RegisterClass(&wc)); -} - - -/* - * FUNCTION: InitInstance(HANDLE, int) - * - * PURPOSE: Saves instance handle and creates main window - * - * COMMENTS: - * - * This function is called at initialization time for every instance of - * this application. This function performs initialization tasks that - * cannot be shared by multiple instances. - * - * In this case, we save the instance handle in a static variable and - * create and display the main program window. - */ -BOOL -InitInstance(HINSTANCE hInstance, int nCmdShow) -{ - int xScreen = 0; - int yScreen = 0; - WSADATA wsaData; - - SetScreenInstance(hInstance); - - /* - * Save the instance handle in static variable, which will be used in - * many subsequence calls from this application to Windows. - */ - hInst = hInstance; - - /* - * Create a main window for this application instance. - */ - hWnd = CreateWindow( - WINDOW_CLASS, /* See RegisterClass() call. */ - "TCPWin", /* Text for window title bar. */ - WS_SYSMENU, /* Window style. */ - xScreen / 3, /* Default horizontal position. */ - yScreen / 3, /* Default vertical position. */ - xScreen / 3, /* Default width. */ - yScreen / 3, /* Default height. */ - NULL, /* Overlapped windows have no parent */ - NULL, /* Use the window class menu. */ - hInstance, /* This instance owns this window. */ - NULL); /* Pointer not needed. */ - - if (!hWnd) - return (FALSE); - - if (WSAStartup(0x0101, &wsaData) != 0) { /* Initialize the network */ - MessageBox(NULL, "Couldn't initialize Winsock!", NULL, - MB_OK | MB_ICONEXCLAMATION); - return(FALSE); - } - - if (!OpenTelnetConnection()) { - WSACleanup(); - return(FALSE); - } - -#ifdef KRB5 - krb5_init_context(&k5_context); -#endif - - return (TRUE); -} - -char buf[2048]; - -/* - * FUNCTION: MainWndProc(HWND, UINT, WPARAM, LPARAM) - * - * PURPOSE: Processes messages - * - * MESSAGES: - * - * WM_COMMAND - application menu (About dialog box) - * WM_DESTROY - destroy window - */ -LRESULT CALLBACK -MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - HGLOBAL hBuffer; - LPSTR lpBuffer; - int iEvent, cnt, ret; - char *tmpCommaLoc; - struct sockaddr_in remote_addr; - struct hostent *remote_host; - - switch (message) { - case WM_MYSCREENCHANGEBKSP: - if (!con) - break; - con->backspace = wParam; - if (con->backspace == VK_BACK) { - con->ctrl_backspace = 0x7f; - WritePrivateProfileString(INI_TELNET, INI_BACKSPACE, - INI_BACKSPACE_BS, TELNET_INI); - } - else { - con->ctrl_backspace = VK_BACK; - WritePrivateProfileString(INI_TELNET, INI_BACKSPACE, - INI_BACKSPACE_DEL, TELNET_INI); - } - GetPrivateProfileString(INI_HOSTS, INI_HOST "0", "", buf, 128, TELNET_INI); - tmpCommaLoc = strchr(buf, ','); - if (tmpCommaLoc == NULL) { - strcat (buf, ","); - tmpCommaLoc = strchr(buf, ','); - } - if (tmpCommaLoc) { - tmpCommaLoc++; - if (con->backspace == VK_BACK) - strcpy(tmpCommaLoc, INI_HOST_BS); - else - strcpy(tmpCommaLoc, INI_HOST_DEL); - } - WritePrivateProfileString(INI_HOSTS, INI_HOST "0", buf, TELNET_INI); - break; - - case WM_MYSCREENCHAR: - { - unsigned char c; - - if (!con) - break; - if (wParam == VK_BACK) - c = con->backspace; - else if (wParam == 0x7f) - c = con->ctrl_backspace; - else if (wParam == VK_SPACE && GetKeyState(VK_CONTROL) < 0) - c = 0; - else - c = wParam; - TelnetSend(con->ks, &c, 1, 0); - } - break; - - case WM_MYCURSORKEY: - /* Acts as a send through: buffer is lParam and length in wParam */ - if (!con) - break; - memcpy(buf, (char *)lParam, wParam); - TelnetSend (con->ks, buf, wParam, 0); - break; - - case WM_MYSCREENBLOCK: - if (!con) - break; - hBuffer = (HGLOBAL) wParam; - lpBuffer = GlobalLock(hBuffer); - TelnetSend(con->ks, lpBuffer, lstrlen(lpBuffer), 0); - GlobalUnlock(hBuffer); - break; - - case WM_MYSCREENCLOSE: -#if 0 - if (con) - { - kstream_destroy(con->ks); - con->ks = NULL; - } -#endif - DestroyWindow(hWnd); - break; - - case WM_QUERYOPEN: - return(0); - break; - - case WM_DESTROY: /* message: window being destroyed */ - if (con) - { - kstream_destroy(con->ks); - free(con); - WSACleanup(); - } - PostQuitMessage(0); - break; - - case WM_NETWORKEVENT: - iEvent = WSAGETSELECTEVENT(lParam); - - switch (iEvent) { - - case FD_READ: - if (con == NULL) - break; - cnt = kstream_read(con->ks, buf, 1500); - buf[cnt] = 0; - parse((CONNECTION *)con, (unsigned char *)buf, cnt); - ScreenEm(buf, cnt, con->pScreen); - break; - - case FD_CLOSE: - kstream_destroy(con->ks); - free(con); - con = NULL; - WSACleanup(); - PostQuitMessage(0); - break; - - case FD_CONNECT: - ret = WSAGETSELECTERROR(lParam); - if (ret) { - wsprintf(buf, "Error %d on Connect", ret); - MessageBox(NULL, buf, NULL, MB_OK | MB_ICONEXCLAMATION); - kstream_destroy(con->ks); - free(con); - WSACleanup(); - PostQuitMessage(0); - break; - } - start_negotiation(con->ks); - break; - } - - break; - - case WM_HOSTNAMEFOUND: - ret = WSAGETASYNCERROR(lParam); - if (ret) { - wsprintf(buf, "Error %d on GetHostbyName", ret); - MessageBox(NULL, buf, NULL, MB_OK | MB_ICONEXCLAMATION); - kstream_destroy(con->ks); - free(con); - WSACleanup(); - PostQuitMessage(0); - break; - } - - remote_host = (struct hostent *)hostdata; - remote_addr.sin_family = AF_INET; - memcpy(&(remote_addr.sin_addr), &(remote_host->h_addr[0]), 4); - remote_addr.sin_port = htons(port_no); - - connect(con->socket, (struct sockaddr *)&remote_addr, sizeof(struct sockaddr)); - break; - - case WM_MYSCREENSIZE: - con->width = LOWORD(lParam); /* width in characters */ - con->height = HIWORD(lParam); /* height in characters */ - if (con->bResizeable && con->ks) - send_naws(con); - wsprintf(buf, "%d", con->height); - WritePrivateProfileString(INI_TELNET, INI_HEIGHT, buf, TELNET_INI); - wsprintf(buf, "%d", con->width); - WritePrivateProfileString(INI_TELNET, INI_WIDTH, buf, TELNET_INI); - break; - - default: /* Passes it on if unproccessed */ - return(DefWindowProc(hWnd, message, wParam, lParam)); - } - return (0); -} - - -/* - * - * FUNCTION: SaveHostName(hostname, port) - * - * PURPOSE: Saves the currently selected host name and port number - * in the KERBEROS.INI file and returns the preferred backspace - * setting if one exists for that host. - * - * RETURNS: VK_BACK or 0x7f depending on the desired backspace setting. - */ -int -SaveHostName(char *host, int port) -{ - char buf[128]; /* Scratch buffer */ - char fullhost[128]; /* Host & port combination */ - char hostName[10][128]; /* Entries from INI files */ - char *comma; /* For parsing del/bs info */ - int len; /* Length of fullhost */ - int n; /* Number of items written */ - int i; /* Index */ - int bs; /* What we return */ - - if (port == 23) /* Default telnet port */ - strcpy(fullhost, host); /* ...then don't add it on */ - else - wsprintf(fullhost, "%s %d", host, port); - len = strlen(fullhost); - - comma = NULL; - for (i = 0; i < 10; i++) { - wsprintf(buf, INI_HOST "%d", i); /* INI item to fetch */ - GetPrivateProfileString(INI_HOSTS, buf, "", hostName[i], - 128, TELNET_INI); - - if (!hostName[i][0]) - break; - - if (strncmp (hostName[i], fullhost, len)) /* A match?? */ - continue; /* Nope, keep going */ - comma = strchr (hostName[i], ','); - } - - if (comma) { - ++comma; /* Past the comma */ - while (*comma == ' ') /* Past leading white space */ - ++comma; - bs = VK_BACK; /* Default for unknown entry */ - if (_stricmp(comma, INI_HOST_DEL) == 0) - bs = 0x7f; - } - else { /* No matching entry */ - GetPrivateProfileString(INI_TELNET, INI_BACKSPACE, INI_BACKSPACE_BS, - buf, sizeof(buf), TELNET_INI); - bs = VK_BACK; /* Default value */ - if (_stricmp(buf, INI_BACKSPACE_DEL) == 0) - bs = 0x7f; - } - - /* - * Build up default host name - */ - strcpy(buf, fullhost); - strcat(buf, ", "); - strcat(buf, (bs == VK_BACK) ? INI_BACKSPACE_BS : INI_BACKSPACE_DEL); - WritePrivateProfileString(INI_HOSTS, INI_HOST "0", buf, TELNET_INI); - - n = 0; - for (i = 0; i < 10; i++) { - if (!hostName[i][0]) /* End of the list? */ - break; - if (strncmp(hostName[i], fullhost, len) != 0) { - wsprintf(buf, INI_HOST "%d", ++n); - WritePrivateProfileString(INI_HOSTS, buf, hostName[i], TELNET_INI); - } - } - return(bs); -} - - -int -OpenTelnetConnection(void) -{ - int nReturn, ret; - struct sockaddr_in sockaddr; - char *p; - static struct kstream_crypt_ctl_block ctl; - char buf[128]; - - tmpConfig = calloc(sizeof(CONFIG), 1); - - if (bAutoConnection) { - tmpConfig->title = calloc(lstrlen(szHostName), 1); - lstrcpy(tmpConfig->title, (char *) szHostName); - } else { - nReturn = DoDialog("OPENTELNETDLG", OpenTelnetDlg); - if (nReturn == FALSE) - return(FALSE); - } - - con = (CONNECTION *) GetNewConnection(); - if (con == NULL) - return(0); - - tmpConfig->width = - GetPrivateProfileInt(INI_TELNET, INI_WIDTH, DEF_WIDTH, TELNET_INI); - - tmpConfig->height = - GetPrivateProfileInt(INI_TELNET, INI_HEIGHT, DEF_HEIGHT, TELNET_INI); - con->width = tmpConfig->width; - con->height = tmpConfig->height; - - con->backspace = SaveHostName(tmpConfig->title, port_no); - - if (con->backspace == VK_BACK) { - tmpConfig->backspace = TRUE; - con->ctrl_backspace = 0x7f; - } else { - tmpConfig->backspace = FALSE; - con->ctrl_backspace = 0x08; - } - - tmpConfig->hwndTel = hWnd; - con->pScreen = InitNewScreen(tmpConfig); - if (!con->pScreen) { - assert(FALSE); - free(con->pScreen); - free(con); - free(tmpConfig); - return(-1); - } - - ret = (SOCKET) socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - - if (ret == SOCKET_ERROR) { - wsprintf(buf, "Socket error on socket = %d!", WSAGetLastError()); - MessageBox(NULL, buf, NULL, MB_OK | MB_ICONEXCLAMATION); - if (con->pScreen != NULL) - DestroyWindow(con->pScreen->hWnd); - free(con); - free(tmpConfig); - return(-1); - } - - con->socket = ret; - - sockaddr.sin_family = AF_INET; - sockaddr.sin_addr.s_addr = htonl(INADDR_ANY); - sockaddr.sin_port = htons(0); - - ret = bind(con->socket, (struct sockaddr *) &sockaddr, - (int) sizeof(struct sockaddr_in)); - - if (ret == SOCKET_ERROR) { - wsprintf(buf, "Socket error on bind!"); - MessageBox(NULL, buf, NULL, MB_OK | MB_ICONEXCLAMATION); - if (con->pScreen != NULL) - DestroyWindow(con->pScreen->hWnd); - free(con); - free(tmpConfig); - return(-1); - } - - WSAAsyncSelect(con->socket, hWnd, WM_NETWORKEVENT, - FD_READ | FD_CLOSE | FD_CONNECT); - - lstrcpy(szHostName, tmpConfig->title); - p = strchr(szHostName, '@'); - if (p != NULL) { - *p = 0; - strcpy (szUserName, szHostName); - strcpy(szHostName, ++p); - } - - WSAAsyncGetHostByName(hWnd, WM_HOSTNAMEFOUND, szHostName, hostdata, - MAXGETHOSTSTRUCT); - - ctl.encrypt = auth_encrypt; - ctl.decrypt = auth_decrypt; - ctl.init = auth_init; - ctl.destroy = auth_destroy; - - con->ks = kstream_create_from_fd(con->socket, &ctl, NULL); - - if (con->ks == NULL) - return(-1); - - kstream_set_buffer_mode(con->ks, 0); - - return(1); -} - - -CONNECTION * -GetNewConnection(void) -{ - CONNECTION *pCon; - - pCon = calloc(sizeof(CONNECTION), 1); - if (pCon == NULL) - return NULL; - pCon->backspace = TRUE; - pCon->bResizeable = TRUE; - return(pCon); -} - - -int -DoDialog(char *szDialog, DLGPROC lpfnDlgProc) -{ - int nReturn; - - nReturn = DialogBox(hInst, szDialog, hWnd, lpfnDlgProc); - return (nReturn); -} - - -/* - * FUNCTION: OpenTelnetDlg(HWND, unsigned, WORD, LONG) - * - * PURPOSE: Processes messages for "Open New Telnet Connection" dialog box - * - * MESSAGES: - * - * WM_INITDIALOG - initialize dialog box - * WM_COMMAND - Input received - */ -INT_PTR CALLBACK -OpenTelnetDlg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) -{ - char szConnectName[256]; - HDC hDC; - int xExt, yExt; - DWORD Ext; - HWND hEdit; - int n; - int iHostNum = 0; - char tmpName[128]; - char tmpBuf[80]; - char *tmpCommaLoc; - - switch (message) { - case WM_INITDIALOG: - hDC = GetDC(hDlg); - Ext = GetDialogBaseUnits(); - xExt = (190 *LOWORD(Ext)) /4 ; - yExt = (72 * HIWORD(Ext)) /8 ; - GetPrivateProfileString(INI_HOSTS, INI_HOST "0", "", tmpName, - 128, TELNET_INI); - if (tmpName[0]) { - tmpCommaLoc = strchr(tmpName, ','); - if (tmpCommaLoc) - *tmpCommaLoc = '\0'; - SetDlgItemText(hDlg, TEL_CONNECT_NAME, tmpName); - } - hEdit = GetWindow(GetDlgItem(hDlg, TEL_CONNECT_NAME), GW_CHILD); - while (TRUE) { - wsprintf(tmpBuf, INI_HOST "%d", iHostNum++); - GetPrivateProfileString(INI_HOSTS, tmpBuf, "", tmpName, - 128, TELNET_INI); - tmpCommaLoc = strchr(tmpName, ','); - if (tmpCommaLoc) - *tmpCommaLoc = '\0'; - if (tmpName[0]) - SendDlgItemMessage(hDlg, TEL_CONNECT_NAME, CB_ADDSTRING, 0, - (LPARAM) ((LPSTR) tmpName)); - else - break; - } -#ifdef FORWARD - EnableWindow(GetDlgItem(hDlg, IDC_FORWARD), 1); - SendDlgItemMessage(hDlg, IDC_FORWARD, BM_SETCHECK, forward_flag, 0); - if (forward_flag) - EnableWindow(GetDlgItem(hDlg, IDC_FORWARDFORWARD), 1); - else - EnableWindow(GetDlgItem(hDlg, IDC_FORWARDFORWARD), 0); - SendDlgItemMessage(hDlg, IDC_FORWARDFORWARD, BM_SETCHECK, - forwardable_flag, 0); -#endif - -#ifdef ENCRYPTION - EnableWindow(GetDlgItem(hDlg, IDC_ENCRYPT), 1); - SendDlgItemMessage(hDlg, IDC_ENCRYPT, - BM_SETCHECK, encrypt_flag, 0); -#endif - - EnableWindow(GetDlgItem(hDlg, TEL_CONNECT_USERID), 1); - - SetWindowPos(hDlg, NULL, - (GetSystemMetrics(SM_CXSCREEN)/2)-(xExt/2), - (GetSystemMetrics(SM_CYSCREEN)/2)-(yExt/2), - 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW); - ReleaseDC(hDlg, hDC); - SendMessage(hEdit, WM_USER + 1, 0, 0); - SendMessage(hDlg, WM_SETFOCUS, 0, 0); - return (TRUE); - - case WM_COMMAND: - switch (wParam) { - case TEL_CANCEL: - case IDCANCEL: /* From the menu */ - EndDialog(hDlg, FALSE); - break; - -#ifdef FORWARD - case IDC_FORWARD: - forward_flag = (BOOL)SendDlgItemMessage(hDlg, IDC_FORWARD, - BM_GETCHECK, 0, 0); - if (forward_flag) - EnableWindow(GetDlgItem(hDlg, IDC_FORWARDFORWARD), 1); - else - EnableWindow(GetDlgItem(hDlg, IDC_FORWARDFORWARD), 0); - break; - - case IDC_FORWARDFORWARD: - forwardable_flag = (BOOL)SendDlgItemMessage(hDlg, IDC_FORWARDFORWARD, - BM_GETCHECK, 0, 0); - break; -#endif - -#if ENCRYPTION - case IDC_ENCRYPT: - encrypt_flag = (BOOL)SendDlgItemMessage(hDlg, IDC_ENCRYPT, - BM_GETCHECK, 0, 0); - break; -#endif - case TEL_CONNECT_USERID: - GetDlgItemText(hDlg, TEL_CONNECT_USERID, szUserName, sizeof(szUserName)); - break; - - case TEL_OK: - GetDlgItemText(hDlg, TEL_CONNECT_NAME, szConnectName, 256); - - n = parse_cmdline (szConnectName); - if (! n) { - MessageBox(hDlg, "You must enter a session name!", - NULL, MB_OK); - break; - } - tmpConfig->title = calloc(lstrlen(szHostName) + 1, 1); - lstrcpy(tmpConfig->title, szConnectName); - EndDialog(hDlg, TRUE); - break; - } - return (FALSE); - } - return(FALSE); -} - - -/* - * - * FUNCTION: TelnetSend(kstream ks, char *buf, int len, int flags) - * - * PURPOSE: This is a replacement for the WinSock send() function, to - * send a buffer of characters to an output socket. It differs - * by retrying endlessly if sending the bytes would cause - * the send() to block. observed EWOULDBLOCK - * errors when running using TCP Software's PC/TCP 3.0 stack, - * even when writing as little as 109 bytes into a socket - * that had no more than 9 bytes queued for output. Note also - * that a kstream is used during output rather than a socket - * to facilitate encryption. - * - * Eventually, for cleanliness and responsiveness, this - * routine should not loop; instead, if the send doesn't - * send all the bytes, it should put them into a buffer - * and return. Message handling code would send out the - * buffer whenever it gets an FD_WRITE message. - */ -int -TelnetSend(kstream ks, char *buf, int len, int flags) -{ - int writelen; - int origlen = len; - - while (TRUE) { - writelen = kstream_write(ks, buf, len); - - if (writelen == len) /* Success, first or Nth time */ - return (origlen); - - if (writelen == SOCKET_ERROR) { - if (WSAGetLastError() != WSAEWOULDBLOCK) - return (SOCKET_ERROR); /* Some error */ - /* For WOULDBLOCK, immediately repeat the send. */ - } - else { - /* Partial write; update the pointers and retry. */ - len -= writelen; - buf += writelen; - } - } -} - - -/* - * Function: Trim leading and trailing white space from a string. - * - * Parameters: - * s - the string to trim. - */ -void -trim(char *s) -{ - int l; - int i; - - for (i = 0; s[i]; i++) - if (s[i] != ' ' && s[i] != '\t') - break; - - l = strlen(&s[i]); - memmove(s, &s[i], l + 1); - - for (l--; l >= 0; l--) { - if (s[l] != ' ' && s[l] != '\t') - break; - } - s[l + 1] = 0; -} - - -/* - * - * Parse_cmdline - * - * Reads hostname and port number off the command line. - * - * Formats: telnet - * telnet - * telnet - * telnet -p - * - * Returns: TRUE if we have a hostname - */ -BOOL -parse_cmdline(char *cmdline) -{ - char *ptr; - - *szHostName = '\0'; /* Nothing yet */ - if (*cmdline == '\0') /* Empty command line? */ - return(FALSE); - - trim (cmdline); /* Remove excess spaces */ - ptr = strchr (cmdline, ' '); /* Find 2nd token */ - - if (ptr != NULL) { /* Port number given */ - *ptr++ = '\0'; /* Separate into 2 words */ - port_no = atoi (ptr); - } - - if (*cmdline != '-' && *cmdline != '/') { /* Host name given */ - lstrcpy (szHostName, cmdline); - return(TRUE); - } - - return(FALSE); -} - -#ifdef DEBUG -void -hexdump(char *msg, unsigned char *st, int cnt) -{ - int i; - char strTmp[128]; - - OutputDebugString("\r\n"); - if (msg != NULL) { - OutputDebugString(msg); - OutputDebugString("\r\n"); - } - for(i = 0 ; i < cnt ; i++) { - int j; - - for(j = 0 ; (j < 16) && ((i + j) < cnt) ; j++) { - wsprintf(strTmp,"%02x ", st[i + j]); - if (j == 8) - OutputDebugString("| "); - OutputDebugString(strTmp); - } - i += j - 1; - OutputDebugString("\r\n"); - } /* end for */ -} -#endif diff --git a/src/windows/wintel/telnet.def b/src/windows/wintel/telnet.def deleted file mode 100644 index e2d2ab93ff..0000000000 --- a/src/windows/wintel/telnet.def +++ /dev/null @@ -1,39 +0,0 @@ -; module-definition file for testdll -- used by LINK.EXE -NAME TELNET -DESCRIPTION 'Sample Microsoft Windows Application' -EXETYPE WINDOWS -STUB 'WINSTUB.EXE' -SEGMENTS _TEXT CLASS 'CODE' PRELOAD -CODE DISCARDABLE -DATA PRELOAD MOVEABLE MULTIPLE -HEAPSIZE 10240 - -; All functions that will be called by any Windows routine -; MUST be exported. - -EXPORTS - MainWndProc @1 ; name of window processing function - OpenTelnetDlg @3 ; name of "Open New Telnet Connection" Dialog Function - -IMPORTS - WINSOCK.WSAStartup - WINSOCK.WSACleanup - WINSOCK.WSAAsyncSelect - WINSOCK.WSAGetLastError - WINSOCK.WSAAsyncGetHostByName - WINSOCK.listen - WINSOCK.accept - WINSOCK.__wsafdisset - WINSOCK.socket - WINSOCK.bind - WINSOCK.gethostbyname - WINSOCK.getsockname - WINSOCK.htons - WINSOCK.connect - WINSOCK.recv - WINSOCK.send - WINSOCK.htonl - WINSOCK.closesocket - WINSOCK.select - WINSOCK.ioctlsocket - WINSOCK.getpeername diff --git a/src/windows/wintel/telnet.h b/src/windows/wintel/telnet.h deleted file mode 100644 index cd1904a140..0000000000 --- a/src/windows/wintel/telnet.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef TELNET_H_INC -#define TELNET_H_INC - -#include -#include - -#ifdef KRB5 -#include "krb5.h" -#include "k5stream.h" -#endif - -#include "dialog.h" -#include "screen.h" -#include "struct.h" -#include "wt-proto.h" -#include "winsock.h" -#include "ini.h" - -/* globals */ -extern char szAutoHostName[64]; -extern char szUserName[64]; -extern char szHostName[64]; - -#ifdef KRB5 -extern krb5_context k5_context; -#endif - -extern void parse(CONNECTION *, unsigned char *, int); - -extern void send_naws(CONNECTION *); - -extern char strTmp[1024]; - -#define DEF_WIDTH 80 -#define DEF_HEIGHT 24 - -#ifdef DEBUG -void hexdump(char *, unsigned char *, int); -#endif - -#endif /* TELNET_H_INC */ diff --git a/src/windows/wintel/telnet.rc b/src/windows/wintel/telnet.rc deleted file mode 100644 index 6fd62c21eb..0000000000 --- a/src/windows/wintel/telnet.rc +++ /dev/null @@ -1,247 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -// XXX since modified by hand... - -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "dialog.h" -#include "screen.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -OPENTELNETDLG DIALOG DISCARDABLE 63, 65, 175, 129 -#ifdef _WIN32 -STYLE DS_ABSALIGN | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | - WS_SYSMENU -#else -STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -#endif -CAPTION "Open New Telnet Connection" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "To Host:",IDC_STATIC,3,10,33,10,NOT WS_GROUP - COMBOBOX TEL_CONNECT_NAME,37,9,128,76,CBS_DROPDOWN | WS_VSCROLL | - WS_GROUP | WS_TABSTOP - CONTROL "Forward credentials",IDC_FORWARD,"Button", - BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,37,28,77,10 - CONTROL "Forward remote credentials",IDC_FORWARDFORWARD,"Button", - BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,37,44,101,10 - CONTROL "Enable encryption",IDC_ENCRYPT,"Button",BS_AUTOCHECKBOX | - WS_DISABLED | WS_TABSTOP,37,60,73,10 - CONTROL "Connect as userid",IDC_STATIC,"Static", - SS_LEFTNOWORDWRAP,15,84,58,8 - EDITTEXT TEL_CONNECT_USERID,77,82,80,13,ES_AUTOHSCROLL | - WS_DISABLED - DEFPUSHBUTTON "OK",TEL_OK,20,106,51,14,WS_GROUP - PUSHBUTTON "Cancel",TEL_CANCEL,106,106,51,14 -END - -ABOUTBOX DIALOG DISCARDABLE 69, 33, 175, 148 -STYLE DS_ABSALIGN | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "About TCPwin" -BEGIN - ICON "NCSA",-1,15,12,16,16 - CTEXT "Microsoft Windows",-1,48,11,93,8 - CTEXT "NCSA TCP/IP Networking Kernel",-1,38,21,120,8 - CTEXT "Version 1.0b2",-1,20,31,144,8 - PUSHBUTTON "OK",IDOK,72,126,39,14,WS_GROUP | NOT WS_TABSTOP - CTEXT "Written By:",606,20,50,144,8 - CTEXT "Jon Mittelhauser (jonm@ncsa.uiuc.edu)",607,20,61,144,8 - CTEXT "Chris Wilson (cwilson@ncsa.uiuc.edu)",608,20,71,144,8 - CTEXT "Special Thanks to:",609,21,97,143,8 - CTEXT "Joe Lepore for DPMI interface code",610,20,107,144,8 - CTEXT "Keberized by: Cygnus Support",611,20,82,144,8 -END - -CONFIG_DLG DIALOG DISCARDABLE 6, 18, 160, 130 -STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Configure Session" -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "Session Name:",301,1,5,54,8 - LTEXT "Default Session",CON_SESSIONNAME,55,5,105,8 - LTEXT "Window Title:",303,1,17,49,8 - EDITTEXT CON_WINDOWTITLE,53,15,102,12,ES_AUTOHSCROLL - CONTROL "132",CON_COLUMNS132,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,53,33,39,10 - CONTROL "80",CON_COLUMNS80,"Button",BS_AUTORADIOBUTTON,110,33,39, - 10 - CONTROL "Backspace",CON_BACKSPACE,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,53,46,49,10 - CONTROL "Delete",CON_DELETE,"Button",BS_AUTORADIOBUTTON,110,46, - 39,10 - CONTROL "CRLF",CON_CRLF,"Button",BS_AUTORADIOBUTTON | WS_GROUP, - 53,59,39,10 - CONTROL "CR-NUL",CON_CRNUL,"Button",BS_AUTORADIOBUTTON,110,59,39, - 10 - CONTROL "Buffers",CON_BUFFERS,"Button",BS_AUTORADIOBUTTON | - WS_GROUP,53,72,39,10 - CONTROL "Sends",CON_SENDS,"Button",BS_AUTORADIOBUTTON,110,72,39, - 10 - LTEXT "Columns",313,1,33,49,8 - LTEXT "Backspace is",314,1,46,51,8 - LTEXT "Return Sends",315,1,59,49,8 - LTEXT "Echo Mode",316,1,72,49,8 - CONTROL "Scrollback",CON_SCRLBCK,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,1,86,50,10 - EDITTEXT CON_NUMLINES,53,85,28,12,ES_AUTOHSCROLL - LTEXT "lines",319,85,86,33,8 - DEFPUSHBUTTON "OK",CON_OK,20,108,50,14,WS_GROUP - PUSHBUTTON "Use Defaults",CON_USEDEFAULTS,90,108,50,14 -END - -IDM_PRINTQUEUE DIALOG DISCARDABLE 69, 25, 160, 80 -STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | - WS_VSCROLL | WS_HSCROLL | WS_SYSMENU -CAPTION "Print Queue" -FONT 8, "MS Sans Serif" -BEGIN -END - -IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 183, 92 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" -FONT 8, "MS Sans Serif" -BEGIN - DEFPUSHBUTTON "OK",IDOK,126,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,126,24,50,14 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -NCSA ICON DISCARDABLE "ncsa.ico" -TERMINAL ICON DISCARDABLE "terminal.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -SCREENMENU MENU DISCARDABLE -BEGIN - POPUP "&File" - BEGIN - MENUITEM "E&xit Alt+F4", IDM_EXIT - END - POPUP "&Edit" - BEGIN - MENUITEM "&Copy Cltr+Ins", IDM_COPY - MENUITEM "&Paste Shift+Ins", IDM_PASTE - END - POPUP "&Options" - BEGIN - MENUITEM "&Backspace", IDM_BACKSPACE - MENUITEM "&Delete", IDM_DELETE, CHECKED - MENUITEM SEPARATOR - MENUITEM "&Font...", IDM_FONT - END -#if 0 - POPUP "&Send", GRAYED - BEGIN - MENUITEM "&Interrupt Process", IDM_SEND_IP - MENUITEM "&Are You There?", IDM_SEND_AYT - MENUITEM "A&bort Process", IDM_SEND_ABORT - END -#endif - POPUP "&Help" - BEGIN - MENUITEM "&Index...", IDM_HELP_INDEX - MENUITEM SEPARATOR - MENUITEM "&About...", IDM_ABOUT - END -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""dialog.h""\r\n" - "#include ""screen.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - IDD_DIALOG1, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 176 - TOPMARGIN, 7 - BOTTOMMARGIN, 85 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - -#include "..\version.rc" diff --git a/src/windows/wintel/telnet_arpa.h b/src/windows/wintel/telnet_arpa.h deleted file mode 100644 index f6d0eb566a..0000000000 --- a/src/windows/wintel/telnet_arpa.h +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (c) 1983, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)telnet.h 8.1 (Berkeley) 6/2/93 - */ - -#ifndef _TELNET_H_ -#define _TELNET_H_ - -/* - * Definitions for the TELNET protocol. - */ -#define IAC 255 /* interpret as command: */ -#define DONT 254 /* you are not to use option */ -#define DO 253 /* please, you use option */ -#define WONT 252 /* I won't use option */ -#define WILL 251 /* I will use option */ -#define SB 250 /* interpret as subnegotiation */ -#define GA 249 /* you may reverse the line */ -#define EL 248 /* erase the current line */ -#define EC 247 /* erase the current character */ -#define AYT 246 /* are you there */ -#define AO 245 /* abort output--but let prog finish */ -#define IP 244 /* interrupt process--permanently */ -#define BREAK 243 /* break */ -#define DM 242 /* data mark--for connect. cleaning */ -#define NOP 241 /* nop */ -#define SE 240 /* end sub negotiation */ -#define EOR 239 /* end of record (transparent mode) */ -#define ABORT 238 /* Abort process */ -#define SUSP 237 /* Suspend process */ -#define xEOF 236 /* End of file: EOF is already used... */ - -#define SYNCH 242 /* for telfunc calls */ - -#ifdef TELCMDS -char *telcmds[] = { - "EOF", "SUSP", "ABORT", "EOR", - "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", - "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0, -}; -#else -extern char *telcmds[]; -#endif - -#define TELCMD_FIRST xEOF -#define TELCMD_LAST IAC -#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && \ - (unsigned int)(x) >= TELCMD_FIRST) -#define TELCMD(x) telcmds[(x)-TELCMD_FIRST] - -/* telnet options */ -#define TELOPT_BINARY 0 /* 8-bit data path */ -#define TELOPT_ECHO 1 /* echo */ -#define TELOPT_RCP 2 /* prepare to reconnect */ -#define TELOPT_SGA 3 /* suppress go ahead */ -#define TELOPT_NAMS 4 /* approximate message size */ -#define TELOPT_STATUS 5 /* give status */ -#define TELOPT_TM 6 /* timing mark */ -#define TELOPT_RCTE 7 /* remote controlled transmission and echo */ -#define TELOPT_NAOL 8 /* negotiate about output line width */ -#define TELOPT_NAOP 9 /* negotiate about output page size */ -#define TELOPT_NAOCRD 10 /* negotiate about CR disposition */ -#define TELOPT_NAOHTS 11 /* negotiate about horizontal tabstops */ -#define TELOPT_NAOHTD 12 /* negotiate about horizontal tab disposition */ -#define TELOPT_NAOFFD 13 /* negotiate about formfeed disposition */ -#define TELOPT_NAOVTS 14 /* negotiate about vertical tab stops */ -#define TELOPT_NAOVTD 15 /* negotiate about vertical tab disposition */ -#define TELOPT_NAOLFD 16 /* negotiate about output LF disposition */ -#define TELOPT_XASCII 17 /* extended ascic character set */ -#define TELOPT_LOGOUT 18 /* force logout */ -#define TELOPT_BM 19 /* byte macro */ -#define TELOPT_DET 20 /* data entry terminal */ -#define TELOPT_SUPDUP 21 /* supdup protocol */ -#define TELOPT_SUPDUPOUTPUT 22 /* supdup output */ -#define TELOPT_SNDLOC 23 /* send location */ -#define TELOPT_TTYPE 24 /* terminal type */ -#define TELOPT_EOR 25 /* end or record */ -#define TELOPT_TUID 26 /* TACACS user identification */ -#define TELOPT_OUTMRK 27 /* output marking */ -#define TELOPT_TTYLOC 28 /* terminal location number */ -#define TELOPT_3270REGIME 29 /* 3270 regime */ -#define TELOPT_X3PAD 30 /* X.3 PAD */ -#define TELOPT_NAWS 31 /* window size */ -#define TELOPT_TSPEED 32 /* terminal speed */ -#define TELOPT_LFLOW 33 /* remote flow control */ -#define TELOPT_LINEMODE 34 /* Linemode option */ -#define TELOPT_XDISPLOC 35 /* X Display Location */ -#define TELOPT_OLD_ENVIRON 36 /* Old - Environment variables */ -#define TELOPT_AUTHENTICATION 37/* Authenticate */ -#define TELOPT_ENCRYPT 38 /* Encryption option */ -#define TELOPT_NEW_ENVIRON 39 /* New - Environment variables */ -#define TELOPT_EXOPL 255 /* extended-options-list */ - - -#define NTELOPTS (1+TELOPT_NEW_ENVIRON) -#ifdef TELOPTS -char *telopts[NTELOPTS+1] = { - "BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME", - "STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP", - "NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS", - "NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO", - "DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT", - "SEND LOCATION", "TERMINAL TYPE", "END OF RECORD", - "TACACS UID", "OUTPUT MARKING", "TTYLOC", - "3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW", - "LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION", - "ENCRYPT", "NEW-ENVIRON", - 0, -}; -#define TELOPT_FIRST TELOPT_BINARY -#define TELOPT_LAST TELOPT_NEW_ENVIRON -#define TELOPT_OK(x) ((unsigned int)(x) <= TELOPT_LAST) -#define TELOPT(x) telopts[(x)-TELOPT_FIRST] -#endif - -/* sub-option qualifiers */ -#define TELQUAL_IS 0 /* option is... */ -#define TELQUAL_SEND 1 /* send option */ -#define TELQUAL_INFO 2 /* ENVIRON: informational version of IS */ -#define TELQUAL_REPLY 2 /* AUTHENTICATION: client version of IS */ -#define TELQUAL_NAME 3 /* AUTHENTICATION: client version of IS */ - -#define LFLOW_OFF 0 /* Disable remote flow control */ -#define LFLOW_ON 1 /* Enable remote flow control */ -#define LFLOW_RESTART_ANY 2 /* Restart output on any char */ -#define LFLOW_RESTART_XON 3 /* Restart output only on XON */ - -/* - * LINEMODE suboptions - */ - -#define LM_MODE 1 -#define LM_FORWARDMASK 2 -#define LM_SLC 3 - -#define MODE_EDIT 0x01 -#define MODE_TRAPSIG 0x02 -#define MODE_ACK 0x04 -#define MODE_SOFT_TAB 0x08 -#define MODE_LIT_ECHO 0x10 - -#define MODE_MASK 0x1f - -/* Not part of protocol, but needed to simplify things... */ -#define MODE_FLOW 0x0100 -#define MODE_ECHO 0x0200 -#define MODE_INBIN 0x0400 -#define MODE_OUTBIN 0x0800 -#define MODE_FORCE 0x1000 - -#define SLC_SYNCH 1 -#define SLC_BRK 2 -#define SLC_IP 3 -#define SLC_AO 4 -#define SLC_AYT 5 -#define SLC_EOR 6 -#define SLC_ABORT 7 -#define SLC_EOF 8 -#define SLC_SUSP 9 -#define SLC_EC 10 -#define SLC_EL 11 -#define SLC_EW 12 -#define SLC_RP 13 -#define SLC_LNEXT 14 -#define SLC_XON 15 -#define SLC_XOFF 16 -#define SLC_FORW1 17 -#define SLC_FORW2 18 - -#define NSLC 18 - -/* - * For backwards compatability, we define SLC_NAMES to be the - * list of names if SLC_NAMES is not defined. - */ -#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \ - "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \ - "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0, -#ifdef SLC_NAMES -char *slc_names[] = { - SLC_NAMELIST -}; -#else -extern char *slc_names[]; -#define SLC_NAMES SLC_NAMELIST -#endif - -#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC) -#define SLC_NAME(x) slc_names[x] - -#define SLC_NOSUPPORT 0 -#define SLC_CANTCHANGE 1 -#define SLC_VARIABLE 2 -#define SLC_DEFAULT 3 -#define SLC_LEVELBITS 0x03 - -#define SLC_FUNC 0 -#define SLC_FLAGS 1 -#define SLC_VALUE 2 - -#define SLC_ACK 0x80 -#define SLC_FLUSHIN 0x40 -#define SLC_FLUSHOUT 0x20 - -#define OLD_ENV_VAR 1 -#define OLD_ENV_VALUE 0 -#define NEW_ENV_VAR 0 -#define NEW_ENV_VALUE 1 -#define ENV_ESC 2 -#define ENV_USERVAR 3 - -/* - * AUTHENTICATION suboptions - */ - -/* - * Who is authenticating who ... - */ -#define AUTH_WHO_CLIENT 0 /* Client authenticating server */ -#define AUTH_WHO_SERVER 1 /* Server authenticating client */ -#define AUTH_WHO_MASK 1 - -/* - * amount of authentication done - */ -#define AUTH_HOW_ONE_WAY 0 -#define AUTH_HOW_MUTUAL 2 -#define AUTH_HOW_MASK 2 - -/* - * should we be encrypting? (not yet formally standardized) - */ -#define AUTH_ENCRYPT_OFF 0 -#define AUTH_ENCRYPT_ON 4 -#define AUTH_ENCRYPT_MASK 4 - -#define AUTHTYPE_NULL 0 -#define AUTHTYPE_KERBEROS_V4 1 -#define AUTHTYPE_KERBEROS_V5 2 -#define AUTHTYPE_SPX 3 -#define AUTHTYPE_MINK 4 -#define AUTHTYPE_CNT 5 - -#define AUTHTYPE_TEST 99 - -#ifdef AUTH_NAMES -char *authtype_names[] = { - "NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0, -}; -#else -extern char *authtype_names[]; -#endif - -#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT) -#define AUTHTYPE_NAME(x) authtype_names[x] - -/* - * ENCRYPTion suboptions - */ -#define ENCRYPT_IS 0 /* I pick encryption type ... */ -#define ENCRYPT_SUPPORT 1 /* I support encryption types ... */ -#define ENCRYPT_REPLY 2 /* Initial setup response */ -#define ENCRYPT_START 3 /* Am starting to send encrypted */ -#define ENCRYPT_END 4 /* Am ending encrypted */ -#define ENCRYPT_REQSTART 5 /* Request you start encrypting */ -#define ENCRYPT_REQEND 6 /* Request you send encrypting */ -#define ENCRYPT_ENC_KEYID 7 -#define ENCRYPT_DEC_KEYID 8 -#define ENCRYPT_CNT 9 - -#define ENCTYPE_ANY 0 -#define ENCTYPE_DES_CFB64 1 -#define ENCTYPE_DES_OFB64 2 -#define ENCTYPE_CNT 3 - -#ifdef ENCRYPT_NAMES -char *encrypt_names[] = { - "IS", "SUPPORT", "REPLY", "START", "END", - "REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID", - 0, -}; -char *enctype_names[] = { - "ANY", "DES_CFB64", "DES_OFB64", 0, -}; -#else -extern char *encrypt_names[]; -extern char *enctype_names[]; -#endif - - -#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT) -#define ENCRYPT_NAME(x) encrypt_names[x] - -#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT) -#define ENCTYPE_NAME(x) enctype_names[x] - -#endif /* !_TELNET_H_ */ diff --git a/src/windows/wintel/telopts.h b/src/windows/wintel/telopts.h deleted file mode 100644 index d8b6a06d25..0000000000 --- a/src/windows/wintel/telopts.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * telopts.h - * Used for telnet options - **************************************************************************** - * * - * * - * NCSA Telnet * - * by Tim Krauskopf, VT100 by Gaige Paulsen, Tek by Aaron Contorer * - * Additions by Kurt Mahan, Heeren Pathak, & Quincey Koziol * - * * - * National Center for Supercomputing Applications * - * 152 Computing Applications Building * - * 605 E. Springfield Ave. * - * Champaign, IL 61820 * - * * - **************************************************************************** - * Quincey Koziol - * Defines for telnet options and related things - */ - -#ifndef TELOPTS_H -#define TELOPTS_H - -#define NUMLMODEOPTIONS 30 - -/* Definitions for telnet protocol */ - -#define STNORM 0 - -/* Definition of the lowest telnet byte following an IAC byte */ -#define LOW_TEL_OPT 236 - -#define TEL_EOF 236 -#define SUSP 237 -#define ABORT 238 - -#define SE 240 -#define NOP 241 -#define DM 242 -#define BREAK 243 -#define IP 244 -#define AO 245 -#define AYT 246 -#define EC 247 -#define EL 248 -#define GOAHEAD 249 -#define SB 250 -#define WILLTEL 251 -#define WONTTEL 252 -#define DOTEL 253 -#define DONTTEL 254 -#define IAC 255 - -/* Assigned Telnet Options */ -#define BINARY 0 -#define ECHO 1 -#define RECONNECT 2 -#define SGA 3 -#define AMSN 4 -#define STATUS 5 -#define TIMING 6 -#define RCTAN 7 -#define OLW 8 -#define OPS 9 -#define OCRD 10 -#define OHTS 11 -#define OHTD 12 -#define OFFD 13 -#define OVTS 14 -#define OVTD 15 -#define OLFD 16 -#define XASCII 17 -#define LOGOUT 18 -#define BYTEM 19 -#define DET 20 -#define SUPDUP 21 -#define SUPDUPOUT 22 -#define SENDLOC 23 -#define TERMTYPE 24 -#define EOR 25 -#define TACACSUID 26 -#define OUTPUTMARK 27 -#define TERMLOCNUM 28 -#define REGIME3270 29 -#define X3PAD 30 -#define NAWS 31 -#define TERMSPEED 32 -#define TFLOWCNTRL 33 -#define LINEMODE 34 - -#define MODE 1 -#define MODE_EDIT 1 -#define MODE_TRAPSIG 2 -#define MODE_ACK 4 -#define MODE_SOFT_TAB 8 -#define MODE_LIT_ECHO 16 - -#define FORWARDMASK 2 - -#define SLC 3 -#define SLC_DEFAULT 3 -#define SLC_VALUE 2 -#define SLC_CANTCHANGE 1 -#define SLC_NOSUPPORT 0 -#define SLC_LEVELBITS 3 - -#define SLC_ACK 128 -#define SLC_FLUSHIN 64 -#define SLC_FLUSHOUT 32 - -#define SLC_SYNCH 1 -#define SLC_BRK 2 -#define SLC_IP 3 -#define SLC_AO 4 -#define SLC_AYT 5 -#define SLC_EOR 6 -#define SLC_ABORT 7 -#define SLC_EOF 8 -#define SLC_SUSP 9 -#define SLC_EC 10 -#define SLC_EL 11 -#define SLC_EW 12 -#define SLC_RP 13 -#define SLC_LNEXT 14 -#define SLC_XON 15 -#define SLC_XOFF 16 -#define SLC_FORW1 17 -#define SLC_FORW2 18 -#define SLC_MCL 19 -#define SLC_MCR 20 -#define SLC_MCWL 21 -#define SLC_MCWR 22 -#define SLC_MCBOL 23 -#define SLC_MCEOL 24 -#define SLC_INSRT 25 -#define SLC_OVER 26 -#define SLC_ECR 27 -#define SLC_EWR 28 -#define SLC_EBOL 29 -#define SLC_EEOL 30 - -#define XDISPLOC 35 -#define ENVIRONMENT 36 -#define AUTHENTICATION 37 -#define TELOPT_AUTHENTICATION AUTHENTICATION -#define DATA_ENCRYPTION 38 -#define XOPTIONS 255 - -#define LINEMODE_MODES_SUPPORTED 0x1B -/* - * set this flag for linemode special functions which are supported by - * Telnet, even though they are not currently active. This is to allow - * the other side to negotiate to a "No Support" state for an option - * and then change later to supporting it, so we know it's ok to change - * our "No Support" state to something else ("Can't Change", "Value", - * whatever) - */ -#define SLC_SUPPORTED 0x10 - -#define ESCFOUND 5 -#define IACFOUND 6 -#define NEGOTIATE 1 - -#endif /* telopts.h */ diff --git a/src/windows/wintel/terminal.ico b/src/windows/wintel/terminal.ico deleted file mode 100644 index 7ec59e980f..0000000000 Binary files a/src/windows/wintel/terminal.ico and /dev/null differ diff --git a/src/windows/wintel/wt-proto.h b/src/windows/wintel/wt-proto.h deleted file mode 100644 index 15b9c1a8e9..0000000000 --- a/src/windows/wintel/wt-proto.h +++ /dev/null @@ -1,63 +0,0 @@ -/* wt-proto.h */ -BOOL -InitApplication( - HINSTANCE - ); - -BOOL -InitInstance( - HINSTANCE, - int - ); - -LRESULT -CALLBACK -MainWndProc( - HWND, - UINT, - WPARAM, - LPARAM - ); - -INT_PTR -CALLBACK -OpenTelnetDlg( - HWND, - UINT, - WPARAM, - LPARAM - ); - -int -TelnetSend( - kstream, - char *, - int, - int - ); - -int -OpenTelnetConnection( - void - ); - -int -DoDialog( - char *szDialog, - DLGPROC lpfnDlgProc - ); - -BOOL -parse_cmdline( - char *cmdline - ); - -CONNECTION * -GetNewConnection( - void - ); - -void -start_negotiation( - kstream ks - );