Skip to content

Commit

Permalink
Prune Leash sources
Browse files Browse the repository at this point in the history
When Leash was imported in 2011-2012, some of its functionality was
removed either at compile-time or runtime--most notably krb4 support,
AFS integration, and editing of "properties" (registry values).
Remove most of the unnecessary material.
  • Loading branch information
greghudson committed Jun 3, 2018
1 parent fff6a3e commit 0e2a5b2
Show file tree
Hide file tree
Showing 214 changed files with 50 additions and 15,354 deletions.
10 changes: 0 additions & 10 deletions src/windows/include/leashwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@
#define __LEASHWIN__

////Is this sufficient?
#ifndef NO_KRB4
#include <krb.h>
#else
#include <krb5.h>
#define ANAME_SZ 40
#define REALM_SZ 40
#define SNAME_SZ 40
#define INST_SZ 40
/* include space for '.' and '@' */
#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2)
#endif

#define DLGTYPE_PASSWD 0
#define DLGTYPE_CHPASSWD 1
Expand Down Expand Up @@ -185,9 +181,6 @@ DWORD Leash_reset_default_proxiable();
DWORD Leash_get_default_publicip();
DWORD Leash_set_default_publicip(DWORD ipv4addr);
DWORD Leash_reset_default_publicip();
DWORD Leash_get_default_use_krb4();
DWORD Leash_set_default_use_krb4(DWORD onoff);
DWORD Leash_reset_default_use_krb4();
DWORD Leash_get_hide_kinit_options();
DWORD Leash_set_hide_kinit_options(DWORD onoff);
DWORD Leash_reset_hide_kinit_options();
Expand All @@ -203,9 +196,6 @@ DWORD Leash_reset_default_renew_min();
DWORD Leash_get_default_renew_max();
DWORD Leash_set_default_renew_max(DWORD minutes);
DWORD Leash_reset_default_renew_max();
DWORD Leash_get_lock_file_locations();
DWORD Leash_set_lock_file_locations(DWORD onoff);
DWORD Leash_reset_lock_file_locations();
DWORD Leash_get_default_uppercaserealm();
DWORD Leash_set_default_uppercaserealm(DWORD onoff);
DWORD Leash_reset_default_uppercaserealm();
Expand Down
36 changes: 0 additions & 36 deletions src/windows/include/loadfuncs-leash.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,24 +204,6 @@ TYPEDEF_FUNC(
Leash_reset_default_publicip,
(void)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Leash_get_default_use_krb4,
(void)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Leash_set_default_use_krb4,
(DWORD)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Leash_reset_default_use_krb4,
(void)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Expand Down Expand Up @@ -312,24 +294,6 @@ TYPEDEF_FUNC(
Leash_reset_default_renewable,
(void)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Leash_get_lock_file_locations,
(void)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Leash_set_lock_file_locations,
(DWORD)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Leash_reset_lock_file_locations,
(void)
);
TYPEDEF_FUNC(
DWORD,
CALLCONV_C,
Expand Down
18 changes: 0 additions & 18 deletions src/windows/installer/wix/config.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@
<?endif?>

<!-- Configuration macros -->
<?ifndef LeashAfsStatus?>
<?define LeashAfsStatus="1"?>
<?endif?>
<?ifndef LeashCreateMissingConfig?>
<?define LeashCreateMissingConfig="0"?>
<?endif?>
Expand Down Expand Up @@ -136,9 +133,6 @@
<?ifndef LeashPublicIp?>
<?define LeashPublicIp="0"?>
<?endif?>
<?ifndef LeashUseKrb4?>
<?define LeashUseKrb4="1"?>
<?endif?>
<?ifndef LeashHideKinitOptions?>
<?define LeashHideKinitOptions="0"?>
<?endif?>
Expand All @@ -164,18 +158,6 @@
<?define LeashPreserveKinitOptions="0"?>
<?endif?>
<!-- These actually have no defaults. -->
<?ifndef Krb4KrbRealms?>
<?define Krb4KrbRealms=""?>
<?endif?>
<?ifndef Krb4KrbConf?>
<?define Krb4KrbConf=""?>
<?endif?>
<?ifndef Krb4ConfigDir?>
<?define Krb4ConfigDir=""?>
<?endif?>
<?ifndef Krb4TicketFile?>
<?define Krb4TicketFile=""?>
<?endif?>
<?ifndef Krb5Config?>
<?define Krb5Config=""?>
<?endif?>
Expand Down
3 changes: 0 additions & 3 deletions src/windows/installer/wix/features.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,8 @@
<ComponentRef Id="rcm_krb5_3" />

<!-- Leash config options -->
<ComponentRef Id="rcm_leash_1" />
<ComponentRef Id="rcm_leash_2" />
<ComponentRef Id="rcm_leash_3" />
<ComponentRef Id="rcm_leash_5" />
<ComponentRef Id="rcm_leash_6" />

<ComponentRef Id="cmf_leash32_chm" />
Expand All @@ -116,7 +114,6 @@
<ComponentRef Id="rcm_leashdll_5" />
<ComponentRef Id="rcm_leashdll_6" />
<ComponentRef Id="rcm_leashdll_7" />
<ComponentRef Id="rcm_leashdll_8" />
<ComponentRef Id="rcm_leashdll_9" />
<ComponentRef Id="rcm_leashdll_10" />
<ComponentRef Id="rcm_leashdll_11" />
Expand Down
12 changes: 0 additions & 12 deletions src/windows/installer/wix/files.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@
</Component> -->

<!-- Leash32 configuration -->
<Component Win64="$(var.Win64)" Id="rcm_leash_1" Guid="$(var.rcm_leash_1_guid)" DiskId="1">
<RegistryValue Id="reg_leash_1" Root="HKLM" Key="Software\MIT\Leash32\Settings" Name="AfsStatus" Type="integer" Value="[LEASHAFSSTATUS]" KeyPath="yes"/>
<Condition>LEASHAFSSTATUS</Condition>
</Component>
<Component Win64="$(var.Win64)" Id="rcm_leash_2" Guid="$(var.rcm_leash_2_guid)" DiskId="1">
<RegistryValue Id="reg_leash_2" Root="HKLM" Key="Software\MIT\Leash32\Settings" Name="createmissingconfig" Type="integer" Value="[LEASHCREATEMISSINGCONFIG]" KeyPath="yes"/>
<Condition>LEASHCREATEMISSINGCONFIG</Condition>
Expand All @@ -189,10 +185,6 @@
<RegistryValue Id="reg_leash_3" Root="HKLM" Key="Software\MIT\Leash32\Settings" Name="AutoRenewTickets" Type="integer" Value="[LEASHAUTORENEWTICKETS]" KeyPath="yes"/>
<Condition>LEASHAUTORENEWTICKETS</Condition>
</Component>
<Component Win64="$(var.Win64)" Id="rcm_leash_5" Guid="$(var.rcm_leash_5_guid)" DiskId="1">
<RegistryValue Id="reg_leash_5" Root="HKLM" Key="Software\MIT\Leash" Name="lock_file_locations" Type="integer" Value="[LEASHLOCKFILELOCATIONS]" KeyPath="yes"/>
<Condition>LEASHLOCKFILELOCATIONS</Condition>
</Component>
<Component Win64="$(var.Win64)" Id="rcm_leash_6" Guid="$(var.rcm_leash_6_guid)" DiskId="1">
<RegistryValue Id="reg_leash_6" Root="HKLM" Key="Software\MIT\Leash" Name="MsLsaImport" Type="integer" Value="[LEASHMSLSAIMPORT]" KeyPath="yes"/>
<Condition>LEASHMSLSAIMPORT</Condition>
Expand Down Expand Up @@ -239,10 +231,6 @@
<RegistryValue Id="reg_leashdll_7" Root="HKLM" Key="Software\MIT\Leash" Name="publicip" Type="integer" Value="[LEASHPUBLICIP]" KeyPath="yes"/>
<Condition>LEASHPUBLICIP</Condition>
</Component>
<Component Win64="$(var.Win64)" Id="rcm_leashdll_8" Guid="$(var.rcm_leashdll_8_guid)" DiskId="1">
<RegistryValue Id="reg_leashdll_8" Root="HKLM" Key="Software\MIT\Leash" Name="usekrb4" Type="integer" Value="[LEASHUSEKRB4]" KeyPath="yes"/>
<Condition>LEASHUSEKRB4</Condition>
</Component>
<Component Win64="$(var.Win64)" Id="rcm_leashdll_9" Guid="$(var.rcm_leashdll_9_guid)" DiskId="1">
<RegistryValue Id="reg_leashdll_9" Root="HKLM" Key="Software\MIT\Leash" Name="hide_kinit_options" Type="integer" Value="[LEASHHIDEKINITOPTIONS]" KeyPath="yes"/>
<Condition>LEASHHIDEKINITOPTIONS</Condition>
Expand Down
81 changes: 1 addition & 80 deletions src/windows/installer/wix/msi-deployment-guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,6 @@ Kerberos for Windows

2.1.2 Leash GUI properties

LEASHAFSSTATUS
Setting: afs token retrieval
Values : '0' or '1'

LEASHCREATEMISSINGCONFIG
Setting: automatic generation of missing configuration files
Values : '0' or '1'
Expand All @@ -184,10 +180,6 @@ Kerberos for Windows
Setting: automatic ticket renewal
Values : '0' or '1'

LEASHLOCKFILELOCATIONS
Setting: lock configuration files location
Values : '0' or '1'

LEASHMSLSAIMPORT
Setting: automatic importation of MSLSA credentials
Values : '0', '1' or '2'
Expand Down Expand Up @@ -222,10 +214,6 @@ Kerberos for Windows
Setting: default public ipv4 address
Values : numeric

LEASHUSEKRB4
Setting: request kerberos iv tickets
Values : '0' or '1'

LEASHHIDEKINITOPTIONS
Setting: hide advanced kinit options in dialog
Values : '0' or '1'
Expand Down Expand Up @@ -258,22 +246,7 @@ Kerberos for Windows
Setting: Preserve ticket initialization dialog options
Values : numeric

2.1.4 Kerberos 4 properties

KRB4KRBREALMS (realms full pathname)
KRB4KRBCONF (config full pathname)
KRB4KRBCONFIDIR (dir for both files)
Setting: location of krbrealm & krbconf
Values : string
(note that the three registry settings are conditioned
independently. I.e. If you only set KRB4KRBCONF, only the
krb.conf setting will be written.)

KRB4TICKETFILE
Setting: ticket file
Values : string

2.1.5 Kerberos 5 properties
2.1.4 Kerberos 5 properties

KRB5CONFIG
Setting: location of krb5.ini
Expand Down Expand Up @@ -638,7 +611,6 @@ Kerberos for Windows

Krb5Cred : Kerberos 5 credentials provider
Krb5Ident: Kerberos 5 Identity provider
Krb4Cred : Kerberos 4 credentials provider

Consult the vendors for the plug-in names of other third party
plug-ins. Additionally, the plug-ins configuration panel in the
Expand Down Expand Up @@ -804,57 +776,6 @@ Kerberos for Windows
Obtain renewable tickets.


3.1.4 Settings for the Kerberos 4 Credentials Provider Plug-in

Registry key 1: 'Software\MIT\NetIDMgr\KCDB\Identity\<principal name>\Krb4Cred'
Registry key 2: 'Software\MIT\NetIDMgr\PluginManager\Plugins\Krb4Cred\Parameters'
---------------

Theses settings are also maintained per identity. However, if the
setting is not specified for some identity or if the identity is
new, then the global default will be used (registry key 2).
Global defaults should be set in the second registry key.

Value : Krb4NewCreds
Type : DWORD (0 or 1)
Default : 1

If '1', obtains Kerberos 4 credentials. Note that currently,
only one identity can have Kerberos 4 credentials at one time.

Value : Krb4Method
Type : DWORD (0, 1 or 2)
Default : 0

Method for obtaining Kerberos 4 credentials. The values are
as follows:

0 : Automatically determine method
1 : Use password
2 : Use Kerberos 5 to 4 translation

Value : DefaultLifetime
Type : DWORD
Default : 36000

The default ticket lifetime, in seconds.

Value : MaxLifetime
Type : DWORD
Default : 86400

Maximum lifetime, in seconds. This value is used to set the
range of the user interface controls that allow setting the
lifetime.

Value : MinLifetime
Type : DWORD
Default : 60

Minimum lifetime, in seconds. This value is used to set the
range of the user interface controls that allow setting the
lifetime.

----------------------------------------------------------------------

4. Additional Resources
Expand Down
7 changes: 0 additions & 7 deletions src/windows/installer/wix/property.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@
variable value is the empty string (""), then the properties will
not be defined. -->
<?ifdef UseDefaultProperties?>
<Property Id="LEASHAFSSTATUS" Admin="yes" Secure="yes">$(var.LeashAfsStatus)</Property>
<Property Id="LEASHCREATEMISSINGCONFIG" Admin="yes" Secure="yes">$(var.LeashCreateMissingConfig)</Property>
<Property Id="LEASHAUTORENEWTICKETS" Admin="yes" Secure="yes">$(var.LeashAutoRenewTickets)</Property>
<Property Id="LEASHLOCKFILELOCATIONS" Admin="yes" Secure="yes">$(var.LeashLockFileLocations)</Property>
<Property Id="LEASHMSLSAIMPORT" Admin="yes" Secure="yes">$(var.LeashMsLsaImport)</Property>
<Property Id="LEASHLIFETIME" Admin="yes" Secure="yes">$(var.LeashLifetime)</Property>
<Property Id="LEASHRENEWTILL" Admin="yes" Secure="yes">$(var.LeashRenewTill)</Property>
Expand All @@ -70,7 +68,6 @@
<Property Id="LEASHNOADDRESSES" Admin="yes" Secure="yes">$(var.LeashNoAddresses)</Property>
<Property Id="LEASHPROXIABLE" Admin="yes" Secure="yes">$(var.LeashProxiable)</Property>
<Property Id="LEASHPUBLICIP" Admin="yes" Secure="yes">$(var.LeashPublicIp)</Property>
<Property Id="LEASHUSEKRB4" Admin="yes" Secure="yes">$(var.LeashUseKrb4)</Property>
<Property Id="LEASHHIDEKINITOPTIONS" Admin="yes" Secure="yes">$(var.LeashHideKinitOptions)</Property>
<Property Id="LEASHLIFEMIN" Admin="yes" Secure="yes">$(var.LeashLifeMin)</Property>
<Property Id="LEASHLIFEMAX" Admin="yes" Secure="yes">$(var.LeashLifeMax)</Property>
Expand All @@ -79,10 +76,6 @@
<Property Id="LEASHUPPERCASEREALM" Admin="yes" Secure="yes">$(var.LeashUppercaseRealm)</Property>
<Property Id="LEASHTIMEHOST" Admin="yes" Secure="yes">$(var.LeashTimeHost)</Property>
<Property Id="LEASHPRESERVEKINITOPTIONS" Admin="yes" Secure="yes">$(var.LeashPreserveKinitOptions)</Property>
<Property Id="KRB4KRBREALMS" Admin="yes" Secure="yes">$(var.Krb4KrbRealms)</Property>
<Property Id="KRB4KRBCONF" Admin="yes" Secure="yes">$(var.Krb4KrbConf)</Property>
<Property Id="KRB4CONFIGDIR" Admin="yes" Secure="yes">$(var.Krb4ConfigDir)</Property>
<Property Id="KRB4TICKETFILE" Admin="yes" Secure="yes">$(var.Krb4TicketFile)</Property>
<Property Id="KRB5CONFIG" Admin="yes" Secure="yes">$(var.Krb5Config)</Property>
<Property Id="KRB5CCNAME" Admin="yes" Secure="yes">$(var.Krb5CcName)</Property>
<Property Id="KRB5PRESERVEIDENTITY" Admin="yes" Secure="yes">$(var.Krb5PreserveIdentity)</Property>
Expand Down
1 change: 0 additions & 1 deletion src/windows/kfwlogon/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

mydir=.
BUILDTOP=$(REL)..$(S)..
DEFINES = -DNO_KRB4
LOCALINCLUDES = -I$(BUILDTOP) -I$(BUILDTOP)\include -I$(BUILDTOP)\windows\include
PROG_LIBPATH=-L$(TOPLIBD) -L$(KRB5_LIBDIR)

Expand Down
2 changes: 0 additions & 2 deletions src/windows/kfwlogon/kfwcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ DECL_FUNC_PTR(Leash_get_default_renew_till);
DECL_FUNC_PTR(Leash_get_default_noaddresses);
DECL_FUNC_PTR(Leash_get_default_proxiable);
DECL_FUNC_PTR(Leash_get_default_publicip);
DECL_FUNC_PTR(Leash_get_default_use_krb4);
DECL_FUNC_PTR(Leash_get_default_life_min);
DECL_FUNC_PTR(Leash_get_default_life_max);
DECL_FUNC_PTR(Leash_get_default_renew_min);
Expand Down Expand Up @@ -167,7 +166,6 @@ FUNC_INFO leash_fi[] = {
MAKE_FUNC_INFO(Leash_get_default_noaddresses),
MAKE_FUNC_INFO(Leash_get_default_proxiable),
MAKE_FUNC_INFO(Leash_get_default_publicip),
MAKE_FUNC_INFO(Leash_get_default_use_krb4),
MAKE_FUNC_INFO(Leash_get_default_life_min),
MAKE_FUNC_INFO(Leash_get_default_life_max),
MAKE_FUNC_INFO(Leash_get_default_renew_min),
Expand Down

0 comments on commit 0e2a5b2

Please sign in to comment.