--- /dev/null
+
+Registry keys used in the Windows AFS Client
+--------------------------------------------
+
+This file describes the registry keys used in the Windows AFS clients.
+
+1. Service parameters
+---------------------
+
+The service parameters primarily affect the behavior of the AFS client
+service (afsd_service.exe).
+
+Regkey:
+[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
+
+Value : LANadapter
+Type : DWORD
+Default : -1
+Variable: LANadapter
+
+ LAN adapter number to use. This is the lana number of the LAN
+ adapter that the SMB server should bind to. If unspecified or set
+ to -1, a LAN adapter with named 'AFS' or a loopback adapter will be
+ selected. If neither are present, then all available adapters will
+ be bound to. When binding to a non-loopback adapter, the NetBIOS
+ name '%hostname%-AFS' will be used (where %hostname% is the NetBIOS
+ name of the host truncated to 11 characters). Otherwise, the NetBIOS
+ name will be 'AFS'.
+
+Value : CacheSize
+Type : QWORD
+Default : 20480 (CM_CONFIGDEFAULT_CACHESIZE)
+Variable: cm_initParams.cacheSize
+
+ Size of the AFS cache.
+
+Value : ChunkSize
+Type : DWORD
+Default : 15 (CM_CONFIGDEFAULT_CHUNKSIZE)
+Variable: cm_logChunkSize (cm_chunkSize = 1 << cm_logChunkSize)
+
+ Size of chunk for reading and writing. Actual chunk size is 2^cm_logChunkSize.
+
+Value : Daemons
+Type : DWORD
+Default : 2 (CM_CONFIGDEFAULT_DAEMONS)
+Variable: numBkgD
+
+ Number of background daemons (number of threads of
+ cm_BkgDaemon). (see cm_BkgDaemon in cm_daemon.c)
+
+Value : ServerThreads
+Type : DWORD
+Default : 4 (CM_CONFIGDEFAULT_SVTHREADS)
+Variable: numSvThreads
+
+ Number of SMB server threads (number of threads of smb_Server). (see
+ smb_Server in smb.c).
+
+Value : Stats
+Type : QWORD
+Default : 1000 (CM_CONFIGDEFAULT_STATS)
+Variable: cm_initParams.nStatCaches
+
+ Cache configuration.
+
+Value : LogoffTokenTransfer
+Type : DWORD {1,0}
+Default : 1
+Variable: smb_LogoffTokenTransfer
+
+ If enabled (set to 1), activates functionality where the user's
+ tokens are kept intact until smb_LogofTokenTransferTimeout seconds
+ elapse after user logs off. If roaming profiles are used and the
+ roaming profile takes a long time to be written back, this ensures
+ that the tokens remain valid until the profile save is complete.
+
+Value : LogoffTokenTransferTimeout
+Type : QWORD
+Default : 10
+Variable: smb_LogoffTokenTransferTimeout
+
+ See LogoffTokenTransfer above.
+
+Value : RootVolume
+Type : REG_SZ
+Default : "root.afs"
+Variable: cm_rootVolumeName
+
+ Root volume name.
+
+Value : Mountroot
+Type : REG_SZ
+Default : "/afs"
+Variable: cm_mountRoot
+
+ Name of root mount point. In symlinks, if a path starts with
+ cm_mountRoot, it is assumed that the path is absolute (as opposed to
+ relative) and is adjusted accordingly. Eg: if a path is specified as
+ /afs/athena.mit.edu/foo/bar/baz and cm_mountRoot is "/afs", then the
+ path is interpreted as \\afs\all\athena.mit.edu\foo\bar\baz. If a
+ path does not start with with cm_mountRoot, the path is assumed to
+ be relative and suffixed to the reference directory (i.e. directory
+ where the symlink exists)
+
+Value : CachePath
+Type : REG_SZ
+Default : "\AFSCache"
+Variable: cm_CachePath
+
+ Location of on-disk cache file.
+
+Value : TrapOnPanic
+Type : DWORD {1,0}
+Default : 0
+Variable: traceOnPanic
+
+ Issues a breakpoint in the event of a panic. (breakpoint: _asm int 3).
+
+Value : IsGateway
+Type : DWORD {1,0}
+Default : 0
+Variable: isGateway
+
+ Select whether or not this AFS client should act as a gateway. If
+ set and the NetBIOS name hostname-AFS is bound to a physical NIC,
+ other machines in the subnet can access AFS via SMB connections to
+ hostname-AFS .
+
+Value : ReportSessionStartups
+Type : DWORD {1,0}
+Default : 0
+Variable: reportSessionStartups
+
+ If enabled, all SMB sessions created are recorded in the Application
+ event log.
+
+Value : TraceBufferSize
+Type : QWORD
+Default : 5000 (CM_CONFIGDEFAULT_TRACEBUFSIZE)
+Variable: traceBufSize
+
+ Number of entries to keep in trace log.
+
+Value : SysName
+Type : REG_SZ
+Default : "i386_nt40"
+Variable: cm_sysName
+
+ Self explanatory.
+
+Value : SecurityLevel
+Type : DWORD {1,0}
+Default : 0
+Variable: cryptall
+
+ Enables encryption on RX calls.
+
+Value : UseDNS
+Type : DWORD {1,0}
+Default : 1
+Variable: cm_dnsEnabled
+
+ Enables resolving volservers using AFSDB DNS queries. (see
+ afsdb-freelance-notes)
+
+Value : FreelanceClient
+Type : DWORD {1,0}
+Default : 0
+Variable: cm_freelanceEnabled
+
+ Enables freelance client. (see afsdb-freelance-notes)
+
+Value : HideDotFiles
+Type : DWORD {1,0}
+Default : 1
+Variable: smb_hideDotFiles
+
+ Enables marking dotfiles with the hidden attribute. Dot files are
+ files whose name starts with a period (excluding "." and "..").
+
+Value : MaxMpxRequests
+Type : DWORD
+Default : 50
+Variable: smb_maxMpxRequests
+
+ Maximum number of multiplexed SMB requests that can be made.
+
+Value : MaxVCPerServer
+Type : DWORD
+Default : 100
+Variable: smb_maxVCPerServer
+
+ Maximum number of SMB virtual circuits.
+
+Value : Cell
+Type : REG_SZ
+Default : <none>
+Variable: rootCellName
+
+ Name of root cell (the cell from which root.afs should be mounted in
+ \\afs\all).
+
+Value : RxNoJumbo
+Type : DWORD {0,1}
+Default : 0
+Variable: rx_nojumbo
+
+ If enabled, does not send or indicate that we are able to send or
+ receive RX jumbograms.
+
+Value : RxMaxMTU
+Type : DWORD
+Default : -1
+Variable: rx_mtu
+
+ If set to anything other than -1, uses that value as the maximum MTU
+ supported by the RX interface.
+
+2. Network provider parameters
+------------------------------
+Affects the network provider (aklogon.dll).
+
+Regkey:
+[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters]
+
+Value : FailLoginsSilently
+Type : DWORD
+Default : 0
+
+Do not display message boxes if the login fails.
+
+Regkey:
+[HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\NetworkProvider]
+
+Value : NoWarnings
+Type : DWORD
+Default : 0
+
+Disables visible warnings during logon.
+
$(NTMAKE)
$(CD) ..\..\..
-finale: client_creds
+extra: client_creds
+! IF EXIST($(SRC)\WINNT\extra) && EXIST($(SRC)\WINNT\extra\NTMakefile)
+ echo ***** $@
+ $(DOCD) $(SRC)\WINNT\$@
+ $(CD) $(SRC)\WINNT\$@
+ $(NTMAKE)
+ $(CD) ..\..\..
+! ELSE
+ echo ***** Skipping $@ ***** Not found.
+! ENDIF
+
+finale: extra
echo ***** $@
$(DOCD) $(SRC)\$@
$(CD) $(SRC)\$@
# InstallShield dependencies
-InstallShield5:
- echo ***** afs_setup_utils
- $(DOCD) $(SRC)\WINNT\afs_setup_utils
- $(CD) $(SRC)\WINNT\afs_setup_utils
- $(NTMAKE)
- $(CD) ..\..\..
-
- $(DOCD) $(SRC)\WINNT\install\$@
- $(CD) $(SRC)\WINNT\install\$@
- $(NTMAKE)
- $(CD) ..\..\..\..
-
-media: InstallShield5 NSIS
-
# Clean target for obj tree
clean:
nmake /nologo /f ntmakefile "NTMAKE = nmake /nologo /f ntmakefile clean" "NTMAKE_HEADERS = nmake /nologo /f ntmakefile clean" "NTMAKE_OBJS = nmake /nologo /f ntmakefile clean" install
NSIS:
echo ***** Making NSIS Installer
- $(DOCD) $(SRC)\WINNT\install\NSIS
- $(CD) $(SRC)\WINNT\install\NSIS
+ $(DOCD) $(SRC)\WINNT\install\$@
+ $(CD) $(SRC)\WINNT\install\$@
$(NTMAKE)
$(CD) ..\..\..\..
+#msi:
+# echo ***** Making MSI Installer
+# $(DOCD) $(SRC)\WINNT\install\$@
+# $(CD) $(SRC)\WINNT\install\$@
+# $(NTMAKE)
+# $(CD) ..\..\..\..
+
+InstallShield5:
+ echo ***** afs_setup_utils
+ $(DOCD) $(SRC)\WINNT\afs_setup_utils
+ $(CD) $(SRC)\WINNT\afs_setup_utils
+ $(NTMAKE)
+ $(CD) ..\..\..
+
+ $(DOCD) $(SRC)\WINNT\install\$@
+ $(CD) $(SRC)\WINNT\install\$@
+ $(NTMAKE)
+ $(CD) ..\..\..\..
+
+media: install InstallShield5 NSIS
+
install-nsis: install NSIS
+install-msi: install msi
+
install-is5: install InstallShield5
-This software has been released under the terms of the IBM Public\r
-License. For details, see the LICENSE file in the top-level source\r
-directory or on-line at http://www.openafs.org/dl/license10.html\r
-\r
-The document now provides a step by step procedure that takes the user \r
-from a basic Windows NT/2000 workstation to an OpenAFS development \r
-environment. Details are provided so that a 'beginning' windows \r
-developer can build an OpenAFS installable package for Windows NT/2000. \r
-\r
-*********** Windows NT/2000 Build Process ****************\r
-\r
-Building OpenAFS for Windows requires configuring a Windows\r
-development system by installing compilation tools and header files.\r
-Open AFS Software development can be done on Windows NT or 2000. The\r
-target system, where OpenAFS will be installed, should be either\r
-Windows NT or Windows 2000. The building process is controlled by a\r
-nmake file that generates the necessary binaries and binds them into an\r
-install package.\r
-\r
-The following steps describe how to configure Windows 2000/NT:\r
-\r
- A. Obtain a copy of the OpenAFS Source Tree\r
- B. Install Compiler and Development tools.\r
- C. Set up drive mappings.\r
- D. Install SDK header files\r
- E. Configure Environment variables\r
- F. Set program version Level\r
- G. Build Win2000 binaries\r
- H. Install InstallShield 5.x\r
- I. Build Win2000 InstallShield Package\r
- J. Build Win2000 InstallShield Package for the Web\r
- K. Final Results\r
- L. Creating a Debug Environment\r
- M. Optional Items\r
- N. Required patches for 1.2.2a and earlier releases\r
- \r
-The Software development tools with InstallShield require 900 MB\r
-storage.\r
-\r
-The Software development tools (without InstallShield) require 660 MB\r
-storage.\r
-\r
-The OpenAFS Source directory requires about 200 MB storage. The Source\r
-directory size includes additional space for files that will be\r
-generated during the build process.\r
-\r
-The following CDs are used in this example:\r
- Microsoft SDK and Tools Jan 2001\r
- Microsoft Visual Studio Version 6.0\r
- InstallShield 5.5\r
-\r
-Different versions of above CDs can be used; however, building an\r
-install package for Windows NT/2000 requires InstallShield\r
-version 5.0 to 5.5 (version 6.0 or better will not work). \r
-\r
-You can build all the necessary binaries without the InstallShield\r
-software. InstallShield is only needed to build an install package.\r
-\r
-STEP A. Obtain a copy of the Open AFS Source Tree.\r
-\r
-Transfer OpenAFS source tree onto your hardrive. The source can be\r
-downloaded from the OpenAFS web site:\r
- http://www.OpenAFS.org/release/snapindex.html.\r
-\r
-For this example, download source for version 1.2.2a using the\r
-following URL:\r
-http://www.openafs.org/dl/openafs/1.2.2a/openafs-1.2.2a-src.tar\r
-\r
-HINT: DailySnapShots are pre-release source trees and much more\r
-likely to have compilation errors. If this is your first attempt, do\r
-your build based on a release version of the source, e.g. 1.2.2.a. Once\r
-you have completed a build process successfully, you can experiment with\r
-other source trees.\r
-\r
-You will need an unzip utility that can expand compressed tar files.\r
-For example "Pkzip for Windows" from Pkware will uncompress tar files.\r
-(http://www.pkware.com/)\r
-\r
-Expand the downloaded tar file (openafs-1.2.2a-src.tar) into target\r
-directory (c:\OpenAFS), the unzip routine will expand the source into a\r
-subdirectory tree:\r
- c:\OpenAFS\OpenAFS-1.2.2a\src\r
-\r
-Copy files NTMAKEFILE from 'src' to the AFS base directory:\r
-\r
-From a DOS command prompt window, enter the following copy commands:\r
-\r
-copy c:\OpenAFS\OpenAFS-1.2.2a\src\NTMAKEFILE c:\OpenAFS\OpenAFS-1.2.2a\.\r
-\r
-The AFS base directory should look something like the following:\r
-\r
-c:\OpenAFS\OpenAFS-1.2.2a\\r
- NTMakefile\r
- src\r
- \r
-STEP B. Install compiler and development tools.\r
-\r
-Install a copy of Microsoft Visual C++ 5.0 or 6.0. The "Typical" install\r
-setting is sufficient.\r
-\r
-(1) You can reduce the installation size by selecting "Custom" install\r
-and remove all but the following Options:\r
-\r
- Microsoft Visual C++\r
- Data Access\r
-\r
-(2) When asked, Select to Register Environment Variables.\r
-\r
-(3) After rebooting you have to choice to install additional software\r
-packages. It is not necessary to install these packages.\r
-\r
-STEP C. Map development drive letters.\r
-\r
-The following documentation will assume you are mapping the Y: drive to\r
-the OpenAFS source directory and you are mapping X: drive to your\r
-development tools directory. Other configurations will work, including\r
-not mapping any drives, as long as the path assignments are consistent\r
-and you don't exceed the maximum environment variable length.\r
-\r
-Y: drive mapping provides a consistent directory location to build from.\r
-Building OpenAFS will require you to open up a command DOS prompt,\r
-navigate to drive Y: and execute the nmake file. The source is based\r
-from Y: drive and the generated files are based from Y:\DEST. If the OpenAFS \r
-source tree is at a different location, you only need to re-map the\r
-Y: drive.\r
-\r
-X: drive mapping shortens the length of several Environment variables\r
-by mapping it to a directory where Visual Studio is installed. Although\r
-this step is not important when using Windows NT or 2000 as a\r
-development OS, it does reduce the chance of typing errors during\r
-the configuration phase.\r
-\r
-From a DOS command window enter the following commands:\r
-\r
-SUBST y: c:\OpenAFS\OpenAFS-1.2.2a\r
-SUBST x: "c:\Program Files\Microsoft Visual Studio\VC98"\r
-\r
-SUBST is persistent across DOS command prompts; that is, if you open up\r
-another DOS command prompt the mapped drives are still defined.\r
-However, if you reboot the mapped drives using SUBST will be lost. \r
-\r
-If you need to remove Y: drive mapping, execute the following command\r
-from a DOS command prompt window:\r
-\r
-SUBST y: /d\r
-\r
-STEP D. Install SDK header files.\r
-\r
-Files from Microsoft's Platform SDK for NT or 98 are required to\r
-complete a build on NT/2000.\r
-\r
-The header files that are required are found from a Microsoft SDK are:\r
-\r
- netspi.h\r
- npapi.h\r
-\r
-These files come from Microsoft DDKs/SDKs as follows:\r
-\r
- January 1997 Windows NT Workstation DDK - /ddk/frc/network/inc/npapi.h\r
- November 2001 Microsoft Platform SDK - install "samples" from "Core SDK"\r
- samples/winbase/security/winnt/logonnp/npapi.h\r
- July 1998 Windows 95 DDK - net/inc/netmpr.h and net/inc/netspi.h\r
- July 1999 Windows 98 DDK - src/net/inc/netmpr.h and src/net/inc/netspi.h\r
- - you need to install "Legacy and Related\r
- driver samples"\r
-\r
-To Install Platform SDK from CDROM\r
- \r
- Run "setup.exe default.htm" from CDROM:\r
- Select Microsoft Core SDK\r
- Select Sample and Source\r
- Select installation path x:\SDK\r
-\r
-To Install Windows SDK from WEB:\r
- http://www.microsoft.com/sdk\r
-\r
-STEP E. Configure the OpenAFS build environment.\r
-\r
-The following environment variables should be set:\r
-\r
-SET AFSDEV_LIB=%LIB%\r
-SET AFSROOT=Y:\r
-SET SYS_NAME=i386_nt40\r
-SET _WIN32_IE=0x400\r
-SET MSSDK=X:\Sdk\r
-SET MSTOOLS=X:\Sdk\r
-SET MSVCDIR=X:\r
-SET AFSDEV_BIN=X:\BIN\r
-SET AFSDEV_BUILDTYPE=FREE\r
-SET AFSDEV_INCLUDE=X:\Sdk\samples\winbase\security\winnt\logonNP;X:\Sdk\Include\ATL30;X:\Sdk\Include;%INCLUDE%\r
-\r
-Please do not include unnecessary spaces in AFSDEV_INLCUDE.\r
-\r
-Create a batch file (SETAFS.BAT) to make these settings that can be \r
-executed when you bring up a DOS command prompt window. Environment \r
-variables are not persistent, if you close the DOS command window \r
-or reboot, the environment variables are lost and they must be \r
-recreated when you open a new DOS command prompt window.\r
-\r
-HINT: SET AFSDEV_BUILDTYPE=CHECKED if you want debug information\r
-included in your binaries.\r
-\r
-HINT: Adding drive mapping commands to the batch file makes it easy to\r
-establish your development environment even if you logoff. I suggest\r
-adding the following lines to the beginning of the batch file:\r
-\r
-SUBST y: /d\r
-SUBST x: /d\r
-SUBST y: c:\OpenAfs\OpenAFS-1.2.2a\r
-SUBST x: "c:\Program Files\Microsoft Visual Studio\VC98"\r
-\r
-HINT: Windows 2000/NT provides an alternate way to set environment\r
-variables in System Proprieties. These can be accessed from the system\r
-control panel, advanced tab, Environment Variables. These are\r
-persistent and will be reset every time a DOS command prompt window is\r
-opened.\r
-\r
-STEP F. Set version and installation options\r
-\r
-Add a CellServDB file to install area. CellServDB contains the entries\r
-for the various cell names. You can download a general purpose one\r
-from:\r
- http://grand.central.org/dl/cellservdb/CellServDB\r
-then copy it to Y:\DEST\Wininstall\Config\CellServDB.GrandCentral\r
-\r
-Note: Create directory Y:\DEST\Wininstall\Config\ if it doesn't exist.\r
-\r
-Edit file Y:\src\config\NTMakefile.i386_nt40\r
- AFSPRODUCT_VERSION - Product version\r
- CELLSERVDB_INSTALL - The default file name for the CellServDB\r
- included in the install Package.\r
- CELLNAME_DEFAULT - The default home cell name.\r
- CELLSERVDB_WEB - The default web address to obtain CellServDB\r
-\r
-For example: in the file Y:\src\config\NTMakefile.i386_nt40 you would\r
-see the following:\r
-\r
- AFSPRODUCT_VERSION=1.2.2a\r
- CELLNAME_DEFAULT=home.cell.com\r
- CELLSERVDB_INSTALL=CellServDB.GrandCentral\r
- CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB\r
-\r
-During the Open AFS installation process the user will be presented\r
-with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and\r
-one that can be downloaded from the web (CELLSERVDB_WEB).\r
-\r
-HINT: The product version number (AFSPRODUCT_VERSION) can be changed to\r
-create a new version number. For example if you have added source\r
-changes to OpenAFS-1.2.2a and you wanted to create a new version level,\r
-you may want to use the following: AFSPRODUCT_VERSION=1.2.2b\r
-\r
-STEP G. Begin the build\r
-\r
-(1) From Windows 2000 open up a DOS prompt window.\r
-\r
-(2) Clean the work area.\r
-\r
- nmake /f NTMakefile clean\r
-\r
-(3) Build the complete Windows NT/2000 development environment.\r
-\r
- nmake /f NTMakefile install\r
-\r
-While the build is running you will see many compile warnings. This\r
-behavior is normal; the build process is successful as long as the build\r
-process doesn't terminate with an error ("nmake.exe return code 0x2")\r
-and it displays 'Build Finished Successfully'.\r
-\r
-STEP H. Install InstallShield (optional).\r
-\r
-In order to build an install package for OpenAFS, InstallShield 5.5\r
-must be installed along with InstallShield East and West\r
-multi-Language packs.\r
-\r
-(1) Install InstallShield (version between 5.0 and 5.5)\r
-\r
-For minimum installation choose "compact".\r
-\r
-(2) Install West Language Pack (5.5)\r
-\r
-(3) Install East Language Pack (5.5)\r
-\r
-NOTE: InstallShield's versions 6 and higher WILL NOT WORK for\r
-Windows NT/2000 build process.\r
-\r
-(4) Add necessary DLL's to work with the InstallShield package.\r
-\r
-Two Microsoft DLL's are missing from the InstallShield package. These\r
-DLL's must be copied to Y:\DEST\WinInstall\Config\:\r
- SHLWAPI.DLL \r
- WININET.DLL\r
-\r
-These files are only used during the installation, and they will not \r
-be left on the target machine. They can be located at \r
-%SystemRoot%\SYSTEM32.\r
-\r
-From a DOS command prompt window enter the following commands:\r
-\r
-copy %systemRoot%\System32\SHLWAPI.DLL y:\dest\wininstall\config\.\r
-copy %systemRoot%\System32\WININET.DLL y:\dest\wininstall\config\.\r
-\r
-(5) Add two Environment variables to the bottom of the batch file,\r
-SETAFS.BAT (see STEP E:).\r
-\r
-SET IS5ROOT="C:\Program Files\InstallShield\InstallShield 5.5 Professional Edition"\r
-SET AFSDEV_INCLUDE=%AFSDEV_INCLUDE%;%IS5ROOT%\Include\r
-\r
-STEP I. Build Win2000 InstallShield package\r
-\r
-From the DOS command prompt window run:\r
-\r
- Y:\r
- nmake /f NTMakefile media\r
-\r
-While the build is running you will see a few compile warnings. This\r
-behavior is normal; the build process is successful as long as the build\r
-process doesn't terminate with an error ("nmake.exe return code 0x2")\r
-and it displays 'Install Script Finished Successfully'.\r
-\r
-STEP J. Build Win2000 InstallShield package for the Web\r
-\r
-InstallShield's PackageForTheWeb combines the installation files into a\r
-single application file that will expand on execution and lead you\r
-through the OpenAFS installation. \r
-\r
-Install PackageForTheWeb 3 from InstallShield\r
-\r
-Add Environment variables to the bottom of the batch file, SETAFS.BAT\r
-(see STEP E:).\r
-\r
-SET ISWEB="C:\Program Files\InstallShield\PackageForTheWeb 3"\r
-\r
-From the DOS command prompt window run:\r
-\r
- Y:\r
- nmake /f NTMakefile media\r
-\r
-While the build is running you will see a few compile warnings. This\r
-behavior is normal; the build process is successful as long as the build\r
-process doesn't terminate with an error ("nmake.exe return code 0x2") and\r
-it displays 'Install Script Finished Successfully'.\r
-\r
-HINT: It is only necessary to run "nmake /f NTMakefile media" once, by \r
-combining steps I & J. \r
-\r
-STEP K. Final Results\r
-\r
-The build process generates its binaries in Y:\DEST. The subdirectory\r
-would look like the following:\r
-\r
-Y:\DEST\r
- bin\r
- etc\r
- include\r
- lib\r
- root.client\r
- root.server\r
- WinInstall\r
-\r
-Y:\DEST\Bin - contains build utilities.\r
-Y:\DEST\root.client - contains Open AFS binaries\r
-Y:\DEST\root.server - contain Open AFS Server binaries\r
-Y:\DEST\WinInstall\PackageWeb\AFSforWindows.exe - is the Web install\r
-package for Open AFS.\r
-Y:\DEST\WinInstall\ - are the install package files for Open AFS\r
-\r
-Step L. Creating a Debug Environment\r
-\r
-Instructions on building a debugging environment from Visual Studio C++\r
-workspace. This example give the user a way to step through the source\r
-code for AFSCREDS.EXE.\r
-\r
-These instructions are to be followed after you have set up the\r
-development environment.\r
-\r
-The following steps must be done before you can build a debug\r
-environment:\r
-\r
-1. Set up the development environment as described above\r
-2. set AFS_BUILDTYPE=CHECKED to get debug information.\r
-3. You must use environment variables in System Properties\r
-4. Do a complete build.\r
-\r
-To set the the environment variables in the System Properties:\r
-1. Select the 'System' icon in the control Panel\r
-2. Select the 'Advanced' tab\r
-3. Select the 'Environment Variables' button\r
-4. In the user area set all variables as you did above that\r
-were used in the setafs.bat file.\r
-\r
-To build a new work space to debug afs_creds.exe:\r
-\r
-1. Create New Workspace - \r
-Select from Microsoft Visual C++ toolbar file New\r
-Select from 'new' Project Tab Makefile Project name: Creds\r
-Location Y:\src\winnt\client_creds\r
-Select OK\r
-\r
-From Dialog Box 'Makefile - Step 1 of 2'\r
-command line= nmake /f"ntmakefile" install\r
-Output = y:\dest\root.client\usr\vice\etc\AFSCREDS.EXE\r
-Select NEXT\r
-\r
-Dialog Box 'Makefile - Step 2 of 2'\r
-Command line= nmake /f"ntmakefile" install\r
-Output = y:\dest\root.client\usr\vice\etc\AFSCREDS.EXE\r
-\r
-Select Finish\r
-\r
-Switch to FileView\r
-Right click on 'Source Files' and select 'Add Files to folder', select\r
-all *.cpp files.\r
-\r
-Right click on 'Header Files' and select 'Add Files to folder', select\r
-all *.h files.\r
-\r
-Right click on 'creds files' and select 'New Folder'\r
-Fill name in 'Build'\r
-\r
-From the toolbar select Build\r
-Select 'Build All'\r
-\r
-You should see the following string when the compile is finished:\r
-"afs_creds.exe - 0 errors(0), 0 warnings(s)"\r
-\r
-Press <F5> to execute afs_creds.exe.\r
-\r
-STEP M. Optional Items\r
-\r
-The build process has an error table that is compiled for many OpenAFS\r
-applications. This table is generated by Unix based tools. It is not\r
-normally necessary to modify this table so pre-generated source files\r
-are included in the OpenAFS source. If you need to make modifications\r
-in these areas the Unix base tools that run on Windows can be found on\r
-the web. For example:\r
-\r
- http://cygwin.com/\r
-\r
-Below is a short explanation how to update the error table.\r
-\r
-(1) Install flex and bison from a Unix based tool provider.\r
-\r
-(2) Make changes to the source files.\r
-\r
-There are two files in the source tree that are processed with lex\r
-and yacc on UNIX systems, src/comerr/et_lex.lex.l and\r
-src/comerr/error_table.y, that when processed produce the files\r
-et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.\r
-\r
-Since NT does not include lex and yacc or any equivalent tools, we\r
-have provided the output files that lex and yacc produce (using Win32\r
-ports of flex and bison). This will allow builds to work for anyone\r
-who does not need to change the .l and .y files.\r
-\r
-If you do need to change et_lex.lex.l, then you will need to install\r
-Win32 port of flex on your system. Put flex.exe in a directory on the\r
-path and rebuild.\r
-\r
-If you do need to change error_table.y, then you will need to install\r
-a Win32 port of bison on your system. Put bison.exe in a directory on\r
-the path, configure bison as explained in step 5, and rebuild.\r
-\r
-You can also attempt to use other replacements for lex and yacc. This\r
-will require modifying the LEX and YACC settings in\r
-/config/NTMakefile.i386_nt40. If the replacements require different\r
-command line options than flex and bison, then you may also need to\r
-change src/comerr/NTMakefile.\r
-\r
-(3) Generate new OpenAFS binaries\r
-\r
-\r
-STEP N. Required patches for 1.2.2a and earlier releases\r
-\r
-There are two set of patches must be applied to 1.2.2a source to\r
-successfully build the binaries:\r
-\r
-(1) Patches applied to 1.2.2a to build binaries, excluding install\r
-package.\r
-\r
-diff -Nur --exclude-from=exclude bas/src/NTMakefile upd/src/NTMakefile\r
---- bas/src/NTMakefile Wed Nov 14 19:38:06 2001\r
-+++ upd/src/NTMakefile Mon Dec 3 14:41:12 2001\r
-@@ -471,6 +471,7 @@\r
- $(CD) $(OBJ)\$@\r
- $(NTMAKE)\r
- $(CD) ..\.. \r
-+ echo Build Finished Successfully\r
- \r
- install: start finale\r
- \r
-@@ -487,6 +488,7 @@\r
- $(CD) ..\..\..\..\r
- \r
- media: InstallShield5\r
-+ echo Install Script Finished Successfully\r
- \r
- \r
-(2) Patches applied to 1.2.2a to build install package.\r
-\r
-diff -Nur --exclude-from=exclude bas/src/WINNT/afsd/NTMakefile upd/src/WINNT/afsd/NTMakefile\r
---- bas/src/WINNT/afsd/NTMakefile Tue Nov 20 22:45:40 2001\r
-+++ upd/src/WINNT/afsd/NTMakefile Wed Dec 5 11:42:46 2001\r
-@@ -169,8 +169,8 @@\r
- $(EXEDIR)\tokens.exe \\r
- $(EXEDIR)\unlog.exe $(EXEDIR)\afsd.exe $(EXEDIR)\afsd_service.exe \\r
- $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \\r
-- $(LOGON_DLLFILE) $(LOG95_DLLFILE) \\r
-- $(EXEDIR)\afsshare.exe \\r
-+ $(LOGON_DLLFILE) \\r
-+ $(EXEDIR)\afsshare.exe \\r
- $(DESTDIR)\bin\kpasswd.exe\r
- \r
- install9X: install_headers $(CONF_DLLFILE) \\r
-\r
-diff -Nur --exclude-from=exclude bas/src/WINNT/install/InstallShield5/NTMakefile upd/src/WINNT/install/InstallShield5/NTMakefile\r
---- bas/src/WINNT/install/InstallShield5/NTMakefile Wed Nov 14 19:38:50 2001\r
-+++ upd/src/WINNT/install/InstallShield5/NTMakefile Mon Dec 3 16:43:08 2001\r
-@@ -60,7 +60,7 @@\r
- $(MKDIR) $(DESTDIR)\Wininstall\PackageWeb\r
- ! ENDIF\r
- $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*\r
-- $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a \r
-+ "$(ISWEB)\Pftwwiz.exe" $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a \r
- !ENDIF\r
- xcopy /s/e/y "Media\OpenAFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall\r
- copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt\r
-diff -Nur --exclude-from=exclude bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC\r
---- bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC Thu Sep 6 20:54:58 2001\r
-+++ upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC Mon Dec 3 15:11:46 2001\r
-@@ -10,7 +10,7 @@\r
- #define APSTUDIO_HIDDEN_SYMBOLS\r
- #include "windows.h"\r
- #undef APSTUDIO_HIDDEN_SYMBOLS\r
--#include <.\sdrc.h>\r
-+#include <sdrc.h>\r
- \r
- /////////////////////////////////////////////////////////////////////////////\r
- #undef APSTUDIO_READONLY_SYMBOLS\r
-diff -Nur --exclude-from=exclude bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep\r
---- bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep Thu Sep 6 20:54:58 2001\r
-+++ upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep Wed Dec 31 16:00:00 1969\r
-@@ -1,5 +0,0 @@\r
--# Microsoft Developer Studio Generated Dependency File, included by _IsUser.mak\r
--\r
--.\_Isuser.RC : \\r
-- ".\sdrc.h"\\r
-- \r
-diff -Nur --exclude-from=exclude bas/src/WINNT/afs_setup_utils/_isuser/ntmakefile upd/src/WINNT/afs_setup_utils/_isuser/ntmakefile\r
---- bas/src/WINNT/afs_setup_utils/_isuser/ntmakefile Mon Sep 10 09:39:50 2001\r
-+++ upd/src/WINNT/afs_setup_utils/_isuser/ntmakefile Mon Dec 3 15:16:04 2001\r
-@@ -30,14 +30,6 @@\r
- "$(OUTDIR)" ::\r
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"\r
- \r
--HEADERS = ".\sdrc.h"\r
--\r
--".\sdrc.h" : $(IS5ROOT)\INCLUDE\sdrc.h\r
-- $(COPY) $(IS5ROOT)\INCLUDE\sdrc.h .\r
--! IF EXIST($(IS5ROOT)\Script\ISRT\Include\sdrc.h)\r
-- $(COPY) $(IS5ROOT)\Script\ISRT\Include\sdrc.h .\r
--! ENDIF\r
--\r
- CPP=cl.exe\r
- CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ISUSER_EXPORTS" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c \r
- \r
-@@ -85,20 +77,10 @@\r
- "$(INTDIR)\_isuser.obj" \\r
- "$(INTDIR)\_Isuser.res"\r
- \r
--"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(HEADERS) $(DEF_FILE) $(LINK32_OBJS)\r
-+"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)\r
- $(LINK32) @<<\r
- $(LINK32_FLAGS) $(LINK32_OBJS)\r
- <<\r
--\r
--\r
--!IF "$(NO_EXTERNAL_DEPS)" != "1"\r
--!IF EXISTS("_IsUser.dep")\r
--!INCLUDE "_IsUser.dep"\r
--!ELSE \r
--!MESSAGE Warning: cannot find "_IsUser.dep"\r
--!ENDIF \r
--!ENDIF \r
--\r
- \r
- SOURCE=.\_isuser.c\r
+This software has been released under the terms of the IBM Public
+License. For details, see the LICENSE file in the top-level source
+directory or on-line at http://www.openafs.org/dl/license10.html
+
+The document now provides a step by step procedure that takes the user
+from a basic Windows NT/2000 workstation to an OpenAFS development
+environment. Details are provided so that a 'beginning' windows
+developer can build an OpenAFS installable package for Windows NT/2000.
+
+*********** Windows NT/2000 Build Process ****************
+
+Building OpenAFS for Windows requires configuring a Windows
+development system by installing compilation tools and header files.
+Open AFS Software development can be done on Windows NT or 2000. The
+target system, where OpenAFS will be installed, should be either
+Windows NT or Windows 2000. The building process is controlled by a
+nmake file that generates the necessary binaries and binds them into an
+install package.
+
+The following steps describe how to configure Windows 2000/NT:
+
+ A. Obtain a copy of the OpenAFS Source Tree
+ B. Install Compiler and Development tools.
+ C. Set up drive mappings.
+ D. Install SDK header files
+ E. Configure Environment variables
+ F. Set program version Level
+ G. Build Win2000 binaries
+ H. Install InstallShield 5.x
+ I. Build Win2000 InstallShield Package
+ J. Build Win2000 InstallShield Package for the Web
+ K. Final Results
+ L. Creating a Debug Environment
+ M. Optional Items
+ N. Required patches for 1.2.2a and earlier releases
+
+The Software development tools with InstallShield require 900 MB
+storage.
+
+The Software development tools (without InstallShield) require 660 MB
+storage.
+
+The OpenAFS Source directory requires about 200 MB storage. The Source
+directory size includes additional space for files that will be
+generated during the build process.
+
+The following CDs are used in this example:
+ Microsoft SDK and Tools Jan 2001
+ Microsoft Visual Studio Version 6.0
+ InstallShield 5.5
+
+Different versions of above CDs can be used; however, building an
+install package for Windows NT/2000 requires InstallShield
+version 5.0 to 5.5 (version 6.0 or better will not work).
+
+You can build all the necessary binaries without the InstallShield
+software. InstallShield is only needed to build an install package.
+
+STEP A. Obtain a copy of the Open AFS Source Tree.
+
+Transfer OpenAFS source tree onto your hardrive. The source can be
+downloaded from the OpenAFS web site:
+ http://www.OpenAFS.org/release/snapindex.html.
+
+For this example, download source for version 1.2.2a using the
+following URL:
+http://www.openafs.org/dl/openafs/1.2.2a/openafs-1.2.2a-src.tar
+
+HINT: DailySnapShots are pre-release source trees and much more
+likely to have compilation errors. If this is your first attempt, do
+your build based on a release version of the source, e.g. 1.2.2.a. Once
+you have completed a build process successfully, you can experiment with
+other source trees.
+
+You will need an unzip utility that can expand compressed tar files.
+For example "Pkzip for Windows" from Pkware will uncompress tar files.
+(http://www.pkware.com/)
+
+Expand the downloaded tar file (openafs-1.2.2a-src.tar) into target
+directory (c:\OpenAFS), the unzip routine will expand the source into a
+subdirectory tree:
+ c:\OpenAFS\OpenAFS-1.2.2a\src
+
+Copy files NTMAKEFILE from 'src' to the AFS base directory:
+
+From a DOS command prompt window, enter the following copy commands:
+
+copy c:\OpenAFS\OpenAFS-1.2.2a\src\NTMAKEFILE c:\OpenAFS\OpenAFS-1.2.2a\.
+
+The AFS base directory should look something like the following:
+
+c:\OpenAFS\OpenAFS-1.2.2a\
+ NTMakefile
+ src
+
+STEP B. Install compiler and development tools.
+
+Install a copy of Microsoft Visual C++ 5.0 or 6.0. The "Typical" install
+setting is sufficient.
+
+(1) You can reduce the installation size by selecting "Custom" install
+and remove all but the following Options:
+
+ Microsoft Visual C++
+ Data Access
+
+(2) When asked, Select to Register Environment Variables.
+
+(3) After rebooting you have to choice to install additional software
+packages. It is not necessary to install these packages.
+
+STEP C. Map development drive letters.
+
+The following documentation will assume you are mapping the Y: drive to
+the OpenAFS source directory and you are mapping X: drive to your
+development tools directory. Other configurations will work, including
+not mapping any drives, as long as the path assignments are consistent
+and you don't exceed the maximum environment variable length.
+
+Y: drive mapping provides a consistent directory location to build from.
+Building OpenAFS will require you to open up a command DOS prompt,
+navigate to drive Y: and execute the nmake file. The source is based
+from Y: drive and the generated files are based from Y:\DEST. If the OpenAFS
+source tree is at a different location, you only need to re-map the
+Y: drive.
+
+X: drive mapping shortens the length of several Environment variables
+by mapping it to a directory where Visual Studio is installed. Although
+this step is not important when using Windows NT or 2000 as a
+development OS, it does reduce the chance of typing errors during
+the configuration phase.
+
+From a DOS command window enter the following commands:
+
+SUBST y: c:\OpenAFS\OpenAFS-1.2.2a
+SUBST x: "c:\Program Files\Microsoft Visual Studio\VC98"
+
+SUBST is persistent across DOS command prompts; that is, if you open up
+another DOS command prompt the mapped drives are still defined.
+However, if you reboot the mapped drives using SUBST will be lost.
+
+If you need to remove Y: drive mapping, execute the following command
+from a DOS command prompt window:
+
+SUBST y: /d
+
+STEP D. Install SDK header files.
+
+Files from Microsoft's Platform SDK for NT or 98 are required to
+complete a build on NT/2000.
+
+The header files that are required are found from a Microsoft SDK are:
+
+ netspi.h
+ npapi.h
+
+These files come from Microsoft DDKs/SDKs as follows:
+
+ January 1997 Windows NT Workstation DDK - /ddk/frc/network/inc/npapi.h
+ November 2001 Microsoft Platform SDK - install "samples" from "Core SDK"
+ samples/winbase/security/winnt/logonnp/npapi.h
+ July 1998 Windows 95 DDK - net/inc/netmpr.h and net/inc/netspi.h
+ July 1999 Windows 98 DDK - src/net/inc/netmpr.h and src/net/inc/netspi.h
+ - you need to install "Legacy and Related
+ driver samples"
+
+To Install Platform SDK from CDROM
+
+ Run "setup.exe default.htm" from CDROM:
+ Select Microsoft Core SDK
+ Select Sample and Source
+ Select installation path x:\SDK
+
+To Install Windows SDK from WEB:
+ http://www.microsoft.com/sdk
+
+STEP E. Configure the OpenAFS build environment.
+
+The following environment variables should be set:
+
+SET AFSDEV_LIB=%LIB%
+SET AFSROOT=Y:
+SET SYS_NAME=i386_nt40
+SET _WIN32_IE=0x400
+SET MSSDK=X:\Sdk
+SET MSTOOLS=X:\Sdk
+SET MSVCDIR=X:
+SET AFSDEV_BIN=X:\BIN
+SET AFSDEV_BUILDTYPE=FREE
+SET AFSDEV_INCLUDE=X:\Sdk\samples\winbase\security\winnt\logonNP;X:\Sdk\Include\ATL30;X:\Sdk\Include;%INCLUDE%
+
+Please do not include unnecessary spaces in AFSDEV_INLCUDE.
+
+Create a batch file (SETAFS.BAT) to make these settings that can be
+executed when you bring up a DOS command prompt window. Environment
+variables are not persistent, if you close the DOS command window
+or reboot, the environment variables are lost and they must be
+recreated when you open a new DOS command prompt window.
+
+HINT: SET AFSDEV_BUILDTYPE=CHECKED if you want debug information
+included in your binaries.
+
+HINT: Adding drive mapping commands to the batch file makes it easy to
+establish your development environment even if you logoff. I suggest
+adding the following lines to the beginning of the batch file:
+
+SUBST y: /d
+SUBST x: /d
+SUBST y: c:\OpenAfs\OpenAFS-1.2.2a
+SUBST x: "c:\Program Files\Microsoft Visual Studio\VC98"
+
+HINT: Windows 2000/NT provides an alternate way to set environment
+variables in System Proprieties. These can be accessed from the system
+control panel, advanced tab, Environment Variables. These are
+persistent and will be reset every time a DOS command prompt window is
+opened.
+
+STEP F. Set version and installation options
+
+Add a CellServDB file to install area. CellServDB contains the entries
+for the various cell names. You can download a general purpose one
+from:
+ http://grand.central.org/dl/cellservdb/CellServDB
+then copy it to Y:\DEST\Wininstall\Config\CellServDB.GrandCentral
+
+Note: Create directory Y:\DEST\Wininstall\Config\ if it doesn't exist.
+
+Edit file Y:\src\config\NTMakefile.i386_nt40
+ AFSPRODUCT_VERSION - Product version
+ CELLSERVDB_INSTALL - The default file name for the CellServDB
+ included in the install Package.
+ CELLNAME_DEFAULT - The default home cell name.
+ CELLSERVDB_WEB - The default web address to obtain CellServDB
+
+For example: in the file Y:\src\config\NTMakefile.i386_nt40 you would
+see the following:
+
+ AFSPRODUCT_VERSION=1.2.2a
+ CELLNAME_DEFAULT=home.cell.com
+ CELLSERVDB_INSTALL=CellServDB.GrandCentral
+ CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
+
+During the Open AFS installation process the user will be presented
+with two choices for the CellServDB: Local copy (CELLSERVDB_INSTALL) and
+one that can be downloaded from the web (CELLSERVDB_WEB).
+
+HINT: The product version number (AFSPRODUCT_VERSION) can be changed to
+create a new version number. For example if you have added source
+changes to OpenAFS-1.2.2a and you wanted to create a new version level,
+you may want to use the following: AFSPRODUCT_VERSION=1.2.2b
+
+STEP G. Begin the build
+
+(1) From Windows 2000 open up a DOS prompt window.
+
+(2) Clean the work area.
+
+ nmake /f NTMakefile clean
+
+(3) Build the complete Windows NT/2000 development environment.
+
+ nmake /f NTMakefile install
+
+While the build is running you will see many compile warnings. This
+behavior is normal; the build process is successful as long as the build
+process doesn't terminate with an error ("nmake.exe return code 0x2")
+and it displays 'Build Finished Successfully'.
+
+STEP H. Install InstallShield (optional).
+
+In order to build an install package for OpenAFS, InstallShield 5.5
+must be installed along with InstallShield East and West
+multi-Language packs.
+
+(1) Install InstallShield (version between 5.0 and 5.5)
+
+For minimum installation choose "compact".
+
+(2) Install West Language Pack (5.5)
+
+(3) Install East Language Pack (5.5)
+
+NOTE: InstallShield's versions 6 and higher WILL NOT WORK for
+Windows NT/2000 build process.
+
+(4) Add necessary DLL's to work with the InstallShield package.
+
+Two Microsoft DLL's are missing from the InstallShield package. These
+DLL's must be copied to Y:\DEST\WinInstall\Config\:
+ SHLWAPI.DLL
+ WININET.DLL
+
+These files are only used during the installation, and they will not
+be left on the target machine. They can be located at
+%SystemRoot%\SYSTEM32.
+
+From a DOS command prompt window enter the following commands:
+
+copy %systemRoot%\System32\SHLWAPI.DLL y:\dest\wininstall\config\.
+copy %systemRoot%\System32\WININET.DLL y:\dest\wininstall\config\.
+
+(5) Add two Environment variables to the bottom of the batch file,
+SETAFS.BAT (see STEP E:).
+
+SET IS5ROOT="C:\Program Files\InstallShield\InstallShield 5.5 Professional Edition"
+SET AFSDEV_INCLUDE=%AFSDEV_INCLUDE%;%IS5ROOT%\Include
+
+STEP I. Build Win2000 InstallShield package
+
+From the DOS command prompt window run:
+
+ Y:
+ nmake /f NTMakefile media
+
+While the build is running you will see a few compile warnings. This
+behavior is normal; the build process is successful as long as the build
+process doesn't terminate with an error ("nmake.exe return code 0x2")
+and it displays 'Install Script Finished Successfully'.
+
+STEP J. Build Win2000 InstallShield package for the Web
+
+InstallShield's PackageForTheWeb combines the installation files into a
+single application file that will expand on execution and lead you
+through the OpenAFS installation.
+
+Install PackageForTheWeb 3 from InstallShield
+
+Add Environment variables to the bottom of the batch file, SETAFS.BAT
+(see STEP E:).
+
+SET ISWEB="C:\Program Files\InstallShield\PackageForTheWeb 3"
+
+From the DOS command prompt window run:
+
+ Y:
+ nmake /f NTMakefile media
+
+While the build is running you will see a few compile warnings. This
+behavior is normal; the build process is successful as long as the build
+process doesn't terminate with an error ("nmake.exe return code 0x2") and
+it displays 'Install Script Finished Successfully'.
+
+HINT: It is only necessary to run "nmake /f NTMakefile media" once, by
+combining steps I & J.
+
+STEP K. Final Results
+
+The build process generates its binaries in Y:\DEST. The subdirectory
+would look like the following:
+
+Y:\DEST
+ bin
+ etc
+ include
+ lib
+ root.client
+ root.server
+ WinInstall
+
+Y:\DEST\Bin - contains build utilities.
+Y:\DEST\root.client - contains Open AFS binaries
+Y:\DEST\root.server - contain Open AFS Server binaries
+Y:\DEST\WinInstall\PackageWeb\AFSforWindows.exe - is the Web install
+package for Open AFS.
+Y:\DEST\WinInstall\ - are the install package files for Open AFS
+
+Step L. Creating a Debug Environment
+
+Instructions on building a debugging environment from Visual Studio C++
+workspace. This example give the user a way to step through the source
+code for AFSCREDS.EXE.
+
+These instructions are to be followed after you have set up the
+development environment.
+
+The following steps must be done before you can build a debug
+environment:
+
+1. Set up the development environment as described above
+2. set AFS_BUILDTYPE=CHECKED to get debug information.
+3. You must use environment variables in System Properties
+4. Do a complete build.
+
+To set the the environment variables in the System Properties:
+1. Select the 'System' icon in the control Panel
+2. Select the 'Advanced' tab
+3. Select the 'Environment Variables' button
+4. In the user area set all variables as you did above that
+were used in the setafs.bat file.
+
+To build a new work space to debug afs_creds.exe:
+
+1. Create New Workspace -
+Select from Microsoft Visual C++ toolbar file New
+Select from 'new' Project Tab Makefile Project name: Creds
+Location Y:\src\winnt\client_creds
+Select OK
+
+From Dialog Box 'Makefile - Step 1 of 2'
+command line= nmake /f"ntmakefile" install
+Output = y:\dest\root.client\usr\vice\etc\AFSCREDS.EXE
+Select NEXT
+
+Dialog Box 'Makefile - Step 2 of 2'
+Command line= nmake /f"ntmakefile" install
+Output = y:\dest\root.client\usr\vice\etc\AFSCREDS.EXE
+
+Select Finish
+
+Switch to FileView
+Right click on 'Source Files' and select 'Add Files to folder', select
+all *.cpp files.
+
+Right click on 'Header Files' and select 'Add Files to folder', select
+all *.h files.
+
+Right click on 'creds files' and select 'New Folder'
+Fill name in 'Build'
+
+From the toolbar select Build
+Select 'Build All'
+
+You should see the following string when the compile is finished:
+"afs_creds.exe - 0 errors(0), 0 warnings(s)"
+
+Press <F5> to execute afs_creds.exe.
+
+STEP M. Optional Items
+
+The build process has an error table that is compiled for many OpenAFS
+applications. This table is generated by Unix based tools. It is not
+normally necessary to modify this table so pre-generated source files
+are included in the OpenAFS source. If you need to make modifications
+in these areas the Unix base tools that run on Windows can be found on
+the web. For example:
+
+ http://cygwin.com/
+
+Below is a short explanation how to update the error table.
+
+(1) Install flex and bison from a Unix based tool provider.
+
+(2) Make changes to the source files.
+
+There are two files in the source tree that are processed with lex
+and yacc on UNIX systems, src/comerr/et_lex.lex.l and
+src/comerr/error_table.y, that when processed produce the files
+et_lex.lex_nt.c, error_table_nt.c, and error_table_nt.h.
+
+Since NT does not include lex and yacc or any equivalent tools, we
+have provided the output files that lex and yacc produce (using Win32
+ports of flex and bison). This will allow builds to work for anyone
+who does not need to change the .l and .y files.
+
+If you do need to change et_lex.lex.l, then you will need to install
+Win32 port of flex on your system. Put flex.exe in a directory on the
+path and rebuild.
+
+If you do need to change error_table.y, then you will need to install
+a Win32 port of bison on your system. Put bison.exe in a directory on
+the path, configure bison as explained in step 5, and rebuild.
+
+You can also attempt to use other replacements for lex and yacc. This
+will require modifying the LEX and YACC settings in
+/config/NTMakefile.i386_nt40. If the replacements require different
+command line options than flex and bison, then you may also need to
+change src/comerr/NTMakefile.
+
+(3) Generate new OpenAFS binaries
+
+
+STEP N. Required patches for 1.2.2a and earlier releases
+
+There are two set of patches must be applied to 1.2.2a source to
+successfully build the binaries:
+
+(1) Patches applied to 1.2.2a to build binaries, excluding install
+package.
+
+diff -Nur --exclude-from=exclude bas/src/NTMakefile upd/src/NTMakefile
+--- bas/src/NTMakefile Wed Nov 14 19:38:06 2001
++++ upd/src/NTMakefile Mon Dec 3 14:41:12 2001
+@@ -471,6 +471,7 @@
+ $(CD) $(OBJ)\$@
+ $(NTMAKE)
+ $(CD) ..\..
++ echo Build Finished Successfully
+
+ install: start finale
+
+@@ -487,6 +488,7 @@
+ $(CD) ..\..\..\..
+
+ media: InstallShield5
++ echo Install Script Finished Successfully
+
+
+(2) Patches applied to 1.2.2a to build install package.
+
+diff -Nur --exclude-from=exclude bas/src/WINNT/afsd/NTMakefile upd/src/WINNT/afsd/NTMakefile
+--- bas/src/WINNT/afsd/NTMakefile Tue Nov 20 22:45:40 2001
++++ upd/src/WINNT/afsd/NTMakefile Wed Dec 5 11:42:46 2001
+@@ -169,8 +169,8 @@
+ $(EXEDIR)\tokens.exe \
+ $(EXEDIR)\unlog.exe $(EXEDIR)\afsd.exe $(EXEDIR)\afsd_service.exe \
+ $(EXEDIR)\fs.exe $(EXEDIR)\symlink.exe \
+- $(LOGON_DLLFILE) $(LOG95_DLLFILE) \
+- $(EXEDIR)\afsshare.exe \
++ $(LOGON_DLLFILE) \
++ $(EXEDIR)\afsshare.exe \
+ $(DESTDIR)\bin\kpasswd.exe
+
+ install9X: install_headers $(CONF_DLLFILE) \
+
+diff -Nur --exclude-from=exclude bas/src/WINNT/install/InstallShield5/NTMakefile upd/src/WINNT/install/InstallShield5/NTMakefile
+--- bas/src/WINNT/install/InstallShield5/NTMakefile Wed Nov 14 19:38:50 2001
++++ upd/src/WINNT/install/InstallShield5/NTMakefile Mon Dec 3 16:43:08 2001
+@@ -60,7 +60,7 @@
+ $(MKDIR) $(DESTDIR)\Wininstall\PackageWeb
+ ! ENDIF
+ $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*
+- $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a
++ "$(ISWEB)\Pftwwiz.exe" $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a
+ !ENDIF
+ xcopy /s/e/y "Media\OpenAFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
+ copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
+diff -Nur --exclude-from=exclude bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC
+--- bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC Thu Sep 6 20:54:58 2001
++++ upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.RC Mon Dec 3 15:11:46 2001
+@@ -10,7 +10,7 @@
+ #define APSTUDIO_HIDDEN_SYMBOLS
+ #include "windows.h"
+ #undef APSTUDIO_HIDDEN_SYMBOLS
+-#include <.\sdrc.h>
++#include <sdrc.h>
+
+ /////////////////////////////////////////////////////////////////////////////
+ #undef APSTUDIO_READONLY_SYMBOLS
+diff -Nur --exclude-from=exclude bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep
+--- bas/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep Thu Sep 6 20:54:58 2001
++++ upd/src/WINNT/afs_setup_utils/_isuser/_IsUser.dep Wed Dec 31 16:00:00 1969
+@@ -1,5 +0,0 @@
+-# Microsoft Developer Studio Generated Dependency File, included by _IsUser.mak
+-
+-.\_Isuser.RC : \
+- ".\sdrc.h"\
+-
+diff -Nur --exclude-from=exclude bas/src/WINNT/afs_setup_utils/_isuser/ntmakefile upd/src/WINNT/afs_setup_utils/_isuser/ntmakefile
+--- bas/src/WINNT/afs_setup_utils/_isuser/ntmakefile Mon Sep 10 09:39:50 2001
++++ upd/src/WINNT/afs_setup_utils/_isuser/ntmakefile Mon Dec 3 15:16:04 2001
+@@ -30,14 +30,6 @@
+ "$(OUTDIR)" ::
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+-HEADERS = ".\sdrc.h"
+-
+-".\sdrc.h" : $(IS5ROOT)\INCLUDE\sdrc.h
+- $(COPY) $(IS5ROOT)\INCLUDE\sdrc.h .
+-! IF EXIST($(IS5ROOT)\Script\ISRT\Include\sdrc.h)
+- $(COPY) $(IS5ROOT)\Script\ISRT\Include\sdrc.h .
+-! ENDIF
+-
+ CPP=cl.exe
+ CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_ISUSER_EXPORTS" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+
+@@ -85,20 +77,10 @@
+ "$(INTDIR)\_isuser.obj" \
+ "$(INTDIR)\_Isuser.res"
+
+-"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(HEADERS) $(DEF_FILE) $(LINK32_OBJS)
++"$(OUTDIR)\_IsUser.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+ <<
+-
+-
+-!IF "$(NO_EXTERNAL_DEPS)" != "1"
+-!IF EXISTS("_IsUser.dep")
+-!INCLUDE "_IsUser.dep"
+-!ELSE
+-!MESSAGE Warning: cannot find "_IsUser.dep"
+-!ENDIF
+-!ENDIF
+-
+
+ SOURCE=.\_isuser.c
# License. For details, see the LICENSE file in the top-level source
# directory or online at http://www.openafs.org/dl/license10.html
+AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL"
AFSDEV_NETGUI = 1
RELDIR=WINNT\afsd
!INCLUDE ..\..\config\NTMakefile.$(SYS_NAME)
INCFILEDIR = $(DESTDIR)\include\afs # header file install directory
+# afsdicon and below added for WINNT\extra support
+
INCFILES =\
$(INCFILEDIR)\afsd.h \
$(INCFILEDIR)\cm.h \
!IFDEF OSICRASH
$(INCFILEDIR)\afsdcrash.h \
!ENDIF
- $(INCFILEDIR)\cm_dns_private.h
+ $(INCFILEDIR)\cm_dns_private.h \
+ $(INCFILEDIR)\lanahelper.h \
+ $(INCFILEDIR)\afsdicon.h \
+ $(INCFILEDIR)\cm_callback.h \
+ $(INCFILEDIR)\cm_aclent.h \
+ $(INCFILEDIR)\cm_volume.h \
+ $(INCFILEDIR)\cm_dcache.h \
+ $(INCFILEDIR)\cm_access.h \
+ $(INCFILEDIR)\cm_vnodeops.h \
+ $(INCFILEDIR)\cm_dir.h \
+ $(INCFILEDIR)\cm_utils.h \
+ $(INCFILEDIR)\cm_daemon.h \
+ $(INCFILEDIR)\cm_ioctl.h \
+ $(INCFILEDIR)\cm_dnlc.h \
+ $(INCFILEDIR)\cm_buf.h \
+ $(INCFILEDIR)\cm_freelance.h \
+ $(INCFILEDIR)\afsd_eventlog.h \
+ $(INCFILEDIR)\afsd_eventmessages.h
IDLFILES =\
- afsrpc.h $(OUT)\afsrpc_c.c
+ afsrpc.h $(OUT)\afsrpc_c.obj
CONFOBJS=$(OUT)\cm_config.obj \
$(OUT)\cm_dns.obj
!IFDEF OSICRASH
$(OUT)\afsdcrash.obj \
!ENDIF
- $(OUT)\cm_freelance.obj
+ $(OUT)\cm_freelance.obj \
+ $(OUT)\lanahelper.obj \
+ $(OUT)\afsd_eventlog.obj \
+ $(OUT)\afsd_flushvol.obj
+
+$(AFSDOBJS):
$(OUT)\cm_conn.obj: cm_conn.c
- $(C2OBJ) -DAFS_PTHREAD_ENV $**
+ $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
FSOBJS=$(OUT)\fs.obj $(OUT)\fs_utils.obj
ILIBDIR = $(DESTDIR)\lib
+#
+# Rules for message compiler info for logging events
+#
+$(INCFILEDIR)\afsd_eventmessages.h: afsd_eventmessages.mc
+ mc afsd_eventmessages.mc
+
############################################################################
#
# Flags for linking LOGON DLL'S
CONF_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\libafsconf.dll
CONF_DLLLIBS = \
+ dnsapi.lib \
$(DESTDIR)\lib\afs\afsutil.lib \
$(DESTDIR)\lib\afs\afsreg.lib
$(OUT)\afslogon.res
LOGON_DLLLIBS =\
+ dnsapi.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\libafsconf.lib
$(OUT)\afslog95.res
LOG95_DLLLIBS =\
+ dnsapi.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\libafsconf.lib
# assorted exe's
EXELIBS = \
+ dnsapi.lib \
$(DESTDIR)\lib\afs\afsauth.lib \
$(DESTDIR)\lib\afs\afskauth.lib \
$(DESTDIR)\lib\afs\afsprot.lib \
AFSD_EXELIBS =\
largeint.lib \
netapi32.lib \
- mpr.lib \
+ mpr.lib \
+ dnsapi.lib \
$(DESTDIR)\lib\libosi.lib \
$(DESTDIR)\lib\afsrpc.lib \
+ $(DESTDIR)\lib\afsrx.lib \
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afs\mtafsvldb.lib \
$(DESTDIR)\lib\afs\mtafsint.lib \
# afsd_service.exe
$(EXEDIR)\afsd_service.exe: $(OUT)\afsd_service.obj $(AFSDOBJS) $(OUT)\afsd_service.res $(RXOBJS)
- $(EXECONLINK) $(AFSD_EXELIBS)
+ $(EXECONLINK) $(AFSD_EXELIBS) /NODEFAULTLIB:libc.lib /MAP
$(EXEPREP)
# fs.exe
KPASSWD_LIBS =\
$(DESTDIR)\lib\afsauthent.lib \
$(DESTDIR)\lib\afsrpc.lib \
+ $(DESTDIR)\lib\afsrx.lib \
$(DESTDIR)\lib\afs\afscmd.lib \
$(DESTDIR)\lib\afsdes.lib \
$(DESTDIR)\lib\afs\afsutil.lib
$(OUT)\kpasswd.obj: $(KAUTH)/kpasswd.c
- $(C2OBJ) -DAFS_PTHREAD_ENV $**
+ $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
$(OUT)\kkids.obj: $(KAUTH)/kkids.c
- $(C2OBJ) -DAFS_PTHREAD_ENV $**
+ $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
$(OUT)\kautils.obj: $(KAUTH)/kautils.c
- $(C2OBJ) -DAFS_PTHREAD_ENV $**
+ $(C2OBJ) -DAFS_PTHREAD_ENV /Fo$@ $**
+
+$(OUT)\kpasswd.res: $(KAUTH)\kpasswd.rc
+ $(RC) /Fo$@ $**
$(DESTDIR)\bin\kpasswd.exe: $(KPASSWD_OBJS) $(KPASSWD_LIBS)
$(DEL) $(DESTDIR)\bin\kpasswd.exe
############################################################################
# generate versioninfo resources
-$(OUT)\afsshare.res: AFS_component_version_number.h
+$(OUT)\afsshare.res: afsshare.rc AFS_component_version_number.h
-$(OUT)\fs.res: AFS_component_version_number.h
+$(OUT)\fs.res: fs.rc AFS_component_version_number.h
-$(OUT)\symlink.res: AFS_component_version_number.h
+$(OUT)\symlink.res: symlink.rc AFS_component_version_number.h
-$(OUT)\klog.res: AFS_component_version_number.h
+$(OUT)\klog.res: klog.rc AFS_component_version_number.h
-$(OUT)\tokens.res: AFS_component_version_number.h
+$(OUT)\tokens.res: tokens.rc AFS_component_version_number.h
-$(OUT)\unlog.res: AFS_component_version_number.h
+$(OUT)\unlog.res: unlog.rc AFS_component_version_number.h
-$(OUT)\afsd_service.res: AFS_component_version_number.h
+afsd_eventmessages.rc: afsd_eventmessages.h
-$(OUT)\afslogon.res: AFS_component_version_number.h
+$(OUT)\afsd_service.res: afsd_service.rc afsd_eventmessages.rc AFS_component_version_number.h
-$(OUT)\afslog95.res: AFS_component_version_number.h
+$(OUT)\afslogon.res: afslogon.rc AFS_component_version_number.h
-$(OUT)\libafsconf.res: AFS_component_version_number.h
+$(OUT)\afslog95.res: afslog95.rc AFS_component_version_number.h
+$(OUT)\libafsconf.res: libafsconf.rc AFS_component_version_number.h
+
+############################################################################
clean::
$(DEL) $(OUT)\*.res
$(DEL) afsrpc.h
$(DEL) afsrpc_?.*
+ $(DEL) afsd_eventmessages.h
$(DEL) $(CONF_DLLFILE)
$(DEL) $(LOGON_DLLFILE)
$(DEL) $(LOG95_DLLFILE)
--- /dev/null
+////////////////////////////////////////////////////////////////////
+//
+//
+// E V E N T L O G G I N G F U N C T I O N S
+//
+//
+////////////////////////////////////////////////////////////////////
+
+
+#include <windows.h>
+#include <stdarg.h>
+#include <string.h>
+#include "afsd_eventlog.h"
+
+#define SZSERVICEPATH "System\\CurrentControlSet\\Services\\"
+#define SZSERVICENAME "TransarcAFSDaemon"
+
+static CHAR szKeyName[] = "System\\CurrentControlSet\\Services\\EventLog\\Application\\TransarcAFSDaemon";
+
+static BOOL GetServicePath(LPTSTR lpPathBuf, PDWORD pdwPathBufSize);
+static BOOL AddEventSource(void);
+
+static BOOL
+GetServicePath(LPTSTR lpPathBuf, PDWORD pdwPathBufSize)
+{
+ HKEY hKey = NULL;
+ UCHAR szBuf[MAX_PATH];
+ DWORD dwData = 0;
+ BOOL bRet = TRUE;
+
+ do {
+ // Prepare path in Registry
+ memset(szBuf, '\0', MAX_PATH);
+ strcpy(szBuf, SZSERVICEPATH);
+ strcat(szBuf, "TransarcAFSDaemon");
+
+ // Open key
+ if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szBuf, 0, KEY_QUERY_VALUE, &hKey ) )
+ {
+ bRet = FALSE;
+ break;
+ }
+
+ // prepare user's buffer and read into it
+ dwData = *pdwPathBufSize;
+ memset(lpPathBuf, '\0', dwData);
+ if ( RegQueryValueEx(
+ hKey, // handle to key
+ "ImagePath", // value name
+ NULL, // reserved
+ NULL, // type buffer
+ (LPBYTE) lpPathBuf, // data buffer
+ &dwData)) // size of data buffer
+ {
+ bRet = FALSE;
+ break;
+ }
+
+ *pdwPathBufSize = dwData;
+
+ } while (0);
+
+ if (hKey != NULL)
+ RegCloseKey(hKey);
+
+ return bRet;
+}
+
+//
+// Ensure name for message file is in proper location in Registry.
+//
+static BOOL
+AddEventSource()
+{
+ HKEY hKey = NULL;
+ UCHAR szBuf[MAX_PATH];
+ DWORD dwData, dwDisposition;
+ BOOL bRet = TRUE;
+
+ do {
+ // Let's see if key already exists as a subkey under the
+ // Application key in the EventLog registry key. If not,
+ // create it.
+ if ( RegOpenKeyEx( HKEY_LOCAL_MACHINE, szKeyName, 0,
+ KEY_QUERY_VALUE, &hKey ) )
+ {
+ // nope - create it
+ if ( RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0,
+ NULL, REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS, NULL, &hKey,
+ &dwDisposition))
+ {
+ bRet = FALSE;
+ break;
+ }
+
+ // Set the name of the message file
+ // Get "ImagePath" from TransarcAFSDaemon service
+ memset(szBuf, '\0', MAX_PATH);
+ dwData = MAX_PATH;
+ GetServicePath(szBuf, &dwData);
+
+ // Add the name to the EventMessageFile subkey.
+ if ( RegSetValueEx(
+ hKey, // subkey handle
+ "EventMessageFile", // value name
+ 0, // must be zero
+ REG_EXPAND_SZ, // value type
+ (LPBYTE) szBuf, // pointer to value data
+ strlen(szBuf) + 1)) // length of value data
+ {
+ bRet = FALSE;
+ break;
+ }
+
+ // Set the supported event types in the TypesSupported subkey.
+ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
+ EVENTLOG_INFORMATION_TYPE;
+
+ if ( RegSetValueEx(
+ hKey, // subkey handle
+ "TypesSupported", // value name
+ 0, // must be zero
+ REG_DWORD, // value type
+ (LPBYTE) &dwData, // pointer to value data
+ sizeof(DWORD))) // length of value data
+ {
+ bRet = FALSE;
+ break;
+ }
+ }
+
+ else
+ {
+ // key was opened - read it
+ memset(szBuf, '\0', MAX_PATH);
+ dwData = MAX_PATH;
+ if ( RegQueryValueEx(
+ hKey, // handle to key
+ "EventMessageFile", // value name
+ NULL, // reserved
+ NULL, // type buffer
+ (LPBYTE) szBuf, // data buffer
+ &dwData)) // size of data buffer
+ {
+ bRet = FALSE;
+ break;
+ }
+ }
+
+ } while (0);
+
+ if (hKey != NULL)
+ RegCloseKey(hKey);
+
+ return bRet;
+}
+
+// Log an event with a formatted system message as the (only) substitution
+// string, from the given message ID.
+VOID
+LogEventMessage(WORD wEventType, DWORD dwEventID, DWORD dwMessageID)
+{
+ LPTSTR msgBuf;
+
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
+ NULL, dwMessageID, 0, (LPTSTR)&msgBuf, 0, NULL);
+ LogEvent(wEventType, dwEventID, msgBuf, NULL);
+ LocalFree(msgBuf);
+}
+
+//
+// Use the ReportEvent API to write an entry to the system event log.
+//
+#define MAXSTRINGARGS 100
+VOID
+LogEvent(WORD wEventType, DWORD dwEventID, LPTSTR lpString, ...)
+{
+ va_list listStrings;
+ HANDLE hEventSource;
+ LPTSTR lpStrings[MAXSTRINGARGS];
+ WORD wNumStrings;
+
+ // Ensure that our event source is properly initialized.
+ if (!AddEventSource())
+ return;
+
+ // Get a handle to the event log.
+ hEventSource = RegisterEventSource(NULL, SZSERVICENAME);
+ if (hEventSource == NULL)
+ return;
+
+ // Construct the array of substitution strings.
+ va_start(listStrings, lpString);
+ for (wNumStrings = 0;
+ lpString != NULL && wNumStrings < MAXSTRINGARGS;
+ wNumStrings++)
+ {
+ lpStrings[wNumStrings] = lpString;
+ // Advance to the next argument.
+ lpString = va_arg(listStrings, LPTSTR);
+ }
+ va_end(listStrings);
+
+ // Make sure we were not given too many args.
+ if (wNumStrings >= MAXSTRINGARGS)
+ return;
+
+ // Log the event.
+ ReportEvent(hEventSource, // handle of event source
+ wEventType, // event type
+ 0, // event category
+ dwEventID, // event ID
+ NULL, // current user's SID
+ wNumStrings, // strings in lpszStrings
+ 0, // no bytes of raw data
+ lpStrings, // array of error strings
+ NULL); // no raw data
+
+ DeregisterEventSource(hEventSource);
+}
--- /dev/null
+// This header contains needed definitions and declarations for afsd's
+// event logging functions.
+
+#ifndef __AFSD_EVENTLOG_H_
+#define __AFSD_EVENTLOG_H_ 1
+
+// Include the event log message definitions.
+#include "afsd_eventmessages.h"
+
+VOID LogEventMessage(WORD wEventType, DWORD dwEventID, DWORD dwMessageID);
+VOID LogEvent(WORD wEventType, DWORD dwEventID, LPTSTR lpString, ...);
+
+#endif /* __AFSD_EVENTLOG_H_ */
--- /dev/null
+;//
+;// afsd_eventmessages.mc
+;//
+;// This file contains the message definitions for the
+;// TransarcAFSDaemon service to facilitate system event logging.
+;//
+;//
+;
+;#ifndef __AFSD_EVENTMESSAGES_H_
+;#define __AFSD_EVENTMESSAGES_H_ 1
+
+MessageIdTypedef=DWORD
+
+SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
+ Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
+ Warning=0x2:STATUS_SEVERITY_WARNING
+ Error=0x3:STATUS_SEVERITY_ERROR
+ )
+
+FacilityNames=(System=0x0:FACILITY_SYSTEM
+ Runtime=0x2:FACILITY_RUNTIME
+ Stubs=0x3:FACILITY_STUBS
+ Io=0x4:FACILITY_IO_ERROR_CODE
+ )
+
+LanguageNames=(English=0x409:MSG00409)
+
+MessageId=0x1
+Severity=Informational
+Facility=System
+SymbolicName=MSG_TIME_FLUSH_PER_VOLUME
+Language=English
+Elapsed time to flush AFS volume <%1> = %2 milliseconds.
+.
+
+MessageId=
+Severity=Informational
+Facility=System
+SymbolicName=MSG_TIME_FLUSH_TOTAL
+Language=English
+Total elapsed time to flush %1 AFS volume(s) = %2 milliseconds.
+.
+
+MessageId=
+Severity=Error
+Facility=System
+SymbolicName=MSG_FLUSH_NO_SHARE_NAME
+Language=English
+Cannot get AFS share name to flush volumes.
+.
+
+MessageId=
+Severity=Error
+Facility=System
+SymbolicName=MSG_FLUSH_BAD_SHARE_NAME
+Language=English
+Invalid share name %1; cannot flush volumes.
+.
+
+MessageId=
+Severity=Error
+Facility=System
+SymbolicName=MSG_FLUSH_NO_MEMORY
+Language=English
+Insufficient memory to flush volumes.
+.
+
+MessageId=
+Severity=Error
+Facility=System
+SymbolicName=MSG_FLUSH_OPEN_ENUM_ERROR
+Language=English
+Cannot open enumeration of network resources: %1
+.
+
+MessageId=
+Severity=Error
+Facility=System
+SymbolicName=MSG_FLUSH_ENUM_ERROR
+Language=English
+Cannot enumerate network resources: %1
+.
+
+MessageId=
+Severity=Warning
+Facility=System
+SymbolicName=MSG_FLUSH_FAILED
+Language=English
+Failed to flush volume %1.
+.
+
+MessageId=
+Severity=Error
+Facility=System
+SymbolicName=MSG_FLUSH_IMPERSONATE_ERROR
+Language=English
+Failed to impersonate logged-on user.
+.
+
+MessageId=
+Severity=Warning
+Facility=System
+SymbolicName=MSG_FLUSH_UNEXPECTED_EVENT
+Language=English
+Flush volumes thread received unrecognized event.
+.
+
+
+;#endif /* __AFSD_EVENTMESSAGES_H_ 1 */
--- /dev/null
+LANGUAGE 0x9,0x1
+1 11 MSG00409.bin
--- /dev/null
+//
+// AFSD_FLUSHVOL.C
+//
+// Routines to handle flushing AFS volumes in response to
+// System Power event notification such as Hibernate request.
+//
+/////////////////////////////////////////////////////////////////////
+
+#include <afs/param.h>
+#include <afs/stds.h>
+
+#include <windows.h>
+
+#include <string.h>
+#include <setjmp.h>
+#include "afsd.h"
+#include "afsd_init.h"
+#include "smb.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <malloc.h>
+
+#include <winsock2.h>
+
+#include <osi.h>
+
+#include "afsd_flushvol.h"
+#include "afsd_eventlog.h"
+
+static FLUSHVOLTHREADINFO gThreadInfo = {0};
+static HANDLE gThreadHandle = NULL;
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// Call routine found in FS.EXE to flush volume.
+//
+// At entry, input param is UNC string for volume,
+// e.g. '\\afs\all\athena.mit.edu\user\m\h\mholiday'
+//
+// I believe that success from 'pioctl' routine
+// indicated by return value of zero (0).
+//
+afs_int32
+afsd_ServicePerformFlushVolumeCmd(char *data)
+{
+ register afs_int32 code;
+ struct ViceIoctl blob;
+
+ memset(&blob, '\0', sizeof(blob));
+ code = pioctl(data, VIOC_FLUSHVOLUME, &blob, 0);
+
+ return code;
+}
+
+BOOL
+afsd_ServicePerformFlushVolumes()
+{
+ CONST CHAR COLON = ':';
+ CONST CHAR SLASH = '\\';
+ CONST DWORD NETRESBUFSIZE = 16384;
+ CHAR bufMessage[1024];
+ UINT i;
+ DWORD dwServerSize;
+ DWORD dwRet;
+ DWORD dwCount;
+ DWORD dwNetResBufSize;
+ DWORD dwTotalVols = 0;
+ DWORD dwVolBegin, dwVolEnd;
+ DWORD dwFlushBegin, dwFlushEnd;
+ HANDLE hEnum;
+ LPNETRESOURCE lpNetResBuf, lpnr;
+ PCHAR pszShareName, pc;
+ afs_int32 afsRet = 0;
+
+ // Determine the root share name (\\AFS\ALL or \\<machine>-AFS\ALL),
+ // and the length of the server name prefix.
+ pszShareName = smb_GetSharename();
+ if (pszShareName == NULL)
+ {
+ LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_NO_SHARE_NAME, NULL);
+ return FALSE;
+ }
+ pc = strrchr(pszShareName, SLASH);
+ if ((pc == NULL) || ((dwServerSize = pc - pszShareName) < 3))
+ {
+ LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_BAD_SHARE_NAME,
+ pszShareName, NULL);
+ free(pszShareName);
+ return FALSE;
+ }
+
+ // Allocate a buffer to hold network resources returned by
+ // WNetEnumResource().
+ lpNetResBuf = malloc(NETRESBUFSIZE);
+ if (lpNetResBuf == NULL)
+ {
+ // Out of memory, give up now.
+ LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_NO_MEMORY, NULL);
+ free(pszShareName);
+ return FALSE;
+ }
+
+ // Initialize the flush timer. Note that GetTickCount() returns
+ // the number of milliseconds since the system started, in a DWORD,
+ // so that the value wraps around every 49.7 days. We do not bother
+ // to handle the case where the flush elapsed time is greater than
+ // that.
+ dwFlushBegin = GetTickCount();
+
+ dwRet = WNetOpenEnum(RESOURCE_CONNECTED, RESOURCETYPE_ANY, 0, NULL,
+ &hEnum);
+ if (dwRet != NO_ERROR)
+ {
+ LogEventMessage(EVENTLOG_ERROR_TYPE, MSG_FLUSH_OPEN_ENUM_ERROR,
+ dwRet);
+ free(pszShareName);
+ return FALSE;
+ }
+
+ // Loop to enumerate network resources, and flush those associated
+ // with AFS volumes.
+ while (1)
+ {
+ dwCount = -1;
+ memset(lpNetResBuf, 0, NETRESBUFSIZE);
+ dwNetResBufSize = NETRESBUFSIZE;
+ dwRet = WNetEnumResource(hEnum, &dwCount,
+ lpNetResBuf, &dwNetResBufSize);
+ if (dwRet != NO_ERROR)
+ break;
+ // Iterate over the returned network resources.
+ for (i = 0, lpnr = lpNetResBuf; i < dwCount; i++, lpnr++)
+ {
+ // Ensure resource has a remote name, and is connected.
+ if ((lpnr->lpRemoteName == NULL) ||
+ (lpnr->dwScope != RESOURCE_CONNECTED))
+ continue;
+ if ((_strnicmp(lpnr->lpRemoteName, pszShareName,
+ dwServerSize) == 0) &&
+ (lpnr->lpRemoteName[dwServerSize] == SLASH))
+ {
+ // got one!
+ // but we don't want to flush '\\[...]afs\all'
+ if (_stricmp(lpnr->lpRemoteName,
+ pszShareName) == 0)
+ continue;
+ ++dwTotalVols;
+
+ dwVolBegin = GetTickCount();
+ afsRet = afsd_ServicePerformFlushVolumeCmd(lpnr->lpRemoteName);
+ dwVolEnd = GetTickCount();
+ if (afsRet == 0)
+ {
+ LogTimingEvent(MSG_TIME_FLUSH_PER_VOLUME,
+ lpnr->lpRemoteName,
+ dwVolEnd - dwVolBegin);
+ }
+ else
+ {
+ LogEvent(EVENTLOG_WARNING_TYPE,
+ MSG_FLUSH_FAILED,
+ lpnr->lpRemoteName, NULL);
+ }
+ }
+ }
+ }
+ WNetCloseEnum(hEnum);
+ free(lpNetResBuf);
+ free(pszShareName);
+ if (dwRet != ERROR_NO_MORE_ITEMS)
+ {
+ LogEventMessage(EVENTLOG_ERROR_TYPE, MSG_FLUSH_ENUM_ERROR,
+ dwRet);
+ return FALSE;
+ }
+
+ dwFlushEnd = GetTickCount();
+
+ // display total volume count in Event Logger
+ sprintf(bufMessage, "%d", dwTotalVols);
+ LogTimingEvent(MSG_TIME_FLUSH_TOTAL, bufMessage,
+ dwFlushEnd - dwFlushBegin);
+
+ return TRUE;
+}
+
+// Report a timing event to the system event log.
+// The lpszString1 argument is the first substitution string for the
+// given event ID. The time argument will be converted into the
+// second substitution string.
+static VOID
+LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime)
+{
+ CHAR szTime[16];
+
+ sprintf(szTime, "%lu", dwTime);
+ LogEvent(EVENTLOG_INFORMATION_TYPE, dwEventID, lpString1, szTime,
+ NULL);
+}
+
+
+/////////////////////////////////////////////////////////////////////
+//
+// GetUserToken
+//
+// Obtain token for the currently logged-in user.
+//
+// This routine looks for a window which we 'know' belongs to
+// the shell, and from there we follow a route which leads to
+// getting a handle on an access token owned by the shell.
+//
+// The return value is either a handle to a suitable token,
+// or else null.
+//
+// One of the times that this function might return null
+// is when there is no logged-in user. Other cases include
+// insufficient access to the desktop, etc.
+//
+// Disclaimer:
+// Portions of this routine found in various newsgroups
+//
+HANDLE GetUserToken(DWORD access)
+{
+ HANDLE hTok = NULL;
+ DWORD pid = 0, tid = 0;
+
+ // Try it the easy way first - look for a window owned by the shell on
+ // our current desktop. If we find one, use that to get the process id.
+ HWND shell = FindWindowEx(NULL, NULL, "Progman", NULL);
+ if (shell != NULL)
+ {
+ tid = GetWindowThreadProcessId(shell, &pid);
+ }
+
+ // We are possibly running on a private window station and desktop: we must
+ // switch to the default (which we suppose is where we will find the
+ // running shell).
+ else
+ {
+ HWINSTA saveWinSta = GetProcessWindowStation();
+ HDESK saveDesk = GetThreadDesktop(GetCurrentThreadId());
+ HWINSTA winSta = NULL;
+ HDESK desk = NULL;
+ BOOL changeFlag = FALSE;
+ BOOL dummy = saveWinSta != NULL &&
+ saveDesk != NULL &&
+ (winSta = OpenWindowStation("WinSta0", FALSE,
+ MAXIMUM_ALLOWED)) != NULL &&
+ (changeFlag = SetProcessWindowStation(winSta)) != 0 &&
+ (desk = OpenDesktop("Default", 0, FALSE,
+ MAXIMUM_ALLOWED)) != NULL &&
+ SetThreadDesktop(desk) != 0;
+
+ // Now find the window and process on this desktop
+ shell = FindWindowEx(NULL, NULL, "Progman", NULL);
+ if (shell != NULL)
+ {
+ tid = GetWindowThreadProcessId(shell, &pid);
+ }
+
+ // Restore our own window station and desktop
+ if (changeFlag)
+ {
+ SetProcessWindowStation(saveWinSta);
+ SetThreadDesktop(saveDesk);
+ }
+
+ // Close temporary objects
+ if (winSta != NULL)
+ CloseWindowStation(winSta);
+ if (desk != NULL)
+ CloseDesktop(desk);
+ }
+
+ //
+ // If we have a process id, use that to get the process handle and
+ // from there the process' access token.
+ //
+ if (pid != 0)
+ {
+ HANDLE hProc = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
+ if (hProc != NULL)
+ {
+ OpenProcessToken(hProc, access, &hTok) || (hTok = NULL);
+ CloseHandle(hProc);
+ }
+ }
+
+ // Return token if we got one
+ return hTok;
+}
+
+// impersonate logged-on user as client
+BOOL
+ImpersonateClient()
+{
+ DWORD dwDesiredAccess = TOKEN_ALL_ACCESS;
+ HANDLE hUserToken = GetUserToken(dwDesiredAccess);
+
+ if (hUserToken == NULL)
+ return FALSE;
+ if (ImpersonateLoggedOnUser(hUserToken) == 0)
+ {
+ LogEvent(EVENTLOG_ERROR_TYPE, MSG_FLUSH_IMPERSONATE_ERROR,
+ NULL);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+// Thread proc
+//
+DWORD WINAPI
+afsd_ServiceFlushVolumesThreadProc(LPVOID lpParam)
+{
+ FLUSHVOLTHREADINFO ThreadInfo;
+ PFLUSHVOLTHREADINFO pThreadInfo = (PFLUSHVOLTHREADINFO) lpParam;
+ HANDLE arHandles[2] = {0};
+ DWORD dwWaitState = 0;
+
+ // thread running - get handles
+ ThreadInfo.hEventPowerEvent = pThreadInfo->hEventPowerEvent;
+ ThreadInfo.hEventResumeMain = pThreadInfo->hEventResumeMain;
+ ThreadInfo.hEventTerminate = pThreadInfo->hEventTerminate;
+
+ // setup to wait
+ arHandles[0] = ThreadInfo.hEventTerminate;
+ arHandles[1] = ThreadInfo.hEventPowerEvent;
+
+ // do stuff ..
+ while (1)
+ {
+ // wait for an event to happen
+ dwWaitState = WaitForMultipleObjectsEx(2, arHandles, FALSE, INFINITE, FALSE);
+
+ switch (dwWaitState)
+ {
+ case WAIT_OBJECT_0:
+ // termination signaled
+ RevertToSelf();
+ ExitThread(0);
+ break;
+
+ case WAIT_OBJECT_0+1:
+ // Power event
+ // - flush 'em!
+ if (ImpersonateClient())
+ {
+ afsd_ServicePerformFlushVolumes();
+ }
+ // acknowledge event
+ ResetEvent(ThreadInfo.hEventPowerEvent);
+ break;
+
+ case WAIT_ABANDONED_0:
+ case WAIT_ABANDONED_0+1:
+ case WAIT_IO_COMPLETION:
+ case WAIT_TIMEOUT:
+ // sno*
+ LogEvent(EVENTLOG_WARNING_TYPE,
+ MSG_FLUSH_UNEXPECTED_EVENT, NULL);
+ break;
+
+ } // end switch
+
+ // signal back to waiting mainline
+ SetEvent(ThreadInfo.hEventResumeMain);
+
+ } // end while
+
+ // I suppose we never get here
+ ExitThread(0);
+}
+
+/////////////////////////////////////////////////////////////////////
+//
+// Mainline thread routines
+//
+
+VOID
+CheckAndCloseHandle(HANDLE thisHandle)
+{
+ if (thisHandle != NULL)
+ {
+ CloseHandle(thisHandle);
+ thisHandle = NULL;
+ }
+}
+
+//
+// Thread Creation
+//
+BOOL
+PowerNotificationThreadCreate()
+{
+ BOOL bSuccess = FALSE;
+ DWORD dwThreadId = 0;
+
+ do
+ {
+ // create power event notification event
+ // bManualReset=TRUE, bInitialState=FALSE
+ gThreadInfo.hEventPowerEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if (gThreadInfo.hEventPowerEvent == NULL)
+ break;
+
+ // create mainline resume event
+ // bManualReset=FALSE, bInitialState=FALSE
+ gThreadInfo.hEventResumeMain = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (gThreadInfo.hEventResumeMain == NULL)
+ break;
+
+ // create thread terminate event
+ // bManualReset=FALSE, bInitialState=FALSE
+ gThreadInfo.hEventTerminate = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (gThreadInfo.hEventTerminate == NULL)
+ break;
+
+ // good so far - create thread
+ gThreadHandle = CreateThread(NULL, 0,
+ afsd_ServiceFlushVolumesThreadProc,
+ (LPVOID) &gThreadInfo,
+ 0, &dwThreadId);
+
+ if (!gThreadHandle)
+ break;
+
+ bSuccess = TRUE;
+
+ } while (0);
+
+
+ if (!bSuccess)
+ {
+ CheckAndCloseHandle(gThreadInfo.hEventPowerEvent);
+ CheckAndCloseHandle(gThreadInfo.hEventResumeMain);
+ CheckAndCloseHandle(gThreadInfo.hEventTerminate);
+ CheckAndCloseHandle(gThreadHandle);
+ }
+
+ return bSuccess;
+}
+
+//
+// Thread Notification
+//
+BOOL
+PowerNotificationThreadNotify()
+{
+ DWORD dwRet = 0;
+ BOOL bRet = FALSE;
+
+ // Notify thread of power event, and wait 19 seconds
+ dwRet = SignalObjectAndWait(
+ gThreadInfo.hEventPowerEvent, // object to signal
+ gThreadInfo.hEventResumeMain, // object to watch
+ 19*1000, // timeout (ms)
+ FALSE // alertable
+ );
+
+ if (dwRet == WAIT_OBJECT_0)
+ bRet = TRUE;
+
+ return bRet;
+}
+
+//
+// Thread Termination
+//
+VOID
+PowerNotificationThreadExit()
+{
+ // ExitThread
+ if (gThreadHandle)
+ {
+ SetEvent(gThreadInfo.hEventTerminate);
+ CloseHandle(gThreadHandle);
+ }
+}
+
--- /dev/null
+//
+// AFSD_FLUSHVOL.H
+//
+// Include file for routines that handle flushing AFS volumes
+// in response to System Power event notification such as
+// Hibernate request.
+//
+/////////////////////////////////////////////////////////////////////
+
+#ifndef _AFSD_FLUSHVOL_H_
+#define _AFSD_FLUSHVOL_H_
+
+#include <Winnetwk.h>
+#include "fs_utils.h"
+
+// handles
+typedef struct _tagFLUSHVOLTHREADINFO {
+ HANDLE hEventPowerEvent;
+ HANDLE hEventResumeMain;
+ HANDLE hEventTerminate;
+} FLUSHVOLTHREADINFO, *PFLUSHVOLTHREADINFO;
+
+// invokes fs.exe pioctl
+static afs_int32 afsd_ServicePerformFlushVolumeCmd(char *data);
+
+// thread callback
+static DWORD WINAPI afsd_ServiceFlushVolumesThreadProc(LPVOID lpParameter);
+
+// helper function
+static VOID CheckAndCloseHandle(HANDLE thisHandle);
+
+// thread construction/notification/destruction
+BOOL PowerNotificationThreadCreate(VOID);
+BOOL PowerNotificationThreadNotify(VOID);
+VOID PowerNotificationThreadExit(VOID);
+
+// impersonation helper(s)
+static HANDLE GetUserToken(DWORD access);
+static BOOL ImpersonateClient(void);
+
+// event logging
+static VOID LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime);
+
+#endif // _AFSD_FLUSHVOL_H_
+
#include "smb.h"
#include "cm_rpc.h"
+#include "lanahelper.h"
-extern int RXAFSCB_ExecuteRequest();
-extern int RXSTATS_ExecuteRequest();
+extern int RXAFSCB_ExecuteRequest(struct rx_call *z_call);
+extern int RXSTATS_ExecuteRequest(struct rx_call *z_call);
extern afs_int32 cryptall;
sprintf(u, "%s: %s\n", t, s);
if (afsi_file != INVALID_HANDLE_VALUE)
WriteFile(afsi_file, u, strlen(u), &zilch, NULL);
+#ifdef NOTSERVICE
+ printf("%s", u);
+#endif
} else {
if (afsi_file != INVALID_HANDLE_VALUE)
WriteFile(afsi_file, s, strlen(s), &zilch, NULL);
long stats;
long traceBufSize;
long ltt, ltto;
+ long rx_mtu, rx_nojumbo;
char rootCellName[256];
struct rx_service *serverp;
static struct rx_securityClass *nullServerSecurityClassp;
dummyLen = sizeof(LANadapter);
code = RegQueryValueEx(parmKey, "LANadapter", NULL, NULL,
(BYTE *) &LANadapter, &dummyLen);
- if (code == ERROR_SUCCESS)
+ if (code == ERROR_SUCCESS) {
afsi_log("LAN adapter number %d", LANadapter);
- else {
+ if (LANadapter < 0 || LANadapter > MAX_LANA)
+ LANadapter = -1;
+ } else {
LANadapter = -1;
+ }
+ if ( LANadapter == -1 )
afsi_log("Default LAN adapter number");
- }
dummyLen = sizeof(cacheSize);
code = RegQueryValueEx(parmKey, "CacheSize", NULL, NULL,
cm_NetBiosName[0] = 0; /* default off */
}
+ dummyLen = sizeof(smb_hideDotFiles);
+ code = RegQueryValueEx(parmKey, "HideDotFiles", NULL, NULL,
+ (BYTE *) &smb_hideDotFiles, &dummyLen);
+ if (code != ERROR_SUCCESS) {
+ smb_hideDotFiles = 1; /* default on */
+ }
+ afsi_log("Dot files/dirs will %sbe marked hidden",
+ smb_hideDotFiles ? "" : "not ");
+
+ dummyLen = sizeof(smb_maxMpxRequests);
+ code = RegQueryValueEx(parmKey, "MaxMpxRequests", NULL, NULL,
+ (BYTE *) &smb_maxMpxRequests, &dummyLen);
+ if (code != ERROR_SUCCESS) {
+ smb_maxMpxRequests = 50;
+ }
+ afsi_log("Maximum number of multiplexed sessions is %d", smb_maxMpxRequests);
+
+ dummyLen = sizeof(smb_maxVCPerServer);
+ code = RegQueryValueEx(parmKey, "MaxVCPerServer", NULL, NULL,
+ (BYTE *) &smb_maxVCPerServer, &dummyLen);
+ if (code != ERROR_SUCCESS) {
+ smb_maxVCPerServer = 100;
+ }
+ afsi_log("Maximum number of VCs per server is %d", smb_maxVCPerServer);
+
+ dummyLen = sizeof(rx_nojumbo);
+ code = RegQueryValueEx(parmKey, "RxNoJumbo", NULL, NULL,
+ (BYTE *) &rx_nojumbo, &dummyLen);
+ if (code != ERROR_SUCCESS) {
+ rx_nojumbo = 0;
+ }
+ if(rx_nojumbo)
+ afsi_log("RX Jumbograms are disabled");
+
+ dummyLen = sizeof(rx_mtu);
+ code = RegQueryValueEx(parmKey, "RxMaxMTU", NULL, NULL,
+ (BYTE *) &rx_mtu, &dummyLen);
+ if (code != ERROR_SUCCESS || !rx_mtu) {
+ rx_mtu = -1;
+ }
+ if(rx_mtu != -1)
+ afsi_log("RX maximum MTU is %d", rx_mtu);
+
RegCloseKey (parmKey);
/* setup early variables */
/* These both used to be configurable. */
smb_UseV3 = 1;
- buf_bufferSize = CM_CONFIGDEFAULT_BLOCKSIZE;
+ buf_bufferSize = CM_CONFIGDEFAULT_BLOCKSIZE;
/* turn from 1024 byte units into memory blocks */
- cacheBlocks = (cacheSize * 1024) / buf_bufferSize;
+ cacheBlocks = (cacheSize * 1024) / buf_bufferSize;
/* setup and enable debug log */
afsd_logp = osi_LogCreate("afsd", traceBufSize);
afsi_log("osi_LogCreate log addr %x", (int)afsd_logp);
- osi_LogEnable(afsd_logp);
+ osi_LogEnable(afsd_logp);
logReady = 1;
+ osi_Log0(afsd_logp, "Log init");
+
/* get network related info */
cm_noIPAddr = CM_MAXINTERFACE_ADDR;
code = syscfg_GetIFInfo(&cm_noIPAddr,
- cm_IPAddr, cm_SubnetMask,
- cm_NetMtu, cm_NetFlags);
+ cm_IPAddr, cm_SubnetMask,
+ cm_NetMtu, cm_NetFlags);
if ( (cm_noIPAddr <= 0) || (code <= 0 ) )
afsi_log("syscfg_GetIFInfo error code %d", code);
else
afsi_log("First Network address %x SubnetMask %x",
- cm_IPAddr[0], cm_SubnetMask[0]);
+ cm_IPAddr[0], cm_SubnetMask[0]);
/*
* Save client configuration for GetCacheConfig requests
cm_initParams.setTime = 0;
cm_initParams.memCache = 0;
+ /* Set RX parameters before initializing RX */
+ if ( rx_nojumbo )
+ rx_SetNoJumbo();
+
+ if ( rx_mtu != -1 )
+ rx_SetMaxMTU(rx_mtu);
+
/* initialize RX, and tell it to listen to port 7001, which is used for
- * callback RPC messages.
- */
+ * callback RPC messages.
+ */
code = rx_Init(htons(7001));
afsi_log("rx_Init code %x", code);
if (code != 0) {
/* create an unauthenticated service #1 for callbacks */
nullServerSecurityClassp = rxnull_NewServerSecurityObject();
- serverp = rx_NewService(0, 1, "AFS", &nullServerSecurityClassp, 1,
- RXAFSCB_ExecuteRequest);
+ serverp = rx_NewService(0, 1, "AFS", &nullServerSecurityClassp, 1,
+ RXAFSCB_ExecuteRequest);
afsi_log("rx_NewService addr %x", (int)serverp);
if (serverp == NULL) {
*reasonP = "unknown error";
}
nullServerSecurityClassp = rxnull_NewServerSecurityObject();
- serverp = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats",
- &nullServerSecurityClassp, 1, RXSTATS_ExecuteRequest);
+ serverp = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats",
+ &nullServerSecurityClassp, 1, RXSTATS_ExecuteRequest);
afsi_log("rx_NewService addr %x", (int)serverp);
if (serverp == NULL) {
*reasonP = "unknown error";
return -1;
}
- /* start server threads, *not* donating this one to the pool */
- rx_StartServer(0);
+ /* start server threads, *not* donating this one to the pool */
+ rx_StartServer(0);
afsi_log("rx_StartServer");
/* init user daemon, and other packages */
cm_InitConn();
- cm_InitCell();
-
- cm_InitServer();
+ cm_InitCell();
- cm_InitVolume();
+ cm_InitServer();
- cm_InitIoctl();
+ cm_InitVolume();
+
+ cm_InitIoctl();
- smb_InitIoctl();
+ smb_InitIoctl();
- cm_InitCallback();
+ cm_InitCallback();
- cm_InitSCache(stats);
+ cm_InitSCache(stats);
- code = cm_InitDCache(0, cacheBlocks);
+ code = cm_InitDCache(0, cacheBlocks);
afsi_log("cm_InitDCache code %x", code);
if (code != 0) {
*reasonP = "error initializing cache";
}
#ifdef AFS_AFSDB_ENV
+#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x500
if (cm_InitDNS(cm_dnsEnabled) == -1)
cm_dnsEnabled = 0; /* init failed, so deactivate */
afsi_log("cm_InitDNS %d", cm_dnsEnabled);
#endif
+#endif
code = cm_GetRootCellName(rootCellName);
- afsi_log("cm_GetRootCellName code %d rcn %s", code,
- (code ? "<none>" : rootCellName));
- if (code != 0 && !cm_freelanceEnabled) {
+ afsi_log("cm_GetRootCellName code %d, cm_freelanceEnabled= %d, rcn= %s",
+ code, cm_freelanceEnabled, (code ? "<none>" : rootCellName));
+ if (code != 0 && !cm_freelanceEnabled)
+ {
*reasonP = "can't find root cell name in afsd.ini";
return -1;
+ }
+ else if (cm_freelanceEnabled)
+ cm_rootCellp = NULL;
+
+ if (code == 0 && !cm_freelanceEnabled)
+ {
+ cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
+ afsi_log("cm_GetCell addr %x", (int)cm_rootCellp);
+ if (cm_rootCellp == NULL)
+ {
+ *reasonP = "can't find root cell in afsdcell.ini";
+ return -1;
}
- else if (cm_freelanceEnabled)
- cm_rootCellp = NULL;
-
- if (code == 0 && !cm_freelanceEnabled) {
- cm_rootCellp = cm_GetCell(rootCellName, CM_FLAG_CREATE);
- afsi_log("cm_GetCell addr %x", (int)cm_rootCellp);
- if (cm_rootCellp == NULL) {
- *reasonP = "can't find root cell in afsdcell.ini";
- return -1;
- }
}
#ifdef AFS_FREELANCE_CLIENT
/* this should really be in an init daemon from here on down */
- if (!cm_freelanceEnabled) {
- code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,
- &req, CM_FLAG_CREATE, &cm_rootVolumep);
- afsi_log("cm_GetVolumeByName code %x root vol %x", code,
- (code ? (cm_volume_t *)-1 : cm_rootVolumep));
- if (code != 0) {
+ if (!cm_freelanceEnabled) {
+ code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,
+ &req, CM_FLAG_CREATE, &cm_rootVolumep);
+ afsi_log("cm_GetVolumeByName code %x root vol %x", code,
+ (code ? (cm_volume_t *)-1 : cm_rootVolumep));
+ if (code != 0) {
*reasonP = "can't find root volume in root cell";
return -1;
- }
}
+ }
/* compute the root fid */
if (!cm_freelanceEnabled) {
- cm_rootFid.cell = cm_rootCellp->cellID;
- cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
- cm_rootFid.vnode = 1;
- cm_rootFid.unique = 1;
+ cm_rootFid.cell = cm_rootCellp->cellID;
+ cm_rootFid.volume = cm_GetROVolumeID(cm_rootVolumep);
+ cm_rootFid.vnode = 1;
+ cm_rootFid.unique = 1;
}
else
- cm_FakeRootFid(&cm_rootFid);
+ cm_FakeRootFid(&cm_rootFid);
- code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
+ code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
afsi_log("cm_GetSCache code %x scache %x", code,
- (code ? (cm_scache_t *)-1 : cm_rootSCachep));
+ (code ? (cm_scache_t *)-1 : cm_rootSCachep));
if (code != 0) {
*reasonP = "unknown error";
return -1;
{
char hostName[200];
char *ctemp;
+ lana_number_t lana;
/* Do this last so that we don't handle requests before init is done.
* Here we initialize the SMB listener.
*/
- if (!cm_NetBiosName[0])
- {
- strcpy(hostName, cm_HostName);
- ctemp = strchr(hostName, '.'); /* turn ntdfs.* into ntdfs */
- if (ctemp) *ctemp = 0;
+ if (LANadapter == -1) {
+ /* Find the default LAN adapter to use. First look for
+ * the adapter named AFS; otherwise, unless we are doing
+ * gateway service, look for any valid loopback adapter.
+ */
+ lana = lana_FindLanaByName("AFS");
+ if (lana == LANA_INVALID && !isGateway)
+ lana = lana_FindLoopback();
+ if (lana != LANA_INVALID)
+ LANadapter = lana;
+ }
+ afsi_log("Lana %d", (int) lana);
+ /* If we are using a loopback adapter, we can use the preferred
+ * (but non-unique) server name; otherwise, we must fall back to
+ * the <machine>-AFS name.
+ */
+ if (LANadapter >= 0 && lana_IsLoopback((lana_number_t) LANadapter)) {
+ if ( cm_NetBiosName[0] )
+ strcpy(hostName, cm_NetBiosName);
+ else
+ strcpy(hostName, "AFS");
+ } else {
+ if (!cm_NetBiosName[0])
+ {
+ strcpy(hostName, cm_HostName);
+ ctemp = strchr(hostName, '.'); /* turn ntdfs.* into ntdfs */
+ if (ctemp) *ctemp = 0;
hostName[11] = 0; /* ensure that even after adding the -A, we
* leave one byte free for the netbios server
* type.
*/
- strcat(hostName, "-AFS");
- } else {
- strcpy(hostName, cm_NetBiosName);
+ strcat(hostName, "-AFS");
+ } else {
+ strcpy(hostName, cm_NetBiosName);
+ }
+ _strupr(hostName);
}
- _strupr(hostName);
-
- smb_Init(afsd_logp, hostName, smb_UseV3, LANadapter, numSvThreads,
- aMBfunc);
+ smb_Init(afsd_logp, hostName, smb_UseV3, LANadapter, numSvThreads, aMBfunc);
afsi_log("smb_Init");
return 0;
#include <crtdbg.h>
#endif
+/*
+// The following is defined if you want to receive Power notifications,
+// including Hibernation, and also subsequent flushing of AFS volumes
+//
+// #define REGISTER_POWER_NOTIFICATIONS
+//
+// Check
+*/
+#include "afsd_flushvol.h"
+
extern void afsi_log(char *pattern, ...);
HANDLE WaitToTerminate;
static SERVICE_STATUS ServiceStatus;
static SERVICE_STATUS_HANDLE StatusHandle;
-void afsd_ServiceControlHandler(DWORD ctrlCode)
+DWORD
+afsd_ServiceFlushVolume(DWORD dwlpEventData)
+{
+ DWORD dwRet = ERROR_NETWORK_BUSY; /* or NO_ERROR */
+
+ /*
+ ** If UI bit is not set, user interaction is not possible
+ ** BUT, since we are a NON-interactive service, and therefore
+ ** have NO user I/O, it doesn't much matter.
+ ** This benign code left here as example of how to find this out
+ */
+ BOOL bUI = (dwlpEventData & 1);
+
+ /* flush volume */
+ if ( PowerNotificationThreadNotify() )
+ {
+ dwRet = NO_ERROR;
+ }
+
+ else
+ {
+ /* flush was unsuccessful, or timeout - deny shutdown */
+ dwRet = ERROR_NETWORK_BUSY;
+ }
+
+ /* to deny hibernate, simply return
+ // any value besides NO_ERROR.
+ // For example:
+ // dwRet = ERROR_NETWORK_BUSY;
+ */
+
+ return dwRet;
+}
+
+/*
+** Extended ServiceControlHandler that provides Event types
+** for monitoring Power events, for example.
+*/
+DWORD
+afsd_ServiceControlHandlerEx(
+ DWORD ctrlCode,
+ DWORD dwEventType,
+ LPVOID lpEventData,
+ LPVOID lpContext
+ )
{
HKEY parmKey;
DWORD dummyLen, doTrace;
long code;
+ DWORD dwRet = ERROR_CALL_NOT_IMPLEMENTED;
+
+ switch (ctrlCode)
+ {
+ case SERVICE_CONTROL_STOP:
+ /* Shutdown RPC */
+ RpcMgmtStopServerListening(NULL);
+
+ /* Force trace if requested */
+ code = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ AFSConfigKeyName,
+ 0, KEY_QUERY_VALUE, &parmKey);
+ if (code != ERROR_SUCCESS)
+ goto doneTrace;
+
+ dummyLen = sizeof(doTrace);
+ code = RegQueryValueEx(parmKey, "TraceOnShutdown",
+ NULL, NULL,
+ (BYTE *) &doTrace, &dummyLen);
+ RegCloseKey (parmKey);
+ if (code != ERROR_SUCCESS)
+ doTrace = 0;
+ if (doTrace)
+ afsd_ForceTrace(FALSE);
+
+ doneTrace:
+ ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
+ ServiceStatus.dwWin32ExitCode = NO_ERROR;
+ ServiceStatus.dwCheckPoint = 1;
+ ServiceStatus.dwWaitHint = 10000;
+ ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_POWEREVENT;
+ SetServiceStatus(StatusHandle, &ServiceStatus);
+ SetEvent(WaitToTerminate);
+ dwRet = NO_ERROR;
+ break;
+
+ case SERVICE_CONTROL_INTERROGATE:
+ ServiceStatus.dwCurrentState = SERVICE_RUNNING;
+ ServiceStatus.dwWin32ExitCode = NO_ERROR;
+ ServiceStatus.dwCheckPoint = 0;
+ ServiceStatus.dwWaitHint = 0;
+ ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_POWEREVENT;
+ SetServiceStatus(StatusHandle, &ServiceStatus);
+ dwRet = NO_ERROR;
+ break;
- switch (ctrlCode) {
- case SERVICE_CONTROL_STOP:
- /* Shutdown RPC */
- RpcMgmtStopServerListening(NULL);
-
- /* Force trace if requested */
- code = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
- AFSConfigKeyName,
- 0, KEY_QUERY_VALUE, &parmKey);
- if (code != ERROR_SUCCESS)
- goto doneTrace;
-
- dummyLen = sizeof(doTrace);
- code = RegQueryValueEx(parmKey, "TraceOnShutdown",
- NULL, NULL,
- (BYTE *) &doTrace, &dummyLen);
- RegCloseKey (parmKey);
- if (code != ERROR_SUCCESS)
- doTrace = 0;
- if (doTrace)
- afsd_ForceTrace(FALSE);
-
-doneTrace:
- ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
- ServiceStatus.dwWin32ExitCode = NO_ERROR;
- ServiceStatus.dwCheckPoint = 1;
- ServiceStatus.dwWaitHint = 10000;
- ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
- SetServiceStatus(StatusHandle, &ServiceStatus);
- SetEvent(WaitToTerminate);
- break;
- case SERVICE_CONTROL_INTERROGATE:
- ServiceStatus.dwCurrentState = SERVICE_RUNNING;
- ServiceStatus.dwWin32ExitCode = NO_ERROR;
- ServiceStatus.dwCheckPoint = 0;
- ServiceStatus.dwWaitHint = 0;
- ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
- SetServiceStatus(StatusHandle, &ServiceStatus);
- break;
/* XXX handle system shutdown */
/* XXX handle pause & continue */
- }
+ case SERVICE_CONTROL_POWEREVENT:
+ {
+ /*
+ ** dwEventType of this notification == WPARAM of WM_POWERBROADCAST
+ ** Return NO_ERROR == return TRUE for that message, i.e. accept request
+ ** Return any error code to deny request,
+ ** i.e. as if returning BROADCAST_QUERY_DENY
+ */
+ switch((int) dwEventType)
+ {
+ case PBT_APMQUERYSUSPEND:
+ case PBT_APMQUERYSTANDBY:
+
+#ifdef REGISTER_POWER_NOTIFICATIONS
+ /* handle event */
+ dwRet = afsd_ServiceFlushVolume((DWORD) lpEventData);
+#else
+ dwRet = NO_ERROR;
+#endif
+ break;
+
+ /* allow remaining case PBT_WhatEver */
+ case PBT_APMSUSPEND:
+ case PBT_APMSTANDBY:
+ case PBT_APMRESUMECRITICAL:
+ case PBT_APMRESUMESUSPEND:
+ case PBT_APMRESUMESTANDBY:
+ case PBT_APMBATTERYLOW:
+ case PBT_APMPOWERSTATUSCHANGE:
+ case PBT_APMOEMEVENT:
+ case PBT_APMRESUMEAUTOMATIC:
+ default:
+ dwRet = NO_ERROR;
+ }
+ }
+ } /* end switch(ctrlCode) */
+ return dwRet;
}
#if 1
#define AFSD_INIT_HOOK "AfsdInitHook"
#define AFSD_HOOK_DLL "afsdhook.dll"
-void afsd_Main()
+void afsd_Main(DWORD argc, LPTSTR *argv)
{
long code;
char *reason;
WaitToTerminate = CreateEvent(NULL, TRUE, FALSE, NULL);
#ifndef NOTSERVICE
- StatusHandle = RegisterServiceCtrlHandler(AFS_DAEMON_SERVICE_NAME,
- (LPHANDLER_FUNCTION) afsd_ServiceControlHandler);
+ StatusHandle = RegisterServiceCtrlHandlerEx(AFS_DAEMON_SERVICE_NAME,
+ (LPHANDLER_FUNCTION_EX) afsd_ServiceControlHandlerEx,
+ NULL /* user context */
+ );
ServiceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
ServiceStatus.dwServiceSpecificExitCode = 0;
ServiceStatus.dwCurrentState = SERVICE_START_PENDING;
ServiceStatus.dwWin32ExitCode = NO_ERROR;
ServiceStatus.dwCheckPoint = 1;
- ServiceStatus.dwWaitHint = 15000;
- ServiceStatus.dwControlsAccepted = 0;
+ ServiceStatus.dwWaitHint = 30000;
+ /* accept Power Events */
+ ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_POWEREVENT;
SetServiceStatus(StatusHandle, &ServiceStatus);
#endif
+
{
HANDLE h; char *ptbuf[1];
h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
DeregisterEventSource(h);
}
+#ifdef REGISTER_POWER_NOTIFICATIONS
+ /* create thread used to flush cache */
+ PowerNotificationThreadCreate();
+#endif
+
afsi_start();
/* allow an exit to be called prior to any initialization */
if (code != 0)
osi_panic(reason, __FILE__, __LINE__);
+#ifndef NOTSERVICE
+ ServiceStatus.dwCheckPoint++;
+ ServiceStatus.dwWaitHint -= 5000;
+ SetServiceStatus(StatusHandle, &ServiceStatus);
+#endif
code = afsd_InitDaemons(&reason);
if (code != 0)
osi_panic(reason, __FILE__, __LINE__);
+#ifndef NOTSERVICE
+ ServiceStatus.dwCheckPoint++;
+ ServiceStatus.dwWaitHint -= 5000;
+ SetServiceStatus(StatusHandle, &ServiceStatus);
+#endif
code = afsd_InitSMB(&reason, DummyMessageBox);
if (code != 0)
osi_panic(reason, __FILE__, __LINE__);
ServiceStatus.dwWin32ExitCode = NO_ERROR;
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
- ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+
+ /* accept Power events */
+ ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_POWEREVENT;
SetServiceStatus(StatusHandle, &ServiceStatus);
#endif
{
ServiceStatus.dwCheckPoint = 0;
ServiceStatus.dwWaitHint = 0;
ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+
+ /* also now accept Power events - shutdown maybe? */
+ ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+
+#ifdef REGISTER_POWER_NOTIFICATIONS
+ /* terminate thread used to flush cache */
+ PowerNotificationThreadExit();
+#endif
+
SetServiceStatus(StatusHandle, &ServiceStatus);
}
DWORD __stdcall afsdMain_thread(void* notUsed)
{
- afsd_Main();
+ afsd_Main(0, (LPTSTR*)NULL);
return(0);
}
/* from .xg file */
/* FIXME: these were "long" but Windows NT wants "int" */
-int VL_GetEntryByID(struct rx_connection *, long, long, struct vldbentry *);
+int VL_GetEntryByID(struct rx_connection *, afs_int32, afs_int32, struct vldbentry *);
int VL_GetEntryByNameO(struct rx_connection *, char *, struct vldbentry *);
int VL_ProbeServer(struct rx_connection *);
-int VL_GetEntryBYIDN(struct rx_connection *, long, long, struct nvldbentry *);
+int VL_GetEntryBYIDN(struct rx_connection *, afs_int32, afs_int32, struct nvldbentry *);
int VL_GetEntryByNameN(struct rx_connection *, char *, struct nvldbentry *);
/* from .xg file */
int StartRXAFS_StoreData (struct rx_call *,
struct AFSFid *Fid,
struct AFSStoreStatus *InStatus,
- afs_int32 Pos,
- afs_int32 Length,
- afs_int32 FileLength);
+ afs_uint32 Pos,
+ afs_uint32 Length,
+ afs_uint32 FileLength);
int EndRXAFS_StoreData(struct rx_call *,
struct AFSFetchStatus *OutStatus,
memset(cp, 0, sizeof(*cp));
code = cm_SearchCellFile(namep, fullname, cm_AddCellProc, cp);
if (code) {
+ afsi_log("in cm_GetCell_gen code= %d fullname= %s", code, fullname);
+
#ifdef AFS_AFSDB_ENV
if (cm_dnsEnabled /*&& cm_DomainValid(namep)*/)
code = cm_SearchCellByDNS(namep, fullname, &ttl, cm_AddCellProc, cp);
#include "cm_config.h"
#ifdef AFS_AFSDB_ENV
+#if !defined(DJGPP) && defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x500
+#include <windns.h>
+#define DNSAPI_ENV
+#else
#include "cm_dns.h"
+#endif
#include <afs/afsint.h>
#endif
char AFSConfigKeyName[] =
"SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
+/* TODO: these should be pulled in from dirpath.h */
#define AFS_THISCELL "ThisCell"
#define AFS_CELLSERVDB_UNIX "CellServDB"
#define AFS_CELLSERVDB_NT "afsdcell.ini"
#define AFS_CELLSERVDB AFS_CELLSERVDB_NT
#endif /* DJGPP || WIN95 */
+DWORD TraceOption=1;
+
+#define TRACE_OPTION_EVENT 1
+#define ISLOGONTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
+
+void DebugEvent0_local(char *a)
+{
+ HANDLE h; char *ptbuf[1];
+ if (!ISLOGONTRACE(TraceOption))
+ return;
+ h = RegisterEventSource(NULL, a);
+ ptbuf[0] = a;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
+ DeregisterEventSource(h);
+}
+
+#define MAXBUF_ 131
+
+void DebugEvent_local(char *a,char *b,...)
+{
+ HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+ va_list marker;
+ if (!ISLOGONTRACE(TraceOption))
+ return;
+ h = RegisterEventSource(NULL, a);
+ va_start(marker,b);
+ _vsnprintf(buf,MAXBUF_,b,marker);
+ ptbuf[0] = buf;
+ ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);\
+ DeregisterEventSource(h);
+ va_end(marker);
+}
static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
{
long ip_addr;
int c1, c2, c3, c4;
char aname[256];
-#endif
char *afsconf_path;
+#endif
foundCell = 0;
tfilep = fopen(wdir, "r");
+#if defined(DJGPP) || defined(AFS_WIN95_ENV)
if (!tfilep) {
/* If we are using DJGPP client, cellservdb will be in afsconf dir. */
/* If we are in Win95 here, we are linking with klog etc. and are
tfilep = fopen(wdir, "r");
if (!tfilep) return -2;
}
+#else
+ /* If we are NT or higher, we don't do DJGPP, So just fail */
+ if ( !tfilep )
+ return -2;
+#endif
bestp = fopen(wdir, "r");
-
+
+ DebugEvent_local("AFS- cm_searchfile fopen", "Handle[%x], wdir[%s]", bestp, wdir);
+
/* have we seen the cell line for the guy we're looking for? */
inRightCell = 0;
while (1) {
strcpy(newCellNamep, lineBuffer+1);
inRightCell = 1;
tracking = 0;
+ DebugEvent_local("AFS- cm_searchfile is cell", "inRightCell[%x], linebuffer[%s]",
+ inRightCell, lineBuffer);
}
else if (strnicmp(lineBuffer+1, cellNamep,
strlen(cellNamep)) == 0) {
if (inRightCell) {
#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
/* add the server to the VLDB list */
+ WSASetLastError(0);
thp = gethostbyname(valuep);
+ {
+ int iErr = 0;
+ iErr = WSAGetLastError();
+ DebugEvent_local("AFS- cm_searchfile inRightCell",
+ "thp[%x], valuep[%s], WSAGetLastError[%d]",
+ thp, valuep, iErr);
+ }
if (thp) {
memcpy(&vlSockAddr.sin_addr.s_addr, thp->h_addr,
sizeof(long));
cm_configProc_t *procp, void *rockp)
{
#ifdef AFS_AFSDB_ENV
- int rc;
- int cellHosts[AFSMAXCELLHOSTS];
- int numServers;
- int i;
- struct sockaddr_in vlSockAddr;
-
- rc = getAFSServer(cellNamep, cellHosts, &numServers, ttl);
- if (rc == 0 && numServers > 0) { /* found the cell */
- for (i = 0; i < numServers; i++) {
- memcpy(&vlSockAddr.sin_addr.s_addr, &cellHosts[i],
- sizeof(long));
+#ifndef DNSAPI_ENV
+ int rc;
+ int cellHosts[AFSMAXCELLHOSTS];
+ int numServers;
+ int i;
+ struct sockaddr_in vlSockAddr;
+
+ DebugEvent_local("AFS SearchCellDNS-","Doing search for [%s]", cellNamep);
+ rc = getAFSServer(cellNamep, cellHosts, &numServers, ttl);
+ if (rc == 0 && numServers > 0) { /* found the cell */
+ for (i = 0; i < numServers; i++) {
+ memcpy(&vlSockAddr.sin_addr.s_addr, &cellHosts[i],
+ sizeof(long));
vlSockAddr.sin_family = AF_INET;
/* sin_port supplied by connection code */
if (procp)
(*procp)(rockp, &vlSockAddr, NULL);
if(newCellNamep)
strcpy(newCellNamep,cellNamep);
- }
- return 0; /* found cell */
- }
- else
-#endif /* AFS_AFSDB_ENV */
+ }
+ return 0; /* found cell */
+ }
+ else
return -1; /* not found */
+#else /* DNSAPI_ENV */
+ PDNS_RECORD pDnsCell, pDnsIter, pDnsVol,pDnsVolIter, pDnsCIter;
+ LPSTR vlServers[AFSMAXCELLHOSTS];
+ IP4_ADDRESS vlAddrs[AFSMAXCELLHOSTS];
+ WORD nvlServers;
+ DWORD wttl, i;
+ BOOL success;
+ struct sockaddr_in vlSockAddr;
+
+ success = FALSE;
+
+ /* query the AFSDB records of cell */
+ if(DnsQuery_A(cellNamep, DNS_TYPE_AFSDB, DNS_QUERY_STANDARD, NULL, &pDnsCell, NULL) == ERROR_SUCCESS) {
+
+ memset((void*) &vlSockAddr, 0, sizeof(vlSockAddr));
+
+ nvlServers = 0; wttl = 0;
+
+ /* go through the returned records */
+ for(pDnsIter = pDnsCell;pDnsIter; pDnsIter = pDnsIter->pNext) {
+ /* if we find an AFSDB record with Preference set to 1, we found a volserver */
+ if(pDnsIter->wType == DNS_TYPE_AFSDB && pDnsIter->Data.Afsdb.wPreference == 1) {
+ vlServers[nvlServers++] = pDnsIter->Data.Afsdb.pNameExchange;
+ if(!wttl) wttl = pDnsIter->dwTtl;
+ if(nvlServers == AFSMAXCELLHOSTS) break;
+ }
+ }
+
+ for(i=0;i<nvlServers;i++) vlAddrs[i] = 0;
+
+ /* now check if there are any A records in the results */
+ for(pDnsIter = pDnsCell; pDnsIter; pDnsIter = pDnsIter->pNext) {
+ if(pDnsIter->wType == DNS_TYPE_A)
+ /* check if its for one of the volservers */
+ for(i=0;i<nvlServers;i++)
+ if(stricmp(pDnsIter->pName, vlServers[i]) == 0)
+ vlAddrs[i] = pDnsIter->Data.A.IpAddress;
+ }
+
+ for(i=0;i<nvlServers;i++) {
+ /* if we don't have an IP yet, then we should try resolving the volserver hostname
+ in a separate query. */
+ if(!vlAddrs[i]) {
+ if(DnsQuery_A(vlServers[i], DNS_TYPE_A, DNS_QUERY_STANDARD, NULL, &pDnsVol, NULL) == ERROR_SUCCESS) {
+ for(pDnsVolIter = pDnsVol; pDnsVolIter; pDnsVolIter=pDnsVolIter->pNext) {
+ /* if we get an A record, keep it */
+ if(pDnsVolIter->wType == DNS_TYPE_A && stricmp(vlServers[i], pDnsVolIter->pName)==0) {
+ vlAddrs[i] = pDnsVolIter->Data.A.IpAddress;
+ break;
+ }
+ /* if we get a CNAME, look for a corresponding A record */
+ if(pDnsVolIter->wType == DNS_TYPE_CNAME && stricmp(vlServers[i], pDnsVolIter->pName)==0) {
+ for(pDnsCIter=pDnsVolIter; pDnsCIter; pDnsCIter=pDnsCIter->pNext) {
+ if(pDnsCIter->wType == DNS_TYPE_A && stricmp(pDnsVolIter->Data.CNAME.pNameHost, pDnsCIter->pName)==0) {
+ vlAddrs[i] = pDnsCIter->Data.A.IpAddress;
+ break;
+ }
+ }
+ if(vlAddrs[i]) break;
+ /* TODO: if the additional section is missing, then do another lookup for the CNAME */
+ }
+ }
+ /* we are done with the volserver lookup */
+ DnsRecordListFree(pDnsVol, DnsFreeRecordListDeep);
+ }
+ }
+
+ /* if we found a volserver, then add it */
+ if(vlAddrs[i]) {
+ vlSockAddr.sin_family = AF_INET;
+ vlSockAddr.sin_addr.s_addr = vlAddrs[i];
+ if(procp)
+ (*procp)(rockp, &vlSockAddr, vlServers[i]);
+ success = TRUE;
+ }
+ }
+
+ DnsRecordListFree(pDnsCell, DnsFreeRecordListDeep);
+ }
+
+ if(!success) return -1;
+ else {
+ strcpy(newCellNamep, cellNamep);
+ if(ttl) *ttl = (int) wttl;
+ return 0;
+ }
+
+#endif /* DNSAPI_ENV */
+#else
+ return -1; /* not found */
+#endif /* AFS_AFSDB_ENV */
}
#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
*
* volSyncp and/or cbrp may also be NULL.
*/
+int
cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
struct cm_fid *fidp,
AFSVolSync *volSyncp, cm_callbackRequest_t *cbrp, long errorCode)
cm_HoldSCache(tscp);
symlinkCount = 0;
while (1) {
- tc = *tp++;
+ tc = *tp++;
- /* map Unix slashes into DOS ones so we can interpret Unix
- * symlinks properly
- */
- if (tc == '/') tc = '\\';
-
- if (!haveComponent) {
+ /* map Unix slashes into DOS ones so we can interpret Unix
+ * symlinks properly
+ */
+ if (tc == '/') tc = '\\';
+
+ if (!haveComponent) {
if (tc == '\\') continue;
- else if (tc == 0) {
+ else if (tc == 0) {
if (phase == 1) {
phase = 2;
tp = pathp;
continue;
}
- code = 0;
- break;
- }
- else {
+ code = 0;
+ break;
+ }
+ else {
haveComponent = 1;
- cp = component;
- *cp++ = tc;
+ cp = component;
+ *cp++ = tc;
+ }
+ }
+ else {
+ /* we have a component here */
+ if (tc == 0 || tc == '\\') {
+ /* end of the component; we're at the last
+ * component if tc == 0. However, if the last
+ * is a symlink, we have more to do.
+ */
+ *cp++ = 0; /* add null termination */
+ extraFlag = 0;
+ if ((flags & CM_FLAG_DIRSEARCH) && tc == 0)
+ extraFlag = CM_FLAG_NOMOUNTCHASE;
+ code = cm_Lookup(tscp, component,
+ flags | extraFlag,
+ userp, reqp, &nscp);
+
+ if (code) {
+ cm_ReleaseSCache(tscp);
+ if (psp) cm_FreeSpace(psp);
+ return code;
+ }
+ haveComponent = 0; /* component done */
+ dirScp = tscp; /* for some symlinks */
+ tscp = nscp; /* already held */
+ if (tc == 0 && !(flags & CM_FLAG_FOLLOW) && phase == 2) {
+ code = 0;
+ cm_ReleaseSCache(dirScp);
+ break;
+ }
+
+ /* now, if tscp is a symlink, we should follow
+ * it and assemble the path again.
+ */
+ lock_ObtainMutex(&tscp->mx);
+ code = cm_SyncOp(tscp, NULL, userp, reqp, 0,
+ CM_SCACHESYNC_GETSTATUS
+ | CM_SCACHESYNC_NEEDCALLBACK);
+ if (code) {
+ lock_ReleaseMutex(&tscp->mx);
+ cm_ReleaseSCache(tscp);
+ cm_ReleaseSCache(dirScp);
+ break;
+ }
+ if (tscp->fileType == CM_SCACHETYPE_SYMLINK) {
+ /* this is a symlink; assemble a new buffer */
+ lock_ReleaseMutex(&tscp->mx);
+ if (symlinkCount++ >= 16) {
+ cm_ReleaseSCache(tscp);
+ cm_ReleaseSCache(dirScp);
+ if (psp) cm_FreeSpace(psp);
+ return CM_ERROR_TOOBIG;
}
- }
- else {
- /* we have a component here */
- if (tc == 0 || tc == '\\') {
- /* end of the component; we're at the last
- * component if tc == 0. However, if the last
- * is a symlink, we have more to do.
- */
- *cp++ = 0; /* add null termination */
- extraFlag = 0;
- if ((flags & CM_FLAG_DIRSEARCH) && tc == 0)
- extraFlag = CM_FLAG_NOMOUNTCHASE;
- code = cm_Lookup(tscp, component,
- flags | extraFlag,
- userp, reqp, &nscp);
- if (code) {
- cm_ReleaseSCache(tscp);
- if (psp) cm_FreeSpace(psp);
- return code;
- }
- haveComponent = 0; /* component done */
- dirScp = tscp; /* for some symlinks */
- tscp = nscp; /* already held */
- if (tc == 0 && !(flags & CM_FLAG_FOLLOW) && phase == 2) {
- code = 0;
- cm_ReleaseSCache(dirScp);
- break;
- }
-
- /* now, if tscp is a symlink, we should follow
- * it and assemble the path again.
- */
- lock_ObtainMutex(&tscp->mx);
- code = cm_SyncOp(tscp, NULL, userp, reqp, 0,
- CM_SCACHESYNC_GETSTATUS
- | CM_SCACHESYNC_NEEDCALLBACK);
- if (code) {
- lock_ReleaseMutex(&tscp->mx);
- cm_ReleaseSCache(tscp);
- cm_ReleaseSCache(dirScp);
- break;
- }
- if (tscp->fileType == CM_SCACHETYPE_SYMLINK) {
- /* this is a symlink; assemble a new buffer */
- lock_ReleaseMutex(&tscp->mx);
- if (symlinkCount++ >= 16) {
- cm_ReleaseSCache(tscp);
- cm_ReleaseSCache(dirScp);
- if (psp) cm_FreeSpace(psp);
- return CM_ERROR_TOOBIG;
- }
- if (tc == 0) restp = "";
- else restp = tp;
- code = cm_AssembleLink(tscp, restp,
- &linkScp, &tempsp, userp, reqp);
- if (code) {
- /* something went wrong */
- cm_ReleaseSCache(tscp);
- cm_ReleaseSCache(dirScp);
- break;
- }
-
- /* otherwise, tempsp has the new path,
- * and linkScp is the new root from
- * which to interpret that path.
- * Continue with the namei processing,
- * also doing the bookkeeping for the
- * space allocation and tracking the
- * vnode reference counts.
- */
- if (psp) cm_FreeSpace(psp);
- psp = tempsp;
- tp = psp->data;
- cm_ReleaseSCache(tscp);
- tscp = linkScp; /* already held
- * by AssembleLink */
- /* now, if linkScp is null, that's
- * AssembleLink's way of telling us that
- * the sym link is relative to the dir
- * containing the link. We have a ref
- * to it in dirScp, and we hold it now
- * and reuse it as the new spot in the
- * dir hierarchy.
- */
- if (tscp == NULL) {
- cm_HoldSCache(dirScp);
- tscp = dirScp;
- }
- } /* if we have a sym link */
- else {
- /* not a symlink, we may be done */
- lock_ReleaseMutex(&tscp->mx);
- if (tc == 0) {
- if (phase == 1) {
- phase = 2;
- tp = pathp;
- continue;
- }
- cm_ReleaseSCache(dirScp);
- code = 0;
- break;
- }
- }
- cm_ReleaseSCache(dirScp);
- } /* end of a component */
- else *cp++ = tc;
- } /* we have a component */
- } /* big while loop over all components */
+ if (tc == 0) restp = "";
+ else restp = tp;
+ code = cm_AssembleLink(tscp, restp, &linkScp, &tempsp, userp, reqp);
+ if (code) {
+ /* something went wrong */
+ cm_ReleaseSCache(tscp);
+ cm_ReleaseSCache(dirScp);
+ break;
+ }
+
+ /* otherwise, tempsp has the new path,
+ * and linkScp is the new root from
+ * which to interpret that path.
+ * Continue with the namei processing,
+ * also doing the bookkeeping for the
+ * space allocation and tracking the
+ * vnode reference counts.
+ */
+ if (psp) cm_FreeSpace(psp);
+ psp = tempsp;
+ tp = psp->data;
+ cm_ReleaseSCache(tscp);
+ tscp = linkScp; /* already held
+ * by AssembleLink */
+ /* now, if linkScp is null, that's
+ * AssembleLink's way of telling us that
+ * the sym link is relative to the dir
+ * containing the link. We have a ref
+ * to it in dirScp, and we hold it now
+ * and reuse it as the new spot in the
+ * dir hierarchy.
+ */
+ if (tscp == NULL) {
+ cm_HoldSCache(dirScp);
+ tscp = dirScp;
+ }
+ } /* if we have a sym link */
+ else {
+ /* not a symlink, we may be done */
+ lock_ReleaseMutex(&tscp->mx);
+ if (tc == 0) {
+ if (phase == 1) {
+ phase = 2;
+ tp = pathp;
+ continue;
+ }
+ cm_ReleaseSCache(dirScp);
+ code = 0;
+ break;
+ }
+ }
+ cm_ReleaseSCache(dirScp);
+ } /* end of a component */
+ else *cp++ = tc;
+ } /* we have a component */
+ } /* big while loop over all components */
/* already held */
- if (psp) cm_FreeSpace(psp);
+ if (psp) cm_FreeSpace(psp);
if (code == 0) *outScpp = tscp;
return code;
}
}
/* get hostname or addr, given addr in network byte order */
-char *hostutil_GetNameByINet(long addr)
+char *hostutil_GetNameByINet(afs_uint32 addr)
{
static char hostNameBuffer[256];
struct hostent *thp;
- thp = gethostbyaddr((char *) &addr, sizeof(long), AF_INET);
+ thp = gethostbyaddr((char *) &addr, sizeof(afs_uint32), AF_INET);
if (thp)
strcpy(hostNameBuffer, thp->h_name);
else {
/* Fake error code since NT errno.h doesn't define it */
#include <afs/errmap_nt.h>
-//extern char *hostutil_GetNameByINet(long addr);
+#ifndef hostutil_GetNameByINet
+extern char *hostutil_GetNameByINet(afs_uint32 addr);
+#endif
#ifndef hostutil_GetHostByName
extern struct hostent *hostutil_GetHostByName(char *namep);
--- /dev/null
+#include <afx.h>
+#include <windows.h>
+#include <winreg.h>
+#include <nb30.h>
+#include <tchar.h>
+#include <shellapi.h>
+#include <objbase.h>
+#include <shlobj.h>
+#include <shlwapi.h>
+#include <wtypes.h>
+#include <string.h>
+#include <malloc.h>
+#include "lanahelper.h"
+
+
+extern "C" void afsi_log(...);
+
+static HRESULT getname_shellfolder(WCHAR *wGuid, WCHAR *wName, int NameSize)
+{
+ // This is the GUID for the network connections folder. It is constant.
+ // {7007ACC7-3202-11D1-AAD2-00805FC1270E}
+ const GUID CLSID_NetworkConnections = {
+ 0x7007ACC7, 0x3202, 0x11D1, {
+ 0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E
+ }
+ };
+ LPITEMIDLIST pidl;
+ IShellFolder *pShellFolder;
+ IMalloc *pShellMalloc;
+
+ // Build the display name in the form "::{GUID}".
+ if (wcslen(wGuid) >= MAX_PATH)
+ return E_INVALIDARG;
+ WCHAR szAdapterGuid[MAX_PATH + 2];
+ swprintf(szAdapterGuid, L"::%ls", wGuid);
+
+ // Initialize COM.
+ CoInitialize(NULL);
+
+ // Get the shell allocator.
+ HRESULT hr = SHGetMalloc(&pShellMalloc);
+ if (SUCCEEDED(hr))
+ // Create an instance of the network connections folder.
+ hr = CoCreateInstance(CLSID_NetworkConnections, NULL,
+ CLSCTX_INPROC_SERVER, IID_IShellFolder,
+ reinterpret_cast<LPVOID *>(&pShellFolder));
+ if (SUCCEEDED(hr))
+ hr = pShellFolder->ParseDisplayName(NULL, NULL, szAdapterGuid, NULL,
+ &pidl, NULL);
+ if (SUCCEEDED(hr)) {
+ // Get the display name; this returns the friendly name.
+ STRRET sName;
+ hr = pShellFolder->GetDisplayNameOf(pidl, SHGDN_NORMAL, &sName);
+ if (SUCCEEDED(hr))
+ wcsncpy(wName, sName.pOleStr, NameSize);
+ pShellMalloc->Free(pidl);
+ }
+
+ CoUninitialize();
+ return hr;
+}
+
+// Get the Connection Name for the given GUID.
+extern "C" int lana_GetNameFromGuid(char *Guid, char **Name)
+{
+ typedef HRESULT (WINAPI *HrLanProcAddr)(GUID *, PCWSTR, PWSTR, LPDWORD);
+ HrLanProcAddr HrLanProc = NULL;
+ HMODULE hNetMan;
+ int size;
+ WCHAR *wGuid = NULL;
+ WCHAR wName[MAX_PATH];
+ DWORD NameSize = (sizeof(wName) / sizeof(wName[0]));
+ HRESULT status;
+
+ // Convert the Guid string to Unicode. First we ask only for the size
+ // of the converted string. Then we allocate a buffer of sufficient
+ // size to hold the result of the conversion.
+ size = MultiByteToWideChar(CP_ACP, 0, Guid, -1, NULL, 0);
+ wGuid = (WCHAR *) malloc(size * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, Guid, -1, wGuid, size);
+
+ // First try the IShellFolder interface, which was unimplemented
+ // for the network connections folder before XP.
+
+ /* XXX pbh 9/11/03 - revert to using the undocumented APIs on XP while
+ * waiting tohear back from PSS about the slow reboot issue.
+ * This is an ungly, misleading hack, but is minimally invasive
+ * and will be easy to rollback.
+ */
+
+ //status = getname_shellfolder(wGuid, wName, NameSize);
+ status = E_NOTIMPL;
+
+ /* XXX end of pbh 9/11/03 temporary hack*/
+
+ if (status == E_NOTIMPL) {
+ // The IShellFolder interface is not implemented on this platform.
+ // Try the (undocumented) HrLanConnectionNameFromGuidOrPath API
+ // from the netman DLL.
+ afsi_log("IShellFolder API not implemented, trying HrLanConnectionNameFromGuidOrPath");
+ hNetMan = LoadLibrary("netman.dll");
+ if (hNetMan == NULL) {
+ free(wGuid);
+ return -1;
+ }
+ HrLanProc =
+ (HrLanProcAddr) GetProcAddress(hNetMan,
+ "HrLanConnectionNameFromGuidOrPath");
+ if (HrLanProc == NULL) {
+ FreeLibrary(hNetMan);
+ free(wGuid);
+ return -1;
+ }
+ status = HrLanProc(NULL, wGuid, wName, &NameSize);
+ FreeLibrary(hNetMan);
+ }
+ free(wGuid);
+ if (FAILED(status)) {
+ afsi_log("lana_GetNameFromGuid: failed to get connection name (status %ld)",
+ status);
+ return -1;
+ }
+
+ // Get the required buffer size, and then convert the string.
+ size = WideCharToMultiByte(CP_ACP, 0, wName, -1, NULL, 0, NULL, NULL);
+ *Name = (char *) malloc(size);
+ if (*Name == NULL)
+ return -1;
+ WideCharToMultiByte(CP_ACP, 0, wName, -1, *Name, size, NULL, NULL);
+ afsi_log("Connection name for %s is '%s'", Guid, *Name);
+ return 0;
+}
+
+// Find the lana number for the given connection name.
+extern "C" lana_number_t lana_FindLanaByName(const char *LanaName)
+{
+ const char RegNetBiosLinkageKeyName[] =
+ "System\\CurrentControlSet\\Services\\NetBios\\Linkage";
+ HKEY hkey;
+ LONG status;
+ struct {
+ BYTE flags;
+ BYTE number;
+ } lanamap[MAX_LANA+1];
+ DWORD lanamapsize = sizeof(lanamap);
+ DWORD type;
+ char *bindpaths = NULL;
+ DWORD bindpathsize;
+ int nlana;
+ int i;
+ char *guid;
+ char *name;
+ char *pBind;
+ char *p;
+
+ // Open the NetBios Linkage key.
+ status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, RegNetBiosLinkageKeyName, 0,
+ KEY_QUERY_VALUE, &hkey);
+
+ if (status != ERROR_SUCCESS) {
+ afsi_log("Failed to open NetBios Linkage key (status %ld)", status);
+ return LANA_INVALID;
+ }
+
+ // Read the lana map.
+ status = RegQueryValueEx(hkey, "LanaMap", 0, &type,
+ (BYTE *) &lanamap, &lanamapsize);
+ if (status != ERROR_SUCCESS) {
+ afsi_log("Failed to read LanaMap (status %ld)", status);
+ RegCloseKey(hkey);
+ return LANA_INVALID;
+ }
+ if (lanamapsize == 0) {
+ afsi_log("No data in LanaMap");
+ return LANA_INVALID;
+ }
+ nlana = lanamapsize / sizeof(lanamap[0]);
+
+ // Get the bind paths for NetBios so we can match them up
+ // with the lana map. First we query for the size, so we
+ // can allocate an appropriate buffer.
+ status = RegQueryValueEx(hkey, "Bind", 0, &type, NULL, &bindpathsize);
+ if (status == ERROR_SUCCESS && bindpathsize != 0) {
+ bindpaths = (char *) malloc(bindpathsize * sizeof(char));
+ if (bindpaths == NULL) {
+ afsi_log("Cannot allocate %ld bytes for bindpaths", bindpathsize);
+ RegCloseKey(hkey);
+ return LANA_INVALID;
+ }
+ status = RegQueryValueEx(hkey, "Bind", 0, &type,
+ (BYTE *) bindpaths, &bindpathsize);
+ }
+ RegCloseKey(hkey);
+ if (status != ERROR_SUCCESS) {
+ afsi_log("Failed to read bind paths (status %ld)", status);
+ if (bindpaths != NULL)
+ free(bindpaths);
+ return LANA_INVALID;
+ }
+ if (bindpathsize == 0) {
+ afsi_log("No bindpath data");
+ if (bindpaths != NULL)
+ free(bindpaths);
+ return LANA_INVALID;
+ }
+
+ // Iterate over the lana map entries and bind paths.
+ for (i = 0, pBind = bindpaths; i < nlana;
+ i++, pBind += strlen(pBind) + 1) {
+ // Ignore an invalid map entry.
+ if ((lanamap[i].flags & 1) == 0)
+ continue;
+
+ // check for a IPv4 binding
+ if(!strstr(pBind,"_Tcpip_"))
+ continue;
+
+ // Find the beginning of the GUID.
+ guid = strchr(pBind, '{');
+ if (guid == NULL)
+ continue; // Malformed path entry?
+ guid = strdup(guid);
+ if (guid == NULL)
+ continue;
+ // Find the end of the GUID.
+ p = strchr(guid, '}');
+ if (p == NULL) {
+ free(guid); // Malformed GUID?
+ continue;
+ }
+ *++p = '\0'; // Ignore anything after the GUID.
+ status = lana_GetNameFromGuid(guid, &name);
+ free(guid);
+ if (status == 0) {
+ status = strcmp(name, LanaName);
+ free(name);
+ if (status == 0) {
+ free(bindpaths);
+ afsi_log("lana_FindLanaByName: Found lana %d for %s",
+ lanamap[i].number, LanaName);
+ return lanamap[i].number;
+ }
+ }
+ }
+ free(bindpaths);
+ return LANA_INVALID;
+}
+
+extern "C" lana_number_t lana_FindLoopback(void)
+{
+ NCB ncb;
+ LANA_ENUM lana_list;
+ int status;
+ int i;
+
+ memset(&ncb, 0, sizeof(ncb));
+ ncb.ncb_command = NCBENUM;
+ ncb.ncb_buffer = (UCHAR *) &lana_list;
+ ncb.ncb_length = sizeof(lana_list);
+ status = Netbios(&ncb);
+ if (status != 0) {
+ afsi_log("Netbios NCBENUM failed: status %ld", status);
+ return LANA_INVALID;
+ }
+ for (i = 0; i < lana_list.length; i++) {
+ if (lana_IsLoopback(lana_list.lana[i])) {
+ // Found one, return it.
+ afsi_log("lana_FindLoopback: Found LAN adapter %d",
+ lana_list.lana[i]);
+ return lana_list.lana[i];
+ }
+ }
+ // Could not find a loopback adapter.
+ return LANA_INVALID;
+}
+
+// Is the given lana a Windows Loopback Adapter?
+extern "C" BOOL lana_IsLoopback(lana_number_t lana)
+{
+ NCB ncb;
+ struct {
+ ADAPTER_STATUS status;
+ NAME_BUFFER names[MAX_LANA+1];
+ } astat;
+ unsigned char kWLA_MAC[6] = { 0x02, 0x00, 0x4c, 0x4f, 0x4f, 0x50 };
+ int status;
+
+ // Reset the adapter: in Win32, this is required for every process, and
+ // acts as an init call, not as a real hardware reset.
+ memset(&ncb, 0, sizeof(ncb));
+ ncb.ncb_command = NCBRESET;
+ ncb.ncb_callname[0] = 100;
+ ncb.ncb_callname[2] = 100;
+ ncb.ncb_lana_num = lana;
+ status = Netbios(&ncb);
+ if (status == 0)
+ status = ncb.ncb_retcode;
+ if (status != 0) {
+ afsi_log("NCBRESET failed: lana %u, status %ld", lana, status);
+ return FALSE;
+ }
+
+ // Use the NCBASTAT command to get the adapter address.
+ memset(&ncb, 0, sizeof(ncb));
+ ncb.ncb_command = NCBASTAT;
+ ncb.ncb_lana_num = lana;
+ strcpy((char *) ncb.ncb_callname, "* ");
+ ncb.ncb_buffer = (UCHAR *) &astat;
+ ncb.ncb_length = sizeof(astat);
+ status = Netbios(&ncb);
+ if (status == 0)
+ status = ncb.ncb_retcode;
+ if (ncb.ncb_retcode != 0) {
+ afsi_log("NCBASTAT failed: lana %u, status %ld", lana, status);
+ return FALSE;
+ }
+ return (memcmp(astat.status.adapter_address, kWLA_MAC, 6) == 0);
+}
--- /dev/null
+#include <windows.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ typedef BYTE lana_number_t;
+
+#define LANA_INVALID 0xff
+
+ int lana_GetNameFromGuid(char *Guid, char **Name);
+
+ lana_number_t lana_FindLanaByName(const char *LanaName);
+
+ lana_number_t lana_FindLoopback(void);
+
+ BOOL lana_IsLoopback(lana_number_t lana);
+
+#ifdef __cplusplus
+}
+#endif
#include "afsd.h"
#include "smb.h"
+#include "lanahelper.h"
/* These characters are illegal in Windows filenames */
static char *illegalChars = "\\/:*?\"<>|";
smb_vc_t *dead_vcp = NULL;
smb_vc_t *active_vcp = NULL;
+/* TODO; logout mechanism needs to be thread-safe */
char *loggedOutName = NULL;
smb_user_t *loggedOutUserp = NULL;
unsigned long loggedOutTime;
int numNCBs, numSessions;
+int smb_maxVCPerServer;
+int smb_maxMpxRequests;
+
#define NCBmax 100
EVENT_HANDLE NCBavails[NCBmax], NCBevents[NCBmax];
EVENT_HANDLE **NCBreturns;
smb_dirSearch_t *smb_firstDirSearchp;
smb_dirSearch_t *smb_lastDirSearchp;
+/* hide dot files? */
+int smb_hideDotFiles;
+
/* global state about V3 protocols */
int smb_useV3; /* try to negotiate V3 */
/* Time difference for converting to kludge-GMT */
int smb_NowTZ;
-char *smb_localNamep;
+char *smb_localNamep = NULL;
smb_vc_t *smb_allVCsp;
NCB *ncbp, raw_write_cont_t *rwcp);
void smb_NetbiosInit();
#ifdef DJGPP
+#ifndef AFS_WIN95_ENV
+DWORD smb_ServerExceptionFilter(void);
+#endif
+
extern char cm_HostName[];
extern char cm_confDir[];
#endif
if (scp->fileType == CM_SCACHETYPE_DIRECTORY
|| scp->fileType == CM_SCACHETYPE_MOUNTPOINT)
- attrs = 0x10;
+ attrs = SMB_ATTR_DIRECTORY;
else
attrs = 0;
if ((scp->unixModeBits & 0222) == 0 || (scp->flags & CM_SCACHEFLAG_RO))
#endif
if ((scp->unixModeBits & 0222) == 0)
- attrs |= 1; /* turn on read-only flag */
+ attrs |= SMB_ATTR_READONLY; /* turn on read-only flag */
return attrs;
}
+/* Check if the named file/dir is a dotfile/dotdir */
+/* String pointed to by lastComp can have leading slashes, but otherwise should have
+ no other patch components */
+unsigned int smb_IsDotFile(char *lastComp) {
+ char *s;
+ if(lastComp) {
+ /* skip over slashes */
+ for(s=lastComp;*s && (*s == '\\' || *s == '/'); s++);
+ }
+ else
+ return 0;
+
+ /* nulls, curdir and parent dir doesn't count */
+ if(!*s) return 0;
+ if(*s == '.') {
+ if(!*(s + 1)) return 0;
+ if(*(s+1) == '.' && !*(s + 2)) return 0;
+ return 1;
+ }
+ return 0;
+}
+
static int ExtractBits(WORD bits, short start, short len)
{
int end;
if (!unp && (flags & SMB_FLAG_CREATE)) {
unp = malloc(sizeof(*unp));
memset(unp, 0, sizeof(*unp));
+ unp->refCount = 1;
unp->nextp = usernamesp;
unp->name = strdup(usern);
unp->machine = strdup(machine);
char *tpath;
tidp = smb_FindTID(vcp, tid, 0);
+ if (!tidp)
+ return NULL;
tpath = tidp->pathname;
smb_ReleaseTID(tidp);
return tpath;
smb_vc_t *vcp;
smb_ioctl_t *ioctlp;
+ if (!fidp)
+ return NULL;
+
scp = NULL;
lock_ObtainWrite(&smb_rctLock);
osi_assert(fidp->refCount-- > 0);
else
smb_subst(p, var, sizeof(VNUserName),
" ");
- smb_ReleaseUID(uidp);
+ if (uidp)
+ smb_ReleaseUID(uidp);
}
else if (var = smb_stristr(p, VNLCUserName)) {
uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
else strcpy(temp, " ");
_strlwr(temp);
smb_subst(p, var, sizeof(VNLCUserName), temp);
- smb_ReleaseUID(uidp);
+ if (uidp)
+ smb_ReleaseUID(uidp);
}
else if (var = smb_stristr(p, VNComputerName)) {
sizeTemp = sizeof(temp);
lock_ObtainWrite(&smb_globalLock);
tbp = smb_packetFreeListp;
- if (tbp) smb_packetFreeListp = tbp->nextp;
+ if (tbp)
+ smb_packetFreeListp = tbp->nextp;
lock_ReleaseWrite(&smb_globalLock);
if (!tbp) {
#ifndef DJGPP
tbp->oddByte = 0;
tbp->ncb_length = 0;
tbp->flags = 0;
+ tbp->spacep = NULL;
#ifdef DJGPP
npar = SMB_PACKETSIZE >> 4; /* number of paragraphs */
/* compute size of protocol entry */
entryLength = strlen(namep+1);
- entryLength += 2; /* 0x02 bytes and null termination */
+ entryLength += 2; /* 0x02 bytes and null termination */
- /* advance over this protocol entry */
+ /* advance over this protocol entry */
namex += entryLength;
- namep += entryLength;
- tcounter++; /* which proto entry we're looking at */
+ namep += entryLength;
+ tcounter++; /* which proto entry we're looking at */
}
#ifndef NOMOREFILESFIX
/*
* ie. the order in which it sends us the protocol list.
*
* Special handling for Windows 2000 clients (defect 11765 )
+ * <asanka:11Jun03> Proto signature is the same for Win XP. </>
*/
if (tcounter == 6) {
int i = 0;
*/
}
}
- // NOMOREFILESFIX
-#endif
+#endif /* NOMOREFILESFIX */
if (NTProtoIndex != -1) {
protoIndex = NTProtoIndex;
return CM_ERROR_INVAL;
else if (NTProtoIndex != -1) {
smb_SetSMBParm(outp, 0, protoIndex);
- smb_SetSMBParmByte(outp, 1, 0); /* share level security, no passwd encrypt */
- smb_SetSMBParm(outp, 1, 8); /* max multiplexed requests */
- smb_SetSMBParm(outp, 2, 100); /* max VCs per consumer/server connection */
- smb_SetSMBParmLong(outp, 3, SMB_PACKETSIZE); /* xmit buffer size */
+ smb_SetSMBParmByte(outp, 1, 0); /* share level security, no passwd encrypt */
+ smb_SetSMBParm(outp, 1, smb_maxMpxRequests); /* max multiplexed requests */
+ smb_SetSMBParm(outp, 2, smb_maxVCPerServer); /* max VCs per consumer/server connection */
+ smb_SetSMBParmLong(outp, 3, SMB_PACKETSIZE); /* xmit buffer size */
smb_SetSMBParmLong(outp, 5, 65536); /* raw buffer size */
- smb_SetSMBParm(outp, 7, 1); /* next 2: session key */
- smb_SetSMBParm(outp, 8, 1);
+ smb_SetSMBParm(outp, 7, 1); /* next 2: session key */
+ smb_SetSMBParm(outp, 8, 1);
/*
* Tried changing the capabilities to support for W2K - defect 117695
* Maybe something else needs to be changed here?
smb_SetSMBParm(outp, 0, protoIndex);
smb_SetSMBParm(outp, 1, 0); /* share level security, no passwd encrypt */
smb_SetSMBParm(outp, 2, SMB_PACKETSIZE);
- smb_SetSMBParm(outp, 3, 8); /* max multiplexed requests */
- smb_SetSMBParm(outp, 4, 100); /* max VCs per consumer/server connection */
+ smb_SetSMBParm(outp, 3, smb_maxMpxRequests); /* max multiplexed requests */
+ smb_SetSMBParm(outp, 4, smb_maxVCPerServer); /* max VCs per consumer/server connection */
smb_SetSMBParm(outp, 5, 0); /* no support of block mode for read or write */
smb_SetSMBParm(outp, 6, 1); /* next 2: session key */
smb_SetSMBParm(outp, 7, 1);
/* names starting with a dot are illegal */
if (*tp == '.') valid8Dot3 = 0;
- for(i=0;; i++) {
+ for(i=0;; i++) {
tc = *tp++;
- if (tc == 0) return valid8Dot3;
- if (tc == '.' || tc == '"') break;
- if (i < 8) *up++ = tc;
- else valid8Dot3 = 0;
- }
+ if (tc == 0) return valid8Dot3;
+ if (tc == '.' || tc == '"') break;
+ if (i < 8) *up++ = tc;
+ else valid8Dot3 = 0;
+ }
- /* if we get here, tp point after the dot */
- up = maskp+8; /* ext goes here */
- for(i=0;;i++) {
- tc = *tp++;
- if (tc == 0) return valid8Dot3;
-
- /* too many dots */
- if (tc == '.' || tc == '"') valid8Dot3 = 0;
+ /* if we get here, tp point after the dot */
+ up = maskp+8; /* ext goes here */
+ for(i=0;;i++) {
+ tc = *tp++;
+ if (tc == 0) return valid8Dot3;
- /* copy extension if not too long */
- if (i < 3) *up++ = tc;
- else valid8Dot3 = 0;
- }
+ /* too many dots */
+ if (tc == '.' || tc == '"') valid8Dot3 = 0;
+
+ /* copy extension if not too long */
+ if (i < 3) *up++ = tc;
+ else valid8Dot3 = 0;
+ }
+
+ /* unreachable */
}
int smb_Match8Dot3Mask(char *unixNamep, char *maskp)
attr = smb_Attributes(scp);
*dptr++ = attr;
+ /* check hidden attribute (the flag is only ON when dot file hiding is on ) */
+ if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
+ attr |= SMB_ATTR_HIDDEN;
+
/* get dos time */
smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
if (attribute & 0x8)
return smb_ReceiveCoreSearchVolume(vcp, inp, outp);
- osi_Log2(afsd_logp, "SMB receive search dir count %d |%s|",
+ osi_Log2(afsd_logp, "SMB receive search dir count %d [%s]",
maxCount, osi_LogSaveString(afsd_logp, pathp));
if (*pathp == 0) { /* null pathp, treat as root dir */
- if (!(attribute & 0x10)) /* exclude dirs */
+ if (!(attribute & SMB_ATTR_DIRECTORY)) /* exclude dirs */
return CM_ERROR_NOFILES;
rootPath = 1;
}
actualName = shortName;
}
- if (dep->fid.vnode != 0 && smb_Match8Dot3Mask(actualName, mask)) {
- /* this is one of the entries to use: it is not deleted
- * and it matches the star pattern we're looking for.
- */
+ if (dep->fid.vnode != 0 && smb_Match8Dot3Mask(actualName, mask)) {
+ /* this is one of the entries to use: it is not deleted
+ * and it matches the star pattern we're looking for.
+ */
- /* Eliminate entries that don't match requested
- attributes */
- if (!(dsp->attribute & 0x10)) /* no directories */
- {
+ /* Eliminate entries that don't match requested
+ attributes */
+
+ /* no hidden files */
+ if(smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) && smb_IsDotFile(actualName))
+ goto nextEntry;
+
+ if (!(dsp->attribute & SMB_ATTR_DIRECTORY)) /* no directories */
+ {
/* We have already done the cm_TryBulkStat above */
fid.cell = scp->fid.cell;
fid.volume = scp->fid.volume;
* The replay will happen at a time when it is safe to
* unlock the directory.
*/
- curPatchp = malloc(sizeof(*curPatchp));
- osi_QAdd((osi_queue_t **) &dirListPatchesp, &curPatchp->q);
- curPatchp->dptr = op;
- curPatchp->fid.cell = scp->fid.cell;
- curPatchp->fid.volume = scp->fid.volume;
- curPatchp->fid.vnode = ntohl(dep->fid.vnode);
- curPatchp->fid.unique = ntohl(dep->fid.unique);
- op += 9; /* skip attr, time, date and size */
+ curPatchp = malloc(sizeof(*curPatchp));
+ osi_QAdd((osi_queue_t **) &dirListPatchesp, &curPatchp->q);
+ curPatchp->dptr = op;
+ curPatchp->fid.cell = scp->fid.cell;
+ curPatchp->fid.volume = scp->fid.volume;
+ curPatchp->fid.vnode = ntohl(dep->fid.vnode);
+ curPatchp->fid.unique = ntohl(dep->fid.unique);
+
+ /* do hidden attribute here since name won't be around when applying
+ * dir list patches
+ */
+
+ if ( smb_hideDotFiles && smb_IsDotFile(actualName) )
+ curPatchp->flags = SMB_DIRLISTPATCH_DOTFILE;
+ else
+ curPatchp->flags = 0;
+
+ op += 9; /* skip attr, time, date and size */
/* zero out name area. The spec says to pad with
* spaces, but Samba doesn't, and neither do we.
*/
spacep = inp->spacep;
smb_StripLastComponent(spacep->data, &lastComp, pathp);
- if (strcmp(lastComp, "\\desktop.ini") == 0) {
+ if (lastComp && stricmp(lastComp, "\\desktop.ini") == 0) {
code = cm_NameI(rootScp, spacep->data,
caseFold | CM_FLAG_DIRSEARCH | CM_FLAG_FOLLOW,
userp, tidPathp, &req, &dscp);
return code;
}
+#ifdef undef
+ /* use smb_Attributes instead. Also the fact that a file is in a readonly volume
+ doesn't mean it shojuld be marked as RO */
+
if (newScp->fileType == CM_SCACHETYPE_DIRECTORY
|| newScp->fileType == CM_SCACHETYPE_MOUNTPOINT)
- attrs = 0x10;
+ attrs = SMB_ATTR_DIRECTORY;
else
attrs = 0;
if ((newScp->unixModeBits & 0222) == 0 || (newScp->flags & CM_SCACHEFLAG_RO))
- attrs |= 1; /* turn on read-only flag */
+ attrs |= SMB_ATTR_READONLY; /* turn on read-only flag */
+#else
+ attrs = smb_Attributes(newScp);
+#endif
+
smb_SetSMBParm(outp, 0, attrs);
smb_DosUTimeFromUnixTime(&dosTime, newScp->clientModTime);
cm_InitReq(&req);
- osi_Log0(afsd_logp, "SMB receive open");
-
- pathp = smb_GetSMBData(inp, NULL);
- pathp = smb_ParseASCIIBlock(pathp, NULL);
+ pathp = smb_GetSMBData(inp, NULL);
+ pathp = smb_ParseASCIIBlock(pathp, NULL);
+ osi_Log1(afsd_logp, "SMB receive open file [%s]", osi_LogSaveString(afsd_logp, pathp));
+
+#ifdef DEBUG_VERBOSE
+ {
+ char *hexpath;
+
+ hexpath = osi_HexifyString( pathp );
+ DEBUG_EVENT2("AFS", "CoreOpen H[%s] A[%s]", hexpath, pathp);
+ free(hexpath);
+ }
+#endif
+
share = smb_GetSMBParm(inp, 0);
attribute = smb_GetSMBParm(inp, 1);
rock.hasTilde = ((strchr(oldLastNamep, '~') != NULL) ? 1 : 0);
rock.newNamep = newLastNamep;
- /* now search the dir for the pattern, and do the appropriate rename when
- * found.
- */
- thyper.LowPart = 0; /* search dir from here */
- thyper.HighPart = 0;
- /* search for file to already exhist, if so return error*/
-
+ /* Check if the file already exists; if so return error */
code = cm_Lookup(newDscp,newLastNamep,CM_FLAG_CHECKPATH,userp,&req,&tmpscp);
if((code != CM_ERROR_NOSUCHFILE) && (code != CM_ERROR_NOSUCHPATH) && (code != CM_ERROR_NOSUCHVOLUME) ) {
cm_ReleaseSCache(tmpscp);
return CM_ERROR_EXISTS; /* file exist, do not rename, also
fixes move*/
}
- code = cm_ApplyDir(oldDscp, smb_RenameProc, &rock, &thyper, userp, &req, NULL);
- if (code == CM_ERROR_STOPNOW)
+ /* Now search the directory for the pattern, and do the appropriate rename when found */
+ thyper.LowPart = 0; /* search dir from here */
+ thyper.HighPart = 0;
+
+ code = cm_ApplyDir(oldDscp, smb_RenameProc, &rock, &thyper, userp, &req, NULL);
+
+ if (code == CM_ERROR_STOPNOW)
code = 0;
else if (code == 0)
code = CM_ERROR_NOSUCHFILE;
if (!smb_IsLegalFilename(lastNamep))
return CM_ERROR_BADNTFILENAME;
- code = cm_Lookup(dscp, lastNamep, caseFold, userp, &req, &scp);
+ osi_Log1(afsd_logp, "SMB receive create [%s]", osi_LogSaveString( afsd_logp, pathp ));
+#ifdef DEBUG_VERBOSE
+ {
+ char *hexp;
+ hexp = osi_HexifyString( lastNamep );
+ DEBUG_EVENT2("AFS", "CoreCreate H[%s] A[%s]", hexp, lastNamep );
+ free(hexp);
+ }
+#endif
+
+code = cm_Lookup(dscp, lastNamep, caseFold, userp, &req, &scp);
if (code && code != CM_ERROR_NOSUCHFILE) {
cm_ReleaseSCache(dscp);
cm_ReleaseUser(userp);
}
else {
/* bad opcode, fail the request, after displaying it */
+#ifdef NOTSERVICE
+ smb_LogPacket(inp);
+#endif /* NOTSERVICE */
+
#ifndef DJGPP
if (showErrors) {
sprintf(tbuffer, "Received bad SMB req 0x%x", inp->inCom);
ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1002, NULL,
1, ncbp->ncb_length, ptbuf, smbp);
DeregisterEventSource(h);
+#ifdef NOTSERVICE
+ smb_LogPacket(inp);
+#endif /* NOTSERVICE */
#else /* DJGPP */
osi_Log1(afsd_logp, "Invalid SMB message, length %d",
ncbp->ncb_length);
code = thrd_WaitForMultipleObjects_Event(numNCBs, NCBreturns[myIdx],
FALSE, INFINITE);
- if (code == WAIT_OBJECT_0)
+ if (code == WAIT_OBJECT_0) {
continue;
+ }
idx_NCB = code - WAIT_OBJECT_0;
ncbp = NCBs[idx_NCB];
case NRC_PENDING:
/* Can this happen? Or is it just my
- * UNIX paranoia? */
+ * UNIX paranoia?
+ */
continue;
case NRC_SCLOSED:
dead_sessions[idx_session] = TRUE;
vcp = smb_FindVC(ncbp->ncb_lsn, 0, lanas[idx_session]);
/* Should also release vcp. Also, would do
- * sanity check that all TID's are gone. */
- if (dead_vcp)
- osi_Log1(afsd_logp,
- "dead_vcp already set, %x",
- dead_vcp);
- if (!dead_vcp
- && !(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
- osi_Log2(afsd_logp,
- "setting dead_vcp %x, user struct %x",
- vcp, vcp->usersp);
- dead_vcp = vcp;
- vcp->flags |= SMB_VCFLAG_ALREADYDEAD;
- }
- if (vcp->justLoggedOut) {
- loggedOut = 1;
- loggedOutTime = vcp->logoffTime;
- loggedOutName =
- strdup(vcp->justLoggedOut->unp->name);
- loggedOutUserp = vcp->justLoggedOut;
- lock_ObtainWrite(&smb_rctLock);
- loggedOutUserp->refCount++;
- lock_ReleaseWrite(&smb_rctLock);
- }
+ * sanity check that all TID's are gone.
+ *
+ * TODO: check if we could use LSNs[idx_session] instead,
+ * also cleanup after dead vcp
+ */
+ if (vcp) {
+ if (dead_vcp)
+ osi_Log1(afsd_logp,
+ "dead_vcp already set, %x",
+ dead_vcp);
+ if (!dead_vcp && !(vcp->flags & SMB_VCFLAG_ALREADYDEAD)) {
+ osi_Log2(afsd_logp,
+ "setting dead_vcp %x, user struct %x",
+ vcp, vcp->usersp);
+ dead_vcp = vcp;
+ vcp->flags |= SMB_VCFLAG_ALREADYDEAD;
+ }
+ if (vcp->justLoggedOut) {
+ loggedOut = 1;
+ loggedOutTime = vcp->logoffTime;
+ loggedOutName =
+ strdup(vcp->justLoggedOut->unp->name);
+ loggedOutUserp = vcp->justLoggedOut;
+ lock_ObtainWrite(&smb_rctLock);
+ loggedOutUserp->refCount++;
+ lock_ReleaseWrite(&smb_rctLock);
+ }
+ }
goto doneWithNCB;
case NRC_INCOMP:
smb_maxObsConcurrentCalls = smb_concurrentCalls;
vcp = smb_FindVC(ncbp->ncb_lsn, 0, ncbp->ncb_lana_num);
+ /*
+ * If at this point vcp is NULL (implies that packet was invalid)
+ * then we are in big trouble. This means either :
+ * a) we have the wrong NCB.
+ * b) Netbios screwed up the call.
+ * Obviously this implies that
+ * ( LSNs[idx_session] != ncbp->ncb_lsn ||
+ * lanas[idx_session] != ncbp->ncb_lana_num )
+ * Either way, we can't do anything with this packet.
+ * Log, sleep and resume.
+ */
+ if(!vcp) {
+ HANDLE h;
+ char buf[1000];
+ char *ptbuf[1];
+
+ sprintf(buf,
+ "Bad vcp!! : "
+ "LSNs[idx_session]=[%d],"
+ "lanas[idx_session]=[%d],"
+ "ncbp->ncb_lsn=[%d],"
+ "ncbp->ncb_lana_num=[%d]",
+ LSNs[idx_session],
+ lanas[idx_session],
+ ncbp->ncb_lsn,
+ ncbp->ncb_lana_num);
+
+ ptbuf[0] = buf;
+
+ h = RegisterEventSource(NULL,AFS_DAEMON_EVENT_NAME);
+ if(h) {
+ ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1001, NULL,1,sizeof(*ncbp),ptbuf,(void*)ncbp);
+ DeregisterEventSource(h);
+ }
+
+ /* Also log in the trace log. */
+ osi_Log4(afsd_logp, "Server: BAD VCP!"
+ "LSNs[idx_session]=[%d],"
+ "lanas[idx_session]=[%d],"
+ "ncbp->ncb_lsn=[%d],"
+ "ncbp->ncb_lana_num=[%d]",
+ LSNs[idx_session],
+ lanas[idx_session],
+ ncbp->ncb_lsn,
+ ncbp->ncb_lana_num);
+
+ /* thrd_Sleep(1000); Don't bother sleeping */
+ thrd_SetEvent(SessionEvents[idx_session]);
+ smb_concurrentCalls--;
+ continue;
+ }
+
+
vcp->errorCount = 0;
bufp = (struct smb_packet *) ncbp->ncb_buffer;
#ifdef DJGPP
smbp = (smb_t *)bufp->data;
outbufp->flags = 0;
+#if !defined(DJGPP) && !defined(AFS_WIN32_ENV)
+ __try
+ {
+#endif
if (smbp->com == 0x1d) {
/* Special handling for Write Raw */
raw_write_cont_t rwc;
thrd_SetEvent(SessionEvents[idx_session]);
} else {
thrd_SetEvent(SessionEvents[idx_session]);
+ /* TODO: what else needs to be serialized? */
smb_DispatchPacket(vcp, bufp, outbufp, ncbp, NULL);
}
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
+ }
+ __except( smb_ServerExceptionFilter() ) {
+ }
+#endif
smb_concurrentCalls--;
}
/*
+ * Exception filter for the server threads. If an exception occurs in the
+ * dispatch routines, which is where exceptions are most common, then do a
+ * force trace and give control to upstream exception handlers. Useful for
+ * debugging.
+ */
+#if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
+DWORD smb_ServerExceptionFilter(void) {
+ /* While this is not the best time to do a trace, if it succeeds, then
+ * we have a trace (assuming tracing was enabled). Otherwise, this should
+ * throw a second exception.
+ */
+ HANDLE h;
+ char *ptbuf[1];
+
+ ptbuf[0] = "Unhandled exception forcing trace";
+
+ h = RegisterEventSource(NULL,AFS_DAEMON_EVENT_NAME);
+ if(h) {
+ ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 1001, NULL,1,0,ptbuf,NULL);
+ DeregisterEventSource(h);
+ }
+
+ afsd_ForceTrace(TRUE);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+#endif
+
+/*
* Create a new NCB and associated events, packet buffer, and "space" buffer.
* If the number of server threads is M, and the number of live sessions is
* N, then the number of NCB's in use at any time either waiting for, or
dos_ncb = ((smb_ncb_t *)ncbp)->dos_ncb;
#endif /* DJGPP */
+ /* retrieve computer name */
+ GetComputerName(cname, &cnamelen);
+ _strupr(cname);
+
while (1) {
memset(ncbp, 0, sizeof(NCB));
flags = 0;
break;
}
}
- /* get local name and compare */
- GetComputerName(cname, &cnamelen);
- _strupr(cname);
+
+ /* compare with local name */
if (!isGateway)
if (strncmp(rname, cname, NCBNAMSZ) != 0)
flags |= SMB_VCFLAG_REMOTECONN;
sessionGen++;
/* Log session startup */
-#ifdef NOSERVICE
+#ifdef NOTSERVICE
fprintf(stderr, "New session(ncb_lsn,ncb_lana_num) %d,%d starting from host "
"%s\n",
ncbp->ncb_lsn,ncbp->ncb_lana_num, rname);
/* Allocate slot in session arrays */
/* Re-use dead session if possible, otherwise add one more */
- for (i = 0; i < numSessions; i++) {
+ /* But don't look at session[0], it is reserved */
+ for (i = 1; i < numSessions; i++) {
if (dead_sessions[i]) {
dead_sessions[i] = FALSE;
break;
}
}
+
+ /* assert that we do not exceed the maximum number of sessions or NCBs.
+ * we should probably want to wait for a session to be freed in case
+ * we run out.
+ */
+
+ osi_assert(i < Sessionmax && numNCBs < NCBmax - 1);
+
LSNs[i] = ncbp->ncb_lsn;
lanas[i] = ncbp->ncb_lana_num;
if (i == numSessions) {
/* Add new NCB for new session */
+
+ osi_Log1(afsd_logp, "smb_Listener creating new session %d", i);
+
InitNCBslot(numNCBs);
numNCBs++;
thrd_SetEvent(NCBavails[0]);
#ifndef DJGPP
if (smb_LANadapter == -1) {
ncbp->ncb_command = NCBENUM;
- ncbp->ncb_buffer = &lana_list;
+ ncbp->ncb_buffer = (PUCHAR)&lana_list;
ncbp->ncb_length = sizeof(lana_list);
code = Netbios(ncbp);
if (code != 0) {
/* remember the name */
len = strlen(snamep);
- smb_localNamep = malloc(len+1);
- strcpy(smb_localNamep, snamep);
+ smb_localNamep = malloc(len+1);
+ strcpy(smb_localNamep, snamep);
+ afsi_log("smb_localNamep is >%s<", smb_localNamep);
/* and the global lock */
lock_InitializeRWLock(&smb_globalLock, "smb global lock");
smb_dispatchTable[0x0b].procp = smb_ReceiveCoreWrite;
smb_dispatchTable[0x0c].procp = smb_ReceiveCoreLockRecord;
smb_dispatchTable[0x0d].procp = smb_ReceiveCoreUnlockRecord;
- smb_dispatchTable[0x0e].procp = smb_SendCoreBadOp;
+ smb_dispatchTable[0x0e].procp = smb_SendCoreBadOp; /* create temporary */
smb_dispatchTable[0x0f].procp = smb_ReceiveCoreCreate;
smb_dispatchTable[0x10].procp = smb_ReceiveCoreCheckPath;
smb_dispatchTable[0x11].procp = smb_SendCoreBadOp; /* process exit */
}
#endif /* DJGPP */
+/* Get the UNC \\<servername>\<sharename> prefix. */
+char *smb_GetSharename()
+{
+ char *name;
+
+ /* Make sure we have been properly initialized. */
+ if (smb_localNamep == NULL)
+ return NULL;
+
+ /* Allocate space for \\<servername>\<sharename>, plus the
+ * terminator.
+ */
+ name = malloc(strlen(smb_localNamep) + strlen("ALL") + 4);
+ sprintf(name, "\\\\%s\\%s", smb_localNamep, "ALL");
+ return name;
+}
+
+#ifdef NOTSERVICE
+
+void smb_LogPacket(smb_packet_t *packet)
+{
+ BYTE *vp, *cp;
+ unsigned length, paramlen, datalen, i, j;
+ char buf[81];
+ char hex[]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
+
+ if(!packet) return;
+
+ osi_Log0(afsd_logp, "*** SMB packet dump ***");
+
+ vp = (BYTE *) packet->data;
+
+ datalen = *((WORD*)(vp + (paramlen = ((unsigned)*(vp+20)) << 1)));
+ length = paramlen + 2 + datalen;
+
+
+ for(i=0;i < length; i+=16)
+ {
+ memset( buf, ' ', 80 );
+ buf[80] = 0;
+
+ itoa( i, buf, 16 );
+
+ buf[strlen(buf)] = ' ';
+
+ cp = (BYTE*) buf + 7;
+
+ for(j=0;j < 16 && (i+j)<length; j++)
+ {
+ *(cp++) = hex[vp[i+j] >> 4];
+ *(cp++) = hex[vp[i+j] & 0xf];
+ *(cp++) = ' ';
+
+ if(j==7)
+ {
+ *(cp++) = '-';
+ *(cp++) = ' ';
+ }
+ }
+
+ for(j=0;j < 16 && (i+j)<length;j++)
+ {
+ *(cp++) = ( 32 <= vp[i+j] && 128 > vp[i+j] )? vp[i+j]:'.';
+ if(j==7)
+ {
+ *(cp++) = ' ';
+ *(cp++) = '-';
+ *(cp++) = ' ';
+ }
+ }
+
+ *cp = 0;
+
+ osi_Log0( afsd_logp, buf );
+ }
+
+ osi_Log0(afsd_logp, "*** End SMB packet dump ***");
+
+}
+
+#endif /* NOTSERVICE */
+
int smb_DumpVCP(FILE *outputFile, char *cookie)
{
int zilch;
char output[1024];
- int i;
smb_vc_t *vcp;
#define SMB_FID_LOOKSLIKECOPY (SMB_FID_LENGTHSETDONE | SMB_FID_MTIMESETDONE)
#define SMB_FID_NTOPEN 0x100 /* have dscp and pathp */
+/*
+ * SMB file attributes
+ */
+#define SMB_ATTR_ARCHIVE 0x20
+#define SMB_ATTR_COMPRESSED 0x800 /* file or dir is compressed */
+#define SMB_ATTR_NORMAL 0x80 /* normal file. Only valid if used alone */
+#define SMB_ATTR_HIDDEN 0x2 /* hidden file for the purpose of dir listings */
+#define SMB_ATTR_READONLY 0x1
+#define SMB_ATTR_TEMPORARY 0x100
+#define SMB_ATTR_DIRECTORY 0x10
+#define SMB_ATTR_SYSTEM 0x4
+
/* for tracking in-progress directory searches */
typedef struct smb_dirSearch {
osi_queue_t q; /* queue of all outstanding cookies */
/* type for patching directory listings */
typedef struct smb_dirListPatch {
osi_queue_t q;
- char *dptr; /* ptr to attr, time, data, sizel, sizeh */
+ char *dptr; /* ptr to attr, time, data, sizel, sizeh */
+ long flags; /* flags. See below */
cm_fid_t fid;
cm_dirEntry_t *dep; /* temp */
} smb_dirListPatch_t;
+/* dirListPatch Flags */
+#define SMB_DIRLISTPATCH_DOTFILE 1 /* the file referenced is a dot file
+ Note: will not be set if smb_hideDotFiles is false */
+
/* waiting lock list elements */
typedef struct smb_waitingLock {
osi_queue_t q;
extern int smb_LogoffTokenTransfer;
extern unsigned long smb_LogoffTransferTimeout;
+extern int smb_maxVCPerServer; /* max # of VCs per server */
+extern int smb_maxMpxRequests; /* max # of mpx requests */
+
+extern int smb_hideDotFiles;
+extern unsigned int smb_IsDotFile(char *lastComp);
+
extern void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp,
smb_packet_t *op);
extern BOOL smb_IsLegalFilename(char *filename);
+extern char *smb_GetSharename(void);
+
/* include other include files */
#include "smb3.h"
#include "smb_ioctl.h"
cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern);
+#ifdef NOTSERVICE
+extern void smb_LogPacket(smb_packet_t *packet);
+#endif /* NOTSERVICE */
#endif /* whole file */
* directory or online at http://www.openafs.org/dl/license10.html
*/
-//#define NOSERVICE 1
-
#include <afs/param.h>
#include <afs/stds.h>
if (scp->fileType == CM_SCACHETYPE_DIRECTORY
|| scp->fileType == CM_SCACHETYPE_MOUNTPOINT)
- attrs = 0x10;
+ attrs = SMB_ATTR_DIRECTORY;
else
attrs = 0;
/*
if ((scp->unixModeBits & 0222) == 0 || (scp->flags & CM_SCACHEFLAG_RO))
#endif
if ((scp->unixModeBits & 0222) == 0)
- attrs |= 1; /* Read-only */
+ attrs |= SMB_ATTR_READONLY; /* Read-only */
if (attrs == 0)
- attrs = 0x80; /* FILE_ATTRIBUTE_NORMAL */
+ attrs = SMB_ATTR_NORMAL; /* FILE_ATTRIBUTE_NORMAL */
return attrs;
}
if (!userp)
userp = cm_NewUser();
lock_ObtainMutex(&vcp->mx);
+ if (!vcp->uidCounter)
+ vcp->uidCounter++; /* handle unlikely wraparounds */
newUid = (strlen(usern)==0)?0:vcp->uidCounter++;
lock_ReleaseMutex(&vcp->mx);
inp->flags |= SMB_PACKETFLAG_PROFILE_UPDATE_OK;
/* find the tree and free it */
- uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
- if (uidp) {
+ uidp = smb_FindUID(vcp, ((smb_t *)inp)->uid, 0);
+ /* TODO: smb_ReleaseUID() ? */
+ if (uidp) {
char *s1 = NULL, *s2 = NULL;
if (s2 == NULL) s2 = " ";
parmCount, dataCount);
}
- /* now copy the parms and data */
+ /* now copy the parms and data */
+ if ( parmCount != 0 )
+ {
memcpy(((char *)asp->parmsp) + parmDisp, inp->data + parmOffset, parmCount);
+ }
+ if ( dataCount != 0 ) {
memcpy(asp->datap + dataDisp, inp->data + dataOffset, dataCount);
-
+ }
+
/* account for new bytes */
asp->curData += dataCount;
asp->curParms += parmCount;
osi_QRemove((osi_queue_t **) &smb_tran2AssemblyQueuep, &asp->q);
lock_ReleaseWrite(&smb_globalLock);
- /* now dispatch it */
- osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",(int)vcp,vcp->lana,vcp->lsn);
- osi_Log4(afsd_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn);
+ /* now dispatch it */
+ if ( asp->opcode >= 0 && asp->opcode < 20 && smb_tran2DispatchTable[asp->opcode].procp) {
+ osi_LogEvent("AFS-Dispatch-2[%s]",myCrt_2Dispatch(asp->opcode),"vcp[%x] lana[%d] lsn[%d]",(int)vcp,vcp->lana,vcp->lsn);
+ osi_Log4(afsd_logp,"AFS Server - Dispatch-2 %s vcp[%x] lana[%d] lsn[%d]",myCrt_2Dispatch(asp->opcode),vcp,vcp->lana,vcp->lsn);
code = (*smb_tran2DispatchTable[asp->opcode].procp)(vcp, asp, outp);
+ }
+ else {
+ osi_LogEvent("AFS-Dispatch-2 [invalid]", NULL, "op[%x] vcp[%x] lana[%d] lsn[%d]", asp->opcode, vcp, vcp->lana, vcp->lsn);
+ osi_Log4(afsd_logp,"AFS Server - Dispatch-2 [INVALID] op[%x] vcp[%x] lana[%d] lsn[%d]", asp->opcode, vcp, vcp->lana, vcp->lsn);
+ code = CM_ERROR_BADOP;
+ }
/* if an error is returned, we're supposed to send an error packet,
* otherwise the dispatched function already did the data sending.
return 0;
}
+#ifdef DEBUG_VERBOSE
+ {
+ char *hexp, *asciip;
+ asciip = (lastNamep ? lastNamep : pathp);
+ hexp = osi_HexifyString( asciip );
+ DEBUG_EVENT2("AFS","T2Open H[%s] A[%s]", hexp, asciip);
+ free(hexp);
+ }
+#endif
+
userp = smb_GetTran2User(vcp, p);
+ /* In the off chance that userp is NULL, we log and abandon */
+ if(!userp) {
+ osi_Log1(afsd_logp, "ReceiveTran2Open user [%d] not resolvable", p->uid);
+ smb_FreeTran2Packet(outp);
+ return CM_ERROR_BADSMB;
+ }
+
tidPathp = smb_GetTIDPath(vcp, p->tid);
dscp = NULL;
}
else openAction = 1; /* found existing file */
}
- else if (!(openFun & 0x10)) {
+ else if (!(openFun & SMB_ATTR_DIRECTORY)) {
/* don't create if not found */
if (dscp) cm_ReleaseSCache(dscp);
osi_assert(scp == NULL);
if (extraInfo) {
outp->parmsp[parmSlot] = smb_Attributes(scp); parmSlot++;
smb_SearchTimeFromUnixTime(&dosTime, scp->clientModTime);
- outp->parmsp[parmSlot] = dosTime & 0xffff; parmSlot++;
- outp->parmsp[parmSlot] = (dosTime>>16) & 0xffff; parmSlot++;
+ outp->parmsp[parmSlot] = (unsigned short)(dosTime & 0xffff); parmSlot++;
+ outp->parmsp[parmSlot] = (unsigned short)((dosTime>>16) & 0xffff); parmSlot++;
outp->parmsp[parmSlot] = (unsigned short) (scp->length.LowPart & 0xffff);
parmSlot++;
outp->parmsp[parmSlot] = (unsigned short) ((scp->length.LowPart >> 16) & 0xffff);
case 2:
/* volume info */
- qi.u.volumeInfo.vsn = 1234;
- qi.u.volumeInfo.vnCount = 4;
+ qi.u.volumeInfo.vsn = 1234;
+ qi.u.volumeInfo.vnCount = 4;
/* we're supposed to pad it out with zeroes to the end */
memset(&qi.u.volumeInfo.label, 0, sizeof(qi.u.volumeInfo.label));
- strcpy(qi.u.volumeInfo.label, "AFS");
+ memcpy(qi.u.volumeInfo.label, "AFS", 4);
break;
case 0x102:
/* FS volume info */
memset((char *)&qi.u.FSvolumeInfo.vct, 0, sizeof(FILETIME));
qi.u.FSvolumeInfo.vsn = 1234;
- qi.u.FSvolumeInfo.vnCount = 4;
- strcpy(qi.u.FSvolumeInfo.label, "AFS");
+ qi.u.FSvolumeInfo.vnCount = 8;
+ memcpy(qi.u.FSvolumeInfo.label, "A\0F\0S\0\0", 8);
break;
case 0x103:
}
userp = smb_GetTran2User(vcp, p);
+ if(!userp) {
+ osi_Log1(afsd_logp, "ReceiveTran2QPathInfo unable to resolve user [%d]", p->uid);
+ smb_FreeTran2Packet(outp);
+ return CM_ERROR_BADSMB;
+ }
tidPathp = smb_GetTIDPath(vcp, p->tid);
smb_StripLastComponent(spacep->data, &lastComp,
(char *)(&p->parmsp[3]));
/* Make sure that lastComp is not NULL */
- if (lastComp)
+ if (lastComp) {
if (strcmp(lastComp, "\\desktop.ini") == 0) {
- code = cm_NameI(cm_rootSCachep, spacep->data,
- CM_FLAG_CASEFOLD
- | CM_FLAG_DIRSEARCH
- | CM_FLAG_FOLLOW,
- userp, tidPathp, &req, &dscp);
- if (code == 0) {
- if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT
- && !dscp->mountRootFidp)
- code = CM_ERROR_NOSUCHFILE;
- else if (dscp->fileType == CM_SCACHETYPE_DIRECTORY) {
- cm_buf_t *bp = buf_Find(dscp, &hzero);
- if (bp)
- buf_Release(bp);
- else
- code = CM_ERROR_NOSUCHFILE;
- }
- cm_ReleaseSCache(dscp);
- if (code) {
- cm_FreeSpace(spacep);
- cm_ReleaseUser(userp);
- smb_SendTran2Error(vcp, p, opx, code);
- smb_FreeTran2Packet(outp);
- return 0;
- }
- }
- }
+ code = cm_NameI(cm_rootSCachep, spacep->data,
+ CM_FLAG_CASEFOLD
+ | CM_FLAG_DIRSEARCH
+ | CM_FLAG_FOLLOW,
+ userp, tidPathp, &req, &dscp);
+ if (code == 0) {
+ if (dscp->fileType == CM_SCACHETYPE_MOUNTPOINT
+ && !dscp->mountRootFidp)
+ code = CM_ERROR_NOSUCHFILE;
+ else if (dscp->fileType == CM_SCACHETYPE_DIRECTORY) {
+ cm_buf_t *bp = buf_Find(dscp, &hzero);
+ if (bp)
+ buf_Release(bp);
+ else
+ code = CM_ERROR_NOSUCHFILE;
+ }
+ cm_ReleaseSCache(dscp);
+ if (code) {
+ cm_FreeSpace(spacep);
+ cm_ReleaseUser(userp);
+ smb_SendTran2Error(vcp, p, opx, code);
+ smb_FreeTran2Packet(outp);
+ return 0;
+ }
+ }
+ }
+ }
cm_FreeSpace(spacep);
}
outp->totalData = nbytesRequired;
userp = smb_GetTran2User(vcp, p);
+ if(!userp) {
+ osi_Log1(afsd_logp, "ReceiveTran2QFileInfo unable to resolve user [%d]", p->uid);
+ code = CM_ERROR_BADSMB;
+ goto done;
+ }
scp = fidp->scp;
lock_ObtainMutex(&scp->mx);
outp->totalData = 0;
userp = smb_GetTran2User(vcp, p);
+ if(!userp) {
+ osi_Log1(afsd_logp,"ReceiveTran2SetFileInfo unable to resolve user [%d]", p->uid);
+ code = CM_ERROR_BADSMB;
+ goto done;
+ }
scp = fidp->scp;
attr.mask = 0;
lastMod = *((FILETIME *)(p->datap + 16));
- /* when called as result of move a b, lastMod is (-1, -1). If the check for -1 is not present, timestamp
- of the resulting file will be 1969 (-1)
+ /* when called as result of move a b, lastMod is (-1, -1).
+ * If the check for -1 is not present, timestamp
+ * of the resulting file will be 1969 (-1)
*/
- if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod)) && lastMod.dwLowDateTime != -1 && lastMod.dwHighDateTime != -1) {
+ if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod)) &&
+ lastMod.dwLowDateTime != -1 && lastMod.dwHighDateTime != -1) {
attr.mask |= CM_ATTRMASK_CLIENTMODTIME;
smb_UnixTimeFromLargeSearchTime(&attr.clientModTime,
&lastMod);
/* Copy attributes */
lattr = smb_ExtAttributes(scp);
*((u_long *)dptr) = lattr;
+ /* merge in hidden (dot file) attribute */
+ if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
+ lattr |= SMB_ATTR_HIDDEN;
dptr += 4;
}
else {
/* finally copy out attributes as short */
attr = smb_Attributes(scp);
+ /* merge in hidden (dot file) attribute */
+ if( patchp->flags & SMB_DIRLISTPATCH_DOTFILE )
+ attr |= SMB_ATTR_HIDDEN;
*dptr++ = attr & 0xff;
*dptr++ = (attr >> 8) & 0xff;
}
osi_LogSaveString(afsd_logp, pathp));
/* bail out if request looks bad */
- if (p->opcode == 1 && !pathp) {
- return CM_ERROR_BADSMB;
- }
+ if (p->opcode == 1 && !pathp) {
+ smb_ReleaseDirSearch(dsp);
+ smb_FreeTran2Packet(outp);
+ return CM_ERROR_BADSMB;
+ }
osi_Log2(afsd_logp, "T2 dir search cookie 0x%x, connection %d",
nextCookie, dsp->cookie);
- userp = smb_GetTran2User(vcp, p);
+ userp = smb_GetTran2User(vcp, p);
+ if (!userp) {
+ osi_Log1(afsd_logp, "T2 dir search unable to resolve user [%d]", p->uid);
+ smb_ReleaseDirSearch(dsp);
+ smb_FreeTran2Packet(outp);
+ return CM_ERROR_BADSMB;
+ }
/* try to get the vnode for the path name next */
lock_ObtainMutex(&dsp->mx);
curOffset.LowPart &= ~(2048-1);
curOffset.LowPart |= temp;
- /* check if we've returned all the names that will fit in the
- * response packet; we check return count as well as the number
- * of bytes requested. We check the # of bytes after we find
- * the dir entry, since we'll need to check its size.
- */
- if (returnedNames >= maxCount) break;
+ /* check if we've passed the dir's EOF */
+ if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) {
+ eos = 1;
+ break;
+ }
+
+ /* check if we've returned all the names that will fit in the
+ * response packet; we check return count as well as the number
+ * of bytes requested. We check the # of bytes after we find
+ * the dir entry, since we'll need to check its size.
+ */
+ if (returnedNames >= maxCount) {
+ break;
+ }
- /* check if we've passed the dir's EOF */
- if (LargeIntegerGreaterThanOrEqualTo(curOffset, dirLength)) {
- eos = 1;
- break;
- }
-
- /* see if we can use the bufferp we have now; compute in which
- * page the current offset would be, and check whether that's
- * the offset of the buffer we have. If not, get the buffer.
- */
- thyper.HighPart = curOffset.HighPart;
- thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1);
- if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) {
+ /* see if we can use the bufferp we have now; compute in which
+ * page the current offset would be, and check whether that's
+ * the offset of the buffer we have. If not, get the buffer.
+ */
+ thyper.HighPart = curOffset.HighPart;
+ thyper.LowPart = curOffset.LowPart & ~(buf_bufferSize-1);
+ if (!bufferp || !LargeIntegerEqualTo(thyper, bufferOffset)) {
/* wrong buffer */
- if (bufferp) {
- buf_Release(bufferp);
- bufferp = NULL;
- }
+ if (bufferp) {
+ buf_Release(bufferp);
+ bufferp = NULL;
+ }
lock_ReleaseMutex(&scp->mx);
lock_ObtainRead(&scp->bufCreateLock);
code = buf_Get(scp, &thyper, &bufferp);
/* Eliminate entries that don't match requested
attributes */
- if (!(dsp->attribute & 0x10)) /* no directories */
- {
+ if (smb_hideDotFiles && !(dsp->attribute & SMB_ATTR_HIDDEN) &&
+ smb_IsDotFile(dep->name))
+ goto nextEntry; /* no hidden files */
+
+ if (!(dsp->attribute & SMB_ATTR_DIRECTORY)) /* no directories */
+ {
/* We have already done the cm_TryBulkStat above */
fid.cell = scp->fid.cell;
fid.volume = scp->fid.volume;
curPatchp->dptr = op;
if (infoLevel >= 0x101)
curPatchp->dptr += 8;
+
+ if (smb_hideDotFiles && smb_IsDotFile(dep->name)) {
+ curPatchp->flags = SMB_DIRLISTPATCH_DOTFILE;
+ }
+ else
+ curPatchp->flags = 0;
+
curPatchp->fid.cell = scp->fid.cell;
curPatchp->fid.volume = scp->fid.volume;
curPatchp->fid.vnode = ntohl(dep->fid.vnode);
if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) {
/* special case magic file name for receiving IOCTL requests
- * (since IOCTL calls themselves aren't getting through).
- */
+ * (since IOCTL calls themselves aren't getting through).
+ */
+#ifdef NOTSERVICE
+ osi_Log0(afsd_logp, "IOCTL Open");
+#endif
+
fidp = smb_FindFID(vcp, 0, SMB_FLAG_CREATE);
smb_SetupIoctlFid(fidp, spacep);
return 0;
}
- userp = smb_GetUser(vcp, inp);
+#ifdef DEBUG_VERBOSE
+ {
+ char *hexp, *asciip;
+ asciip = (lastNamep ? lastNamep : pathp );
+ hexp = osi_HexifyString(asciip);
+ DEBUG_EVENT2("AFS", "V3Open H[%s] A[%s]", hexp, asciip );
+ free(hexp);
+ }
+#endif
+ userp = smb_GetUser(vcp, inp);
dscp = NULL;
tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid);
if (searchTime != 0) {
smb_UnixTimeFromSearchTime(&unixTime, searchTime);
+
+ if ( unixTime != -1 ) {
attrs.mask = CM_ATTRMASK_CLIENTMODTIME;
attrs.clientModTime = unixTime;
code = cm_SetAttr(scp, &attrs, userp, &req);
+
+ osi_Log1(afsd_logp, "SMB receive V3SetAttributes [fid=%ld]", fid);
+ } else {
+ osi_Log1(afsd_logp, "**smb_UnixTimeFromSearchTime failed searchTime=%ld", searchTime);
+ }
}
else code = 0;
cm_scache_t *scp; /* file to create or open */
cm_attr_t setAttr;
char *lastNamep;
+ char *treeStartp;
unsigned short nameLength;
unsigned int flags;
unsigned int requestOpLock;
unsigned int requestBatchOpLock;
unsigned int mustBeDir;
+ unsigned int treeCreate;
int realDirFlag;
unsigned int desiredAccess;
unsigned int extAttributes;
cm_InitReq(&req);
+ treeCreate = FALSE;
foundscp = FALSE;
scp = NULL;
spacep = inp->spacep;
smb_StripLastComponent(spacep->data, &lastNamep, realPathp);
+ osi_Log1(afsd_logp,"NTCreateX for [%s]",osi_LogSaveString(afsd_logp,realPathp));
+ osi_Log4(afsd_logp,"NTCreateX da=[%x] ea=[%x] cd=[%x] co=[%x]", desiredAccess, extAttributes, createDisp, createOptions);
+
if (lastNamep && strcmp(lastNamep, SMB_IOCTL_FILENAME) == 0) {
/* special case magic file name for receiving IOCTL requests
* (since IOCTL calls themselves aren't getting through).
return 0;
}
- userp = smb_GetUser(vcp, inp);
+#ifdef DEBUG_VERBOSE
+ {
+ char *hexp, *asciip;
+ asciip = (lastNamep? lastNamep : realPathp);
+ hexp = osi_HexifyString( asciip );
+ DEBUG_EVENT2("AFS", "NTCreateX H[%s] A[%s]", hexp, asciip);
+ free(hexp);
+ }
+#endif
+ userp = smb_GetUser(vcp, inp);
+ if (!userp) {
+ osi_Log1(afsd_logp, "NTCreateX Invalid user [%d]", ((smb_t *) inp)->uid);
+ free(realPathp);
+ return CM_ERROR_INVAL;
+ }
if (baseFid == 0) {
baseDirp = cm_rootSCachep;
tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid);
}
else {
- baseFidp = smb_FindFID(vcp, baseFid, 0);
+ baseFidp = smb_FindFID(vcp, baseFid, 0);
+ if (!baseFidp) {
+ osi_Log1(afsd_logp, "NTCreateX Invalid base fid [%d]", baseFid);
+ free(realPathp);
+ cm_ReleaseUser(userp);
+ return CM_ERROR_INVAL;
+ }
baseDirp = baseFidp->scp;
tidPathp = NULL;
}
- /* compute open mode */
+ osi_Log1(afsd_logp, "NTCreateX tidPathp=[%s]", (tidPathp==NULL)?"null": osi_LogSaveString(afsd_logp,tidPathp));
+
+ /* compute open mode */
fidflags = 0;
if (desiredAccess & DELETE)
fidflags |= SMB_FID_OPENDELETE;
if (code != 0
|| (fidflags & (SMB_FID_OPENDELETE | SMB_FID_OPENWRITE))) {
/* look up parent directory */
- code = cm_NameI(baseDirp, spacep->data,
- CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD | CM_FLAG_CHECKPATH,
- userp, tidPathp, &req, &dscp);
+ /* If we are trying to create a path (i.e. multiple nested directories), then we don't *need*
+ the immediate parent. We have to work our way up realPathp until we hit something that we
+ recognize.
+ */
+
+ while(1) {
+ char *tp;
+
+ code = cm_NameI(baseDirp, spacep->data,
+ CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD,
+ userp, tidPathp, &req, &dscp);
+
+ if(code &&
+ (tp = strrchr(spacep->data,'\\')) &&
+ (createDisp == 2) &&
+ (realDirFlag == 1)) {
+ *tp++ = 0;
+ treeCreate = TRUE;
+ treeStartp = realPathp + (tp - spacep->data);
+
+ if(*tp && !smb_IsLegalFilename(tp)) {
+ if(baseFid != 0) smb_ReleaseFID(baseFidp);
+ cm_ReleaseUser(userp);
+ free(realPathp);
+ return CM_ERROR_BADNTFILENAME;
+ }
+ }
+ else
+ break;
+ }
- if (baseFid != 0) smb_ReleaseFID(baseFidp);
+ if (baseFid != 0) smb_ReleaseFID(baseFidp);
- if (code) {
- cm_ReleaseUser(userp);
- free(realPathp);
- return code;
- }
+ if (code) {
+ osi_Log0(afsd_logp,"NTCreateX parent not found");
+ cm_ReleaseUser(userp);
+ free(realPathp);
+ return code;
+ }
- if (!lastNamep) lastNamep = realPathp;
- else lastNamep++;
+ if(treeCreate && dscp->fileType == CM_SCACHETYPE_FILE) {
+ /* A file exists where we want a directory. */
+ cm_ReleaseSCache(dscp);
+ cm_ReleaseUser(userp);
+ free(realPathp);
+ return CM_ERROR_EXISTS;
+ }
- if (!smb_IsLegalFilename(lastNamep))
- return CM_ERROR_BADNTFILENAME;
+ if (!lastNamep) lastNamep = realPathp;
+ else lastNamep++;
- if (!foundscp) {
+ if (!smb_IsLegalFilename(lastNamep)) {
+ cm_ReleaseSCache(dscp);
+ cm_ReleaseUser(userp);
+ free(realPathp);
+ return CM_ERROR_BADNTFILENAME;
+ }
+
+ if (!foundscp && !treeCreate) {
code = cm_Lookup(dscp, lastNamep,
CM_FLAG_FOLLOW | CM_FLAG_CASEFOLD,
userp, &req, &scp);
* by dscp, or we may have found the file directly. If code is non-zero,
* scp is NULL.
*/
- if (code == 0) {
+ if (code == 0 && !treeCreate) {
code = cm_CheckNTOpen(scp, desiredAccess, createDisp, userp,
&req);
if (code) {
}
}
else {
- /* create directory */
- osi_assert(dscp != NULL);
- osi_Log1(afsd_logp, "smb_ReceiveNTCreateX creating directory %s",
- osi_LogSaveString(afsd_logp, lastNamep));
+ char *tp, *pp;
+ char *cp; /* This component */
+ int clen; /* length of component */
+ cm_scache_t *tscp;
+ int isLast = 0;
+
+ /* create directory */
+ if ( !treeCreate ) treeStartp = lastNamep;
+ osi_assert(dscp != NULL);
+ osi_Log1(afsd_logp, "smb_ReceiveNTCreateX creating directory [%s]",
+ osi_LogSaveString(afsd_logp, treeStartp));
openAction = 2; /* created directory */
+
setAttr.mask = CM_ATTRMASK_CLIENTMODTIME;
setAttr.clientModTime = time(NULL);
- code = cm_MakeDir(dscp, lastNamep, 0, &setAttr, userp, &req);
- if (code == 0 && (dscp->flags & CM_SCACHEFLAG_ANYWATCH))
- smb_NotifyChange(FILE_ACTION_ADDED,
- FILE_NOTIFY_CHANGE_DIR_NAME,
- dscp, lastNamep, NULL, TRUE);
- if (code == 0
- || (code == CM_ERROR_EXISTS && createDisp != 2)) {
- /* Not an exclusive create, and someone else tried
- * creating it already, then we open it anyway. We
- * don't bother retrying after this, since if this next
- * fails, that means that the file was deleted after we
- * started this call.
- */
- code = cm_Lookup(dscp, lastNamep, CM_FLAG_CASEFOLD,
- userp, &req, &scp);
+
+ pp = treeStartp;
+ cp = spacep->data;
+ tscp = dscp;
+
+ while(pp && *pp) {
+ tp = strchr(pp, '\\');
+ if(!tp) {
+ strcpy(cp,pp);
+ isLast = 1; /* indicate last component. the supplied path never ends in a slash */
+ }
+ else {
+ clen = tp - pp;
+ strncpy(cp,pp,clen);
+ *(cp + clen) = 0;
+ tp++;
+ }
+ pp = tp;
+
+ if(clen == 0) continue; /* the supplied path can't have consecutive slashes either , but */
+
+ /* cp is the next component to be created. */
+ code = cm_MakeDir(tscp, cp, 0, &setAttr, userp, &req);
+ if (code == 0 && (tscp->flags & CM_SCACHEFLAG_ANYWATCH))
+ smb_NotifyChange(FILE_ACTION_ADDED,
+ FILE_NOTIFY_CHANGE_DIR_NAME,
+ tscp, cp, NULL, TRUE);
+ if (code == 0 ||
+ (code == CM_ERROR_EXISTS && createDisp != 2)) {
+ /* Not an exclusive create, and someone else tried
+ * creating it already, then we open it anyway. We
+ * don't bother retrying after this, since if this next
+ * fails, that means that the file was deleted after we
+ * started this call.
+ */
+ code = cm_Lookup(tscp, cp, CM_FLAG_CASEFOLD,
+ userp, &req, &scp);
+ }
+ if(code) break;
+
+ if(!isLast) { /* for anything other than dscp, release it unless it's the last one */
+ cm_ReleaseSCache(tscp);
+ tscp = scp; /* Newly created directory will be next parent */
+ }
}
+
+ /*
+ if we get here and code == 0, then scp is the last directory created, and tscp is the
+ parent of scp. dscp got released if dscp != tscp. both tscp and scp are held.
+ */
+ dscp = tscp;
}
if (code) {
/* something went wrong creating or truncating the file */
if (scp) cm_ReleaseSCache(scp);
+ if (dscp) cm_ReleaseSCache(dscp);
cm_ReleaseUser(userp);
free(realPathp);
return code;
}
- /* make sure we have file vs. dir right */
+ /* make sure we have file vs. dir right (only applies for single component case) */
if (realDirFlag == 0 && scp->fileType != CM_SCACHETYPE_FILE) {
cm_ReleaseSCache(scp);
+ if (dscp) cm_ReleaseSCache(dscp);
cm_ReleaseUser(userp);
free(realPathp);
return CM_ERROR_ISDIR;
}
+ /* (only applies to single component case) */
if (realDirFlag == 1 && scp->fileType == CM_SCACHETYPE_FILE) {
cm_ReleaseSCache(scp);
+ if (dscp) cm_ReleaseSCache(dscp);
cm_ReleaseUser(userp);
free(realPathp);
return CM_ERROR_NOTDIR;
cm_ReleaseUser(userp);
+ /* Can't free realPathp if we get here since fidp->NTopen_wholepathp is pointing there */
+
/* leave scp held since we put it in fidp->scp */
return 0;
}
unsigned int requestOpLock;
unsigned int requestBatchOpLock;
unsigned int mustBeDir;
+ unsigned int extendedRespRequired;
int realDirFlag;
unsigned int desiredAccess;
+#ifdef DEBUG_VERBOSE
+ unsigned int allocSize;
+ unsigned int shareAccess;
+#endif
unsigned int extAttributes;
unsigned int createDisp;
+#ifdef DEBUG_VERBOSE
+ unsigned int sdLen;
+#endif
unsigned int createOptions;
int initialModeBits;
unsigned short baseFid;
requestOpLock = flags & 0x02;
requestBatchOpLock = flags & 0x04;
mustBeDir = flags & 0x08;
+ extendedRespRequired = flags & 0x10;
+
/*
* Why all of a sudden 32-bit FID?
* We will reject all bits higher than 16.
return CM_ERROR_INVAL;
baseFid = (unsigned short)lparmp[1];
desiredAccess = lparmp[2];
+#ifdef DEBUG_VERBOSE
+ allocSize = lparmp[3];
+#endif /* DEBUG_VERSOSE */
extAttributes = lparmp[5];
+#ifdef DEBUG_VEROSE
+ shareAccess = lparmp[6];
+#endif
createDisp = lparmp[7];
createOptions = lparmp[8];
+#ifdef DEBUG_VERBOSE
+ sdLen = lparmp[9];
+#endif
nameLength = lparmp[11];
+#ifdef DEBUG_VERBOSE
+ osi_Log4(afsd_logp,"NTTransCreate with da[%x],ea[%x],sa[%x],cd[%x]",desiredAccess,extAttributes,shareAccess,createDisp);
+ osi_Log2(afsd_logp,"... co[%x],sdl[%x],as[%x]",createOptions,sdLen,allocSize);
+ osi_Log1(afsd_logp,"... flags[%x]",flags);
+#endif
+
/* mustBeDir is never set; createOptions directory bit seems to be
* more important
*/
* Will add it if necessary.
*/
+#ifdef DEBUG_VERBOSE
+ {
+ char *hexp, *asciip;
+ asciip = (lastNamep? lastNamep : realPathp);
+ hexp = osi_HexifyString( asciip );
+ DEBUG_EVENT2("AFS", "NTTranCreate H[%s] A[%s]", hexp, asciip);
+ free(hexp);
+ }
+#endif
+
userp = smb_GetUser(vcp, inp);
+ if(!userp) {
+ osi_Log1(afsd_logp, "NTTranCreate invalid user [%d]", ((smb_t *) inp)->uid);
+ free(realPathp);
+ return CM_ERROR_INVAL;
+ }
if (baseFid == 0) {
baseDirp = cm_rootSCachep;
tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid);
}
else {
- baseFidp = smb_FindFID(vcp, baseFid, 0);
+ baseFidp = smb_FindFID(vcp, baseFid, 0);
+ if(!baseFidp) {
+ osi_Log1(afsd_logp, "NTTranCreate Invalid fid [%d]", baseFid);
+ free(realPathp);
+ cm_ReleaseUser(userp);
+ return CM_ERROR_INVAL;
+ }
baseDirp = baseFidp->scp;
tidPathp = NULL;
}
/* set inp->fid so that later read calls in same msg can find fid */
inp->fid = fidp->fid;
- /* out parms */
- parmOffset = 8*4 + 39;
- parmOffset += 1; /* pad to 4 */
- dataOffset = parmOffset + 70;
+ /* check whether we are required to send an extended response */
+ if (!extendedRespRequired) {
+ /* out parms */
+ parmOffset = 8*4 + 39;
+ parmOffset += 1; /* pad to 4 */
+ dataOffset = parmOffset + 70;
+
+ parmSlot = 1;
+ outp->oddByte = 1;
+ /* Total Parameter Count */
+ smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2;
+ /* Total Data Count */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ /* Parameter Count */
+ smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2;
+ /* Parameter Offset */
+ smb_SetSMBParmLong(outp, parmSlot, parmOffset); parmSlot += 2;
+ /* Parameter Displacement */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ /* Data Count */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ /* Data Offset */
+ smb_SetSMBParmLong(outp, parmSlot, dataOffset); parmSlot += 2;
+ /* Data Displacement */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ smb_SetSMBParmByte(outp, parmSlot, 0); /* Setup Count */
+ smb_SetSMBDataLength(outp, 70);
- parmSlot = 1;
- outp->oddByte = 1;
- /* Total Parameter Count */
- smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2;
- /* Total Data Count */
- smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
- /* Parameter Count */
- smb_SetSMBParmLong(outp, parmSlot, 70); parmSlot += 2;
- /* Parameter Offset */
- smb_SetSMBParmLong(outp, parmSlot, parmOffset); parmSlot += 2;
- /* Parameter Displacement */
- smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
- /* Data Count */
- smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
- /* Data Offset */
- smb_SetSMBParmLong(outp, parmSlot, dataOffset); parmSlot += 2;
- /* Data Displacement */
- smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
- smb_SetSMBParmByte(outp, parmSlot, 0); /* Setup Count */
- smb_SetSMBDataLength(outp, 70);
-
- lock_ObtainMutex(&scp->mx);
- outData = smb_GetSMBData(outp, NULL);
- outData++; /* round to get to parmOffset */
- *outData = 0; outData++; /* oplock */
- *outData = 0; outData++; /* reserved */
- *((USHORT *)outData) = fidp->fid; outData += 2; /* fid */
- *((ULONG *)outData) = openAction; outData += 4;
- *((ULONG *)outData) = 0; outData += 4; /* EA error offset */
- smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
- *((FILETIME *)outData) = ft; outData += 8; /* creation time */
- *((FILETIME *)outData) = ft; outData += 8; /* last access time */
- *((FILETIME *)outData) = ft; outData += 8; /* last write time */
- *((FILETIME *)outData) = ft; outData += 8; /* change time */
- *((ULONG *)outData) = smb_ExtAttributes(scp); outData += 4;
- *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* alloc sz */
- *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */
- *((USHORT *)outData) = 0; outData += 2; /* filetype */
- *((USHORT *)outData) = 0; outData += 2; /* dev state */
- *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY);
- outData += 2; /* is a dir? */
- lock_ReleaseMutex(&scp->mx);
+ lock_ObtainMutex(&scp->mx);
+ outData = smb_GetSMBData(outp, NULL);
+ outData++; /* round to get to parmOffset */
+ *outData = 0; outData++; /* oplock */
+ *outData = 0; outData++; /* reserved */
+ *((USHORT *)outData) = fidp->fid; outData += 2; /* fid */
+ *((ULONG *)outData) = openAction; outData += 4;
+ *((ULONG *)outData) = 0; outData += 4; /* EA error offset */
+ smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
+ *((FILETIME *)outData) = ft; outData += 8; /* creation time */
+ *((FILETIME *)outData) = ft; outData += 8; /* last access time */
+ *((FILETIME *)outData) = ft; outData += 8; /* last write time */
+ *((FILETIME *)outData) = ft; outData += 8; /* change time */
+ *((ULONG *)outData) = smb_ExtAttributes(scp); outData += 4;
+ *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* alloc sz */
+ *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */
+ *((USHORT *)outData) = 0; outData += 2; /* filetype */
+ *((USHORT *)outData) = 0; outData += 2; /* dev state */
+ *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY);
+ outData += 2; /* is a dir? */
+ lock_ReleaseMutex(&scp->mx);
+ } else {
+ /* out parms */
+ parmOffset = 8*4 + 39;
+ parmOffset += 1; /* pad to 4 */
+ dataOffset = parmOffset + 104;
+
+ parmSlot = 1;
+ outp->oddByte = 1;
+ /* Total Parameter Count */
+ smb_SetSMBParmLong(outp, parmSlot, 101); parmSlot += 2;
+ /* Total Data Count */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ /* Parameter Count */
+ smb_SetSMBParmLong(outp, parmSlot, 101); parmSlot += 2;
+ /* Parameter Offset */
+ smb_SetSMBParmLong(outp, parmSlot, parmOffset); parmSlot += 2;
+ /* Parameter Displacement */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ /* Data Count */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ /* Data Offset */
+ smb_SetSMBParmLong(outp, parmSlot, dataOffset); parmSlot += 2;
+ /* Data Displacement */
+ smb_SetSMBParmLong(outp, parmSlot, 0); parmSlot += 2;
+ smb_SetSMBParmByte(outp, parmSlot, 0); /* Setup Count */
+ smb_SetSMBDataLength(outp, 105);
+
+ lock_ObtainMutex(&scp->mx);
+ outData = smb_GetSMBData(outp, NULL);
+ outData++; /* round to get to parmOffset */
+ *outData = 0; outData++; /* oplock */
+ *outData = 1; outData++; /* response type */
+ *((USHORT *)outData) = fidp->fid; outData += 2; /* fid */
+ *((ULONG *)outData) = openAction; outData += 4;
+ *((ULONG *)outData) = 0; outData += 4; /* EA error offset */
+ smb_LargeSearchTimeFromUnixTime(&ft, scp->clientModTime);
+ *((FILETIME *)outData) = ft; outData += 8; /* creation time */
+ *((FILETIME *)outData) = ft; outData += 8; /* last access time */
+ *((FILETIME *)outData) = ft; outData += 8; /* last write time */
+ *((FILETIME *)outData) = ft; outData += 8; /* change time */
+ *((ULONG *)outData) = smb_ExtAttributes(scp); outData += 4;
+ *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* alloc sz */
+ *((LARGE_INTEGER *)outData) = scp->length; outData += 8; /* EOF */
+ *((USHORT *)outData) = 0; outData += 2; /* filetype */
+ *((USHORT *)outData) = 0; outData += 2; /* dev state */
+ *((USHORT *)outData) = (scp->fileType == CM_SCACHETYPE_DIRECTORY);
+ outData += 1; /* is a dir? */
+ memset(outData,0,24); outData += 24; /* Volume ID and file ID */
+ *((ULONG *)outData) = 0x001f01ffL; outData += 4; /* Maxmimal access rights */
+ *((ULONG *)outData) = 0; outData += 4; /* Guest Access rights */
+ lock_ReleaseMutex(&scp->mx);
+ }
osi_Log1(afsd_logp, "SMB NTTranCreate opening fid %d", fidp->fid);
cm_ReleaseUser(userp);
+ /* free(realPathp); Can't free realPathp here because fidp->NTopen_wholepathp points there */
/* leave scp held since we put it in fidp->scp */
return 0;
}
filter = smb_GetSMBParm(inp, 19)
| (smb_GetSMBParm(inp, 20) << 16);
fid = smb_GetSMBParm(inp, 21);
- watchtree = smb_GetSMBParm(inp, 22) && 0xffff;
+ watchtree = smb_GetSMBParm(inp, 22) && 0xffff; /* TODO: should this be 0xff ? */
+
+ fidp = smb_FindFID(vcp, fid, 0);
+ if (!fidp) {
+ osi_Log1(afsd_logp, "ERROR: NotifyChange given invalid fid [%d]", fid);
+ return CM_ERROR_BADFD;
+ }
savedPacketp = smb_CopyPacket(inp);
- savedPacketp->vcp = vcp;
+ savedPacketp->vcp = vcp; /* TODO: refcount vcp? */
lock_ObtainMutex(&smb_Dir_Watch_Lock);
savedPacketp->nextp = smb_Directory_Watches;
smb_Directory_Watches = savedPacketp;
filter = smb_GetSMBParm(watch, 19)
| (smb_GetSMBParm(watch, 20) << 16);
fid = smb_GetSMBParm(watch, 21);
- wtree = smb_GetSMBParm(watch, 22) & 0xffff;
+ wtree = smb_GetSMBParm(watch, 22) & 0xffff; /* TODO: should this be 0xff ? */
maxLen = smb_GetSMBOffsetParm(watch, 5, 1)
| (smb_GetSMBOffsetParm(watch, 6, 1) << 16);
vcp = watch->vcp;
filter = 0x17;
fidp = smb_FindFID(vcp, fid, 0);
+ if (!fidp) {
+ lastWatch = watch;
+ watch = watch->nextp;
+ continue;
+ }
if (fidp->scp != dscp
|| (filter & notifyFilter) == 0
|| (!isDirectParent && !wtree)) {
watchtree = smb_GetSMBParm(watch, 22) & 0xffff;
fidp = smb_FindFID(vcp, fid, 0);
-
- osi_Log3(afsd_logp, "Cancelling change notification for fid %d wtree %d file %s",
- fid, watchtree,
- osi_LogSaveString(afsd_logp, (fidp)?fidp->NTopen_wholepathp:""));
-
- scp = fidp->scp;
- lock_ObtainMutex(&scp->mx);
- if (watchtree)
- scp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE;
- else
- scp->flags &= ~CM_SCACHEFLAG_WATCHED;
- lock_ReleaseMutex(&scp->mx);
- smb_ReleaseFID(fidp);
+ if (fidp) {
+ osi_Log3(afsd_logp, "Cancelling change notification for fid %d wtree %d file %s",
+ fid, watchtree,
+ osi_LogSaveString(afsd_logp, (fidp)?fidp->NTopen_wholepathp:""));
+
+ scp = fidp->scp;
+ lock_ObtainMutex(&scp->mx);
+ if (watchtree)
+ scp->flags &= ~CM_SCACHEFLAG_WATCHEDSUBTREE;
+ else
+ scp->flags &= ~CM_SCACHEFLAG_WATCHED;
+ lock_ReleaseMutex(&scp->mx);
+ smb_ReleaseFID(fidp);
+ } else {
+ osi_Log2(afsd_logp,"NTCancel unable to resolve fid [%d] in vcp[%x]", fid,vcp);
+ }
/* assume STATUS32; return 0xC0000120 (CANCELED) */
replyWctp = watch->wctp;
cm_user_t *smb_FindCMUserByName(/*smb_vc_t *vcp,*/ char *usern, char *machine)
{
- cm_user_t *userp;
/*int newUid;*/
smb_username_t *unp;
op = smb_GetSMBData(outp, NULL);
*op++ = 1;
- *op++ = count & 0xff;
- *op++ = (count >> 8) & 0xff;
+ *op++ = (char)(count & 0xff);
+ *op++ = (char)((count >> 8) & 0xff);
/* now copy the data into the response packet */
memcpy(op, iop->outCopied + iop->outAllocp, count);
osi_Log1(afsd_logp, "Ioctl no uid user %x no name",
userp);
}
- smb_ReleaseUID(uidp);
+ if (uidp) smb_ReleaseUID(uidp);
}
iop->tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid);
osi_Log3(afsd_logp, "Ioctl uid %d user %x name %s",
uidp->userID, userp,
osi_LogSaveString(afsd_logp, uidp->unp->name));
- else
+ else if (uidp)
osi_Log2(afsd_logp, "Ioctl uid %d user %x no name",
uidp->userID, userp);
- smb_ReleaseUID(uidp);
+ else
+ osi_Log1(afsd_logp, "Ioctl no uid user %x no name",
+ userp);
+ if (uidp) smb_ReleaseUID(uidp);
}
iop->tidPathp = smb_GetTIDPath(vcp, ((smb_t *)inp)->tid);
############################################################################
# Definitions for generating versioninfo resource via RC
-$(OUT)\afscfg_stub.res: AFS_component_version_number.h
+$(OUT)\afscfg_stub.res:afscfg_stub.rc AFS_component_version_number.h
############################################################################
# Install target; primary makefile target
lang::
$(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
+ for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
############################################################################
# Definitions for generating versioninfo resource via RC
-$(OUT)\afssvrcpa_stub.res: AFS_component_version_number.h
+$(OUT)\afssvrcpa_stub.res: afssvrcpa_stub.rc AFS_component_version_number.h
############################################################################
# Install target; primary makefile target
lang::
$(CD) lang
- for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /f NTMakefile install
+ for /f %l in ('dir /B ??_??') do @$(NTLANG) %l $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
# include the AFSD source tree on our inclusion path
-AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I..\afsd
+AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\afsd
# include the primary makefile
RELDIR=WINNT\client_config
$(OUT)\dlg_diag.obj \
$(OUT)\dlg_misc.obj \
$(OUT)\isadmin.obj \
- $(OUT)\dlg_automap.obj
+ $(OUT)\dlg_automap.obj \
+ $(OUT)\dlg_binding.obj \
+ $(OUT)\RegistrySupport.obj \
+ $(OUT)\getlana.obj
EXEOBJSc = \
$(OUT)\cellservdb.obj
VCLIBS =\
comctl32.lib \
shell32.lib \
- mpr.lib
+ mpr.lib \
+ netapi32.lib
EXELIBS = \
$(DESTDIR)\lib\afs\TaLocale.lib \
en_US:
$(CD) lang
- $(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ $(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
ja_JP:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
ko_KR:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
zh_CN:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
zh_TW:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
pt_BR:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
es_ES:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
de_DE:
$(CD) lang
- @$(NTLANG) $@ $(MAKECMD) /nologo /f NTMakefile install
+ @$(NTLANG) $@ $(MAKECMD) /nologo /e /f NTMakefile install
$(CD) ..
-$(OUT)\afs_config_stub.res : AFS_component_version_number.h
+$(OUT)\afs_config_stub.res : afs_config_stub.rc AFS_component_version_number.h
clean::
$(DEL) $(COPYHEADERS)
$(CD) lang
- if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /f NTMakefile clean
- if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) en_US $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ja_JP $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) ko_KR $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_CN $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) zh_TW $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) pt_BR $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) es_ES $(MAKECMD) /nologo /e /f NTMakefile clean
+ if exist $(NTLANG) $(NTLANG) de_DE $(MAKECMD) /nologo /e /f NTMakefile clean
$(CD) ..
mkdir:
-mkdir $(OUT)\lang
cd lang
- nmake /nologo /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
+ nmake /nologo /e /f ntmakefile SRC=$(SRC) OBJ=$(OBJ) mkdir
cd ..
--- /dev/null
+/*det
+ * Configuration Read/Modify Functions ________________________________________
+ *
+ * Temporarily these just modify the local Registry.
+ * In the near future, they will modify the Registry on the
+ * gateway, if a gateway is being used.
+ *
+ */
+
+#include <windows.h>
+#include <tchar.h>
+//#include <ctype.h>
+#include <stdlib.h>
+#include <drivemap.h>
+
+BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax);
+
+extern TCHAR AFSConfigKeyName[] = TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters");
+
+void Config_GetGlobalDriveList (DRIVEMAPLIST *pDriveList)
+{
+ // Read the GlobalAutoMapper registry key
+ TCHAR szDriveToMapTo[5];
+ DWORD dwResult;
+ TCHAR szKeyName[256];
+ HKEY hKey;
+ DWORD dwIndex = 0;
+ DWORD dwDriveSize;
+ DWORD dwSubMountSize;
+ TCHAR szSubMount[256];
+ DWORD dwType;
+
+ if (!pDriveList)
+ return;
+
+ memset(pDriveList, 0, sizeof(DRIVEMAPLIST));
+
+ lstrcpy(szKeyName, AFSConfigKeyName);
+ lstrcat(szKeyName, TEXT("\\GlobalAutoMapper"));
+
+ dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey);
+ if (dwResult != ERROR_SUCCESS)
+ return;
+
+ // Get the drive map list so we can lookup the paths that go with our submounts
+ DRIVEMAPLIST DriveMapList;
+ memset(&DriveMapList, 0, sizeof(DRIVEMAPLIST));
+ QueryDriveMapList (&DriveMapList);
+
+ while (1) {
+ dwDriveSize = sizeof(szDriveToMapTo);
+ dwSubMountSize = sizeof(szSubMount);
+
+ dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, (BYTE*)szSubMount, &dwSubMountSize);
+ if (dwResult != ERROR_SUCCESS)
+ break;
+
+ szDriveToMapTo[0] = _totupper(szDriveToMapTo[0]);
+
+ int nCurDrive = szDriveToMapTo[0] - TEXT('A');
+
+ pDriveList->aDriveMap[nCurDrive].chDrive = szDriveToMapTo[0];
+ lstrcpy(pDriveList->aDriveMap[nCurDrive].szSubmount, szSubMount);
+
+ // Find the path that goes with this submount
+ SubmountToPath (&DriveMapList, pDriveList->aDriveMap[nCurDrive].szMapping, szSubMount, FALSE);
+ }
+
+ FreeDriveMapList(&DriveMapList);
+
+ RegCloseKey(hKey);
+}
+
+BOOL Config_ReadNum (LPCTSTR pszLHS, DWORD *pdwRHS)
+{
+ HKEY hk;
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS)
+ return FALSE;
+
+ DWORD dwSize = sizeof(*pdwRHS);
+ if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pdwRHS, &dwSize) != ERROR_SUCCESS)
+ {
+ RegCloseKey (hk);
+ return FALSE;
+ }
+
+ RegCloseKey (hk);
+ return TRUE;
+}
+
+
+BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax)
+{
+ HKEY hk;
+ if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS)
+ return FALSE;
+
+ DWORD dwSize = sizeof(TCHAR) * cchMax;
+ if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pszRHS, &dwSize) != ERROR_SUCCESS)
+ {
+ RegCloseKey (hk);
+ return FALSE;
+ }
+
+ RegCloseKey (hk);
+ return TRUE;
+}
+
+
+void Config_WriteNum (LPCTSTR pszLHS, DWORD dwRHS)
+{
+ HKEY hk;
+ DWORD dwDisp;
+ if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS)
+ {
+ RegSetValueEx (hk, pszLHS, NULL, REG_DWORD, (PBYTE)&dwRHS, sizeof(dwRHS));
+ RegCloseKey (hk);
+ }
+}
+
+
+void Config_WriteString (LPCTSTR pszLHS, LPCTSTR pszRHS)
+{
+ HKEY hk;
+ DWORD dwDisp;
+ if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS)
+ {
+ RegSetValueEx (hk, pszLHS, NULL, REG_SZ, (PBYTE)pszRHS, sizeof(TCHAR) * (1+lstrlen(pszRHS)));
+ RegCloseKey (hk);
+ }
+}
+
return TRUE;
}
-void Config_GetGlobalDriveList (DRIVEMAPLIST *pDriveList)
-{
- // Read the GlobalAutoMapper registry key
- TCHAR szDriveToMapTo[5];
- DWORD dwResult;
- TCHAR szKeyName[256];
- HKEY hKey;
- DWORD dwIndex = 0;
- DWORD dwDriveSize;
- DWORD dwSubMountSize;
- TCHAR szSubMount[256];
- DWORD dwType;
-
- if (!pDriveList)
- return;
-
- memset(pDriveList, 0, sizeof(DRIVEMAPLIST));
-
- lstrcpy(szKeyName, AFSConfigKeyName);
- lstrcat(szKeyName, TEXT("\\GlobalAutoMapper"));
-
- dwResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_QUERY_VALUE, &hKey);
- if (dwResult != ERROR_SUCCESS)
- return;
-
- // Get the drive map list so we can lookup the paths that go with our submounts
- DRIVEMAPLIST DriveMapList;
- memset(&DriveMapList, 0, sizeof(DRIVEMAPLIST));
- QueryDriveMapList (&DriveMapList);
-
- while (1) {
- dwDriveSize = sizeof(szDriveToMapTo);
- dwSubMountSize = sizeof(szSubMount);
-
- dwResult = RegEnumValue(hKey, dwIndex++, szDriveToMapTo, &dwDriveSize, 0, &dwType, (BYTE*)szSubMount, &dwSubMountSize);
- if (dwResult != ERROR_SUCCESS)
- break;
-
- szDriveToMapTo[0] = _totupper(szDriveToMapTo[0]);
-
- int nCurDrive = szDriveToMapTo[0] - TEXT('A');
-
- pDriveList->aDriveMap[nCurDrive].chDrive = szDriveToMapTo[0];
- lstrcpy(pDriveList->aDriveMap[nCurDrive].szSubmount, szSubMount);
-
- // Find the path that goes with this submount
- SubmountToPath (&DriveMapList, pDriveList->aDriveMap[nCurDrive].szMapping, szSubMount, FALSE);
- }
-
- FreeDriveMapList(&DriveMapList);
-
- RegCloseKey(hKey);
-}
-
-
-/*
- * Configuration Read/Modify Functions ________________________________________
- *
- * Temporarily these just modify the local Registry.
- * In the near future, they will modify the Registry on the
- * gateway, if a gateway is being used.
- *
- */
-
-BOOL Config_ReadNum (LPCTSTR pszLHS, DWORD *pdwRHS)
-{
- HKEY hk;
- if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS)
- return FALSE;
-
- DWORD dwSize = sizeof(*pdwRHS);
- if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pdwRHS, &dwSize) != ERROR_SUCCESS)
- {
- RegCloseKey (hk);
- return FALSE;
- }
-
- RegCloseKey (hk);
- return TRUE;
-}
-
-
-BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax)
-{
- HKEY hk;
- if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, KEY_QUERY_VALUE, &hk) != ERROR_SUCCESS)
- return FALSE;
-
- DWORD dwSize = sizeof(TCHAR) * cchMax;
- if (RegQueryValueEx (hk, pszLHS, NULL, NULL, (PBYTE)pszRHS, &dwSize) != ERROR_SUCCESS)
- {
- RegCloseKey (hk);
- return FALSE;
- }
-
- RegCloseKey (hk);
- return TRUE;
-}
-
-
-void Config_WriteNum (LPCTSTR pszLHS, DWORD dwRHS)
-{
- HKEY hk;
- DWORD dwDisp;
- if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS)
- {
- RegSetValueEx (hk, pszLHS, NULL, REG_DWORD, (PBYTE)&dwRHS, sizeof(dwRHS));
- RegCloseKey (hk);
- }
-}
-
-
-void Config_WriteString (LPCTSTR pszLHS, LPCTSTR pszRHS)
-{
- HKEY hk;
- DWORD dwDisp;
- if (RegCreateKeyEx (HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0, TEXT("container"), 0, KEY_SET_VALUE, NULL, &hk, &dwDisp) == ERROR_SUCCESS)
- {
- RegSetValueEx (hk, pszLHS, NULL, REG_SZ, (PBYTE)pszRHS, sizeof(TCHAR) * (1+lstrlen(pszRHS)));
- RegCloseKey (hk);
- }
-}
-
* PROTOTYPES _________________________________________________________________
*
*/
+extern void GetNetbiosName(LPTSTR pszName, int type);
void AutoMap_OnInitDialog (HWND hDlg);
void AutoMap_OnAdd (HWND hDlg);
SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0);
TCHAR szMapping[ MAX_PATH ];
+#ifdef NOLANA
AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : cm_slash_mount_root), TRUE, FALSE);
+#else
+ memset(szMapping, '\0', sizeof(szMapping));
+ szMapping[0] = '\\';
+ GetNetbiosName(&szMapping[1], 0);
+#endif
SetDlgItemText (hDlg, IDC_PATH, szMapping);
SetDlgItemText (hDlg, IDC_DESC, pMap->szSubmount);
return;
}
- if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) &&
- (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) )
+#ifdef NOLANA
+ if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) &&
+ (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) )
+ {
+ Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC);
+ return;
+ }
+#else
+ TCHAR szName[MAX_PATH];
+ memset(szName, '\0', sizeof(szName));
+ szName[0] = '\\';
+ GetNetbiosName(&szName[1], 0);
+
+ if ( lstrncmpi (pMap->szMapping, szName, lstrlen(szName) ))
{
Message (MB_ICONHAND, GetErrorTitle(), IDS_BADMAP_DESC);
return;
}
+#endif
// First get a proper submount
if (pMap->szSubmount[0]) {
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+extern "C" {
+#include <afs/param.h>
+#include <afs/stds.h>
+}
+#include <stdio.h>
+#include "afs_config.h"
+#include "getlana.h"
+
+
+/*
+ * DEFINITIONS ________________________________________________________________
+ *
+ */
+
+
+// Our dialog data
+static BOOL fFirstTime = TRUE;
+int nLanAdapter;
+LANAINFO* lanainfo = NULL;
+
+int GetAdapterNumber(TCHAR*);
+
+/*
+ * PROTOTYPES _________________________________________________________________
+ *
+ */
+
+void Binding_OnInitDialog (HWND hDlg);
+void Binding_OnOK(HWND hDlg);
+void Binding_OnCancel(HWND hDlg);
+BOOL Binding_OnApply();
+
+BOOL isGateway = FALSE;
+/*
+ * ROUTINES ___________________________________________________________________
+ *
+ */
+
+BOOL CALLBACK Binding_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ Binding_OnInitDialog (hDlg);
+ break;
+
+ case WM_CTLCOLORSTATIC:
+ if ((HWND)lp == GetDlgItem (hDlg, IDC_CHUNK_SIZE))
+ {
+ if (IsWindowEnabled ((HWND)lp))
+ {
+ static HBRUSH hbrStatic = CreateSolidBrush (GetSysColor (COLOR_WINDOW));
+ SetTextColor ((HDC)wp, GetSysColor (COLOR_WINDOWTEXT));
+ SetBkColor ((HDC)wp, GetSysColor (COLOR_WINDOW));
+ return (BOOL)hbrStatic;
+ }
+ }
+ break;
+
+ case WM_COMMAND:
+ switch (LOWORD(wp))
+ {
+ case IDHELP:
+ Binding_DlgProc (hDlg, WM_HELP, 0, 0);
+ break;
+
+ case IDOK:
+ Binding_OnOK(hDlg);
+ break;
+
+ case IDCANCEL:
+ Binding_OnCancel(hDlg);
+ break;
+ case IDC_DEFAULTNIC:
+ if (HIWORD(wp) == BN_CLICKED)
+ {
+ TCHAR name[MAX_PATH];
+ memset(name, 0, sizeof(name));
+ if (IsDlgButtonChecked(hDlg,IDC_DEFAULTNIC))
+ nLanAdapter=-1;
+ else
+ {
+ HWND hwndCombo = GetDlgItem(hDlg, IDC_NICSELECTION);
+ if (SendMessage(hwndCombo, CB_GETCURSEL, 0, 0) == CB_ERR)
+ SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM)0, (LPARAM)0);
+
+ TCHAR selected[MAX_PATH];
+ memset(selected, 0, sizeof(selected));
+ SendDlgItemMessage(hDlg, IDC_NICSELECTION,
+ WM_GETTEXT, sizeof(selected),
+ (LPARAM) selected);
+
+ if (_tcslen(selected) <= 0)
+
+ nLanAdapter = -1;
+ else
+ nLanAdapter = GetAdapterNumber(selected);
+ }
+
+ GetAfsName(nLanAdapter, isGateway, name);
+ SetDlgItemText (hDlg, IDC_BINDING_MESSAGE, name);
+ EnableWindow(GetDlgItem(hDlg,IDC_NICSELECTION),(nLanAdapter!=-1));
+ break;
+ }
+ case IDC_NICSELECTION:
+ if (HIWORD(wp) == CBN_SELCHANGE)
+ {
+ TCHAR name[MAX_PATH];
+ TCHAR selected[MAX_PATH];
+ memset(name, 0, sizeof(name));
+ memset(selected, 0, sizeof(selected));
+ HWND hwndCombo = GetDlgItem(hDlg, IDC_NICSELECTION);
+ int i = SendMessage(hwndCombo, CB_GETCURSEL, 0, 0);
+ if (i != CB_ERR)
+ SendMessage(hwndCombo, CB_GETLBTEXT, (WPARAM)i,
+ (LPARAM) selected);
+
+ if (_tcslen(selected) <= 0)
+ nLanAdapter = -1;
+ else
+ nLanAdapter = GetAdapterNumber(selected);
+
+
+ GetAfsName(nLanAdapter, isGateway, name);
+ SetDlgItemText (hDlg, IDC_BINDING_MESSAGE, name);
+ break;
+ }
+
+ }
+ break;
+
+ case WM_HELP:
+ WinHelp (hDlg, g.szHelpFile, HELP_CONTEXT, IDH_AFSCONFIG_ADVANCED_MISC);
+ break;
+ }
+
+ return FALSE;
+}
+
+
+void Binding_OnInitDialog (HWND hDlg)
+{
+
+ TCHAR msg[MAX_PATH];
+ TCHAR name[MAX_PATH];
+ memset(msg, 0, sizeof(msg));
+ memset(name, 0, sizeof(name));
+
+ if (fFirstTime) {
+ Config_GetLanAdapter(&g.Configuration.nLanAdapter);
+ nLanAdapter = g.Configuration.nLanAdapter;
+ isGateway = g.Configuration.fBeGateway;
+ fFirstTime = FALSE;
+ }
+
+ lanainfo = GetLana(msg, NULL);
+
+ if (!lanainfo && _tcslen(msg) > 0)
+ MessageBox(hDlg, msg, "LANA ERROR", MB_ICONERROR);
+ else
+ {
+ HWND hwndCombo = GetDlgItem(hDlg, IDC_NICSELECTION);
+ int index = 0;
+ TCHAR tmp[MAX_PATH];
+ while (_tcslen(lanainfo[index].lana_name) > 0)
+ {
+ _stprintf(tmp, "%s (lana number = %d)", lanainfo[index].lana_name,
+ lanainfo[index].lana_number);
+ SendMessage(hwndCombo, CB_ADDSTRING,
+ 0, (LPARAM) tmp);
+ if (nLanAdapter == lanainfo[index].lana_number)
+ SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM)-1,
+ (LPARAM)tmp);
+ index++;
+ }
+ }
+
+
+ GetAfsName(nLanAdapter, isGateway, name);
+ SetDlgItemText (hDlg, IDC_BINDING_MESSAGE, name);
+
+ CheckDlgButton (hDlg, IDC_DEFAULTNIC, (nLanAdapter==-1));
+
+ EnableWindow(GetDlgItem(hDlg,IDC_NICSELECTION),(nLanAdapter!=-1));
+}
+
+void Binding_OnOK (HWND hDlg)
+{
+ if (IsDlgButtonChecked(hDlg,IDC_DEFAULTNIC))
+ nLanAdapter = -1;
+ else
+ {
+ TCHAR selected[MAX_PATH];
+ memset(selected, 0, sizeof(selected));
+ SendDlgItemMessage(hDlg, IDC_NICSELECTION,
+ WM_GETTEXT, sizeof(selected),
+ (LPARAM) selected);
+
+ if (_tcslen(selected) <= 0)
+ {
+ MessageBox(hDlg, "Please select the NIC to bind to", "Error", MB_ICONERROR);
+ return;
+ }
+
+ nLanAdapter = GetAdapterNumber(selected);
+
+ }
+
+ EndDialog(hDlg, IDOK);
+}
+
+
+BOOL Binding_OnApply()
+{
+ if (fFirstTime)
+ return TRUE;
+
+ if (nLanAdapter != g.Configuration.nLanAdapter) {
+ if (!Config_SetLanAdapter (nLanAdapter))
+ return FALSE;
+ g.Configuration.nLanAdapter = nLanAdapter;
+ }
+
+ return TRUE;
+
+
+}
+
+void Binding_OnCancel(HWND hDlg)
+{
+ fFirstTime = TRUE;
+
+ if (lanainfo)
+ {
+ delete lanainfo;
+ lanainfo = NULL;
+ }
+
+ EndDialog(hDlg, IDCANCEL);
+}
+
+
+int GetAdapterNumber(TCHAR* n)
+{
+ int index = 0;
+ while (_tcslen(lanainfo[index].lana_name) > 0)
+ {
+ if (_tcsncmp(lanainfo[index].lana_name, n, _tcslen(lanainfo[index].lana_name)) == 0)
+ {
+ return lanainfo[index].lana_number;
+ }
+ index++;
+ }
+
+ return -1;
+
+}
// Our dialog data
BOOL fFirstTime = TRUE;
+#if undef
DWORD nLanAdapter;
+#endif
DWORD csecProbe;
DWORD nThreads;
DWORD nDaemons;
case IDCANCEL:
Misc_OnCancel(hDlg);
break;
+#if undef
case IDC_AUTOLANA:
if (IsDlgButtonChecked(hDlg,IDC_AUTOLANA))
nLanAdapter=-1;
nLanAdapter=0;
SP_SetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER),nLanAdapter);
EnableWindow(GetDlgItem(hDlg,IDC_LAN_ADAPTER),(nLanAdapter!=-1));
+#endif
}
break;
void Misc_OnInitDialog (HWND hDlg)
{
if (fFirstTime) {
+#if undef
Config_GetLanAdapter(&g.Configuration.nLanAdapter);
+#endif
Config_GetProbeInt (&g.Configuration.csecProbe);
Config_GetNumThreads (&g.Configuration.nThreads);
Config_GetNumDaemons (&g.Configuration.nDaemons);
Config_GetRootVolume (g.Configuration.szRootVolume);
Config_GetMountRoot (g.Configuration.szMountDir);
+#if undef
nLanAdapter = g.Configuration.nLanAdapter;
+#endif
csecProbe = g.Configuration.csecProbe;
nThreads = g.Configuration.nThreads;
nDaemons = g.Configuration.nDaemons;
fFirstTime = FALSE;
}
+#if undef
CreateSpinner (GetDlgItem (hDlg, IDC_LAN_ADAPTER), 99, FALSE, nLANA_MIN, nLanAdapter, nLANA_MAX);
+#endif
CreateSpinner (GetDlgItem (hDlg, IDC_PROBE), 10, FALSE, csecPROBE_MIN, csecProbe, csecPROBE_MAX);
CreateSpinner (GetDlgItem (hDlg, IDC_THREADS), 10, FALSE, cTHREADS_MIN, nThreads, cTHREADS_MAX);
CreateSpinner (GetDlgItem (hDlg, IDC_DAEMONS), 10, FALSE, cDAEMONS_MIN, nDaemons, cDAEMONS_MAX);
SetDlgItemText (hDlg, IDC_SYSNAME, szSysName);
SetDlgItemText (hDlg, IDC_ROOTVOLUME, szRootVolume);
SetDlgItemText (hDlg, IDC_MOUNTDIR, szMountDir);
+#if undef
CheckDlgButton (hDlg, IDC_AUTOLANA, (nLanAdapter==-1));
EnableWindow(GetDlgItem(hDlg,IDC_LAN_ADAPTER),(nLanAdapter!=-1));
+#endif
}
void Misc_OnOK (HWND hDlg)
{
+#if undef
nLanAdapter = (IsDlgButtonChecked(hDlg,IDC_AUTOLANA))?-1
:SP_GetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER));
-
+#endif
csecProbe = SP_GetPos (GetDlgItem (hDlg, IDC_PROBE));
nThreads = SP_GetPos (GetDlgItem (hDlg, IDC_THREADS));
if (fFirstTime)
return TRUE;
+#if undef
if (nLanAdapter != g.Configuration.nLanAdapter) {
if (!Config_SetLanAdapter (nLanAdapter))
return FALSE;
g.Configuration.nLanAdapter = nLanAdapter;
}
+#endif
if (csecProbe != g.Configuration.csecProbe) {
if (!Config_SetProbeInt (csecProbe))
#define DEBUG_VERBOSE
#include <osilog.h>
+extern void Config_GetLanAdapter (ULONG *pnLanAdapter);
+void GetNetbiosName(LPTSTR pszName, int type);
+extern BOOL Config_ReadNum (LPCTSTR pszLHS, DWORD *pdwRHS);
+extern BOOL Config_ReadString (LPCTSTR pszLHS, LPTSTR pszRHS, size_t cchMax);
+extern void GetUncServerName(int lanaNumber, BOOL isGateway, TCHAR* name, int type);
+
+#define NETBIOS_NAME_FULL 0
+#define NETBIOS_NAME_SUFFIX 1
+
/*
* REGISTRY ___________________________________________________________________
*
static TCHAR cszINIFILE[] = TEXT("afsdsbmt.ini");
static TCHAR cszSECTION_SUBMOUNTS[] = TEXT("AFS Submounts");
static TCHAR cszSECTION_MAPPINGS[] = TEXT("AFS Mappings");
+static TCHAR cszSECTION_ACTIVE[] = TEXT("AFS Active");
static TCHAR cszAUTOSUBMOUNT[] = TEXT("Auto");
static TCHAR cszLANMANDEVICE[] = TEXT("\\Device\\LanmanRedirector\\");
void GetClientNetbiosName (LPTSTR pszName)
{
- *pszName = TEXT('\0');
-
- if (IsWindowsNT())
- {
- HKEY hk;
- if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Control\\ComputerName\\ComputerName"), &hk) == 0)
- {
- DWORD dwSize = MAX_PATH;
- DWORD dwType = REG_SZ;
- RegQueryValueEx (hk, TEXT("ComputerName"), NULL, &dwType, (PBYTE)pszName, &dwSize);
- }
- }
- else // (!IsWindowsNT())
- {
- HKEY hk;
- if (RegOpenKey (HKEY_LOCAL_MACHINE, TEXT("System\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"), &hk) == 0)
- {
- DWORD dwSize = MAX_PATH;
- DWORD dwType = REG_SZ;
- RegQueryValueEx (hk, TEXT("Gateway"), NULL, &dwType, (PBYTE)pszName, &dwSize);
- }
- }
-
- // Shorten the server name from its FQDN
- //
- for (LPTSTR pch = pszName; *pch; ++pch)
- {
- if (*pch == TEXT('.'))
- {
- *(LPTSTR)pch = TEXT('\0');
- break;
- }
- }
-
- // Form NetBIOS name from client's (possibly truncated) simple host name.
- if (*pszName != TEXT('\0')) {
- pszName[11] = TEXT('\0');
- lstrcat(pszName, TEXT("-AFS"));
- }
+ *pszName = TEXT('\0');
+ GetNetbiosName(pszName, NETBIOS_NAME_FULL);
}
FreeStringMemory (mszLHS);
}
+BOOL ForceMapActive (TCHAR chDrive)
+{
+ TCHAR szDrive[2];
+ TCHAR szActive[32];
+
+ szDrive[0] = chDrive;
+ szDrive[1] = 0;
+
+ GetPrivateProfileString (cszSECTION_ACTIVE, szDrive, TEXT("0"), szActive, sizeof(szActive), cszINIFILE);
+
+ if ( !lstrcmp(szActive,"1") || !lstrcmpi(szActive,"true") || !lstrcmpi(szActive,"on") || !lstrcmpi(szActive,"yes") )
+ return TRUE;
+ return FALSE;
+}
+
+
+void WriteActiveMap (TCHAR chDrive, BOOL on)
+{
+ TCHAR szDrive[2];
+
+ szDrive[0] = chDrive;
+ szDrive[1] = 0;
+
+ WritePrivateProfileString (cszSECTION_ACTIVE, szDrive, on ? "1" : "0", cszINIFILE);
+}
void QueryDriveMapList_WriteMappings (PDRIVEMAPLIST pList)
{
IOInfo.out = (char *)OutData;
IOInfo.out_size = PIOCTL_MAXSIZE;
- ULONG status;
- if ((status = pioctl (0, VIOC_MAKESUBMOUNT, &IOInfo, 1)) != 0)
+ ULONG status = pioctl (0, VIOC_MAKESUBMOUNT, &IOInfo, 1);
+ if (pStatus)
+ *pStatus = status;
+
+ if (status)
return FALSE;
lstrcpy (pszSubmount, (LPCTSTR)OutData);
BOOL GetDriveSubmount (TCHAR chDrive, LPTSTR pszSubmountNow)
{
- TCHAR szDrive[] = TEXT("*:");
- szDrive[0] = chDrive;
+ TCHAR szDrive[] = TEXT("*:");
+ szDrive[0] = chDrive;
+
+ TCHAR szMapping[ MAX_PATH ] = TEXT("");
+ LPTSTR pszSubmount = szMapping;
+ TCHAR szNetBiosName[32];
- TCHAR szMapping[ MAX_PATH ] = TEXT("");
- LPTSTR pszSubmount = szMapping;
+ memset(szNetBiosName, '\0', sizeof(szNetBiosName));
+ GetNetbiosName(szNetBiosName, NETBIOS_NAME_SUFFIX);
+ _tcscat(szNetBiosName, TEXT("\\"));
if (IsWindowsNT())
{
return FALSE;
}
for (++pszSubmount; *pszSubmount && (*pszSubmount != TEXT('\\')); ++pszSubmount)
- if (!lstrncmpi (pszSubmount, TEXT("-afs\\"), lstrlen(TEXT("-afs\\"))))
+ if (!lstrncmpi (pszSubmount, szNetBiosName, lstrlen(szNetBiosName)))
break;
if ((!*pszSubmount) || (*pszSubmount == TEXT('\\')))
return FALSE;
- pszSubmount += lstrlen("-afs\\");
+ pszSubmount += lstrlen(szNetBiosName);
}
else // (!IsWindowsNT())
{
if (*(pszSubmount++) != TEXT('\\'))
return FALSE;
for ( ; *pszSubmount && (*pszSubmount != TEXT('\\')); ++pszSubmount)
- if (!lstrncmpi (pszSubmount, TEXT("-afs\\"), lstrlen(TEXT("-afs\\"))))
+ if (!lstrncmpi (pszSubmount, szNetBiosName, lstrlen(szNetBiosName)))
break;
if ((!*pszSubmount) || (*pszSubmount == TEXT('\\')))
return FALSE;
- pszSubmount += lstrlen("-afs\\");
+ pszSubmount += lstrlen(szNetBiosName);
}
if (!pszSubmount || !*pszSubmount)
DWORD res;
DWORD cbBuffer=16384;
DWORD cEntries=-1;
- GetComputerName(szMachine,&rc);
CHAR *pSubmount="";
+
+ memset(szMachine, '\0', sizeof(szMachine));
+ GetNetbiosName(szMachine, NETBIOS_NAME_FULL);
+
// Initialize the data structure
if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR)
return;
- sprintf(szPath,"\\\\%s-afs\\",szMachine);
+ sprintf(szPath,"\\\\%s\\",szMachine);
_strlwr(szPath);
lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer);
do {
DWORD res;
DWORD cbBuffer=16384;
DWORD cEntries=-1;
- GetComputerName(szMachine,&rc);
CHAR szUser[MAXRANDOMNAMELEN];
- // Initialize the data structure
+
+ memset(szMachine, '\0', sizeof(szMachine));
+ GetNetbiosName(szMachine, NETBIOS_NAME_FULL);
+
+ // Initialize the data structure
if (!IsServiceActive())
return TRUE;
memset (&List, 0x00, sizeof(DRIVEMAPLIST));
if ((res=WNetOpenEnum(RESOURCE_CONNECTED,RESOURCETYPE_DISK,RESOURCEUSAGE_CONNECTABLE,lpnr,&hEnum))!=NO_ERROR)
return FALSE;
lpnrLocal=(LPNETRESOURCE) GlobalAlloc(GPTR,cbBuffer);
- sprintf(szPath,"\\\\%s-afs\\",szMachine);
+ sprintf(szPath,"\\\\%s\\",szMachine);
_strlwr(szPath);
do {
memset(lpnrLocal,0,cbBuffer);
} while (res!=ERROR_NO_MORE_ITEMS);
GlobalFree((HGLOBAL)lpnrLocal);
WNetCloseEnum(hEnum);
- sprintf(szPath,"\\\\%s-afs\\all",szMachine);
+ sprintf(szPath,"\\\\%s\\all",szMachine);
cbBuffer=MAXRANDOMNAMELEN-1;
// Lets connect all submounts that weren't connectd
CHAR * pUser = NULL;
BOOL DoMapShare()
{
DRIVEMAPLIST List;
- TCHAR szMachine[ MAX_PATH ];
DWORD rc=28;
BOOL bMappedAll=FALSE;
CHAR * pUser = NULL;
- GetComputerName(szMachine,&rc);
+
// Initialize the data structure
DEBUG_EVENT0("AFS DoMapShare");
QueryDriveMapList (&List);
}
for (TCHAR chDrive = chDRIVE_A; chDrive <= chDRIVE_Z; ++chDrive)
{
- if (List.aDriveMap[chDrive-chDRIVE_A].fActive)
+ if (List.aDriveMap[chDrive-chDRIVE_A].fActive ||
+ ForceMapActive(chDrive))
{
+ TCHAR szSubmount[ MAX_PATH ];
+ if (List.aDriveMap[chDrive-chDRIVE_A].szSubmount[0])
+ lstrcpy(szSubmount,List.aDriveMap[chDrive-chDRIVE_A].szSubmount);
+ else if (!PathToSubmount (szSubmount, List.aDriveMap[chDrive-chDRIVE_A].szMapping, NULL, NULL))
+ continue;
+
+ BOOL fPersistent = List.aDriveMap[chDrive-chDRIVE_A].fPersistent;
+ if (RWLogonOption(TRUE,LOGON_OPTION_HIGHSECURITY))
+ fPersistent = FALSE;
DWORD res=MountDOSDrive(chDrive
- ,List.aDriveMap[chDrive-chDRIVE_A].szSubmount
- ,List.aDriveMap[chDrive-chDRIVE_A].fPersistent);
+ ,szSubmount
+ ,fPersistent,pUser);
}
}
return TRUE;
if (dwResult != ERROR_SUCCESS) {
if (dwResult != ERROR_NO_MORE_ITEMS)
{
- DEBUG_EVENT1("AFS DriveMap","Failed to read \\GlobalAutoMapper values: %d",dwResult);
+ DEBUG_EVENT1("AFS DriveMap","Failed to read GlobalAutoMapper values: %d",dwResult);
}
break;
}
nr.lpRemoteName=szPath;
nr.dwDisplayType = RESOURCEDISPLAYTYPE_SHARE;
DWORD res=WNetAddConnection2(&nr,NULL,pUsername,(bPersistent)?CONNECT_UPDATE_PROFILE:0);
- DEBUG_EVENT3("AFS DriveMap","Mount %s Remote[%s]=%x",(bPersistent)?"Persistant" : "NonPresistant",szPath,res);
+ DEBUG_EVENT5("AFS DriveMap","Mount %s Local[%s] Remote[%s] User[%s]=%x",
+ (bPersistent)?"Persistant" : "NonPresistant",
+ szDrive,szPath,pUsername?pUsername:"NULL",res);
return res;
}
DWORD DisMountDOSDriveFull(const char *szPath,BOOL bForce)
{
DWORD res=WNetCancelConnection(szPath,bForce);
- DEBUG_EVENT2("AFS DriveMap","Dismount Remote[%s]=%x",szPath,res);
+ DEBUG_EVENT3("AFS DriveMap","%sDismount Remote[%s]=%x",
+ bForce ? "Forced " : "",szPath,res);
return (res==ERROR_NOT_CONNECTED)?NO_ERROR:res;
}
sprintf(szPath,"%c:",chDrive);
return DisMountDOSDriveFull(szPath,bForce);
}
+
+void GetNetbiosName(LPTSTR pszName, int type)
+{
+ DWORD LanAdapter;
+ DWORD dwIsGateWay = 0;
+ TCHAR name[MAX_PATH];
+ TCHAR *Ptr;
+
+ memset(name, '\0', sizeof(name));
+ if (!IsWindowsNT())
+ {
+ if (type == NETBIOS_NAME_SUFFIX)
+ {
+ _tcscpy(pszName, TEXT("-afs"));
+ return;
+ }
+ Config_ReadString (TEXT("Gateway"), pszName, MAX_PATH);
+ if (strlen(pszName) == 0)
+ {
+ strcpy(pszName, TEXT("unknown"));
+ return;
+ }
+ _tcscat(pszName, TEXT("-afs"));
+ return;
+ }
+ if (!Config_ReadNum (TEXT("IsGateway"), &dwIsGateWay))
+ dwIsGateWay = 0;
+ memset(name, 0, sizeof(name));
+ if (!Config_ReadNum (TEXT("LANadapter"), &LanAdapter))
+ LanAdapter = -1;
+ GetUncServerName(LanAdapter, dwIsGateWay, name, type);
+ _tcscpy(pszName, name);
+ return;
+}
+
DWORD DisMountDOSDrive(const char *szSubmount,BOOL bForce=TRUE);
DWORD DisMountDOSDrive(char chDrive,BOOL bForce=TRUE);
DWORD DisMountDOSDriveFull(const char *pPath,BOOL bForce=TRUE);
+
+void WriteActiveMap(TCHAR chDrive, BOOL bOn);
+BOOL ForceMapActive(TCHAR chDrive);
+
#ifndef DRIVEMAP_DEF_H
extern void TestAndDoUnMapShare();
extern TCHAR pUserName[];
--- /dev/null
+// getlana.cpp : Defines the entry point for the console application.
+//
+
+#include <afx.h>
+#include <windows.h>
+#include <winreg.h>
+#include <nb30.h>
+#include <tchar.h>
+#include <shellapi.h>
+#include <iostream>
+#include <objbase.h>
+#include <shlobj.h>
+#include <shlwapi.h>
+#include <wtypes.h>
+#include <string.h>
+#include <malloc.h>
+#include <winsock2.h>
+#include <getlana.h>
+
+
+
+#define LANA_INVALID 0xff
+using namespace std;
+BOOL lana_IsLoopback(lana_number_t lana, TCHAR*);
+lana_number_t lana_FindLoopback(TCHAR*);
+
+
+
+// Use the IShellFolder API to get the connection name for the given Guid.
+static HRESULT getname_shellfolder(WCHAR *wGuid, WCHAR *wName, int NameSize)
+{
+ // This is the GUID for the network connections folder. It is constant.
+ // {7007ACC7-3202-11D1-AAD2-00805FC1270E}
+ const GUID CLSID_NetworkConnections = {
+ 0x7007ACC7, 0x3202, 0x11D1, {
+ 0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E
+ }
+ };
+ LPITEMIDLIST pidl;
+ IShellFolder *pShellFolder;
+ IMalloc *pShellMalloc;
+
+ // Build the display name in the form "::{GUID}".
+ if (wcslen(wGuid) >= MAX_PATH)
+ return E_INVALIDARG;
+ WCHAR szAdapterGuid[MAX_PATH + 2];
+ swprintf(szAdapterGuid, L"::%ls", wGuid);
+
+ // Initialize COM.
+ CoInitialize(NULL);
+
+ // Get the shell allocator.
+ HRESULT hr = SHGetMalloc(&pShellMalloc);
+ if (SUCCEEDED(hr))
+ {
+ // Create an instance of the network connections folder.
+ hr = CoCreateInstance(CLSID_NetworkConnections, NULL,
+ CLSCTX_INPROC_SERVER, IID_IShellFolder,
+ reinterpret_cast<LPVOID *>(&pShellFolder));
+ }
+ if (SUCCEEDED(hr))
+ hr = pShellFolder->ParseDisplayName(NULL, NULL, szAdapterGuid, NULL,
+ &pidl, NULL);
+ if (SUCCEEDED(hr))
+ {
+ // Get the display name; this returns the friendly name.
+ STRRET sName;
+ hr = pShellFolder->GetDisplayNameOf(pidl, SHGDN_NORMAL, &sName);
+ if (SUCCEEDED(hr))
+ wcsncpy(wName, sName.pOleStr, NameSize);
+ pShellMalloc->Free(pidl);
+ }
+
+ CoUninitialize();
+ return hr;
+}
+
+// Get the Connection Name for the given GUID.
+static int lana_GetNameFromGuid(char *Guid, char **Name)
+{
+ typedef HRESULT (WINAPI *HrLanProcAddr)(GUID *, PCWSTR, PWSTR, LPDWORD);
+ HrLanProcAddr HrLanProc = NULL;
+ HMODULE hNetMan;
+ int size;
+ WCHAR *wGuid = NULL;
+ WCHAR wName[MAX_PATH];
+ DWORD NameSize = (sizeof(wName) / sizeof(wName[0]));
+ HRESULT status;
+
+ // Convert the Guid string to Unicode. First we ask only for the size
+ // of the converted string. Then we allocate a buffer of sufficient
+ // size to hold the result of the conversion.
+ size = MultiByteToWideChar(CP_ACP, 0, Guid, -1, NULL, 0);
+ wGuid = (WCHAR *) malloc(size * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, Guid, -1, wGuid, size);
+
+ // First try the IShellFolder interface, which was unimplemented
+ // for the network connections folder before XP.
+ status = getname_shellfolder(wGuid, wName, NameSize);
+ if (status == E_NOTIMPL)
+ {
+ // The IShellFolder interface is not implemented on this platform.
+ // Try the (undocumented) HrLanConnectionNameFromGuidOrPath API
+ // from the netman DLL.
+ hNetMan = LoadLibrary("netman.dll");
+ if (hNetMan == NULL)
+ {
+ free(wGuid);
+ return -1;
+ }
+ HrLanProc =
+ (HrLanProcAddr) GetProcAddress(hNetMan,
+ "HrLanConnectionNameFromGuidOrPath");
+ if (HrLanProc == NULL)
+ {
+ FreeLibrary(hNetMan);
+ free(wGuid);
+ return -1;
+ }
+ // Super Secret Microsoft Call
+ status = HrLanProc(NULL, wGuid, wName, &NameSize);
+ FreeLibrary(hNetMan);
+ }
+ free(wGuid);
+ if (FAILED(status))
+ {
+ cerr << "lana_GetNameFromGuid: failed to get connection name (status "
+ << status << ")\r\n";
+ return -1;
+ }
+
+ // Get the required buffer size, and then convert the string.
+ size = WideCharToMultiByte(CP_ACP, 0, wName, -1, NULL, 0, NULL, NULL);
+ *Name = (char *) malloc(size);
+ if (*Name == NULL)
+ return -1;
+ WideCharToMultiByte(CP_ACP, 0, wName, -1, *Name, size, NULL, NULL);
+ return 0;
+}
+
+LANAINFO* GetLana(TCHAR* msg, const char *LanaName)
+{
+ const char RegNetBiosLinkageKeyName[] =
+ "System\\CurrentControlSet\\Services\\NetBios\\Linkage";
+ HKEY hkey;
+ LONG status;
+ struct {
+ BYTE flags;
+ BYTE number;
+ } lanamap[MAX_LANA+1];
+ DWORD lanamapsize = sizeof(lanamap);
+ DWORD type;
+ char *bindpaths = NULL;
+ DWORD bindpathsize;
+ int nlana;
+ int i;
+ char *guid;
+ char *name;
+ char *pBind;
+ char *p;
+
+ LANAINFO* lanainfo;
+
+ // Open the NetBios Linkage key.
+ status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, RegNetBiosLinkageKeyName, 0,
+ KEY_QUERY_VALUE, &hkey);
+
+ if (status != ERROR_SUCCESS)
+ {
+ _stprintf(msg, _T("Failed to open NetBios Linkage key (status %d)"), status);
+ return NULL;
+ }
+
+ // Read the lana map.
+ status = RegQueryValueEx(hkey, "LanaMap", 0, &type,
+ (BYTE *) &lanamap, &lanamapsize);
+ if (status != ERROR_SUCCESS)
+ {
+ _stprintf(msg, _T("Failed to read LanaMap (status %d)"), status);
+ RegCloseKey(hkey);
+ return NULL;
+ }
+ if (lanamapsize == 0)
+ {
+ _stprintf(msg, _T("No data in LanaMap"));
+ return NULL;
+ }
+ nlana = lanamapsize / sizeof(lanamap[0]);
+
+ // Get the bind paths for NetBios so we can match them up
+ // with the lana map. First we query for the size, so we
+ // can allocate an appropriate buffer.
+ status = RegQueryValueEx(hkey, "Bind", 0, &type, NULL, &bindpathsize);
+ if (status == ERROR_SUCCESS && bindpathsize != 0)
+ {
+ bindpaths = (char *) malloc(bindpathsize * sizeof(char));
+ if (bindpaths == NULL)
+ {
+ _stprintf(msg, _T("Cannot allocate %d bytes for bindpaths"), bindpathsize);
+
+ RegCloseKey(hkey);
+ return NULL;
+ }
+ status = RegQueryValueEx(hkey, "Bind", 0, &type,
+ (BYTE *) bindpaths, &bindpathsize);
+ }
+ RegCloseKey(hkey);
+ if (status != ERROR_SUCCESS)
+ {
+ _stprintf(msg, _T("Failed to read bind paths (status %d)"), status);
+ if (bindpaths != NULL)
+ free(bindpaths);
+ return NULL;
+ }
+ if (bindpathsize == 0)
+ {
+ _stprintf(msg, _T("No bindpath data"));
+ if (bindpaths != NULL)
+ free(bindpaths);
+ return NULL;
+ }
+
+ if (LanaName)
+ {
+ lanainfo = new LANAINFO[1];
+ lanainfo[0].lana_number = LANA_INVALID;
+ memset(lanainfo[0].lana_name, 0, sizeof(lanainfo[0].lana_name));
+ }
+ else
+ {
+ lanainfo = new LANAINFO[nlana+1];
+ memset(lanainfo, 0, sizeof(LANAINFO) * nlana);
+ }
+ int index = 0;
+ for (i = 0, pBind = bindpaths; i < nlana;
+ i++, pBind += strlen(pBind) + 1)
+ {
+ // Ignore an invalid map entry.
+ if ((lanamap[i].flags & 1) == 0)
+ continue;
+ // Find the beginning of the GUID.
+ guid = strchr(pBind, '{');
+ if (guid == NULL)
+ continue; // Malformed path entry?
+ guid = strdup(guid);
+ if (guid == NULL)
+ continue;
+ // Find the end of the GUID.
+ p = strchr(guid, '}');
+ if (p == NULL)
+ {
+ free(guid); // Malformed GUID?
+ continue;
+ }
+ *++p = '\0'; // Ignore anything after the GUID.
+ status = lana_GetNameFromGuid(guid, &name);
+ if (status == 0)
+ {
+ if (LanaName)
+ {
+ if (strcmp(name, LanaName) ==0)
+ {
+ lanainfo[index].lana_number = lanamap[i].number;
+ _tcscpy(lanainfo[index].lana_name ,name);
+ free(name);
+ free(guid);
+ break;
+ }
+ }
+ else
+ {
+ lanainfo[index].lana_number = lanamap[i].number;
+ _tcscpy(lanainfo[index].lana_name ,name);
+ free(name);
+ index++;
+ }
+ }
+
+ free(guid);
+ }
+ free(bindpaths);
+ return lanainfo;
+}
+
+
+lana_number_t lana_FindLoopback(TCHAR* msg)
+{
+ NCB ncb;
+ LANA_ENUM lana_list;
+ int status;
+ int i;
+
+ memset(&ncb, 0, sizeof(ncb));
+ ncb.ncb_command = NCBENUM;
+ ncb.ncb_buffer = (UCHAR *) &lana_list;
+ ncb.ncb_length = sizeof(lana_list);
+ status = Netbios(&ncb);
+ if (status != 0) {
+ _stprintf(msg, _T("Netbios NCBENUM failed: status %ld"), status);
+ return LANA_INVALID;
+ }
+
+ for (i = 0; i < lana_list.length; i++) {
+ if (lana_IsLoopback(lana_list.lana[i], msg)) {
+ // Found one, return it.
+ return lana_list.lana[i];
+ }
+ }
+ // Could not find a loopback adapter.
+ return LANA_INVALID;
+}
+
+
+// Is the given lana a Windows Loopback Adapter?
+BOOL lana_IsLoopback(lana_number_t lana, TCHAR* msg)
+{
+ NCB ncb;
+ struct {
+ ADAPTER_STATUS status;
+ NAME_BUFFER names[MAX_LANA+1];
+ } astat;
+ unsigned char kWLA_MAC[6] = { 0x02, 0x00, 0x4c, 0x4f, 0x4f, 0x50 };
+ int status;
+
+ // Reset the adapter: in Win32, this is required for every process, and
+ // acts as an init call, not as a real hardware reset.
+ memset(&ncb, 0, sizeof(ncb));
+ ncb.ncb_command = NCBRESET;
+ ncb.ncb_callname[0] = 100;
+ ncb.ncb_callname[2] = 100;
+ ncb.ncb_lana_num = lana;
+ status = Netbios(&ncb);
+ if (status == 0)
+ status = ncb.ncb_retcode;
+ if (status != 0) {
+ sprintf(msg, "NCBRESET failed: lana %u, status %ld", lana, status);
+ return FALSE;
+ }
+
+ // Use the NCBASTAT command to get the adapter address.
+ memset(&ncb, 0, sizeof(ncb));
+ ncb.ncb_command = NCBASTAT;
+ ncb.ncb_lana_num = lana;
+ strcpy((char *) ncb.ncb_callname, "* ");
+ ncb.ncb_buffer = (UCHAR *) &astat;
+ ncb.ncb_length = sizeof(astat);
+ status = Netbios(&ncb);
+ if (status == 0)
+ status = ncb.ncb_retcode;
+ if (ncb.ncb_retcode != 0) {
+ sprintf(msg, "NCBASTAT failed: lana %u, status %ld", lana, status);
+ return FALSE;
+ }
+ return (memcmp(astat.status.adapter_address, kWLA_MAC, 6) == 0);
+}
+
+#define NETBIOS_NAME_FULL 0
+#define NETBIOS_NAME_SUFFIX 1
+#define AFSCONFIGKEYNAME TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters")
+
+void GetUncServerName(int lanaNumber, BOOL isGateway, TCHAR* name, int type)
+{
+ lana_number_t lana = LANA_INVALID;
+ LANAINFO* lanainfo;
+ WSADATA WSAjunk;
+ char cm_HostName[MAX_PATH];
+ TCHAR tmpName[MAX_PATH];
+ TCHAR msg[MAX_PATH];
+ memset(msg, 0, sizeof(msg));
+ memset(tmpName, 0, sizeof(tmpName));
+ memset(cm_HostName, 0, sizeof(cm_HostName));
+ WSAStartup(0x0101, &WSAjunk);
+
+ if (lanaNumber == -1) {
+ /* Find the default LAN adapter to use. First look for
+ * the adapter named AFS; otherwise, unless we are doing
+ * gateway service, look for any valid loopback adapter.
+ */
+ lanainfo = GetLana(msg, "AFS");
+ if (lanainfo)
+ {
+ lana = lanainfo[0].lana_number;
+ delete lanainfo;
+ }
+ if (lana == LANA_INVALID && !isGateway)
+ lana = lana_FindLoopback(msg);
+ if (lana != LANA_INVALID)
+ lanaNumber = lana;
+ }
+ /* If we are using a loopback adapter, we can use the preferred
+ * (but non-unique) server name; otherwise, we must fall back to
+ * the <machine>-AFS name.
+ */
+ if (lanaNumber >= 0 && lana_IsLoopback(lanaNumber, msg))
+ {
+ HKEY parmKey;
+ char mountRoot[MAX_PATH+1];
+ char *pmount=mountRoot;
+ DWORD len=sizeof(mountRoot)-1;
+ printf("int mountroot \n");
+ if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSCONFIGKEYNAME,0, KEY_QUERY_VALUE, &parmKey)!= ERROR_SUCCESS)
+ || (RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,(LPBYTE)(mountRoot), &len)!= ERROR_SUCCESS)
+ || (len > sizeof(mountRoot)-1)
+ )
+ strcpy(mountRoot, "afs");
+ RegCloseKey(parmKey);
+ mountRoot[len]=0; /*safety see ms-help://MS.MSDNQTR.2002OCT.1033/sysinfo/base/regqueryvalueex.htm*/
+ if ((*pmount=='/') || (*pmount='\\'))
+ pmount++;
+
+ _tcscpy(name, pmount);
+ } else {
+ gethostname(cm_HostName, sizeof(cm_HostName));
+ _tcscpy(tmpName, cm_HostName);
+ char* ctemp = _tcschr(tmpName, '.'); /* turn ntdfs.* into ntdfs */
+ if (ctemp) *ctemp = 0;
+ tmpName[11] = 0; /* ensure that even after adding the -A, we
+ * leave one byte free for the netbios server
+ * type.
+ */
+ if (type == NETBIOS_NAME_FULL) {
+ _tcscat(tmpName, _T("-afs"));
+ _tcscpy(name, tmpName);
+ } else {
+ _tcscpy(name, _T("-afs"));
+ }
+ }
+}
+
+void GetAfsName(int lanaNumber, BOOL isGateway, TCHAR* name)
+{
+
+ GetUncServerName(lanaNumber, isGateway, name, NETBIOS_NAME_FULL);
+ _stprintf(name, _T("Your UNC name to reach the root of AFS is \\\\%s\\all"), name);
+}
+
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef GETLANA_H
+#define GETLANA_H
+
+typedef BYTE lana_number_t;
+struct LANAINFO
+ {
+ lana_number_t lana_number;
+ TCHAR lana_name[MAX_PATH];
+ };
+
+ LANAINFO * GetLana(TCHAR* msg, const char *LanaName);
+
+ void GetAfsName(int lanaNumber, BOOL isGateway, TCHAR* name);
+
+#endif
\ No newline at end of file
IDC_WARN,13,193,193,17
END
-IDD_ADVANCED_NT DIALOG DISCARDABLE 0, 0, 220, 225
+IDD_ADVANCED_NT DIALOG DISCARDABLE 0, 0, 220, 247
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Advanced"
FONT 9, "MS Shell Dlg"
EDITTEXT IDC_CHUNK_SIZE,88,62,32,13,ES_AUTOHSCROLL | ES_READONLY
EDITTEXT IDC_STAT_ENTRIES,88,83,32,13,ES_AUTOHSCROLL
PUSHBUTTON "&Logon...",IDC_LOGON_PARMS,13,128,56,14
- PUSHBUTTON "&Global Drives...",IDC_AUTOMAP_PARMS,13,173,56,14
- PUSHBUTTON "&Miscellaneous...",IDC_MISC_PARMS,13,195,56,14
+ PUSHBUTTON "&Global Drives...",IDC_AUTOMAP_PARMS,13,172,56,14
+ PUSHBUTTON "&Miscellaneous...",IDC_MISC_PARMS,13,216,56,14
GROUPBOX "Cache Configuration",IDC_STATIC,7,7,206,100
LTEXT "&Cache Size:",IDC_STATIC,13,23,71,8
LTEXT "kb",IDC_INUSE,136,23,68,8
LTEXT "&Status Cache:",IDC_STATIC,13,85,71,8
LTEXT "entries",IDC_STATIC,136,85,68,8
LTEXT "Cache &Path:",IDC_STATIC,13,44,71,8
- GROUPBOX "Additional Advanced Parameters",IDC_STATIC,7,114,206,
- 104
- LTEXT "Create global AFS drive mappings.",IDC_STATIC,74,176,
+ GROUPBOX "Additional Advanced Parameters",IDC_STATIC,7,118,206,
+ 122
+ LTEXT "Create global AFS drive mappings.",IDC_STATIC,74,174,
132,10
- LTEXT "Adjust integrated logon settings.",IDC_STATIC,74,132,
+ LTEXT "Adjust integrated logon settings.",IDC_STATIC,74,130,
133,10
LTEXT "Set various other advanced parameters.",IDC_STATIC,74,
- 199,132,10
+ 218,132,10
PUSHBUTTON "&Diagnostic...",IDC_DIAG_PARMS,13,150,56,14
LTEXT "Enable settings for problem debugging.",IDC_STATIC,74,
- 153,132,10
+ 152,132,10
+ PUSHBUTTON "&Binding...",IDC_BINDING_PARMS,13,194,56,14
+ LTEXT "Adjust network adapter binding settings.",IDC_STATIC,74,
+ 196,133,10
END
IDD_PREFS_EDIT DIALOG DISCARDABLE 0, 0, 251, 123
PUSHBUTTON "&Remove",IDC_REMOVE,157,227,50,14
END
-IDD_MISC_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 220, 193
+IDD_MISC_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 220, 170
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Miscellaneous Configuration"
FONT 8, "MS Sans Serif"
BEGIN
- EDITTEXT IDC_LAN_ADAPTER,162,22,32,13,ES_AUTOHSCROLL
- EDITTEXT IDC_PROBE,90,40,32,13,ES_AUTOHSCROLL
- EDITTEXT IDC_THREADS,90,60,32,13,ES_AUTOHSCROLL
- EDITTEXT IDC_DAEMONS,90,80,32,13,ES_AUTOHSCROLL
- EDITTEXT IDC_SYSNAME,90,100,83,13,ES_AUTOHSCROLL
- EDITTEXT IDC_MOUNTDIR,90,120,83,13,ES_AUTOHSCROLL
- EDITTEXT IDC_ROOTVOLUME,90,140,83,13,ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,55,172,50,14
- PUSHBUTTON "Cancel",IDCANCEL,109,172,50,14
- PUSHBUTTON "Help",9,163,172,50,14
- GROUPBOX "Parameters",IDC_STATIC,7,7,206,156
- LTEXT "&Probe Interval:",IDC_STATIC,15,42,71,8
- LTEXT "seconds",IDC_STATIC,138,42,68,8
- LTEXT "&Background Threads:",IDC_STATIC,15,62,71,8
- LTEXT "threads",IDC_STATIC,138,62,68,8
- LTEXT "S&ervice Threads:",IDC_STATIC,15,82,71,8
- LTEXT "threads",IDC_STATIC,138,82,68,8
- LTEXT "S&ystem Name:",IDC_STATIC,15,102,71,8
- LTEXT "&Mount Directory:",IDC_STATIC,15,122,71,8
- LTEXT "&Root Volume:",IDC_STATIC,15,141,71,8
- CONTROL "Automatic Lana scan",IDC_AUTOLANA,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,19,22,82,10
- RTEXT "Lana Number:",IDC_STATICLANA,106,24,53,8
+ EDITTEXT IDC_PROBE,90,16,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_THREADS,90,36,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_DAEMONS,90,56,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_SYSNAME,90,76,83,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_MOUNTDIR,90,96,83,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_ROOTVOLUME,90,116,83,13,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK",IDOK,55,143,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,109,143,50,14
+ PUSHBUTTON "Help",9,163,143,50,14
+ GROUPBOX "Parameters",IDC_STATIC,7,7,206,130
+ LTEXT "&Probe Interval:",IDC_STATIC,15,18,71,8
+ LTEXT "seconds",IDC_STATIC,138,18,68,8
+ LTEXT "&Background Threads:",IDC_STATIC,15,38,71,8
+ LTEXT "threads",IDC_STATIC,138,38,68,8
+ LTEXT "S&ervice Threads:",IDC_STATIC,15,58,71,8
+ LTEXT "threads",IDC_STATIC,138,58,68,8
+ LTEXT "S&ystem Name:",IDC_STATIC,15,78,71,8
+ LTEXT "&Mount Directory:",IDC_STATIC,15,98,71,8
+ LTEXT "&Root Volume:",IDC_STATIC,15,117,71,8
END
IDD_DIAG_PARMS DIALOG DISCARDABLE 0, 0, 217, 135
GROUPBOX "Global AFS Drive",IDC_STATIC,7,7,232,80
END
+IDD_BINDING_CONFIG_PARAMS DIALOG DISCARDABLE 0, 0, 220, 149
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Binding"
+FONT 8, "MS Sans Serif"
+BEGIN
+ CONTROL "Use Default NIC",IDC_DEFAULTNIC,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,15,14,82,10
+ COMBOBOX IDC_NICSELECTION,15,41,159,66,CBS_DROPDOWN | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "OK",IDOK,55,128,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,109,128,50,14
+ PUSHBUTTON "Help",9,163,128,50,14
+ GROUPBOX "Network Adapter Selection (NIC):",IDC_STATIC,7,5,206,57
+ LTEXT "Select the NIC to Bind to:",IDC_STATICLANA,15,29,78,8
+ LTEXT "",IDC_BINDING_MESSAGE,7,68,206,41
+END
+
/////////////////////////////////////////////////////////////////////////////
//
LEFTMARGIN, 7
RIGHTMARGIN, 213
TOPMARGIN, 7
- BOTTOMMARGIN, 218
+ BOTTOMMARGIN, 240
END
IDD_PREFS_EDIT, DIALOG
LEFTMARGIN, 7
RIGHTMARGIN, 213
TOPMARGIN, 7
- BOTTOMMARGIN, 186
+ BOTTOMMARGIN, 163
END
IDD_DIAG_PARMS, DIALOG
TOPMARGIN, 7
BOTTOMMARGIN, 162
END
+
+ IDD_BINDING_CONFIG_PARAMS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 142
+ END
END
#endif // APSTUDIO_INVOKED
* directory or online at http://www.openafs.org/dl/license10.html
*/
-#include "resource.h"\r
-\r
-#define APSTUDIO_READONLY_SYMBOLS\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 2 resource.\r
-//\r
-#include <windows.h>\r
-#ifndef APSTUDIO_INVOKED\r
-#define AFS_VERINFO_FILE_DESCRIPTION "AFS ¿Í»§»úÅäÖÃ"\r
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <windows.h>
+#ifndef APSTUDIO_INVOKED
+#define AFS_VERINFO_FILE_DESCRIPTION "AFS ¿Í»§»úÅäÖÃ"
#define AFS_VERINFO_NAME "afs_config"
#define AFS_VERINFO_FILENAME "afs_config.exe"
#define AFS_VERINFO_LANG_CODE 0x804
#define AFS_VERINFO_CHARSET 936
-#include "AFS_component_version_number.h"\r
-#include "..\..\config\NTVersioninfo.rc"\r
-#endif // APSTUDIO_INVOKED\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#undef APSTUDIO_READONLY_SYMBOLS\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-// Chinese (P.R.C.) resources\r
-\r
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r
-#ifdef _WIN32\r
-LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED\r
-#endif //_WIN32\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Dialog\r
-//\r
-\r
-IDD_GENERAL_NT DIALOG DISCARDABLE 0, 0, 220, 225\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ò»°ã"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,206,142\r
- LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,23,44,8\r
- EDITTEXT IDC_CELL,62,22,114,13,ES_LOWERCASE | ES_AUTOHSCROLL\r
- CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button",\r
- BS_AUTOCHECKBOX | WS_TABSTOP,13,50,193,10\r
- CONTROL "Ìṩ AFS Light Íø¹Ø(&P)",IDC_GATEWAY,"Button",\r
- BS_AUTOCHECKBOX | WS_TABSTOP,13,72,193,10\r
- CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS ¿Í»§»úͼ±ê(&I)",IDC_TRAYICON,"Button",\r
- BS_AUTOCHECKBOX | WS_TABSTOP,13,95,193,10\r
- LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",\r
- IDC_WARN,13,124,193,17\r
- GROUPBOX "¿Í»§»ú״̬",IDC_STATIC,7,157,206,61\r
- LTEXT "(²éѯµ±Ç°×´Ì¬)",IDC_STATUS,13,172,193,17\r
- PUSHBUTTON "Æô¶¯·þÎñ(&S)",IDC_SERVICE_START,88,195,57,14\r
- PUSHBUTTON "Í£Ö¹·þÎñ(&T)",IDC_SERVICE_STOP,149,195,57,14\r
-END\r
-\r
-IDD_GENERAL_95 DIALOG DISCARDABLE 0, 0, 245, 145\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ò»°ã"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,231,131\r
- LTEXT "Íø¹Ø(&G)£º",IDC_STATIC,13,28,45,8\r
- EDITTEXT IDC_GATEWAY,63,27,104,13,ES_AUTOHSCROLL\r
- PUSHBUTTON "ÏÖÔÚÁ¬½Ó(&N)",IDC_GATEWAY_CONN,172,27,57,14\r
- LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,51,45,8\r
- EDITTEXT IDC_CELL,63,49,104,13,ES_LOWERCASE | ES_AUTOHSCROLL | \r
- WS_DISABLED | NOT WS_TABSTOP\r
- CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button",\r
- BS_AUTOCHECKBOX | WS_TABSTOP,13,73,193,10\r
- CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS Light ͼ±ê(&H)",IDC_TRAYICON,"Button",\r
- BS_AUTOCHECKBOX | WS_TABSTOP,13,93,193,10\r
- LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",\r
- IDC_WARN,13,114,219,17\r
-END\r
-\r
-IDD_PREFS_NT DIALOG DISCARDABLE 0, 0, 220, 225\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ê×Ñ¡Ïî"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "·þÎñÆ÷Ê×Ñ¡Ïî",-1,7,7,206,211\r
- CONTROL "ÏÔʾÎļþ·þÎñÆ÷Ê×Ñ¡Ïî(&F)",IDC_SHOW_FS,"Button",\r
- BS_AUTORADIOBUTTON,13,21,193,10\r
- CONTROL "ÏÔʾ¾íλÖ÷þÎñÆ÷Ê×Ñ¡Ïî(&V)",IDC_SHOW_VLS,"Button",\r
- BS_AUTORADIOBUTTON,13,34,193,10\r
- CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0xb,13,\r
- 49,173,120\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,84,172,50,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,137,172,50,14\r
- PUSHBUTTON "^",IDC_UP,191,97,15,14,BS_ICON\r
- PUSHBUTTON "v",IDC_DOWN,191,117,15,14,BS_ICON\r
- PUSHBUTTON "µ¼Èë(&I)...",IDC_IMPORT,13,172,50,14\r
- LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",\r
- IDC_WARN,13,193,193,17\r
-END\r
-\r
-IDD_HOSTS_NT DIALOG DISCARDABLE 0, 0, 220, 225\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "AFS µ¥Ôª"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,206,211\r
- CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13,\r
- 21,193,168\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,195,50,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,195,50,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,195,50,14\r
-END\r
-\r
-IDD_DRIVES_NT DIALOG DISCARDABLE 0, 0, 220, 225\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "ÅÌ·û"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,206,211\r
- CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153,\r
- 13,32,193,135\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,69,171,48,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,120,171,42,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,165,171,42,14\r
- LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8\r
- PUSHBUTTON "¸ß¼¶(&V)...",IDC_ADVANCED,13,171,53,14\r
- LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",\r
- IDC_WARN,13,193,193,17\r
-END\r
-\r
-IDD_ADVANCED_NT DIALOG DISCARDABLE 0, 0, 220, 225\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "¸ß¼¶"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- EDITTEXT IDC_CACHE_SIZE,88,21,32,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_CACHE_PATH,88,41,83,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_CHUNK_SIZE,88,62,32,13,ES_AUTOHSCROLL | ES_READONLY\r
- EDITTEXT IDC_STAT_ENTRIES,88,83,32,13,ES_AUTOHSCROLL\r
- PUSHBUTTON "怬(&L)...",IDC_LOGON_PARMS,13,128,68,14\r
- PUSHBUTTON "È«¾ÖÇý¶¯Æ÷(&G)...",IDC_AUTOMAP_PARMS,13,173,68,14\r
- PUSHBUTTON "ÔÓÏî(&M)...",IDC_MISC_PARMS,13,195,68,14\r
- GROUPBOX "¸ßËÙ»º´æÅäÖÃ",IDC_STATIC,7,7,206,100\r
- LTEXT "¸ßËÙ»º´æ´óС(&C)£º",IDC_STATIC,13,23,71,8\r
- LTEXT "KB",IDC_INUSE,136,23,68,8\r
- LTEXT "¿é´óС(&H)£º",IDC_STATIC,13,64,71,8\r
- LTEXT "KB",IDC_STATIC,136,64,68,8\r
- LTEXT "״̬¸ßËÙ»º´æ(&S)£º",IDC_STATIC,13,85,71,8\r
- LTEXT "ÌõÄ¿",IDC_STATIC,136,85,68,8\r
- LTEXT "¸ßËÙ»º´æ·¾¶(&P)£º",IDC_STATIC,13,44,71,8\r
- GROUPBOX "¸½¼Ó¸ß¼¶²ÎÊý",IDC_STATIC,7,114,206,104\r
- LTEXT "´´½¨È«¾Ö AFS Çý¶¯Æ÷Ó³Éä¡£",IDC_STATIC,86,176,120,10\r
- LTEXT "µ÷Õû¼¯³ÉµÇ¼ÉèÖá£",IDC_STATIC,86,132,120,10\r
- LTEXT "ÉèÖÃÆäËü¸ß¼¶²ÎÊý¡£",IDC_STATIC,86,199,120,10\r
- PUSHBUTTON "Õï¶Ï(&D)...",IDC_DIAG_PARMS,13,150,68,14\r
- LTEXT "ÆôÓÃÎÊÌâµ÷ÊÔÉèÖá£",IDC_STATIC,86,153,120,10\r
-END\r
-\r
-IDD_PREFS_EDIT DIALOG DISCARDABLE 0, 0, 251, 123\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ö¸¶¨·þÎñÆ÷µÄÓÅÏȼ¶"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- LTEXT "¿ÉΪ´Ë AFS µ¥ÔªÖеķþÎñÆ÷Ö¸¶¨ÓÅÏȼ¶ÅÅÐò¡£µ±²éÕÒ AFS ÖеÄÊý¾Ýʱ£¬½«Ê×ÏȲéѯÓÅÏȼ¶½Ï¸ßµÄ·þÎñÆ÷¡£",\r
- IDC_STATIC,7,7,237,17\r
- LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,7,38,51,8\r
- LTEXT "ÅÅÐò(&R)£º",IDC_STATIC,7,54,51,8\r
- EDITTEXT IDC_SERVER,63,36,80,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_RANK,63,52,36,13,ES_AUTOHSCROLL\r
- LTEXT "ÇÏÃÅ£ºÔÚʹÓá°µ¼È롱°´Å¥ÒÔ¶ÁÈ¡Îı¾ÎļþÖ¸¶¨µÄ·þÎñÆ÷ºÍËüÃǵÄÅÅÐòʱ£¬¿Éͬʱָ¶¨¼¸¸ö·þÎñÆ÷µÄÅÅÐò¡£",\r
- IDC_STATIC,7,76,237,18\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,140,102,50,14\r
- PUSHBUTTON "È·¶¨",IDOK,86,102,50,14\r
- PUSHBUTTON "°ïÖú",9,194,102,50,14\r
-END\r
-\r
-IDD_CELL_EDIT DIALOG DISCARDABLE 0, 0, 244, 223\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "µ¥ÔªÌØÐÔ"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- LTEXT "´ËÒ³ÃæÉϵÄÐÅÏ¢½«¸æËß AFS ÈçºÎÁªÏµÖ¸¶¨µÄµ¥Ôª¡£",\r
- IDC_STATIC,4,4,226,8\r
- LTEXT "AFS µ¥Ôª(&A)£º",IDC_STATIC,4,24,58,8\r
- EDITTEXT IDC_CELL,62,22,105,13,ES_LOWERCASE | ES_AUTOHSCROLL\r
- LTEXT "ÃèÊö(&D)£º",IDC_STATIC,4,41,38,8\r
- EDITTEXT IDC_COMMENT,62,39,171,13,ES_AUTOHSCROLL\r
- GROUPBOX "·þÎñÆ÷",IDC_STATIC,4,61,236,158\r
- CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x1b,13,\r
- 76,217,117\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,198,50,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,198,50,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,198,50,14\r
-END\r
-\r
-IDD_SERVER_EDIT DIALOG DISCARDABLE 0, 0, 251, 112\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ìí¼Ó£¯±à¼·þÎñÆ÷"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- LTEXT "ÔÚÖ¸¶¨µ¥ÔªÖÐÊäÈë¾íλÖ÷þÎñÆ÷µÄÃû³Æ¡£",IDC_STATIC,7,7,\r
- 237,8\r
- LTEXT "·þÎñÆ÷Ãû(&N)£º",IDC_STATIC,7,31,53,8\r
- EDITTEXT IDC_COMMENT,75,29,156,13,ES_AUTOHSCROLL\r
- LTEXT "·þÎñÆ÷µØÖ·(&A)£º",IDC_STATIC,7,52,64,8\r
- CONTROL "ʹÓÃÌض¨µØÖ·(&U)£º",IDC_ADDR_SPECIFIC,"Button",\r
- BS_AUTORADIOBUTTON,75,52,83,10\r
- CONTROL "×Ô¶¯²éÕÒµØÖ·(&L)",IDC_ADDR_LOOKUP,"Button",\r
- BS_AUTORADIOBUTTON,75,66,111,10\r
- CONTROL "",IDC_SERVER,"SockAddr",WS_BORDER | WS_TABSTOP,163,51,\r
- 65,13\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,140,91,50,14\r
- PUSHBUTTON "È·¶¨",IDOK,86,91,50,14\r
- PUSHBUTTON "°ïÖú",9,194,91,50,14\r
-END\r
-\r
-IDD_DRIVE_EDIT DIALOG DISCARDABLE 0, 0, 297, 156\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ó³ÉäÅÌ·û"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- LTEXT "¿ÉÓ³Éä¼ÆËã»úÉϵÄÅÌ·ûÖÁ AFS ÖеÄ·¾¶¡£",IDC_STATIC,7,7,\r
- 283,8\r
- LTEXT "ÀýÈ磬Èç¹ûÓ³ÉäÇý¶¯Æ÷ Q ÖÁ /afs/acme.com/usr/bob£¬Ôò AFS µÄ /afs/acme.com/usr/bob/* ÖеĿÉÓÃÎļþ½«ÔÚÄú¼ÆËã»úµÄ Q:\\ Ŀ¼Ï¿ɼû¡£",\r
- IDC_STATIC,7,26,283,16\r
- LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,14,59,58,8\r
- COMBOBOX IDC_DRIVE,77,57,63,206,CBS_DROPDOWNLIST | CBS_SORT | \r
- WS_VSCROLL | WS_TABSTOP\r
- LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,14,77,58,8\r
- EDITTEXT IDC_PATH,77,75,168,13,ES_AUTOHSCROLL\r
- LTEXT "ÃèÊö(&E)£º",IDC_STATIC,14,96,58,8\r
- EDITTEXT IDC_DESC,77,94,72,13,ES_AUTOHSCROLL\r
- CONTROL "µÇ¼ʱ»Ö¸´Ó³Éä(&R)",IDC_PERSISTENT,"Button",\r
- BS_AUTOCHECKBOX | WS_TABSTOP,77,112,188,10\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,186,135,50,14\r
- PUSHBUTTON "È·¶¨",IDOK,132,135,50,14\r
- PUSHBUTTON "°ïÖú",9,240,135,50,14\r
-END\r
-\r
-IDD_SUBMOUNTS DIALOG DISCARDABLE 0, 0, 244, 198\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "×Ó°²×°"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- LTEXT "ÄúµÄ¼ÆËã»ú¿ÉÌṩ AFS ÖеÄ×Ó°²×°--ÍøÂç¹²Ïí¡£",IDC_STATIC,\r
- 4,4,196,8\r
- GROUPBOX "×Ó°²×°",IDC_STATIC,4,26,236,168\r
- LTEXT "ÏÂÁÐ×Ó°²×°´Ó´Ë¼ÆËã»úÉϹ²Ïí£º",IDC_STATIC,10,42,176,8\r
- CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x413,10,\r
- 54,223,115\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,78,173,50,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,131,173,50,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,173,50,14\r
-END\r
-\r
-IDD_SUBMOUNT_EDIT DIALOG DISCARDABLE 0, 0, 270, 112\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ö¸¶¨×Ó°²×°"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- LTEXT "ʹÓà Windows ÍøÂ磬×Ó°²×°ÈÃÄú¹²ÏíÒ»¸ö×ÓĿ¼Ê÷¡£",\r
- IDC_STATIC,7,7,256,8\r
- LTEXT "×Ó°²×°(&S)£º",IDC_STATIC,7,27,53,8\r
- LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,7,43,53,8\r
- EDITTEXT IDC_SUBMOUNT,63,25,80,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_MAPPING,63,41,181,13,ES_AUTOHSCROLL\r
- LTEXT "Ϊ×Ó°²×°ÊäÈë¶ÌÃû£¬²¢ÇÒµ±³öÏÖÌáʾʱÊäÈëÒ»¸öÈ« AFS ·¾¶¡£AFS ·¾¶¿ÉÒÔ""\\afs""¿ªÊ¼(Èç¹û²»ÊÇ£¬""\\afs""½«×Ô¶¯Ìí¼Ó)¡£",\r
- IDC_STATIC,7,64,256,18\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,159,91,50,14\r
- PUSHBUTTON "È·¶¨",IDOK,105,91,50,14\r
- PUSHBUTTON "°ïÖú",9,213,91,50,14\r
-END\r
-\r
-IDD_DRIVES_95 DIALOG DISCARDABLE 0, 0, 245, 145\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "ÅÌ·û"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,231,131\r
- CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153,\r
- 13,32,219,60\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,83,95,48,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,134,95,48,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,95,48,14\r
- LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8\r
- LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",\r
- IDC_WARN,13,116,219,17\r
-END\r
-\r
-IDD_HOSTS_95 DIALOG DISCARDABLE 0, 0, 245, 145\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "AFS µ¥Ôª"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,231,131\r
- CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13,\r
- 19,218,94\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,116,50,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,116,50,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,116,50,14\r
-END\r
-\r
-IDD_STARTSTOP DIALOGEX 0, 0, 219, 48\r
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION\r
-EXSTYLE WS_EX_TOOLWINDOW\r
-CAPTION "AFS ¿Í»§»ú·þÎñ"\r
-FONT 9, "ËÎÌå", 0, 0, 0x1\r
-BEGIN\r
- GROUPBOX "",IDC_STATIC,4,0,211,44\r
- ICON IDI_MAIN,IDC_STATIC,14,15,20,20\r
- LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯...",IDC_STARTING,46,20,\r
- 157,8\r
- LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹...",IDC_STOPPING,46,20,\r
- 157,8\r
-END\r
-\r
-IDD_HOSTS_CCENTER DIALOG DISCARDABLE 0, 0, 220, 256\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ò»°ã"\r
-FONT 9, "ËÎÌå"\r
-BEGIN\r
- GROUPBOX "ȱʡµ¥Ôª",IDC_STATIC,7,7,206,54\r
- LTEXT "ÊäÈëÒª¹ÜÀíµÄȱʡ AFS µ¥ÔªÃû£º",IDC_STATIC,14,19,164,8\r
- LTEXT "ȱʡµ¥Ôª£º",IDC_STATIC,14,37,44,8\r
- EDITTEXT IDC_CELL,65,35,141,14,ES_LOWERCASE | ES_AUTOHSCROLL\r
- GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,69,206,180\r
- CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13,\r
- 84,193,137\r
- PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,227,50,14\r
- PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,227,50,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,227,50,14\r
-END\r
-\r
-IDD_MISC_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 220, 193\r
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "ÔÓÏîÅäÖÃ"\r
-FONT 8, "System"\r
-BEGIN\r
- EDITTEXT IDC_LAN_ADAPTER,90,20,32,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_PROBE,90,40,32,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_THREADS,90,60,32,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_DAEMONS,90,80,32,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_SYSNAME,90,100,83,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_MOUNTDIR,90,120,83,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_ROOTVOLUME,90,140,83,13,ES_AUTOHSCROLL\r
- DEFPUSHBUTTON "È·¶¨",IDOK,55,172,50,14\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,109,172,50,14\r
- PUSHBUTTON "°ïÖú",9,163,172,50,14\r
- GROUPBOX "²ÎÊý",IDC_STATIC,7,7,206,156\r
- LTEXT "¼ì²â¼ä¸ô(&P)£º",IDC_STATIC,15,42,71,8\r
- LTEXT "Ãë",IDC_STATIC,138,42,68,8\r
- LTEXT "ºǫ́Ïß³Ì(&B)£º",IDC_STATIC,15,62,71,8\r
- LTEXT "Ïß³Ì",IDC_STATIC,138,62,68,8\r
- LTEXT "·þÎñÏß³Ì(&E)£º",IDC_STATIC,15,82,71,8\r
- LTEXT "Ïß³Ì",IDC_STATIC,138,82,68,8\r
- LTEXT "ϵͳÃû³Æ(&Y)£º",IDC_STATIC,15,102,71,8\r
- LTEXT "°²×°Ä¿Â¼(&M)£º",IDC_STATIC,15,122,71,8\r
- LTEXT "LAN ÊÊÅäÆ÷ºÅ(&L)£º",IDC_STATIC,15,22,71,8\r
- LTEXT "¸ù¾í(&R)£º",IDC_STATIC,15,141,71,8\r
-END\r
-\r
-IDD_DIAG_PARMS DIALOG DISCARDABLE 0, 0, 217, 135\r
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Õï¶ÏÅäÖÃ"\r
-FONT 8, "System"\r
-BEGIN\r
- EDITTEXT IDC_TRACE_LOG_BUF_SIZE,112,20,32,13,ES_AUTOHSCROLL\r
- DEFPUSHBUTTON "È·¶¨",IDOK,52,114,50,14\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,106,114,50,14\r
- PUSHBUTTON "°ïÖú",9,160,114,50,14\r
- GROUPBOX "¸ú×ÙÈÕÖ¾²ÎÊý",IDC_STATIC,7,7,203,54\r
- LTEXT "»º³åÇø´óС(&B)£º",IDC_STATIC,13,22,73,8\r
- LTEXT "KB",IDC_STATIC,155,24,9,8\r
- GROUPBOX "ʼþÈÕÖ¾²ÎÊý",IDC_STATIC,7,69,203,35\r
- COMBOBOX IDC_TRAP_ON_PANIC,112,40,32,61,CBS_DROPDOWNLIST | \r
- CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
- LTEXT "½ô¼±Çé¿öϵ÷ÓÃÏÝÚå(&T)£º",IDC_STATIC,13,42,93,8\r
- LTEXT "±¨¸æ»á»°Æô¶¯£º",IDC_STATIC,13,86,79,8\r
- COMBOBOX IDC_REPORT_SESSION_STARTUPS,112,84,32,64,\r
- CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
-END\r
-\r
-IDD_LOGIN_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 186, 92\r
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "µÇ¼ÅäÖÃ"\r
-FONT 8, "System"\r
-BEGIN\r
- EDITTEXT IDC_LOGIN_RETRY_INTERVAL,117,18,32,13,ES_AUTOHSCROLL\r
- COMBOBOX IDC_FAIL_SILENTLY,117,39,32,40,CBS_DROPDOWNLIST | \r
- CBS_SORT | WS_VSCROLL | WS_TABSTOP\r
- DEFPUSHBUTTON "È·¶¨",IDOK,21,71,50,14\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,75,71,50,14\r
- PUSHBUTTON "°ïÖú",9,129,71,50,14\r
- LTEXT "µÇ¼ÖØÊÔ¼ä¸ô(&L)£º",IDC_STATIC,13,20,98,8\r
- GROUPBOX "²ÎÊý",IDC_STATIC,7,7,172,54\r
- LTEXT "µÇ¼ʧ°Ü£¬ÎÞÈκÎÌáʾ(&F)£º",IDC_STATIC,13,41,98,8\r
-END\r
-\r
-IDD_GLOBAL_DRIVES DIALOG DISCARDABLE 0, 0, 253, 169\r
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "È«¾ÖÇý¶¯Æ÷"\r
-FONT 8, "System"\r
-BEGIN\r
- DEFPUSHBUTTON "¹Ø±Õ",IDOK,141,148,50,14\r
- PUSHBUTTON "°ïÖú",9,196,148,50,14\r
- PUSHBUTTON "Ìí¼Ó(&A)",IDC_ADD,108,117,42,14\r
- GROUPBOX "È«¾ÖÓ³Éä AFS Çý¶¯Æ÷",IDC_STATIC,7,7,239,133\r
- CONTROL "",IDC_GLOBAL_DRIVE_LIST,"FastList",WS_BORDER | \r
- WS_TABSTOP | 0x1b,14,20,226,89\r
- PUSHBUTTON "¸ü¸Ä(&C)",IDC_CHANGE,153,117,42,14\r
- PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,198,117,42,14\r
-END\r
-\r
-IDD_GLOBAL_DRIVES_ADDEDIT DIALOG DISCARDABLE 0, 0, 247, 118\r
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU\r
-CAPTION "Ó³ÉäÈ«¾ÖÇý¶¯Æ÷"\r
-FONT 8, "System"\r
-BEGIN\r
- COMBOBOX IDC_DRIVE,63,23,63,206,CBS_DROPDOWNLIST | CBS_SORT | \r
- WS_VSCROLL | WS_TABSTOP\r
- EDITTEXT IDC_PATH,63,42,168,13,ES_AUTOHSCROLL\r
- EDITTEXT IDC_DESC,63,62,72,13,ES_AUTOHSCROLL\r
- DEFPUSHBUTTON "È·¶¨",IDOK,82,96,50,14\r
- PUSHBUTTON "È¡Ïû",IDCANCEL,136,96,50,14\r
- PUSHBUTTON "°ïÖú",9,190,96,50,14\r
- LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,12,25,48,8\r
- LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,12,44,48,8\r
- LTEXT "ÃèÊö(&E)£º",IDC_STATIC,12,64,48,8\r
- GROUPBOX "È«¾Ö AFS Çý¶¯Æ÷",IDC_STATIC,7,7,232,80\r
-END\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// DESIGNINFO\r
-//\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-GUIDELINES DESIGNINFO DISCARDABLE \r
-BEGIN\r
- IDD_GENERAL_NT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 218\r
- END\r
-\r
- IDD_GENERAL_95, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 238\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 138\r
- END\r
-\r
- IDD_PREFS_NT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 218\r
- END\r
-\r
- IDD_HOSTS_NT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 218\r
- END\r
-\r
- IDD_DRIVES_NT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 218\r
- END\r
-\r
- IDD_ADVANCED_NT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 218\r
- END\r
-\r
- IDD_PREFS_EDIT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 244\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 116\r
- END\r
-\r
- IDD_CELL_EDIT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 4\r
- RIGHTMARGIN, 240\r
- TOPMARGIN, 4\r
- BOTTOMMARGIN, 219\r
- END\r
-\r
- IDD_SERVER_EDIT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 244\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 105\r
- END\r
-\r
- IDD_DRIVE_EDIT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 290\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 149\r
- END\r
-\r
- IDD_SUBMOUNTS, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 4\r
- RIGHTMARGIN, 240\r
- TOPMARGIN, 4\r
- BOTTOMMARGIN, 194\r
- END\r
-\r
- IDD_SUBMOUNT_EDIT, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 263\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 105\r
- END\r
-\r
- IDD_DRIVES_95, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 238\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 138\r
- END\r
-\r
- IDD_HOSTS_95, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 238\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 138\r
- END\r
-\r
- IDD_STARTSTOP, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 4\r
- RIGHTMARGIN, 215\r
- TOPMARGIN, 4\r
- BOTTOMMARGIN, 44\r
- END\r
-\r
- IDD_HOSTS_CCENTER, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 249\r
- END\r
-\r
- IDD_MISC_CONFIG_PARMS, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 213\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 186\r
- END\r
-\r
- IDD_DIAG_PARMS, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 210\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 128\r
- END\r
-\r
- IDD_LOGIN_CONFIG_PARMS, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 179\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 85\r
- END\r
-\r
- IDD_GLOBAL_DRIVES, DIALOG\r
- BEGIN\r
- LEFTMARGIN, 7\r
- RIGHTMARGIN, 246\r
- TOPMARGIN, 7\r
- BOTTOMMARGIN, 162\r
- END\r
-END\r
-#endif // APSTUDIO_INVOKED\r
-\r
-\r
-#ifdef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// TEXTINCLUDE\r
-//\r
-\r
-1 TEXTINCLUDE DISCARDABLE \r
-BEGIN\r
- "resource.h\0"\r
-END\r
-\r
-2 TEXTINCLUDE DISCARDABLE \r
-BEGIN\r
- "#include <windows.h>\r\n"\r
- "#ifndef APSTUDIO_INVOKED\r\n"\r
- "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ¿Í»§»úÅäÖÃ""\r\n"\r
- "#include ""AFS_component_version_number.h""\r\n"\r
- "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n"\r
- "#endif // APSTUDIO_INVOKED\r\n"\r
- "\0"\r
-END\r
-\r
-3 TEXTINCLUDE DISCARDABLE \r
-BEGIN\r
- "\r\n"\r
- "\0"\r
-END\r
-\r
-#endif // APSTUDIO_INVOKED\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Icon\r
-//\r
-\r
-// Icon with lowest ID value placed first to ensure application icon\r
-// remains consistent on all systems.\r
-IDI_MAIN ICON DISCARDABLE "afs_config.ico"\r
-IDI_UP ICON DISCARDABLE "up.ico"\r
-IDI_DOWN ICON DISCARDABLE "down.ico"\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// String Table\r
-//\r
-\r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
- IDS_TITLE_NT "AFS ¿Í»§»úÅäÖÃ"\r
- IDS_TITLE_95 "AFS Light ÅäÖÃ"\r
- IDS_STATE_STOPPED "AFS ¿Í»§»ú·þÎñµ±Ç°ÎªÍ£Ö¹×´Ì¬¡£"\r
- IDS_STATE_RUNNING "AFS ¿Í»§»ú·þÎñÕýÔÚÕý³£ÔËÐС£"\r
- IDS_STATE_STARTING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯..."\r
- IDS_STATE_STOPPING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹..."\r
- IDS_STATE_UNKNOWN "AFS ¿Í»§»ú·þÎñûÓÐÊʵ±ÅäÖá£"\r
- IDS_SERVICE_FAIL_START "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Æô¶¯¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£"\r
- IDS_SERVICE_FAIL_STOP "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Í£Ö¹¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£"\r
- IDS_WARN_STOPPED "ÓÉÓÚ AFS ¿Í»§»ú·þÎñûÓÐÔËÐУ¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£"\r
- IDS_WARN_ADMIN "ÓÉÓÚÄúûÓÐÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼ÖÁ Windows£¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£"\r
- IDS_CELL_UNKNOWN "(δ֪)"\r
- IDS_GATEWAY_UNKNOWN "(δ֪)"\r
-END\r
-\r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
- IDS_BADLOOKUP_DESC "Windows ÕÒ²»µ½ %1 µÄÍøÂçµØÖ·¡£¼ì²éÒÔÈ·±£ÊäÈëÁËÕýÈ·µÄ»úÆ÷Ãû¡£"\r
- IDS_NEWSUB_DESC "µ±Á¬½ÓÍøÂçÇý¶¯Æ÷ʱ£¬AFS ÎÞ·¨Ê¹ÓÃÖ¸¶¨µÄÃèÊö¡£\n\nÖ¸¶¨µÄÃèÊöÒÑʹÓÃÔÚ²»Í¬µÄ AFS ·¾¶ÖС£"\r
- IDS_BADSUB_DESC "²»ÄÜʹÓÃÄúÊäÈëµÄÅÌ·ûÃèÊö¡£\n\nÅÌ·ûÃèÊö²»Äܳ¬¹ý 12 ¸ö×Ö·û£¬²¢ÇÒ²»ÄÜ°üº¬¿Õ¸ñ»òÖƱí·û¡£"\r
- IDS_BADGATEWAY_DESC "AFS ÎÞ·¨Á¬½ÓÖÁÄúÖ¸¶¨µÄÍø¹Ø»úÆ÷¡£\n\n¼ì²éÒÔÈ·±£ÊäÈëÁíÍâÕýÈ·µÄÍø¹ØÉ豸Ãû³Æ¡£"\r
- IDS_BADGWCELL_DESC "ÕÒ²»µ½Ö¸¶¨µÄÍø¹Ø»úÆ÷ʹÓÃµÄ AFS µ¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nÈç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nµ¥Ôª£º%1"\r
- IDS_TITLE_CAUTION_NT "×¢Òâ - AFS ¿Í»§»úÅäÖÃ"\r
- IDS_TITLE_CAUTION_95 "×¢Òâ - AFS Light"\r
- IDS_TITLE_ERROR_NT "³ö´í - AFS ¿Í»§»úÅäÖÃ"\r
- IDS_TITLE_ERROR_95 "³ö´í - AFS Light ÅäÖÃ"\r
- IDS_SHRINKCACHE "µ± AFS ¿Í»§»ú·þÎñÕýÔÚÔËÐÐʱ²»ÄܼõÉÙ AFS ¿Í»§»ú¸ßËÙ»º´æµÄ´óС¡£\n\nÒª¼õÉÙ¸ßËÙ»º´æµÄ´óС£¬Ê×ÏÈÔÚ¡°Ò»°ã¡±±êÇ©ÉÏʹÓá°Í£Ö¹·þÎñ¡±°´Å¥Í£Ö¹ AFS ¿Í»§»ú·þÎñ¡£"\r
- IDS_BADCELL_DESC_CC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+"\r
-END\r
-\r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
- IDS_STOP_DESC "Èç¹ûÍ£Ö¹ AFS ¿Í»§»ú·þÎñ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´Ó´Ë¼ÆËã»úÖдæÈ¡¡£\n\nÈ·ÈÏҪֹͣ·þÎñÂð?"\r
- IDS_PREFCOL_SERVER "·þÎñÆ÷"\r
- IDS_PREFCOL_RANK "ÅÅÐò"\r
- IDS_TIP_PREFS "ÇÏÃÅ£ºµ±´Ó AFS ¶ÁÈ¡Îļþʱ£¬µÍÅÅÐòÊýµÄ·þÎñÆ÷½«»ñµÃ¸ßÓÅÏȼ¶¡£"\r
- IDS_PREFERROR_RESOLVE "AFS ÕÒ²»µ½ÃûΪ %1 µÄ·þÎñÆ÷¡£Çë¼ì²éÒÔÈ·±£ÊäÈëÕýÈ·µÄ·þÎñÆ÷¡£"\r
- IDS_FILTER_TXT "Îı¾Îļþ(*.TXT)£»*.TXT£»"\r
- IDS_HOSTREM_MANY "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓйØÑ¡¶¨µÄ AFS µ¥ÔªµÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?"\r
- IDS_HOSTREM_ONE "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓÐ¹Ø AFS µ¥Ôª %1 µÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?"\r
- IDS_CELLEDIT_TITLE "%1 - ÌØÐÔ"\r
- IDS_CELLADD_TITLE "н¨µ¥Ôª"\r
- IDS_SVRCOL_SERVER "µØÖ·"\r
- IDS_SVRCOL_COMMENT "·þÎñÆ÷Ãû"\r
- IDS_TIP_DRIVES "ÇÏÃÅ£ºÑ¡ÖÐÓ³ÉäÅÌ·ûÅԵĸ´Ñ¡¿ò£¬Á¬½ÓÍøÂçÇý¶¯Æ÷Ó³Éä¡£"\r
- IDS_MAP_LETTER "Çý¶¯Æ÷ *:"\r
-END\r
-\r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
- IDS_DRIVE_MAP "Çý¶¯Æ÷ %1: \t%2"\r
- IDS_ERROR_MAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í"\r
- IDS_ERROR_MAP_DESC "AFS ÎÞ·¨Ó³ÉäÍøÂçÇý¶¯Æ÷ÖÁ AFS ÖеÄ·¾¶¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£"\r
- IDS_ERROR_UNMAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í"\r
- IDS_ERROR_UNMAP_DESC "AFS ÎÞ·¨¶Ï¿ªÓëÖ¸¶¨ÍøÂçÇý¶¯Æ÷µÄÓ³Éä¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£"\r
- IDS_ADDSERVER_TITLE "Ìí¼Ó·þÎñÆ÷"\r
- IDS_EDITSERVER_TITLE "±à¼·þÎñÆ÷"\r
- IDS_SUBCOL_SHARE "×Ó°²×°"\r
- IDS_SUBCOL_PATH "AFS ·¾¶"\r
- IDS_SUBMOUNTS_TITLE "×Ó°²×°"\r
- IDS_BADCELL_DESC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+"\r
- IDS_BADCELL_DESC2 "¼ì²éÒÔÈ·±£ÄúÕýÈ·ÊäÈëÁ˵¥ÔªµÄÃû³Æ¡£Èç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬Äú±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£"\r
- IDS_KB_IN_USE "KB (%1 KB ÕýÔÚʹÓÃ)"\r
- IDS_NOGATEWAY_TITLE "ÎÞЧ AFS Íø¹Ø"\r
- IDS_NOGATEWAY_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS Íø¹Ø£¬²»ÄÜÅäÖà AFS Light¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS Íø¹ØµÄÃû³Æ»ò IP µØÖ·¡£"\r
-END\r
-\r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
- IDS_NOCELL_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS µ¥Ôª£¬²»ÄÜÅäÖà AFS ¿Í»§»ú¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªµÄÃû³Æ¡£"\r
- IDS_STOPPED_NOCELL "ÔÚÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬±ØÐëÖ¸¶¨ AFS µ¥Ôª¡£"\r
- IDS_OKSTOP_DESC "ûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£ÔÚûÓÐÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´æÈ¡¡£\n\nÏÖÔÚÆô¶¯·þÎñÂð? "\r
- IDS_BADMAP_DESC "ÓÉÓÚ·¾¶Ã»ÓÐÒÔ""\\afs""¿ªÊ¼£¬AFS ²»ÄÜÓ³ÉäÅÌ·ûÖÁÖ¸¶¨µÄ·¾¶¡£\n\nÈ·±£ÄúËùÊäÈëµÄ·¾¶ÊÇÒÔ""\\afs""¿ªÊ¼µÄ£¬²¢ÖØÊÔÒ»´Î¡£"\r
- IDS_RESTART_TITLE "AFS ¿Í»§»úÅäÖÃ"\r
- IDS_RESTART_DESC "ÔÚ AFS ¿Í»§»ú·þÎñÍ£Ö¹²¢ÖØÐÂÆô¶¯Ö®Ç°£¬ÄúËù×öµÄһЩ¸ü¸Ä½«²»»áÉúЧ¡£\n\nÏÖÔÚÍ£Ö¹²¢ÖØÐÂÆô¶¯·þÎñÂð? "\r
- IDS_KB_ONLY "KB"\r
- IDS_FAILCONFIG_AUTHENT "µ±ÔڵǼʱ³¢ÊÔÆôÓûò½ûÓÃÈÏ֤ʱ³ö´í¡£\n\n´íÎó %1"\r
- IDS_FAILCONFIG_PREFS "ÄúÖ¸¶¨µÄһЩ·þÎñÆ÷ÅÅÐòÓÅÏȼ¶²»ÄÜʹÓá£\n\n´íÎó %1"\r
- IDS_FAILCONFIG_CACHE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¸ßËÙ»º´æ´óС¡£\n\n´íÎó %1"\r
- IDS_FAILCONFIG_PROBE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¼ì²â¼ä¸ô¡£\n\n´íÎó %1"\r
- IDS_FAILCONFIG_SYSNAME "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»úϵͳÃû¡£\n\n´íÎó %1"\r
-END\r
-\r
-STRINGTABLE DISCARDABLE \r
-BEGIN\r
- IDS_BADCELL_DESC_CC2 "Çë¼ì²éµ¥ÔªÃûÈ·±£ÄúÒÑÊäÈëÕýÈ·¡£Èç¹ûÔÚ AFS µ¥ÔªÁбíÖÐûÓгöÏÖÕýÈ·µÄµ¥ÔªÃû£¬ÇëʹÓá°Ìí¼Ó¡±°´Å¥Îª¸Ãµ¥Ôª´´½¨Ò»¸öÌõÄ¿¡£"\r
- IDS_NOCELL_DESC_CC "²»ÄÜÅäÖà AFS ¿ØÖÆÖÐÐÄ£¬ÒòΪÄú»¹Ã»ÓÐÖ¸¶¨È±Ê¡µÄ AFS µ¥Ôª¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªÃû¡£"\r
- IDS_TITLE_CAUTION_CCENTER "×¢Òâ - AFS ¿ØÖÆÖÐÐÄÌØÐÔ"\r
- IDS_TITLE_ERROR_CCENTER "³ö´í - AFS ¿ØÖÆÖÐÐÄÌØÐÔ"\r
- IDS_TITLE_CCENTER "AFS ¿ØÖÆÖÐÐÄÌØÐÔ"\r
- IDS_YES "ÊÇ"\r
- IDS_NO "·ñ"\r
- IDS_DRIVE "Çý¶¯Æ÷"\r
-END\r
-\r
-#endif // Chinese (P.R.C.) resources\r
-/////////////////////////////////////////////////////////////////////////////\r
-\r
-\r
-\r
-#ifndef APSTUDIO_INVOKED\r
-/////////////////////////////////////////////////////////////////////////////\r
-//\r
-// Generated from the TEXTINCLUDE 3 resource.\r
-//\r
-\r
-\r
-/////////////////////////////////////////////////////////////////////////////\r
-#endif // not APSTUDIO_INVOKED\r
-\r
+#include "AFS_component_version_number.h"
+#include "..\..\config\NTVersioninfo.rc"
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Chinese (P.R.C.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
+#ifdef _WIN32
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_GENERAL_NT DIALOG DISCARDABLE 0, 0, 220, 225
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ò»°ã"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,206,142
+ LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,23,44,8
+ EDITTEXT IDC_CELL,62,22,114,13,ES_LOWERCASE | ES_AUTOHSCROLL
+ CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,50,193,10
+ CONTROL "Ìṩ AFS Light Íø¹Ø(&P)",IDC_GATEWAY,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,72,193,10
+ CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS ¿Í»§»úͼ±ê(&I)",IDC_TRAYICON,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,95,193,10
+ LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",
+ IDC_WARN,13,124,193,17
+ GROUPBOX "¿Í»§»ú״̬",IDC_STATIC,7,157,206,61
+ LTEXT "(²éѯµ±Ç°×´Ì¬)",IDC_STATUS,13,172,193,17
+ PUSHBUTTON "Æô¶¯·þÎñ(&S)",IDC_SERVICE_START,88,195,57,14
+ PUSHBUTTON "Í£Ö¹·þÎñ(&T)",IDC_SERVICE_STOP,149,195,57,14
+END
+
+IDD_GENERAL_95 DIALOG DISCARDABLE 0, 0, 245, 145
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ò»°ã"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "¿Í»§»úÅäÖÃ",IDC_STATIC,7,7,231,131
+ LTEXT "Íø¹Ø(&G)£º",IDC_STATIC,13,28,45,8
+ EDITTEXT IDC_GATEWAY,63,27,104,13,ES_AUTOHSCROLL
+ PUSHBUTTON "ÏÖÔÚÁ¬½Ó(&N)",IDC_GATEWAY_CONN,172,27,57,14
+ LTEXT "µ¥ÔªÃû(&C)£º",IDC_STATIC,13,51,45,8
+ EDITTEXT IDC_CELL,63,49,104,13,ES_LOWERCASE | ES_AUTOHSCROLL |
+ WS_DISABLED | NOT WS_TABSTOP
+ CONTROL "µÇ¼µ½ Windows ʱ»ñµÃ AFS ÁîÅÆ",IDC_LOGON,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,73,193,10
+ CONTROL "ÔÚÈÎÎñÀ¸ÖÐÏÔʾ AFS Light ͼ±ê(&H)",IDC_TRAYICON,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,93,193,10
+ LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",
+ IDC_WARN,13,114,219,17
+END
+
+IDD_PREFS_NT DIALOG DISCARDABLE 0, 0, 220, 225
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ê×Ñ¡Ïî"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "·þÎñÆ÷Ê×Ñ¡Ïî",-1,7,7,206,211
+ CONTROL "ÏÔʾÎļþ·þÎñÆ÷Ê×Ñ¡Ïî(&F)",IDC_SHOW_FS,"Button",
+ BS_AUTORADIOBUTTON,13,21,193,10
+ CONTROL "ÏÔʾ¾íλÖ÷þÎñÆ÷Ê×Ñ¡Ïî(&V)",IDC_SHOW_VLS,"Button",
+ BS_AUTORADIOBUTTON,13,34,193,10
+ CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0xb,13,
+ 49,173,120
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,84,172,50,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,137,172,50,14
+ PUSHBUTTON "^",IDC_UP,191,97,15,14,BS_ICON
+ PUSHBUTTON "v",IDC_DOWN,191,117,15,14,BS_ICON
+ PUSHBUTTON "µ¼Èë(&I)...",IDC_IMPORT,13,172,50,14
+ LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",
+ IDC_WARN,13,193,193,17
+END
+
+IDD_HOSTS_NT DIALOG DISCARDABLE 0, 0, 220, 225
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "AFS µ¥Ôª"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,206,211
+ CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13,
+ 21,193,168
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,195,50,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,195,50,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,195,50,14
+END
+
+IDD_DRIVES_NT DIALOG DISCARDABLE 0, 0, 220, 225
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ÅÌ·û"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,206,211
+ CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153,
+ 13,32,193,135
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,69,171,48,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,120,171,42,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,165,171,42,14
+ LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8
+ PUSHBUTTON "¸ß¼¶(&V)...",IDC_ADVANCED,13,171,53,14
+ LTEXT "×¢Ò⣺ÓÉÓÚûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",
+ IDC_WARN,13,193,193,17
+END
+
+IDD_ADVANCED_NT DIALOG DISCARDABLE 0, 0, 220, 225
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "¸ß¼¶"
+FONT 9, "ËÎÌå"
+BEGIN
+ EDITTEXT IDC_CACHE_SIZE,88,21,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_CACHE_PATH,88,41,83,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_CHUNK_SIZE,88,62,32,13,ES_AUTOHSCROLL | ES_READONLY
+ EDITTEXT IDC_STAT_ENTRIES,88,83,32,13,ES_AUTOHSCROLL
+ PUSHBUTTON "怬(&L)...",IDC_LOGON_PARMS,13,128,68,14
+ PUSHBUTTON "È«¾ÖÇý¶¯Æ÷(&G)...",IDC_AUTOMAP_PARMS,13,173,68,14
+ PUSHBUTTON "ÔÓÏî(&M)...",IDC_MISC_PARMS,13,195,68,14
+ GROUPBOX "¸ßËÙ»º´æÅäÖÃ",IDC_STATIC,7,7,206,100
+ LTEXT "¸ßËÙ»º´æ´óС(&C)£º",IDC_STATIC,13,23,71,8
+ LTEXT "KB",IDC_INUSE,136,23,68,8
+ LTEXT "¿é´óС(&H)£º",IDC_STATIC,13,64,71,8
+ LTEXT "KB",IDC_STATIC,136,64,68,8
+ LTEXT "״̬¸ßËÙ»º´æ(&S)£º",IDC_STATIC,13,85,71,8
+ LTEXT "ÌõÄ¿",IDC_STATIC,136,85,68,8
+ LTEXT "¸ßËÙ»º´æ·¾¶(&P)£º",IDC_STATIC,13,44,71,8
+ GROUPBOX "¸½¼Ó¸ß¼¶²ÎÊý",IDC_STATIC,7,114,206,104
+ LTEXT "´´½¨È«¾Ö AFS Çý¶¯Æ÷Ó³Éä¡£",IDC_STATIC,86,176,120,10
+ LTEXT "µ÷Õû¼¯³ÉµÇ¼ÉèÖá£",IDC_STATIC,86,132,120,10
+ LTEXT "ÉèÖÃÆäËü¸ß¼¶²ÎÊý¡£",IDC_STATIC,86,199,120,10
+ PUSHBUTTON "Õï¶Ï(&D)...",IDC_DIAG_PARMS,13,150,68,14
+ LTEXT "ÆôÓÃÎÊÌâµ÷ÊÔÉèÖá£",IDC_STATIC,86,153,120,10
+END
+
+IDD_PREFS_EDIT DIALOG DISCARDABLE 0, 0, 251, 123
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ö¸¶¨·þÎñÆ÷µÄÓÅÏȼ¶"
+FONT 9, "ËÎÌå"
+BEGIN
+ LTEXT "¿ÉΪ´Ë AFS µ¥ÔªÖеķþÎñÆ÷Ö¸¶¨ÓÅÏȼ¶ÅÅÐò¡£µ±²éÕÒ AFS ÖеÄÊý¾Ýʱ£¬½«Ê×ÏȲéѯÓÅÏȼ¶½Ï¸ßµÄ·þÎñÆ÷¡£",
+ IDC_STATIC,7,7,237,17
+ LTEXT "·þÎñÆ÷(&S)£º",IDC_STATIC,7,38,51,8
+ LTEXT "ÅÅÐò(&R)£º",IDC_STATIC,7,54,51,8
+ EDITTEXT IDC_SERVER,63,36,80,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_RANK,63,52,36,13,ES_AUTOHSCROLL
+ LTEXT "ÇÏÃÅ£ºÔÚʹÓá°µ¼È롱°´Å¥ÒÔ¶ÁÈ¡Îı¾ÎļþÖ¸¶¨µÄ·þÎñÆ÷ºÍËüÃǵÄÅÅÐòʱ£¬¿Éͬʱָ¶¨¼¸¸ö·þÎñÆ÷µÄÅÅÐò¡£",
+ IDC_STATIC,7,76,237,18
+ PUSHBUTTON "È¡Ïû",IDCANCEL,140,102,50,14
+ PUSHBUTTON "È·¶¨",IDOK,86,102,50,14
+ PUSHBUTTON "°ïÖú",9,194,102,50,14
+END
+
+IDD_CELL_EDIT DIALOG DISCARDABLE 0, 0, 244, 223
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "µ¥ÔªÌØÐÔ"
+FONT 9, "ËÎÌå"
+BEGIN
+ LTEXT "´ËÒ³ÃæÉϵÄÐÅÏ¢½«¸æËß AFS ÈçºÎÁªÏµÖ¸¶¨µÄµ¥Ôª¡£",
+ IDC_STATIC,4,4,226,8
+ LTEXT "AFS µ¥Ôª(&A)£º",IDC_STATIC,4,24,58,8
+ EDITTEXT IDC_CELL,62,22,105,13,ES_LOWERCASE | ES_AUTOHSCROLL
+ LTEXT "ÃèÊö(&D)£º",IDC_STATIC,4,41,38,8
+ EDITTEXT IDC_COMMENT,62,39,171,13,ES_AUTOHSCROLL
+ GROUPBOX "·þÎñÆ÷",IDC_STATIC,4,61,236,158
+ CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x1b,13,
+ 76,217,117
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,198,50,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,198,50,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,198,50,14
+END
+
+IDD_SERVER_EDIT DIALOG DISCARDABLE 0, 0, 251, 112
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ìí¼Ó£¯±à¼·þÎñÆ÷"
+FONT 9, "ËÎÌå"
+BEGIN
+ LTEXT "ÔÚÖ¸¶¨µ¥ÔªÖÐÊäÈë¾íλÖ÷þÎñÆ÷µÄÃû³Æ¡£",IDC_STATIC,7,7,
+ 237,8
+ LTEXT "·þÎñÆ÷Ãû(&N)£º",IDC_STATIC,7,31,53,8
+ EDITTEXT IDC_COMMENT,75,29,156,13,ES_AUTOHSCROLL
+ LTEXT "·þÎñÆ÷µØÖ·(&A)£º",IDC_STATIC,7,52,64,8
+ CONTROL "ʹÓÃÌض¨µØÖ·(&U)£º",IDC_ADDR_SPECIFIC,"Button",
+ BS_AUTORADIOBUTTON,75,52,83,10
+ CONTROL "×Ô¶¯²éÕÒµØÖ·(&L)",IDC_ADDR_LOOKUP,"Button",
+ BS_AUTORADIOBUTTON,75,66,111,10
+ CONTROL "",IDC_SERVER,"SockAddr",WS_BORDER | WS_TABSTOP,163,51,
+ 65,13
+ PUSHBUTTON "È¡Ïû",IDCANCEL,140,91,50,14
+ PUSHBUTTON "È·¶¨",IDOK,86,91,50,14
+ PUSHBUTTON "°ïÖú",9,194,91,50,14
+END
+
+IDD_DRIVE_EDIT DIALOG DISCARDABLE 0, 0, 297, 156
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ó³ÉäÅÌ·û"
+FONT 9, "ËÎÌå"
+BEGIN
+ LTEXT "¿ÉÓ³Éä¼ÆËã»úÉϵÄÅÌ·ûÖÁ AFS ÖеÄ·¾¶¡£",IDC_STATIC,7,7,
+ 283,8
+ LTEXT "ÀýÈ磬Èç¹ûÓ³ÉäÇý¶¯Æ÷ Q ÖÁ /afs/acme.com/usr/bob£¬Ôò AFS µÄ /afs/acme.com/usr/bob/* ÖеĿÉÓÃÎļþ½«ÔÚÄú¼ÆËã»úµÄ Q:\\ Ŀ¼Ï¿ɼû¡£",
+ IDC_STATIC,7,26,283,16
+ LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,14,59,58,8
+ COMBOBOX IDC_DRIVE,77,57,63,206,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,14,77,58,8
+ EDITTEXT IDC_PATH,77,75,168,13,ES_AUTOHSCROLL
+ LTEXT "ÃèÊö(&E)£º",IDC_STATIC,14,96,58,8
+ EDITTEXT IDC_DESC,77,94,72,13,ES_AUTOHSCROLL
+ CONTROL "µÇ¼ʱ»Ö¸´Ó³Éä(&R)",IDC_PERSISTENT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,77,112,188,10
+ PUSHBUTTON "È¡Ïû",IDCANCEL,186,135,50,14
+ PUSHBUTTON "È·¶¨",IDOK,132,135,50,14
+ PUSHBUTTON "°ïÖú",9,240,135,50,14
+END
+
+IDD_SUBMOUNTS DIALOG DISCARDABLE 0, 0, 244, 198
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "×Ó°²×°"
+FONT 9, "ËÎÌå"
+BEGIN
+ LTEXT "ÄúµÄ¼ÆËã»ú¿ÉÌṩ AFS ÖеÄ×Ó°²×°--ÍøÂç¹²Ïí¡£",IDC_STATIC,
+ 4,4,196,8
+ GROUPBOX "×Ó°²×°",IDC_STATIC,4,26,236,168
+ LTEXT "ÏÂÁÐ×Ó°²×°´Ó´Ë¼ÆËã»úÉϹ²Ïí£º",IDC_STATIC,10,42,176,8
+ CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x413,10,
+ 54,223,115
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,78,173,50,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,131,173,50,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,173,50,14
+END
+
+IDD_SUBMOUNT_EDIT DIALOG DISCARDABLE 0, 0, 270, 112
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ö¸¶¨×Ó°²×°"
+FONT 9, "ËÎÌå"
+BEGIN
+ LTEXT "ʹÓà Windows ÍøÂ磬×Ó°²×°ÈÃÄú¹²ÏíÒ»¸ö×ÓĿ¼Ê÷¡£",
+ IDC_STATIC,7,7,256,8
+ LTEXT "×Ó°²×°(&S)£º",IDC_STATIC,7,27,53,8
+ LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,7,43,53,8
+ EDITTEXT IDC_SUBMOUNT,63,25,80,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_MAPPING,63,41,181,13,ES_AUTOHSCROLL
+ LTEXT "Ϊ×Ó°²×°ÊäÈë¶ÌÃû£¬²¢ÇÒµ±³öÏÖÌáʾʱÊäÈëÒ»¸öÈ« AFS ·¾¶¡£AFS ·¾¶¿ÉÒÔ""\\afs""¿ªÊ¼(Èç¹û²»ÊÇ£¬""\\afs""½«×Ô¶¯Ìí¼Ó)¡£",
+ IDC_STATIC,7,64,256,18
+ PUSHBUTTON "È¡Ïû",IDCANCEL,159,91,50,14
+ PUSHBUTTON "È·¶¨",IDOK,105,91,50,14
+ PUSHBUTTON "°ïÖú",9,213,91,50,14
+END
+
+IDD_DRIVES_95 DIALOG DISCARDABLE 0, 0, 245, 145
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ÅÌ·û"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "ÅÌ·û",IDC_STATIC,7,7,231,131
+ CONTROL "",IDC_LIST,"CheckList",WS_BORDER | WS_TABSTOP | 0x153,
+ 13,32,219,60
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,83,95,48,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,134,95,48,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,184,95,48,14
+ LTEXT "½«ÅÌ·ûÓ³ÉäÖÁ AFS ÖеÄ·¾¶£º",IDC_STATIC,13,21,193,8
+ LTEXT "×¢Ò⣺ÓÉÓÚ AFS ¿Í»§»úûÓÐÁ¬½ÓÖÁ AFS Íø¹Ø£¬½«½ûÓÃÕâЩ¿ØÖÆ¡£",
+ IDC_WARN,13,116,219,17
+END
+
+IDD_HOSTS_95 DIALOG DISCARDABLE 0, 0, 245, 145
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "AFS µ¥Ôª"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,7,231,131
+ CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13,
+ 19,218,94
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,75,116,50,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,128,116,50,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,181,116,50,14
+END
+
+IDD_STARTSTOP DIALOGEX 0, 0, 219, 48
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION "AFS ¿Í»§»ú·þÎñ"
+FONT 9, "ËÎÌå", 0, 0, 0x1
+BEGIN
+ GROUPBOX "",IDC_STATIC,4,0,211,44
+ ICON IDI_MAIN,IDC_STATIC,14,15,20,20
+ LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯...",IDC_STARTING,46,20,
+ 157,8
+ LTEXT "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹...",IDC_STOPPING,46,20,
+ 157,8
+END
+
+IDD_HOSTS_CCENTER DIALOG DISCARDABLE 0, 0, 220, 256
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ò»°ã"
+FONT 9, "ËÎÌå"
+BEGIN
+ GROUPBOX "ȱʡµ¥Ôª",IDC_STATIC,7,7,206,54
+ LTEXT "ÊäÈëÒª¹ÜÀíµÄȱʡ AFS µ¥ÔªÃû£º",IDC_STATIC,14,19,164,8
+ LTEXT "ȱʡµ¥Ôª£º",IDC_STATIC,14,37,44,8
+ EDITTEXT IDC_CELL,65,35,141,14,ES_LOWERCASE | ES_AUTOHSCROLL
+ GROUPBOX "AFS µ¥Ôª",IDC_STATIC,7,69,206,180
+ CONTROL "",IDC_LIST,"FastList",WS_BORDER | WS_TABSTOP | 0x11b,13,
+ 84,193,137
+ PUSHBUTTON "Ìí¼Ó(&A)...",IDC_ADD,51,227,50,14
+ PUSHBUTTON "¸ü¸Ä(&C)...",IDC_EDIT,104,227,50,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,157,227,50,14
+END
+
+IDD_MISC_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 220, 193
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ÔÓÏîÅäÖÃ"
+FONT 8, "System"
+BEGIN
+ EDITTEXT IDC_LAN_ADAPTER,90,20,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_PROBE,90,40,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_THREADS,90,60,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_DAEMONS,90,80,32,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_SYSNAME,90,100,83,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_MOUNTDIR,90,120,83,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_ROOTVOLUME,90,140,83,13,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "È·¶¨",IDOK,55,172,50,14
+ PUSHBUTTON "È¡Ïû",IDCANCEL,109,172,50,14
+ PUSHBUTTON "°ïÖú",9,163,172,50,14
+ GROUPBOX "²ÎÊý",IDC_STATIC,7,7,206,156
+ LTEXT "¼ì²â¼ä¸ô(&P)£º",IDC_STATIC,15,42,71,8
+ LTEXT "Ãë",IDC_STATIC,138,42,68,8
+ LTEXT "ºǫ́Ïß³Ì(&B)£º",IDC_STATIC,15,62,71,8
+ LTEXT "Ïß³Ì",IDC_STATIC,138,62,68,8
+ LTEXT "·þÎñÏß³Ì(&E)£º",IDC_STATIC,15,82,71,8
+ LTEXT "Ïß³Ì",IDC_STATIC,138,82,68,8
+ LTEXT "ϵͳÃû³Æ(&Y)£º",IDC_STATIC,15,102,71,8
+ LTEXT "°²×°Ä¿Â¼(&M)£º",IDC_STATIC,15,122,71,8
+ LTEXT "LAN ÊÊÅäÆ÷ºÅ(&L)£º",IDC_STATIC,15,22,71,8
+ LTEXT "¸ù¾í(&R)£º",IDC_STATIC,15,141,71,8
+END
+
+IDD_DIAG_PARMS DIALOG DISCARDABLE 0, 0, 217, 135
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Õï¶ÏÅäÖÃ"
+FONT 8, "System"
+BEGIN
+ EDITTEXT IDC_TRACE_LOG_BUF_SIZE,112,20,32,13,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "È·¶¨",IDOK,52,114,50,14
+ PUSHBUTTON "È¡Ïû",IDCANCEL,106,114,50,14
+ PUSHBUTTON "°ïÖú",9,160,114,50,14
+ GROUPBOX "¸ú×ÙÈÕÖ¾²ÎÊý",IDC_STATIC,7,7,203,54
+ LTEXT "»º³åÇø´óС(&B)£º",IDC_STATIC,13,22,73,8
+ LTEXT "KB",IDC_STATIC,155,24,9,8
+ GROUPBOX "ʼþÈÕÖ¾²ÎÊý",IDC_STATIC,7,69,203,35
+ COMBOBOX IDC_TRAP_ON_PANIC,112,40,32,61,CBS_DROPDOWNLIST |
+ CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ LTEXT "½ô¼±Çé¿öϵ÷ÓÃÏÝÚå(&T)£º",IDC_STATIC,13,42,93,8
+ LTEXT "±¨¸æ»á»°Æô¶¯£º",IDC_STATIC,13,86,79,8
+ COMBOBOX IDC_REPORT_SESSION_STARTUPS,112,84,32,64,
+ CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_LOGIN_CONFIG_PARMS DIALOG DISCARDABLE 0, 0, 186, 92
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "µÇ¼ÅäÖÃ"
+FONT 8, "System"
+BEGIN
+ EDITTEXT IDC_LOGIN_RETRY_INTERVAL,117,18,32,13,ES_AUTOHSCROLL
+ COMBOBOX IDC_FAIL_SILENTLY,117,39,32,40,CBS_DROPDOWNLIST |
+ CBS_SORT | WS_VSCROLL | WS_TABSTOP
+ DEFPUSHBUTTON "È·¶¨",IDOK,21,71,50,14
+ PUSHBUTTON "È¡Ïû",IDCANCEL,75,71,50,14
+ PUSHBUTTON "°ïÖú",9,129,71,50,14
+ LTEXT "µÇ¼ÖØÊÔ¼ä¸ô(&L)£º",IDC_STATIC,13,20,98,8
+ GROUPBOX "²ÎÊý",IDC_STATIC,7,7,172,54
+ LTEXT "µÇ¼ʧ°Ü£¬ÎÞÈκÎÌáʾ(&F)£º",IDC_STATIC,13,41,98,8
+END
+
+IDD_GLOBAL_DRIVES DIALOG DISCARDABLE 0, 0, 253, 169
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "È«¾ÖÇý¶¯Æ÷"
+FONT 8, "System"
+BEGIN
+ DEFPUSHBUTTON "¹Ø±Õ",IDOK,141,148,50,14
+ PUSHBUTTON "°ïÖú",9,196,148,50,14
+ PUSHBUTTON "Ìí¼Ó(&A)",IDC_ADD,108,117,42,14
+ GROUPBOX "È«¾ÖÓ³Éä AFS Çý¶¯Æ÷",IDC_STATIC,7,7,239,133
+ CONTROL "",IDC_GLOBAL_DRIVE_LIST,"FastList",WS_BORDER |
+ WS_TABSTOP | 0x1b,14,20,226,89
+ PUSHBUTTON "¸ü¸Ä(&C)",IDC_CHANGE,153,117,42,14
+ PUSHBUTTON "³ýÈ¥(&R)",IDC_REMOVE,198,117,42,14
+END
+
+IDD_GLOBAL_DRIVES_ADDEDIT DIALOG DISCARDABLE 0, 0, 247, 118
+STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Ó³ÉäÈ«¾ÖÇý¶¯Æ÷"
+FONT 8, "System"
+BEGIN
+ COMBOBOX IDC_DRIVE,63,23,63,206,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ EDITTEXT IDC_PATH,63,42,168,13,ES_AUTOHSCROLL
+ EDITTEXT IDC_DESC,63,62,72,13,ES_AUTOHSCROLL
+ DEFPUSHBUTTON "È·¶¨",IDOK,82,96,50,14
+ PUSHBUTTON "È¡Ïû",IDCANCEL,136,96,50,14
+ PUSHBUTTON "°ïÖú",9,190,96,50,14
+ LTEXT "ÅÌ·û(&D)£º",IDC_STATIC,12,25,48,8
+ LTEXT "AFS ·¾¶(&P)£º",IDC_STATIC,12,44,48,8
+ LTEXT "ÃèÊö(&E)£º",IDC_STATIC,12,64,48,8
+ GROUPBOX "È«¾Ö AFS Çý¶¯Æ÷",IDC_STATIC,7,7,232,80
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_GENERAL_NT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 218
+ END
+
+ IDD_GENERAL_95, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 238
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 138
+ END
+
+ IDD_PREFS_NT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 218
+ END
+
+ IDD_HOSTS_NT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 218
+ END
+
+ IDD_DRIVES_NT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 218
+ END
+
+ IDD_ADVANCED_NT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 218
+ END
+
+ IDD_PREFS_EDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 244
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 116
+ END
+
+ IDD_CELL_EDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 240
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 219
+ END
+
+ IDD_SERVER_EDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 244
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 105
+ END
+
+ IDD_DRIVE_EDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 290
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 149
+ END
+
+ IDD_SUBMOUNTS, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 240
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 194
+ END
+
+ IDD_SUBMOUNT_EDIT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 263
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 105
+ END
+
+ IDD_DRIVES_95, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 238
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 138
+ END
+
+ IDD_HOSTS_95, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 238
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 138
+ END
+
+ IDD_STARTSTOP, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 215
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 44
+ END
+
+ IDD_HOSTS_CCENTER, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 249
+ END
+
+ IDD_MISC_CONFIG_PARMS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 213
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 186
+ END
+
+ IDD_DIAG_PARMS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 210
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 128
+ END
+
+ IDD_LOGIN_CONFIG_PARMS, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 179
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 85
+ END
+
+ IDD_GLOBAL_DRIVES, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 246
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 162
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include <windows.h>\r\n"
+ "#ifndef APSTUDIO_INVOKED\r\n"
+ "#define AFS_VERINFO_FILE_DESCRIPTION ""AFS ¿Í»§»úÅäÖÃ""\r\n"
+ "#include ""AFS_component_version_number.h""\r\n"
+ "#include ""..\\..\\config\\NTVersioninfo.rc""\r\n"
+ "#endif // APSTUDIO_INVOKED\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAIN ICON DISCARDABLE "afs_config.ico"
+IDI_UP ICON DISCARDABLE "up.ico"
+IDI_DOWN ICON DISCARDABLE "down.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_TITLE_NT "AFS ¿Í»§»úÅäÖÃ"
+ IDS_TITLE_95 "AFS Light ÅäÖÃ"
+ IDS_STATE_STOPPED "AFS ¿Í»§»ú·þÎñµ±Ç°ÎªÍ£Ö¹×´Ì¬¡£"
+ IDS_STATE_RUNNING "AFS ¿Í»§»ú·þÎñÕýÔÚÕý³£ÔËÐС£"
+ IDS_STATE_STARTING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÆô¶¯..."
+ IDS_STATE_STOPPING "ÇëµÈ´ý£»AFS ¿Í»§»ú·þÎñÕýÔÚÍ£Ö¹..."
+ IDS_STATE_UNKNOWN "AFS ¿Í»§»ú·þÎñûÓÐÊʵ±ÅäÖá£"
+ IDS_SERVICE_FAIL_START "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Æô¶¯¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£"
+ IDS_SERVICE_FAIL_STOP "AFS ¿Í»§»ú·þÎñ²»Äܳɹ¦Í£Ö¹¡£Äú¿ÉÄÜûÓÐȨÏÞÀ´Ö´Ðд˲Ù×÷¡£\n\n´íÎó 0x%1¡£"
+ IDS_WARN_STOPPED "ÓÉÓÚ AFS ¿Í»§»ú·þÎñûÓÐÔËÐУ¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£"
+ IDS_WARN_ADMIN "ÓÉÓÚÄúûÓÐÒÔ¹ÜÀíÔ±Éí·ÝµÇ¼ÖÁ Windows£¬²»Äܸü¸Ä½ûÓõĿØÖÆ¡£"
+ IDS_CELL_UNKNOWN "(δ֪)"
+ IDS_GATEWAY_UNKNOWN "(δ֪)"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_BADLOOKUP_DESC "Windows ÕÒ²»µ½ %1 µÄÍøÂçµØÖ·¡£¼ì²éÒÔÈ·±£ÊäÈëÁËÕýÈ·µÄ»úÆ÷Ãû¡£"
+ IDS_NEWSUB_DESC "µ±Á¬½ÓÍøÂçÇý¶¯Æ÷ʱ£¬AFS ÎÞ·¨Ê¹ÓÃÖ¸¶¨µÄÃèÊö¡£\n\nÖ¸¶¨µÄÃèÊöÒÑʹÓÃÔÚ²»Í¬µÄ AFS ·¾¶ÖС£"
+ IDS_BADSUB_DESC "²»ÄÜʹÓÃÄúÊäÈëµÄÅÌ·ûÃèÊö¡£\n\nÅÌ·ûÃèÊö²»Äܳ¬¹ý 12 ¸ö×Ö·û£¬²¢ÇÒ²»ÄÜ°üº¬¿Õ¸ñ»òÖƱí·û¡£"
+ IDS_BADGATEWAY_DESC "AFS ÎÞ·¨Á¬½ÓÖÁÄúÖ¸¶¨µÄÍø¹Ø»úÆ÷¡£\n\n¼ì²éÒÔÈ·±£ÊäÈëÁíÍâÕýÈ·µÄÍø¹ØÉ豸Ãû³Æ¡£"
+ IDS_BADGWCELL_DESC "ÕÒ²»µ½Ö¸¶¨µÄÍø¹Ø»úÆ÷ʹÓÃµÄ AFS µ¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nÈç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£\n\nµ¥Ôª£º%1"
+ IDS_TITLE_CAUTION_NT "×¢Òâ - AFS ¿Í»§»úÅäÖÃ"
+ IDS_TITLE_CAUTION_95 "×¢Òâ - AFS Light"
+ IDS_TITLE_ERROR_NT "³ö´í - AFS ¿Í»§»úÅäÖÃ"
+ IDS_TITLE_ERROR_95 "³ö´í - AFS Light ÅäÖÃ"
+ IDS_SHRINKCACHE "µ± AFS ¿Í»§»ú·þÎñÕýÔÚÔËÐÐʱ²»ÄܼõÉÙ AFS ¿Í»§»ú¸ßËÙ»º´æµÄ´óС¡£\n\nÒª¼õÉÙ¸ßËÙ»º´æµÄ´óС£¬Ê×ÏÈÔÚ¡°Ò»°ã¡±±êÇ©ÉÏʹÓá°Í£Ö¹·þÎñ¡±°´Å¥Í£Ö¹ AFS ¿Í»§»ú·þÎñ¡£"
+ IDS_BADCELL_DESC_CC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_STOP_DESC "Èç¹ûÍ£Ö¹ AFS ¿Í»§»ú·þÎñ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´Ó´Ë¼ÆËã»úÖдæÈ¡¡£\n\nÈ·ÈÏҪֹͣ·þÎñÂð?"
+ IDS_PREFCOL_SERVER "·þÎñÆ÷"
+ IDS_PREFCOL_RANK "ÅÅÐò"
+ IDS_TIP_PREFS "ÇÏÃÅ£ºµ±´Ó AFS ¶ÁÈ¡Îļþʱ£¬µÍÅÅÐòÊýµÄ·þÎñÆ÷½«»ñµÃ¸ßÓÅÏȼ¶¡£"
+ IDS_PREFERROR_RESOLVE "AFS ÕÒ²»µ½ÃûΪ %1 µÄ·þÎñÆ÷¡£Çë¼ì²éÒÔÈ·±£ÊäÈëÕýÈ·µÄ·þÎñÆ÷¡£"
+ IDS_FILTER_TXT "Îı¾Îļþ(*.TXT)£»*.TXT£»"
+ IDS_HOSTREM_MANY "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓйØÑ¡¶¨µÄ AFS µ¥ÔªµÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?"
+ IDS_HOSTREM_ONE "ÄúÒÑÑ¡Ôñ³ýÈ¥ÓÐ¹Ø AFS µ¥Ôª %1 µÄËùÓÐÁ¬½ÓÐÅÏ¢¡£\n\nÈ·ÈÏÒª³ýÈ¥ÕâЩÌõÄ¿Âð?"
+ IDS_CELLEDIT_TITLE "%1 - ÌØÐÔ"
+ IDS_CELLADD_TITLE "н¨µ¥Ôª"
+ IDS_SVRCOL_SERVER "µØÖ·"
+ IDS_SVRCOL_COMMENT "·þÎñÆ÷Ãû"
+ IDS_TIP_DRIVES "ÇÏÃÅ£ºÑ¡ÖÐÓ³ÉäÅÌ·ûÅԵĸ´Ñ¡¿ò£¬Á¬½ÓÍøÂçÇý¶¯Æ÷Ó³Éä¡£"
+ IDS_MAP_LETTER "Çý¶¯Æ÷ *:"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_DRIVE_MAP "Çý¶¯Æ÷ %1: \t%2"
+ IDS_ERROR_MAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í"
+ IDS_ERROR_MAP_DESC "AFS ÎÞ·¨Ó³ÉäÍøÂçÇý¶¯Æ÷ÖÁ AFS ÖеÄ·¾¶¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£"
+ IDS_ERROR_UNMAP "Ó³ÉäÍøÂçÇý¶¯Æ÷³ö´í"
+ IDS_ERROR_UNMAP_DESC "AFS ÎÞ·¨¶Ï¿ªÓëÖ¸¶¨ÍøÂçÇý¶¯Æ÷µÄÓ³Éä¡£¼ì²éÒÔÈ·±£ÅÌ·ûµ±Ç°Ã»ÓÐʹÓá£\n\n´íÎó£º0x%1¡£"
+ IDS_ADDSERVER_TITLE "Ìí¼Ó·þÎñÆ÷"
+ IDS_EDITSERVER_TITLE "±à¼·þÎñÆ÷"
+ IDS_SUBCOL_SHARE "×Ó°²×°"
+ IDS_SUBCOL_PATH "AFS ·¾¶"
+ IDS_SUBMOUNTS_TITLE "×Ó°²×°"
+ IDS_BADCELL_DESC "ÔÚÄúÊäÈëµÄ AFS µ¥ÔªÖÐÕÒ²»µ½ÅäÖÃÐÅÏ¢¡£\n\n+"
+ IDS_BADCELL_DESC2 "¼ì²éÒÔÈ·±£ÄúÕýÈ·ÊäÈëÁ˵¥ÔªµÄÃû³Æ¡£Èç¹ûÄúÒªÔÚеĵ¥ÔªÖÐÅäÖà AFS ¿Í»§»ú£¬Äú±ØÐëʹÓá°AFS µ¥Ôª¡±±êÇ©ÒÔÌí¼Ó¸Ãе¥ÔªµÄÅäÖÃÐÅÏ¢¡£"
+ IDS_KB_IN_USE "KB (%1 KB ÕýÔÚʹÓÃ)"
+ IDS_NOGATEWAY_TITLE "ÎÞЧ AFS Íø¹Ø"
+ IDS_NOGATEWAY_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS Íø¹Ø£¬²»ÄÜÅäÖà AFS Light¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS Íø¹ØµÄÃû³Æ»ò IP µØÖ·¡£"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_NOCELL_DESC "ÓÉÓÚÄúûÓÐÖ¸¶¨ AFS µ¥Ôª£¬²»ÄÜÅäÖà AFS ¿Í»§»ú¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªµÄÃû³Æ¡£"
+ IDS_STOPPED_NOCELL "ÔÚÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬±ØÐëÖ¸¶¨ AFS µ¥Ôª¡£"
+ IDS_OKSTOP_DESC "ûÓÐÔËÐÐ AFS ¿Í»§»ú·þÎñ¡£ÔÚûÓÐÆô¶¯ AFS ¿Í»§»ú·þÎñ֮ǰ£¬´æ´¢ÔÚ AFS ÖеÄÎļþ½«²»¿É´æÈ¡¡£\n\nÏÖÔÚÆô¶¯·þÎñÂð? "
+ IDS_BADMAP_DESC "ÓÉÓÚ·¾¶Ã»ÓÐÒÔ""\\afs""¿ªÊ¼£¬AFS ²»ÄÜÓ³ÉäÅÌ·ûÖÁÖ¸¶¨µÄ·¾¶¡£\n\nÈ·±£ÄúËùÊäÈëµÄ·¾¶ÊÇÒÔ""\\afs""¿ªÊ¼µÄ£¬²¢ÖØÊÔÒ»´Î¡£"
+ IDS_RESTART_TITLE "AFS ¿Í»§»úÅäÖÃ"
+ IDS_RESTART_DESC "ÔÚ AFS ¿Í»§»ú·þÎñÍ£Ö¹²¢ÖØÐÂÆô¶¯Ö®Ç°£¬ÄúËù×öµÄһЩ¸ü¸Ä½«²»»áÉúЧ¡£\n\nÏÖÔÚÍ£Ö¹²¢ÖØÐÂÆô¶¯·þÎñÂð? "
+ IDS_KB_ONLY "KB"
+ IDS_FAILCONFIG_AUTHENT "µ±ÔڵǼʱ³¢ÊÔÆôÓûò½ûÓÃÈÏ֤ʱ³ö´í¡£\n\n´íÎó %1"
+ IDS_FAILCONFIG_PREFS "ÄúÖ¸¶¨µÄһЩ·þÎñÆ÷ÅÅÐòÓÅÏȼ¶²»ÄÜʹÓá£\n\n´íÎó %1"
+ IDS_FAILCONFIG_CACHE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¸ßËÙ»º´æ´óС¡£\n\n´íÎó %1"
+ IDS_FAILCONFIG_PROBE "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»ú¼ì²â¼ä¸ô¡£\n\n´íÎó %1"
+ IDS_FAILCONFIG_SYSNAME "²»ÄÜʹÓÃÄúÊäÈëµÄ AFS ¿Í»§»úϵͳÃû¡£\n\n´íÎó %1"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_BADCELL_DESC_CC2 "Çë¼ì²éµ¥ÔªÃûÈ·±£ÄúÒÑÊäÈëÕýÈ·¡£Èç¹ûÔÚ AFS µ¥ÔªÁбíÖÐûÓгöÏÖÕýÈ·µÄµ¥ÔªÃû£¬ÇëʹÓá°Ìí¼Ó¡±°´Å¥Îª¸Ãµ¥Ôª´´½¨Ò»¸öÌõÄ¿¡£"
+ IDS_NOCELL_DESC_CC "²»ÄÜÅäÖà AFS ¿ØÖÆÖÐÐÄ£¬ÒòΪÄú»¹Ã»ÓÐÖ¸¶¨È±Ê¡µÄ AFS µ¥Ôª¡£\n\nÇëÔÚÌṩµÄÇøÓòÖÐÊäÈë AFS µ¥ÔªÃû¡£"
+ IDS_TITLE_CAUTION_CCENTER "×¢Òâ - AFS ¿ØÖÆÖÐÐÄÌØÐÔ"
+ IDS_TITLE_ERROR_CCENTER "³ö´í - AFS ¿ØÖÆÖÐÐÄÌØÐÔ"
+ IDS_TITLE_CCENTER "AFS ¿ØÖÆÖÐÐÄÌØÐÔ"
+ IDS_YES "ÊÇ"
+ IDS_NO "·ñ"
+ IDS_DRIVE "Çý¶¯Æ÷"
+END
+
+#endif // Chinese (P.R.C.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
#define IDD_LOGIN_CONFIG_PARMS 119
#define IDD_GLOBAL_DRIVES 120
#define IDD_GLOBAL_DRIVES_ADDEDIT 121
+#define IDD_BINDING_CONFIG_PARAMS 122
#define IDC_STATUS 1000
#define IDC_SERVICE_STOP 1001
#define IDC_SERVICE_START 1002
#define IDC_ADDR_LOOKUP 1049
#define IDC_LOGON_PARMS 1049
#define IDC_TRACE_LOG_BUF_SIZE 1050
-#define IDC_AUTOMAP_PARMS 1050
+#define IDC_AUTOMAP_PARMS 1051
#define IDC_LOGIN_RETRY_INTERVAL 1052
+#define IDC_BINDING_PARMS 1053
#define IDC_TRAP_ON_PANIC 1054
#define IDC_REPORT_SESSION_STARTUPS 1055
#define IDC_FAIL_SILENTLY 1056
#define IDC_DIAG_PARMS 1060
#define IDC_ROOTVOLUME 1061
#define IDC_AUTOLANA 1062
+#define IDC_DEFAULTNIC 1062
#define IDC_STATICLANA 1063
#define IDC_STATICSUBMOUNT 1064
+#define IDC_NICSELECTION 1065
+#define IDC_BINDING_MESSAGE 1066
#define IDC_STATIC -1
// Next default values for new objects
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 122
+#define _APS_NEXT_RESOURCE_VALUE 123
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1064
+#define _APS_NEXT_CONTROL_VALUE 1067
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
extern BOOL CALLBACK Diag_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp);
extern BOOL Diag_OnApply();
+// From binding_misc.cpp
+extern BOOL Binding_OnApply();
+extern BOOL CALLBACK Binding_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp);
/*
* ROUTINES ___________________________________________________________________
ModalDialog(IDD_MISC_CONFIG_PARMS, hDlg, (DLGPROC)Misc_DlgProc);
break;
+ case IDC_BINDING_PARMS:
+ ModalDialog(IDD_BINDING_CONFIG_PARAMS, hDlg, (DLGPROC)Binding_DlgProc);
+ break;
+
case IDC_LOGON_PARMS:
ModalDialog(IDD_LOGIN_CONFIG_PARMS, hDlg, (DLGPROC)Logon_DlgProc);
break;
if (!Misc_OnApply())
return FALSE;
+ if (!Binding_OnApply())
+ return FALSE;
+
if (!Logon_OnApply())
return FALSE;
return FALSE;
}
+extern void GetNetbiosName(LPTSTR pszName, int type);
void DriveEdit_OnInitDialog (HWND hDlg)
{
SendMessage (hCombo, CB_SETCURSEL, iItemSel, 0);
TCHAR szMapping[ MAX_PATH ];
+#ifdef NOLANA
AdjustAfsPath (szMapping, ((pMap->szMapping[0]) ? pMap->szMapping : cm_slash_mount_root), TRUE, FALSE);
+#else
+ memset(szMapping, '\0', sizeof(szMapping));
+ szMapping[0] = '\\';
+ GetNetbiosName(&szMapping[1], 0);
+#endif
+
CHAR msg[256], msgf[256];
if (GetDlgItemText(hDlg,IDC_STATICSUBMOUNT,(LPSTR)msg,sizeof(msg)-1)>0)
{
guilflags = $(guilflags) -MACHINE:$(CPU)
cflags = $(cflags) -Zi -Od -DDEBUG -D_DEBUG -DDBG
-lflags = $(lflags) -debug:full -debugtype:both
+lflags = $(lflags) -debug:full
.rc.res :
$(rc) $(rcflags) $(rcvars) $*.rc
# include the AFSD source tree on our inclusion path
-AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I..\afsd -I..\client_config
-
+AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) /D"_AFXDLL" -I..\afsd -I..\client_config -I..\kfw\inc\loadfuncs -I..\kfw\inc\krb5 -I..\kfw\inc\leash
# include the primary makefile
RELDIR=WINNT\client_creds
$(OUT)\trayicon.obj \
$(OUT)\window.obj
+EXECOBJS = \
+ $(OUT)\afskfw.obj
+
EXERES = \
$(OUT)\afscreds_stub.res
$(OUT)\subclass.obj
CLIENTOBJS = \
- $(OUT)\drivemap.obj
+ $(OUT)\drivemap.obj \
+ $(OUT)\RegistrySupport.obj \
+ $(OUT)\getlana.obj
VCLIBS =\
+ iphlpapi.lib \
comctl32.lib \
shell32.lib \
uuid.lib \
ole32.lib \
- mpr.lib
+ mpr.lib \
+ netapi32.lib
EXELIBS = \
$(DESTDIR)\lib\afs\afspioctl.lib \
$(EXEOBJS): $$(@B).cpp
$(C2OBJ) -I$*(*D) -I$(AFSAPPLIB) $**
+$(EXECOBJS): $$(@B).c
+ $(C2OBJ) -I$*(*D) -I$(AFSAPPLIB) $**
+
############################################################################
-$(EXEFILE) : $(EXEOBJS) $(EXERES) $(AFSAPPLIBOBJS) $(AFSDOBJS) $(CLIENTOBJS) $(EXELIBS)
+$(EXEFILE) : $(EXEOBJS) $(EXECOBJS) $(EXERES) $(AFSAPPLIBOBJS) $(AFSDOBJS) $(CLIENTOBJS) $(EXELIBS)
$(EXEGUILINK) $(VCLIBS)
$(EXEPREP)
}
#include "afscreds.h"
-
+#ifdef USE_KFW
+#include "afskrb5.h"
+#endif
/*
* PROTOTYPES _________________________________________________________________
SetWindowLong (hDlg, DWL_USER, TRUE);
Advanced_OnServiceTimer (hDlg);
Advanced_StartTimer (hDlg);
+#ifdef USE_KFW
+ if ( wCmd == IDC_SERVICE_START && KRB5_is_available() && KRB5_wait_for_service_start() )
+ KRB5_AFS_renew_tokens_for_all_cells();
+#endif /* USE_KFW */
}
else
{
#define cszSHORTCUT_NAME TEXT("AFS Credentials.lnk")
+#define AFSCREDS_SHORTCUT_OPTIONS TEXT("-A -M -N -Q")
/*
* VARIABLES __________________________________________________________________
#define cminREMIND_TEST 1 // test every minute for expired creds
#define cminREMIND_WARN 15 // warn if creds expire in 15 minutes
+#define cminRENEW 20 // renew creds when there are 20 minutes remaining
+#define cminMINLIFE 30 // minimum life of Kerberos creds
#define cmsecMOUSEOVER 1000 // retest freq when mouse is over tray icon
#define cmsecSERVICE 2000 // retest freq when starting/stopping service
--- /dev/null
+/*
+ * Copyright (c) 2003 SkyRope, LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - 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.
+ * - Neither the name of Skyrope, LLC nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission from Skyrope, LLC.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER
+ * 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.
+ *
+ * Portions of this code are derived from portions of the MIT
+ * Leash Ticket Manager and LoadFuncs utilities. For these portions the
+ * following copyright applies.
+ *
+ * Copyright (c) 2003,2004 by the Massachusetts Institute of Technology.
+ * All rights reserved.
+ *
+ * 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.
+ *
+ */
+
+#ifndef AFSKRB5_INT_H
+#define AFSKRB5_INT_H
+
+#include <windows.h>
+#ifdef USE_MS2MIT
+#define SECURITY_WIN32
+#include <security.h>
+#include <ntsecapi.h>
+#endif /* USE_MS2MIT */
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <winsock2.h>
+
+#ifdef USE_MS2MIT
+#include <loadfuncs-lsa.h>
+#endif /* USE_MS2MIT */
+
+#include <afs/stds.h>
+#include <krb5.h>
+
+#include <rxkad.h>
+
+/* Defined in the KRBV4W32 version of krb.h but not the Kerberos V version */
+/* Required for some of the loadfuncs headers */
+typedef struct ktext far *KTEXT;
+typedef struct ktext far *KTEXT_FP;
+#include <KerberosIV/krb.h>
+
+/* AFS has its own version of com_err.h */
+typedef afs_int32 errcode_t;
+
+#include <loadfuncs-com_err.h>
+#include <loadfuncs-krb5.h>
+#include <loadfuncs-profile.h>
+#include <loadfuncs-krb.h>
+#include <loadfuncs-krb524.h>
+#include <loadfuncs-afs36.h>
+#include <loadfuncs-leash.h>
+
+// service definitions
+#define SERVICE_DLL "advapi32.dll"
+typedef SC_HANDLE (WINAPI *FP_OpenSCManagerA)(char *, char *, DWORD);
+typedef SC_HANDLE (WINAPI *FP_OpenServiceA)(SC_HANDLE, char *, DWORD);
+typedef BOOL (WINAPI *FP_QueryServiceStatus)(SC_HANDLE, LPSERVICE_STATUS);
+typedef BOOL (WINAPI *FP_CloseServiceHandle)(SC_HANDLE);
+
+#define KRB5_DEFAULT_LIFE 60*60*10 /* 10 hours */
+#define LSA_CCNAME "MSLSA:"
+
+#define PROBE_USERNAME "OPENAFS-KDC-PROBE"
+#define PROBE_PASSWORD_LEN 16
+
+#define MAXCELLCHARS 64
+#define MAXHOSTCHARS 64
+#define MAXHOSTSPERCELL 8
+#define TRANSARCAFSDAEMON "TransarcAFSDaemon"
+typedef struct {
+ char name[MAXCELLCHARS];
+ short numServers;
+ short flags;
+ struct sockaddr_in hostAddr[MAXHOSTSPERCELL];
+ char hostName[MAXHOSTSPERCELL][MAXHOSTCHARS];
+ char *linkedCell;
+} afsconf_cell;
+
+struct ktc_token {
+ time_t startTime;
+ time_t endTime;
+ struct ktc_encryptionKey sessionKey;
+ short kvno; /* XXX UNALIGNED */
+ int ticketLen;
+ char ticket[MAXKTCTICKETLEN];
+};
+
+#define KTC_ERROR 11862784L
+#define KTC_TOOBIG 11862785L
+#define KTC_INVAL 11862786L
+#define KTC_NOENT 11862787L
+#define KTC_PIOCTLFAIL 11862788L
+#define KTC_NOPIOCTL 11862789L
+#define KTC_NOCELL 11862790L
+#define KTC_NOCM 11862791L
+
+/* User Query data structures and functions */
+
+struct textField {
+ char * buf; /* Destination buffer address */
+ int len; /* Destination buffer length */
+ char * label; /* Label for this field */
+ char * def; /* Default response for this field */
+ int echo; /* 0 = no, 1 = yes, 2 = asterisks */
+};
+
+#define ID_TEXT 150
+#define ID_MID_TEXT 300
+
+struct principal_ccache_data {
+ struct principal_ccache_data * next;
+ char * principal;
+ char * ccache_name;
+ int from_lsa;
+ int expired;
+ int expiration_time;
+ int renew;
+};
+
+struct cell_principal_map {
+ struct cell_principal_map * next;
+ char * cell;
+ char * principal;
+ int active;
+};
+
+/* In order to avoid including the private CCAPI headers */
+typedef int cc_int32;
+
+#define CC_API_VER_1 1
+#define CC_API_VER_2 2
+
+#define CCACHE_API cc_int32
+
+/*
+** The Official Error Codes
+*/
+#define CC_NOERROR 0
+#define CC_BADNAME 1
+#define CC_NOTFOUND 2
+#define CC_END 3
+#define CC_IO 4
+#define CC_WRITE 5
+#define CC_NOMEM 6
+#define CC_FORMAT 7
+#define CC_LOCKED 8
+#define CC_BAD_API_VERSION 9
+#define CC_NO_EXIST 10
+#define CC_NOT_SUPP 11
+#define CC_BAD_PARM 12
+#define CC_ERR_CACHE_ATTACH 13
+#define CC_ERR_CACHE_RELEASE 14
+#define CC_ERR_CACHE_FULL 15
+#define CC_ERR_CRED_VERSION 16
+
+enum {
+ CC_CRED_VUNKNOWN = 0, // For validation
+ CC_CRED_V4 = 1,
+ CC_CRED_V5 = 2,
+ CC_CRED_VMAX = 3 // For validation
+};
+
+typedef struct opaque_dll_control_block_type* apiCB;
+typedef struct _infoNC {
+ char* name;
+ char* principal;
+ cc_int32 vers;
+} infoNC;
+
+TYPEDEF_FUNC(
+CCACHE_API,
+CALLCONV_C,
+cc_initialize,
+ (
+ apiCB** cc_ctx, // < DLL's primary control structure.
+ // returned here, passed everywhere else
+ cc_int32 api_version, // > ver supported by caller (use CC_API_VER_1)
+ cc_int32* api_supported, // < if ~NULL, max ver supported by DLL
+ const char** vendor // < if ~NULL, vendor name in read only C string
+ )
+);
+
+TYPEDEF_FUNC(
+CCACHE_API,
+CALLCONV_C,
+cc_shutdown,
+ (
+ apiCB** cc_ctx // <> DLL's primary control structure. NULL after
+ )
+);
+
+TYPEDEF_FUNC(
+CCACHE_API,
+CALLCONV_C,
+cc_get_NC_info,
+ (
+ apiCB* cc_ctx, // > DLL's primary control structure
+ struct _infoNC*** ppNCi // < (NULL before call) null terminated,
+ // list of a structs (free via cc_free_infoNC())
+ )
+);
+
+TYPEDEF_FUNC(
+CCACHE_API,
+CALLCONV_C,
+cc_free_NC_info,
+ (
+ apiCB* cc_ctx,
+ struct _infoNC*** ppNCi // < free list of structs returned by
+ // cc_get_cache_names(). set to NULL on return
+ )
+);
+#define CCAPI_DLL "krbcc32.dll"
+
+/* Function Prototypes */
+DWORD GetServiceStatus(LPSTR, LPSTR, DWORD *);
+void KFW_AFS_error(LONG, LPCSTR);
+
+void UnloadFuncs(FUNC_INFO [], HINSTANCE);
+int LoadFuncs(const char*, FUNC_INFO [], HINSTANCE*, int*, int, int, int);
+int KFW_get_ccache(krb5_context, krb5_principal, krb5_ccache *);
+int KFW_error(krb5_error_code, LPCSTR, int, krb5_context *, krb5_ccache *);
+int KFW_kinit(krb5_context, krb5_ccache, HWND, char *, char *, krb5_deltat,
+ DWORD, DWORD, krb5_deltat, DWORD, DWORD);
+int KFW_AFS_get_cred(char *, char *, char *, char *, int, char **);
+int KFW_renew(krb5_context, krb5_ccache);
+int KFW_destroy(krb5_context, krb5_ccache);
+BOOL KFW_ms2mit(krb5_context, krb5_ccache, BOOL);
+int KFW_AFS_unlog(void);
+int KFW_AFS_klog(krb5_context, krb5_ccache, char*, char*, char*, int);
+void KFW_import_ccache_data(void);
+void KFW_import_windows_lsa(void);
+BOOL MSLSA_IsKerberosLogon();
+#endif /* AFSKFW_INT_H */
--- /dev/null
+/*
+ * Copyright (c) 2003 SkyRope, LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - 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.
+ * - Neither the name of Skyrope, LLC nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission from Skyrope, LLC.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER
+ * 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.
+ *
+ * Portions of this code are derived from portions of the MIT
+ * Leash Ticket Manager and LoadFuncs utilities. For these portions the
+ * following copyright applies.
+ *
+ * Copyright (c) 2003,2004 by the Massachusetts Institute of Technology.
+ * All rights reserved.
+ *
+ * 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.
+ *
+ */
+
+
+#define USE_MS2MIT
+#define USE_KRB4
+#include "afskfw-int.h"
+#include "afskfw.h"
+#include "creds.h"
+
+#include <osilog.h>
+
+/*
+ * TIMING _____________________________________________________________________
+ *
+ */
+
+#define cminREMIND_TEST 1 // test every minute for expired creds
+#define cminREMIND_WARN 15 // warn if creds expire in 15 minutes
+#define cminRENEW 20 // renew creds when there are 20 minutes remaining
+#define cminMINLIFE 30 // minimum life of Kerberos creds
+
+#define c100ns1SECOND (LONGLONG)10000000
+#define cmsec1SECOND 1000
+#define cmsec1MINUTE 60000
+#define csec1MINUTE 60
+
+/* Function Pointer Declarations for Delayed Loading */
+// CCAPI
+DECL_FUNC_PTR(cc_initialize);
+DECL_FUNC_PTR(cc_shutdown);
+DECL_FUNC_PTR(cc_get_NC_info);
+DECL_FUNC_PTR(cc_free_NC_info);
+
+// leash functions
+DECL_FUNC_PTR(Leash_get_default_lifetime);
+DECL_FUNC_PTR(Leash_get_default_forwardable);
+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);
+DECL_FUNC_PTR(Leash_get_default_renew_max);
+DECL_FUNC_PTR(Leash_get_default_renewable);
+
+// krb5 functions
+DECL_FUNC_PTR(krb5_change_password);
+DECL_FUNC_PTR(krb5_get_init_creds_opt_init);
+DECL_FUNC_PTR(krb5_get_init_creds_opt_set_tkt_life);
+DECL_FUNC_PTR(krb5_get_init_creds_opt_set_renew_life);
+DECL_FUNC_PTR(krb5_get_init_creds_opt_set_forwardable);
+DECL_FUNC_PTR(krb5_get_init_creds_opt_set_proxiable);
+DECL_FUNC_PTR(krb5_get_init_creds_opt_set_address_list);
+DECL_FUNC_PTR(krb5_get_init_creds_password);
+DECL_FUNC_PTR(krb5_build_principal_ext);
+DECL_FUNC_PTR(krb5_cc_get_name);
+DECL_FUNC_PTR(krb5_cc_resolve);
+DECL_FUNC_PTR(krb5_cc_default);
+DECL_FUNC_PTR(krb5_cc_default_name);
+DECL_FUNC_PTR(krb5_cc_set_default_name);
+DECL_FUNC_PTR(krb5_cc_initialize);
+DECL_FUNC_PTR(krb5_cc_destroy);
+DECL_FUNC_PTR(krb5_cc_close);
+DECL_FUNC_PTR(krb5_cc_store_cred);
+DECL_FUNC_PTR(krb5_cc_copy_creds);
+DECL_FUNC_PTR(krb5_cc_retrieve_cred);
+DECL_FUNC_PTR(krb5_cc_get_principal);
+DECL_FUNC_PTR(krb5_cc_start_seq_get);
+DECL_FUNC_PTR(krb5_cc_next_cred);
+DECL_FUNC_PTR(krb5_cc_end_seq_get);
+DECL_FUNC_PTR(krb5_cc_remove_cred);
+DECL_FUNC_PTR(krb5_cc_set_flags);
+DECL_FUNC_PTR(krb5_cc_get_type);
+DECL_FUNC_PTR(krb5_free_context);
+DECL_FUNC_PTR(krb5_free_cred_contents);
+DECL_FUNC_PTR(krb5_free_principal);
+DECL_FUNC_PTR(krb5_get_in_tkt_with_password);
+DECL_FUNC_PTR(krb5_init_context);
+DECL_FUNC_PTR(krb5_parse_name);
+DECL_FUNC_PTR(krb5_timeofday);
+DECL_FUNC_PTR(krb5_timestamp_to_sfstring);
+DECL_FUNC_PTR(krb5_unparse_name);
+DECL_FUNC_PTR(krb5_get_credentials);
+DECL_FUNC_PTR(krb5_mk_req);
+DECL_FUNC_PTR(krb5_sname_to_principal);
+DECL_FUNC_PTR(krb5_get_credentials_renew);
+DECL_FUNC_PTR(krb5_free_data);
+DECL_FUNC_PTR(krb5_free_data_contents);
+DECL_FUNC_PTR(krb5_free_unparsed_name);
+DECL_FUNC_PTR(krb5_os_localaddr);
+DECL_FUNC_PTR(krb5_copy_keyblock_contents);
+DECL_FUNC_PTR(krb5_copy_data);
+DECL_FUNC_PTR(krb5_free_creds);
+DECL_FUNC_PTR(krb5_build_principal);
+DECL_FUNC_PTR(krb5_get_renewed_creds);
+DECL_FUNC_PTR(krb5_get_default_config_files);
+DECL_FUNC_PTR(krb5_free_config_files);
+DECL_FUNC_PTR(krb5_get_default_realm);
+DECL_FUNC_PTR(krb5_free_ticket);
+DECL_FUNC_PTR(krb5_decode_ticket);
+DECL_FUNC_PTR(krb5_get_host_realm);
+DECL_FUNC_PTR(krb5_free_host_realm);
+DECL_FUNC_PTR(krb5_free_addresses);
+DECL_FUNC_PTR(krb5_c_random_make_octets);
+
+// Krb524 functions
+DECL_FUNC_PTR(krb524_init_ets);
+DECL_FUNC_PTR(krb524_convert_creds_kdc);
+
+// krb4 functions
+DECL_FUNC_PTR(krb_get_cred);
+DECL_FUNC_PTR(tkt_string);
+DECL_FUNC_PTR(krb_get_tf_realm);
+DECL_FUNC_PTR(krb_mk_req);
+
+// ComErr functions
+DECL_FUNC_PTR(com_err);
+DECL_FUNC_PTR(error_message);
+
+// Profile functions
+DECL_FUNC_PTR(profile_init);
+DECL_FUNC_PTR(profile_release);
+DECL_FUNC_PTR(profile_get_subsection_names);
+DECL_FUNC_PTR(profile_free_list);
+DECL_FUNC_PTR(profile_get_string);
+DECL_FUNC_PTR(profile_release_string);
+
+// Service functions
+DECL_FUNC_PTR(OpenSCManagerA);
+DECL_FUNC_PTR(OpenServiceA);
+DECL_FUNC_PTR(QueryServiceStatus);
+DECL_FUNC_PTR(CloseServiceHandle);
+#ifdef USE_MS2MIT
+DECL_FUNC_PTR(LsaNtStatusToWinError);
+#endif /* USE_MS2MIT */
+
+#ifdef USE_MS2MIT
+// LSA Functions
+DECL_FUNC_PTR(LsaConnectUntrusted);
+DECL_FUNC_PTR(LsaLookupAuthenticationPackage);
+DECL_FUNC_PTR(LsaCallAuthenticationPackage);
+DECL_FUNC_PTR(LsaFreeReturnBuffer);
+DECL_FUNC_PTR(LsaGetLogonSessionData);
+#endif /* USE_MS2MIT */
+
+// AFS36 Token Functions
+DECL_FUNC_PTR(ktc_ListTokens);
+DECL_FUNC_PTR(ktc_GetToken);
+DECL_FUNC_PTR(ktc_SetToken);
+DECL_FUNC_PTR(ktc_ForgetAllTokens);
+
+// AFS36 Config Functions
+DECL_FUNC_PTR(cm_SearchCellFile);
+DECL_FUNC_PTR(cm_GetRootCellName);
+
+// CCAPI
+FUNC_INFO ccapi_fi[] = {
+ MAKE_FUNC_INFO(cc_initialize),
+ MAKE_FUNC_INFO(cc_shutdown),
+ MAKE_FUNC_INFO(cc_get_NC_info),
+ MAKE_FUNC_INFO(cc_free_NC_info),
+ END_FUNC_INFO
+};
+
+FUNC_INFO leash_fi[] = {
+ MAKE_FUNC_INFO(Leash_get_default_lifetime),
+ MAKE_FUNC_INFO(Leash_get_default_renew_till),
+ MAKE_FUNC_INFO(Leash_get_default_forwardable),
+ 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),
+ MAKE_FUNC_INFO(Leash_get_default_renew_max),
+ MAKE_FUNC_INFO(Leash_get_default_renewable),
+ END_FUNC_INFO
+};
+
+FUNC_INFO k5_fi[] = {
+ MAKE_FUNC_INFO(krb5_change_password),
+ MAKE_FUNC_INFO(krb5_get_init_creds_opt_init),
+ MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_tkt_life),
+ MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_renew_life),
+ MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_forwardable),
+ MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_proxiable),
+ MAKE_FUNC_INFO(krb5_get_init_creds_opt_set_address_list),
+ MAKE_FUNC_INFO(krb5_get_init_creds_password),
+ MAKE_FUNC_INFO(krb5_build_principal_ext),
+ MAKE_FUNC_INFO(krb5_cc_get_name),
+ MAKE_FUNC_INFO(krb5_cc_resolve),
+ MAKE_FUNC_INFO(krb5_cc_default),
+ MAKE_FUNC_INFO(krb5_cc_default_name),
+ MAKE_FUNC_INFO(krb5_cc_set_default_name),
+ MAKE_FUNC_INFO(krb5_cc_initialize),
+ MAKE_FUNC_INFO(krb5_cc_destroy),
+ MAKE_FUNC_INFO(krb5_cc_close),
+ MAKE_FUNC_INFO(krb5_cc_copy_creds),
+ MAKE_FUNC_INFO(krb5_cc_store_cred),
+ MAKE_FUNC_INFO(krb5_cc_retrieve_cred),
+ MAKE_FUNC_INFO(krb5_cc_get_principal),
+ MAKE_FUNC_INFO(krb5_cc_start_seq_get),
+ MAKE_FUNC_INFO(krb5_cc_next_cred),
+ MAKE_FUNC_INFO(krb5_cc_end_seq_get),
+ MAKE_FUNC_INFO(krb5_cc_remove_cred),
+ MAKE_FUNC_INFO(krb5_cc_set_flags),
+ MAKE_FUNC_INFO(krb5_cc_get_type),
+ MAKE_FUNC_INFO(krb5_free_context),
+ MAKE_FUNC_INFO(krb5_free_cred_contents),
+ MAKE_FUNC_INFO(krb5_free_principal),
+ MAKE_FUNC_INFO(krb5_get_in_tkt_with_password),
+ MAKE_FUNC_INFO(krb5_init_context),
+ MAKE_FUNC_INFO(krb5_parse_name),
+ MAKE_FUNC_INFO(krb5_timeofday),
+ MAKE_FUNC_INFO(krb5_timestamp_to_sfstring),
+ MAKE_FUNC_INFO(krb5_unparse_name),
+ MAKE_FUNC_INFO(krb5_get_credentials),
+ MAKE_FUNC_INFO(krb5_mk_req),
+ MAKE_FUNC_INFO(krb5_sname_to_principal),
+ MAKE_FUNC_INFO(krb5_get_credentials_renew),
+ MAKE_FUNC_INFO(krb5_free_data),
+ MAKE_FUNC_INFO(krb5_free_data_contents),
+ MAKE_FUNC_INFO(krb5_free_unparsed_name),
+ MAKE_FUNC_INFO(krb5_os_localaddr),
+ MAKE_FUNC_INFO(krb5_copy_keyblock_contents),
+ MAKE_FUNC_INFO(krb5_copy_data),
+ MAKE_FUNC_INFO(krb5_free_creds),
+ MAKE_FUNC_INFO(krb5_build_principal),
+ MAKE_FUNC_INFO(krb5_get_renewed_creds),
+ MAKE_FUNC_INFO(krb5_free_addresses),
+ MAKE_FUNC_INFO(krb5_get_default_config_files),
+ MAKE_FUNC_INFO(krb5_free_config_files),
+ MAKE_FUNC_INFO(krb5_get_default_realm),
+ MAKE_FUNC_INFO(krb5_free_ticket),
+ MAKE_FUNC_INFO(krb5_decode_ticket),
+ MAKE_FUNC_INFO(krb5_get_host_realm),
+ MAKE_FUNC_INFO(krb5_free_host_realm),
+ MAKE_FUNC_INFO(krb5_free_addresses),
+ MAKE_FUNC_INFO(krb5_c_random_make_octets),
+ END_FUNC_INFO
+};
+
+FUNC_INFO k4_fi[] = {
+ MAKE_FUNC_INFO(krb_get_cred),
+ MAKE_FUNC_INFO(krb_get_tf_realm),
+ MAKE_FUNC_INFO(krb_mk_req),
+ MAKE_FUNC_INFO(tkt_string),
+ END_FUNC_INFO
+};
+
+FUNC_INFO k524_fi[] = {
+ MAKE_FUNC_INFO(krb524_init_ets),
+ MAKE_FUNC_INFO(krb524_convert_creds_kdc),
+ END_FUNC_INFO
+};
+
+FUNC_INFO profile_fi[] = {
+ MAKE_FUNC_INFO(profile_init),
+ MAKE_FUNC_INFO(profile_release),
+ MAKE_FUNC_INFO(profile_get_subsection_names),
+ MAKE_FUNC_INFO(profile_free_list),
+ MAKE_FUNC_INFO(profile_get_string),
+ MAKE_FUNC_INFO(profile_release_string),
+ END_FUNC_INFO
+};
+
+FUNC_INFO ce_fi[] = {
+ MAKE_FUNC_INFO(com_err),
+ MAKE_FUNC_INFO(error_message),
+ END_FUNC_INFO
+};
+
+FUNC_INFO service_fi[] = {
+ MAKE_FUNC_INFO(OpenSCManagerA),
+ MAKE_FUNC_INFO(OpenServiceA),
+ MAKE_FUNC_INFO(QueryServiceStatus),
+ MAKE_FUNC_INFO(CloseServiceHandle),
+#ifdef USE_MS2MIT
+ MAKE_FUNC_INFO(LsaNtStatusToWinError),
+#endif /* USE_MS2MIT */
+ END_FUNC_INFO
+};
+
+#ifdef USE_MS2MIT
+FUNC_INFO lsa_fi[] = {
+ MAKE_FUNC_INFO(LsaConnectUntrusted),
+ MAKE_FUNC_INFO(LsaLookupAuthenticationPackage),
+ MAKE_FUNC_INFO(LsaCallAuthenticationPackage),
+ MAKE_FUNC_INFO(LsaFreeReturnBuffer),
+ MAKE_FUNC_INFO(LsaGetLogonSessionData),
+ END_FUNC_INFO
+};
+#endif /* USE_MS2MIT */
+
+FUNC_INFO afst_fi[] = {
+ MAKE_FUNC_INFO(ktc_ListTokens),
+ MAKE_FUNC_INFO(ktc_GetToken),
+ MAKE_FUNC_INFO(ktc_SetToken),
+ MAKE_FUNC_INFO(ktc_ForgetAllTokens),
+ END_FUNC_INFO
+};
+
+FUNC_INFO afsc_fi[] = {
+ MAKE_FUNC_INFO(cm_SearchCellFile),
+ MAKE_FUNC_INFO(cm_GetRootCellName),
+ END_FUNC_INFO
+};
+
+/* Static Prototypes */
+static char *afs_realm_of_cell(afsconf_cell *);
+static long get_cellconfig_callback(void *, struct sockaddr_in *, char *);
+static int get_cellconfig(char *, afsconf_cell *, char *);
+static krb5_error_code KRB5_CALLCONV KRB5_prompter( krb5_context context,
+ void *data, const char *name, const char *banner, int num_prompts,
+ krb5_prompt prompts[]);
+
+
+/* Static Declarations */
+static int inited = 0;
+static int mid_cnt = 0;
+static struct textField * mid_tb = NULL;
+static HINSTANCE hKrb5 = 0;
+static HINSTANCE hKrb4 = 0;
+static HINSTANCE hKrb524 = 0;
+#ifdef USE_MS2MIT
+static HINSTANCE hSecur32 = 0;
+#endif /* USE_MS2MIT */
+static HINSTANCE hAdvApi32 = 0;
+static HINSTANCE hAfsTokens = 0;
+static HINSTANCE hAfsConf = 0;
+static HINSTANCE hComErr = 0;
+static HINSTANCE hService = 0;
+static HINSTANCE hProfile = 0;
+static HINSTANCE hLeash = 0;
+static HINSTANCE hCCAPI = 0;
+static struct principal_ccache_data * princ_cc_data = NULL;
+static struct cell_principal_map * cell_princ_map = NULL;
+
+void
+KFW_initialize(void)
+{
+ static int inited = 0;
+ if ( !inited ) {
+ inited = 1;
+ LoadFuncs(KRB5_DLL, k5_fi, &hKrb5, 0, 1, 0, 0);
+ LoadFuncs(KRB4_DLL, k4_fi, &hKrb5, 0, 1, 0, 0);
+ LoadFuncs(COMERR_DLL, ce_fi, &hComErr, 0, 0, 1, 0);
+ LoadFuncs(SERVICE_DLL, service_fi, &hService, 0, 1, 0, 0);
+#ifdef USE_MS2MIT
+ LoadFuncs(SECUR32_DLL, lsa_fi, &hSecur32, 0, 1, 1, 1);
+#endif /* USE_MS2MIT */
+ LoadFuncs(KRB524_DLL, k524_fi, &hKrb524, 0, 1, 1, 1);
+ LoadFuncs(PROFILE_DLL, profile_fi, &hProfile, 0, 1, 0, 0);
+ LoadFuncs(AFSTOKENS_DLL, afst_fi, &hAfsTokens, 0, 1, 0, 0);
+ LoadFuncs(AFSCONF_DLL, afsc_fi, &hAfsConf, 0, 1, 0, 0);
+ LoadFuncs(LEASH_DLL, leash_fi, &hLeash, 0, 1, 0, 0);
+ LoadFuncs(CCAPI_DLL, ccapi_fi, &hCCAPI, 0, 1, 0, 0);
+
+ if ( KFW_is_available() ) {
+ char rootcell[MAXCELLCHARS+1];
+#ifdef USE_MS2MIT
+ KFW_import_windows_lsa();
+#endif /* USE_MS2MIT */
+ KFW_import_ccache_data();
+ KFW_AFS_renew_expiring_credentials();
+
+ /* WIN32 NOTE: no way to get max chars */
+ if (!pcm_GetRootCellName(rootcell))
+ KFW_AFS_renew_token_for_cell(rootcell);
+ }
+ }
+}
+
+void
+KFW_cleanup(void)
+{
+ if (hKrb5)
+ FreeLibrary(hKrb5);
+ if (hKrb4)
+ FreeLibrary(hKrb4);
+ if (hProfile)
+ FreeLibrary(hProfile);
+ if (hAfsTokens)
+ FreeLibrary(hAfsTokens);
+ if (hAfsConf)
+ FreeLibrary(hAfsConf);
+ if (hComErr)
+ FreeLibrary(hComErr);
+ if (hService)
+ FreeLibrary(hService);
+#ifdef USE_MS2MIT
+ if (hSecur32)
+ FreeLibrary(hSecur32);
+#endif /* USE_MS2MIT */
+ if (hKrb524)
+ FreeLibrary(hKrb524);
+ if (hLeash)
+ FreeLibrary(hLeash);
+ if (hCCAPI)
+ FreeLibrary(hCCAPI);
+}
+
+int
+KFW_is_available(void)
+{
+ KFW_initialize();
+ if ( hKrb5 && hComErr && hService &&
+#ifdef USE_MS2MIT
+ hSecur32 &&
+#endif /* USE_MS2MIT */
+ hKrb524 &&
+ hProfile && hAfsTokens && hAfsConf )
+ return TRUE;
+ return FALSE;
+}
+
+int
+KRB5_error(krb5_error_code rc, LPCSTR FailedFunctionName,
+ int FreeContextFlag, krb5_context * ctx,
+ krb5_ccache * cache)
+{
+ char message[256];
+ const char *errText;
+ int krb5Error = ((int)(rc & 255));
+
+ /*
+ switch (krb5Error)
+ {
+ // Wrong password
+ case 31:
+ case 8:
+ return;
+ }
+ */
+
+ errText = perror_message(rc);
+ _snprintf(message, sizeof(message),
+ "%s\n(Kerberos error %ld)\n\n%s failed",
+ errText,
+ krb5Error,
+ FailedFunctionName);
+
+ if ( IsDebuggerPresent() )
+ OutputDebugString(message);
+
+ MessageBox(NULL, message, "Kerberos Five", MB_OK | MB_ICONERROR |
+ MB_TASKMODAL |
+ MB_SETFOREGROUND);
+ if (FreeContextFlag == 1)
+ {
+ if (ctx && *ctx != NULL)
+ {
+ if (cache && *cache != NULL) {
+ pkrb5_cc_close(*ctx, *cache);
+ *cache = NULL;
+ }
+
+ pkrb5_free_context(*ctx);
+ *ctx = NULL;
+ }
+ }
+
+ return rc;
+}
+
+void
+KFW_AFS_update_princ_ccache_data(krb5_context ctx, krb5_ccache cc, int lsa)
+{
+ struct principal_ccache_data * next = princ_cc_data;
+ krb5_principal principal = 0;
+ char * pname = NULL;
+ const char * ccname = NULL;
+ krb5_error_code code = 0;
+ krb5_error_code cc_code = 0;
+ krb5_cc_cursor cur;
+ krb5_creds creds;
+ krb5_flags flags=0;
+ krb5_timestamp now;
+
+ if (ctx == 0 || cc == 0)
+ return;
+
+ code = pkrb5_cc_get_principal(ctx, cc, &principal);
+ if ( code ) return;
+
+ code = pkrb5_unparse_name(ctx, principal, &pname);
+ if ( code ) goto cleanup;
+
+ ccname = pkrb5_cc_get_name(ctx, cc);
+ if (!ccname) goto cleanup;
+
+ // Search the existing list to see if we have a match
+ if ( next ) {
+ for ( ; next ; next = next->next ) {
+ if ( !strcmp(next->principal,pname) && !strcmp(next->ccache_name, ccname) )
+ break;
+ }
+ }
+
+ // If not, match add a new node to the beginning of the list and assign init it
+ if ( !next ) {
+ next = (struct principal_ccache_data *) malloc(sizeof(struct principal_ccache_data));
+ next->next = princ_cc_data;
+ princ_cc_data = next;
+ next->principal = _strdup(pname);
+ next->ccache_name = _strdup(ccname);
+ next->from_lsa = lsa;
+ next->expired = 1;
+ next->expiration_time = 0;
+ next->renew = 0;
+ }
+
+ flags = 0; // turn off OPENCLOSE mode
+ code = pkrb5_cc_set_flags(ctx, cc, flags);
+ if ( code ) goto cleanup;
+
+ code = pkrb5_timeofday(ctx, &now);
+
+ cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur);
+
+ while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) {
+ if ( creds.ticket_flags & TKT_FLG_INITIAL ) {
+ int valid;
+ // we found the ticket we are looking for
+ // check validity of timestamp
+ // We add a 5 minutes fudge factor to compensate for potential
+ // clock skew errors between the KDC and client OS
+
+ valid = ((creds.times.starttime > 0) &&
+ now >= (creds.times.starttime - 300) &&
+ now < (creds.times.endtime + 300) &&
+ !(creds.ticket_flags & TKT_FLG_INVALID));
+
+ if ( next->from_lsa) {
+ next->expired = 0;
+ next->expiration_time = creds.times.endtime;
+ next->renew = 1;
+ } else if ( valid ) {
+ next->expired = 0;
+ next->expiration_time = creds.times.endtime;
+ next->renew = (creds.times.renew_till > creds.times.endtime) &&
+ (creds.ticket_flags & TKT_FLG_RENEWABLE);
+ } else {
+ next->expired = 1;
+ next->expiration_time = 0;
+ next->renew = 0;
+ }
+
+ pkrb5_free_cred_contents(ctx, &creds);
+ cc_code = KRB5_CC_END;
+ break;
+ }
+ pkrb5_free_cred_contents(ctx, &creds);
+ }
+
+ if (cc_code == KRB5_CC_END) {
+ code = pkrb5_cc_end_seq_get(ctx, cc, &cur);
+ if (code) goto cleanup;
+ }
+
+ cleanup:
+ flags = KRB5_TC_OPENCLOSE; //turn on OPENCLOSE
+ code = pkrb5_cc_set_flags(ctx, cc, flags);
+
+ if ( pname )
+ pkrb5_free_unparsed_name(ctx,pname);
+ if ( principal )
+ pkrb5_free_principal(ctx,principal);
+}
+
+int
+KFW_AFS_find_ccache_for_principal(krb5_context ctx, char * principal, char **ccache, int valid_only)
+{
+ struct principal_ccache_data * next = princ_cc_data;
+ char * response = NULL;
+
+ if ( !principal || !ccache )
+ return 0;
+
+ while ( next ) {
+ if ( (!valid_only || !next->expired) && !strcmp(next->principal,principal) ) {
+ if (response) {
+ // we always want to prefer the MS Kerberos LSA cache or
+ // the cache afscreds created specifically for the principal
+ // if the current entry is either one, drop the previous find
+ if ( next->from_lsa || !strcmp(next->ccache_name,principal) )
+ free(response);
+ }
+ response = _strdup(next->ccache_name);
+ // MS Kerberos LSA is our best option so use it and quit
+ if ( next->from_lsa )
+ break;
+ }
+ next = next->next;
+ }
+
+ if ( response ) {
+ *ccache = response;
+ return 1;
+ }
+ return 0;
+}
+
+void
+KFW_AFS_delete_princ_ccache_data(krb5_context ctx, char * pname, char * ccname)
+{
+ struct principal_ccache_data ** next = &princ_cc_data;
+
+ if ( !pname && !ccname )
+ return;
+
+ while ( (*next) ) {
+ if ( !strcmp((*next)->principal,pname) ||
+ !strcmp((*next)->ccache_name,ccname) ) {
+ void * temp;
+ free((*next)->principal);
+ free((*next)->ccache_name);
+ temp = (*next);
+ (*next) = (*next)->next;
+ free(temp);
+ }
+ }
+}
+
+void
+KFW_AFS_update_cell_princ_map(krb5_context ctx, char * cell, char *pname, int active)
+{
+ struct cell_principal_map * next = cell_princ_map;
+
+ // Search the existing list to see if we have a match
+ if ( next ) {
+ for ( ; next ; next = next->next ) {
+ if ( !strcmp(next->cell, cell) ) {
+ if ( !strcmp(next->principal,pname) ) {
+ next->active = active;
+ break;
+ } else {
+ // OpenAFS currently has a restriction of one active token per cell
+ // Therefore, whenever we update the table with a new active cell we
+ // must mark all of the other principal to cell entries as inactive.
+ if (active)
+ next->active = 0;
+ }
+ }
+ }
+ }
+
+ // If not, match add a new node to the beginning of the list and assign init it
+ if ( !next ) {
+ next = (struct cell_principal_map *) malloc(sizeof(struct cell_principal_map));
+ next->next = cell_princ_map;
+ cell_princ_map = next;
+ next->principal = _strdup(pname);
+ next->cell = _strdup(cell);
+ next->active = active;
+ }
+}
+
+void
+KFW_AFS_delete_cell_princ_maps(krb5_context ctx, char * pname, char * cell)
+{
+ struct cell_principal_map ** next = &cell_princ_map;
+
+ if ( !pname && !cell )
+ return;
+
+ while ( (*next) ) {
+ if ( !strcmp((*next)->principal,pname) ||
+ !strcmp((*next)->cell,cell) ) {
+ void * temp;
+ free((*next)->principal);
+ free((*next)->cell);
+ temp = (*next);
+ (*next) = (*next)->next;
+ free(temp);
+ }
+ }
+}
+
+// Returns (if possible) a principal which has been known in
+// the past to have been used to obtain tokens for the specified
+// cell.
+// TODO: Attempt to return one which has not yet expired by checking
+// the principal/ccache data
+int
+KFW_AFS_find_principals_for_cell(krb5_context ctx, char * cell, char **principals[], int active_only)
+{
+ struct cell_principal_map * next_map = cell_princ_map;
+ const char * princ = NULL;
+ int count = 0, i;
+
+ if ( !cell )
+ return 0;
+
+ while ( next_map ) {
+ if ( (!active_only || next_map->active) && !strcmp(next_map->cell,cell) ) {
+ count++;
+ }
+ next_map = next_map->next;
+ }
+
+ if ( !principals )
+ return count;
+
+ *principals = (char **) malloc(sizeof(char *) * count);
+ for ( next_map = cell_princ_map, i=0 ; next_map && i<count; next_map = next_map->next )
+ {
+ if ( (!active_only || next_map->active) && !strcmp(next_map->cell,cell) ) {
+ (*principals)[i++] = _strdup(next_map->principal);
+ }
+ }
+ return count;
+}
+
+int
+KFW_AFS_find_cells_for_princ(krb5_context ctx, char * pname, char **cells[], int active_only)
+{
+ int count = 0, i;
+ struct cell_principal_map * next_map = cell_princ_map;
+ const char * princ = NULL;
+
+ if ( !pname )
+ return 0;
+
+ while ( next_map ) {
+ if ( (!active_only || next_map->active) && !strcmp(next_map->principal,pname) ) {
+ count++;
+ }
+ next_map = next_map->next;
+ }
+
+ if ( !cells )
+ return count;
+
+ *cells = (char **) malloc(sizeof(char *) * count);
+ for ( next_map = cell_princ_map, i=0 ; next_map && i<count; next_map = next_map->next )
+ {
+ if ( (!active_only || next_map->active) && !strcmp(next_map->principal,pname) ) {
+ (*cells)[i++] = _strdup(next_map->cell);
+ }
+ }
+ return count;
+}
+
+/* Given a principal return an existing ccache or create one and return */
+int
+KFW_get_ccache(krb5_context alt_ctx, krb5_principal principal, krb5_ccache * cc)
+{
+ krb5_context ctx;
+ char * pname = 0;
+ char * ccname = 0;
+ krb5_error_code code;
+
+ if ( alt_ctx ) {
+ ctx = alt_ctx;
+ } else {
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+ }
+
+ if ( principal ) {
+ code = pkrb5_unparse_name(ctx, principal, &pname);
+ if (code) goto cleanup;
+
+ if ( !KFW_AFS_find_ccache_for_principal(ctx,pname,&ccname,TRUE) &&
+ !KFW_AFS_find_ccache_for_principal(ctx,pname,&ccname,FALSE)) {
+ ccname = (char *)malloc(strlen(pname) + 5);
+ sprintf(ccname,"API:%s",pname);
+ }
+ code = pkrb5_cc_resolve(ctx, ccname, cc);
+ } else {
+ code = pkrb5_cc_default(ctx, cc);
+ if (code) goto cleanup;
+ }
+
+ cleanup:
+ if (ccname)
+ free(ccname);
+ if (pname)
+ pkrb5_free_unparsed_name(ctx,pname);
+ if (ctx && (ctx != alt_ctx))
+ pkrb5_free_context(ctx);
+ return(code);
+}
+
+#ifdef USE_MS2MIT
+// Import Microsoft Credentials into a new MIT ccache
+void
+KFW_import_windows_lsa(void)
+{
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ krb5_principal princ = 0;
+ char * pname = NULL;
+ krb5_data * realm;
+ krb5_error_code code;
+ char cell[128]="";
+ int i;
+
+ if ( !MSLSA_IsKerberosLogon() )
+ return;
+
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+
+ code = pkrb5_cc_resolve(ctx, LSA_CCNAME, &cc);
+ if (code) goto cleanup;
+
+ KFW_AFS_update_princ_ccache_data(ctx, cc, TRUE);
+
+ code = pkrb5_cc_get_principal(ctx, cc, &princ);
+ if ( code ) goto cleanup;
+
+ code = pkrb5_unparse_name(ctx,princ,&pname);
+ if ( code ) goto cleanup;
+
+ realm = krb5_princ_realm(ctx, princ);
+ for ( i=0; i<realm->length; i++ ) {
+ cell[i] = tolower(realm->data[i]);
+ }
+ cell[i] = '\0';
+
+ code = KFW_AFS_klog(ctx, cc, "afs", cell, realm->data, pLeash_get_default_lifetime());
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ if ( code ) goto cleanup;
+
+ KFW_AFS_update_cell_princ_map(ctx, cell, pname, TRUE);
+
+ cleanup:
+ if (pname)
+ pkrb5_free_unparsed_name(ctx,pname);
+ if (princ)
+ pkrb5_free_principal(ctx,princ);
+ if (cc)
+ pkrb5_cc_close(ctx,cc);
+ if (ctx)
+ pkrb5_free_context(ctx);
+}
+#endif /* USE_MS2MIT */
+
+// If there are existing MIT credentials, copy them to a new
+// ccache named after the principal
+
+// Enumerate all existing MIT ccaches and construct entries
+// in the principal_ccache table
+
+// Enumerate all existing AFS Tokens and construct entries
+// in the cell_principal table
+void
+KFW_import_ccache_data(void)
+{
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ krb5_principal principal = 0;
+ krb5_creds creds;
+ krb5_error_code code;
+ krb5_error_code cc_code;
+ krb5_cc_cursor cur;
+ apiCB * cc_ctx = 0;
+ struct _infoNC ** pNCi = NULL;
+ int i, j, flags;
+
+ if ( !pcc_initialize )
+ return;
+
+ if ( IsDebuggerPresent() )
+ OutputDebugString("KFW_import_ccache_data()\n");
+
+ code = pcc_initialize(&cc_ctx, CC_API_VER_2, NULL, NULL);
+ if (code) goto cleanup;
+
+ code = pcc_get_NC_info(cc_ctx, &pNCi);
+ if (code) goto cleanup;
+
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+
+ for ( i=0; pNCi[i]; i++ ) {
+ if ( pNCi[i]->vers != CC_CRED_V5 )
+ continue;
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Principal: ");
+ OutputDebugString(pNCi[i]->principal);
+ OutputDebugString(" in ccache ");
+ OutputDebugString(pNCi[i]->name);
+ OutputDebugString("\n");
+ }
+ if ( strcmp(pNCi[i]->name,pNCi[i]->principal)
+ && strcmp(pNCi[i]->name,LSA_CCNAME)
+ ) {
+ int found = 0;
+ krb5_ccache oldcc = 0;
+ for ( j=0; pNCi[j]; j++ ) {
+ if (!strcmp(pNCi[j]->name,pNCi[i]->principal)) {
+ found = 1;
+ break;
+ }
+ }
+ if (found)
+ continue;
+
+ if ( IsDebuggerPresent() )
+ OutputDebugString("copying ccache data to new ccache\n");
+
+ code = pkrb5_cc_resolve(ctx, pNCi[i]->principal, &cc);
+ if (code) goto loop_cleanup;
+ code = pkrb5_parse_name(ctx, pNCi[i]->principal, &principal);
+ if (code) goto loop_cleanup;
+ code = pkrb5_cc_initialize(ctx, cc, principal);
+ if (code) goto loop_cleanup;
+ code = pkrb5_cc_resolve(ctx, pNCi[i]->name, &oldcc);
+ if (code) goto loop_cleanup;
+ code = pkrb5_cc_copy_creds(ctx,oldcc,cc);
+ if (code) {
+ code = pkrb5_cc_close(ctx,cc);
+ cc = 0;
+ code = pkrb5_cc_close(ctx,oldcc);
+ cc = 0;
+ KRB5_error(code, "krb5_cc_copy_creds", 0, NULL, NULL);
+ continue;
+ }
+ code = pkrb5_cc_close(ctx,oldcc);
+ } else {
+ code = pkrb5_cc_resolve(ctx, pNCi[i]->name, &cc);
+ if (code) goto loop_cleanup;
+ }
+
+ flags = 0; // turn off OPENCLOSE mode
+ code = pkrb5_cc_set_flags(ctx, cc, flags);
+ if ( code ) goto cleanup;
+
+ KFW_AFS_update_princ_ccache_data(ctx, cc, !strcmp(pNCi[i]->name,LSA_CCNAME));
+
+ cc_code = pkrb5_cc_start_seq_get(ctx, cc, &cur);
+
+ while (!(cc_code = pkrb5_cc_next_cred(ctx, cc, &cur, &creds))) {
+ krb5_data * sname = krb5_princ_name(ctx, creds.server);
+ krb5_data * cell = krb5_princ_component(ctx, creds.server, 1);
+ krb5_data * realm = krb5_princ_realm(ctx, creds.server);
+ if ( sname && cell && !strcmp("afs",sname->data) ) {
+ struct ktc_principal aserver;
+ struct ktc_principal aclient;
+ struct ktc_token atoken;
+ int active = TRUE;
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Found AFS ticket: ");
+ OutputDebugString(sname->data);
+ if ( cell->data ) {
+ OutputDebugString("/");
+ OutputDebugString(cell->data);
+ }
+ OutputDebugString("@");
+ OutputDebugString(realm->data);
+ OutputDebugString("\n");
+ }
+
+ memset(&aserver, '\0', sizeof(aserver));
+ strcpy(aserver.name, sname->data);
+ strcpy(aserver.cell, cell->data);
+
+ code = pktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient);
+ if (!code) {
+ // Found a token in AFS Client Server which matches
+ char pname[128], *p, *q;
+ for ( p=pname, q=aclient.name; *q; p++, q++)
+ *p = *q;
+ for ( *p++ = '@', q=aclient.cell; *q; p++, q++)
+ *p = toupper(*q);
+ *p = '\0';
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Found AFS token: ");
+ OutputDebugString(pname);
+ OutputDebugString("\n");
+ }
+
+ if ( strcmp(pname,pNCi[i]->principal) )
+ active = FALSE;
+ KFW_AFS_update_cell_princ_map(ctx, cell->data, pNCi[i]->principal, active);
+ } else {
+ // Attempt to import it
+ KFW_AFS_update_cell_princ_map(ctx, cell->data, pNCi[i]->principal, active);
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Calling KFW_AFS_klog() to obtain token\n");
+ }
+
+ code = KFW_AFS_klog(ctx, cc, "afs", cell->data, realm->data, pLeash_get_default_lifetime());
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ }
+ } else if ( IsDebuggerPresent() ) {
+ OutputDebugString("Found ticket: ");
+ OutputDebugString(sname->data);
+ if ( cell && cell->data ) {
+ OutputDebugString("/");
+ OutputDebugString(cell->data);
+ }
+ OutputDebugString("@");
+ OutputDebugString(realm->data);
+ OutputDebugString("\n");
+ }
+ pkrb5_free_cred_contents(ctx, &creds);
+ }
+
+ if (cc_code == KRB5_CC_END) {
+ cc_code = pkrb5_cc_end_seq_get(ctx, cc, &cur);
+ if (cc_code) goto loop_cleanup;
+ }
+
+ loop_cleanup:
+ flags = KRB5_TC_OPENCLOSE; //turn on OPENCLOSE
+ code = pkrb5_cc_set_flags(ctx, cc, flags);
+ if (cc) {
+ pkrb5_cc_close(ctx,cc);
+ cc = 0;
+ }
+ }
+
+ cleanup:
+ if (principal)
+ pkrb5_free_principal(ctx,principal);
+ if (ctx)
+ pkrb5_free_context(ctx);
+ if (pNCi)
+ pcc_free_NC_info(cc_ctx, &pNCi);
+ if (cc_ctx)
+ pcc_shutdown(&cc_ctx);
+}
+
+
+int
+KFW_AFS_get_cred(char * username,
+ char * instance,
+ char * cell,
+ char * password,
+ int lifetime,
+ char ** reasonP )
+{
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ char * realm = 0;
+ char ** realmlist = 0;
+ krb5_principal principal = 0;
+ char * pname = 0;
+ krb5_error_code code;
+ char local_cell[MAXCELLCHARS+1];
+ char **cells = NULL;
+ int cell_count=0;
+ afsconf_cell cellconfig;
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("KFW_AFS_get_cred for token ");
+ OutputDebugString(username);
+ if ( instance ) {
+ OutputDebugString("/");
+ OutputDebugString(instance);
+ }
+ OutputDebugString("@");
+ OutputDebugString(cell);
+ OutputDebugString("\n");
+ }
+
+ code = pkrb5_init_context(&ctx);
+ if ( code ) goto cleanup;
+
+ code = get_cellconfig( cell, (void*)&cellconfig, local_cell);
+ if ( code ) goto cleanup;
+
+ realm = afs_realm_of_cell(&cellconfig); // do not free
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Realm: ");
+ OutputDebugString(realm);
+ OutputDebugString("\n");
+ }
+
+ code = pkrb5_build_principal(ctx, &principal, strlen(realm),
+ realm, username,
+ (instance && instance[0]) ? instance : NULL,
+ NULL);
+
+ code = KFW_get_ccache(ctx, principal, &cc);
+ if ( code ) goto cleanup;
+
+ code = pkrb5_unparse_name(ctx, principal, &pname);
+ if ( code ) goto cleanup;
+
+ if ( lifetime == 0 )
+ lifetime = pLeash_get_default_lifetime();
+
+ code = KFW_kinit(ctx, cc, HWND_DESKTOP,
+ pname,
+ password,
+ lifetime,
+ pLeash_get_default_forwardable(),
+ pLeash_get_default_proxiable(),
+ pLeash_get_default_renewable() ? pLeash_get_default_renew_till() : 0,
+ pLeash_get_default_noaddresses(),
+ pLeash_get_default_publicip());
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_kinit() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ if ( code ) goto cleanup;
+
+ KFW_AFS_update_princ_ccache_data(ctx, cc, FALSE);
+
+ code = KFW_AFS_klog(ctx, cc, "afs", cell, realm, lifetime);
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ if ( code ) goto cleanup;
+
+ KFW_AFS_update_cell_princ_map(ctx, cell, pname, TRUE);
+
+ // Attempt to obtain new tokens for other cells supported by the same
+ // principal
+ cell_count = KFW_AFS_find_cells_for_princ(ctx, pname, &cells, TRUE);
+ if ( cell_count > 1 ) {
+ while ( cell_count-- ) {
+ if ( strcmp(cells[cell_count],cell) ) {
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"found another cell for the same principal: %s\n",cell);
+ OutputDebugString(message);
+ }
+ code = get_cellconfig( cells[cell_count], (void*)&cellconfig, local_cell);
+ if ( code ) continue;
+
+ realm = afs_realm_of_cell(&cellconfig); // do not free
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Realm: ");
+ OutputDebugString(realm);
+ OutputDebugString("\n");
+ }
+
+ code = KFW_AFS_klog(ctx, cc, "afs", cells[cell_count], realm, lifetime);
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ }
+ free(cells[cell_count]);
+ }
+ free(cells);
+ } else if ( cell_count == 1 ) {
+ free(cells[0]);
+ free(cells);
+ }
+
+ cleanup:
+ if ( pname )
+ pkrb5_free_unparsed_name(ctx,pname);
+ if ( cc )
+ pkrb5_cc_close(ctx, cc);
+
+ if ( code && reasonP ) {
+ *reasonP = (char *)perror_message(code);
+ }
+ return(code);
+}
+
+int
+KFW_AFS_destroy_tickets_for_cell(char * cell)
+{
+ krb5_context ctx = 0;
+ krb5_error_code code;
+ int count;
+ char ** principals = NULL;
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("KFW_AFS_destroy_ticets_for_cell: ");
+ OutputDebugString(cell);
+ OutputDebugString("\n");
+ }
+
+ code = pkrb5_init_context(&ctx);
+ if (code) ctx = 0;
+
+ count = KFW_AFS_find_principals_for_cell(ctx, cell, &principals, FALSE);
+ if ( count > 0 ) {
+ krb5_principal princ = 0;
+ krb5_ccache cc = 0;
+
+ while ( count-- ) {
+ int cell_count = KFW_AFS_find_cells_for_princ(ctx, principals[count], NULL, TRUE);
+ if ( cell_count > 1 ) {
+ // TODO - What we really should do here is verify whether or not any of the
+ // other cells which use this principal to obtain its credentials actually
+ // have valid tokens or not. If they are currently using these credentials
+ // we will skip them. For the time being we assume that if there is an active
+ // map in the table that they are actively being used.
+ goto loop_cleanup;
+ }
+
+ code = pkrb5_parse_name(ctx, principals[count], &princ);
+ if (code) goto loop_cleanup;
+
+ code = KFW_get_ccache(ctx, princ, &cc);
+ if (code) goto loop_cleanup;
+
+ code = pkrb5_cc_destroy(ctx, cc);
+ if (!code) cc = 0;
+
+ loop_cleanup:
+ if ( cc ) {
+ pkrb5_cc_close(ctx, cc);
+ cc = 0;
+ }
+ if ( princ ) {
+ pkrb5_free_principal(ctx, princ);
+ princ = 0;
+ }
+
+ KFW_AFS_update_cell_princ_map(ctx, cell, principals[count], FALSE);
+ free(principals[count]);
+ }
+ free(principals);
+ }
+ pkrb5_free_context(ctx);
+ return 0;
+}
+
+int
+KFW_AFS_renew_expiring_credentials(void)
+{
+ krb5_error_code code = 0;
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ krb5_timestamp now;
+ struct principal_ccache_data * pcc_next = princ_cc_data;
+ int cell_count;
+ char ** cells=NULL;
+ const char * realm = NULL;
+ char local_cell[MAXCELLCHARS+1]="";
+ afsconf_cell cellconfig;
+
+ if ( pcc_next == NULL ) // nothing to do
+ return 0;
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("KFW_AFS_renew_expiring_credentials\n");
+ }
+
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+
+ code = pkrb5_timeofday(ctx, &now);
+ if (code) goto cleanup;
+
+ for ( ; pcc_next ; pcc_next = pcc_next->next ) {
+ if ( pcc_next->expired )
+ continue;
+
+ if ( now >= (pcc_next->expiration_time) ) {
+ if ( !pcc_next->from_lsa ) {
+ pcc_next->expired = 1;
+ continue;
+ }
+ }
+
+ if ( pcc_next->renew && now >= (pcc_next->expiration_time - cminRENEW * csec1MINUTE) ) {
+ code = pkrb5_cc_resolve(ctx, pcc_next->ccache_name, &cc);
+ if ( code )
+ goto loop_cleanup;
+ code = KFW_renew(ctx,cc);
+#ifdef USE_MS2MIT
+ if ( code && pcc_next->from_lsa)
+ goto loop_cleanup;
+#endif /* USE_MS2MIT */
+
+
+ KFW_AFS_update_princ_ccache_data(ctx, cc, pcc_next->from_lsa);
+ if (code) goto loop_cleanup;
+
+ // Attempt to obtain new tokens for other cells supported by the same
+ // principal
+ cell_count = KFW_AFS_find_cells_for_princ(ctx, pcc_next->principal, &cells, TRUE);
+ if ( cell_count > 0 ) {
+ while ( cell_count-- ) {
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Cell: ");
+ OutputDebugString(cells[cell_count]);
+ OutputDebugString("\n");
+ }
+ code = get_cellconfig( cells[cell_count], (void*)&cellconfig, local_cell);
+ if ( code ) continue;
+ realm = afs_realm_of_cell(&cellconfig); // do not free
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Realm: ");
+ OutputDebugString(realm);
+ OutputDebugString("\n");
+ }
+ code = KFW_AFS_klog(ctx, cc, "afs", cells[cell_count], (char *)realm, pLeash_get_default_lifetime());
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ free(cells[cell_count]);
+ }
+ free(cells);
+ }
+ }
+
+ loop_cleanup:
+ if ( cc ) {
+ pkrb5_cc_close(ctx,cc);
+ cc = 0;
+ }
+ }
+
+ cleanup:
+ if ( cc )
+ pkrb5_cc_close(ctx,cc);
+ if ( ctx )
+ pkrb5_free_context(ctx);
+
+ return 0;
+}
+
+
+BOOL
+KFW_AFS_renew_token_for_cell(char * cell)
+{
+ krb5_error_code code = 0;
+ krb5_context ctx = 0;
+ int count;
+ char ** principals = NULL;
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("KFW_AFS_renew_token_for_cell:");
+ OutputDebugString(cell);
+ OutputDebugString("\n");
+ }
+
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+
+ count = KFW_AFS_find_principals_for_cell(ctx, cell, &principals, TRUE);
+ if ( count > 0 ) {
+ krb5_principal princ = 0;
+ krb5_principal service = 0;
+ krb5_creds mcreds, creds;
+ krb5_ccache cc = 0;
+ const char * realm = NULL;
+ afsconf_cell cellconfig;
+ char local_cell[MAXCELLCHARS+1];
+
+ while ( count-- ) {
+ code = pkrb5_parse_name(ctx, principals[count], &princ);
+ if (code) goto loop_cleanup;
+
+ code = KFW_get_ccache(ctx, princ, &cc);
+ if (code) goto loop_cleanup;
+
+ code = get_cellconfig( cell, (void*)&cellconfig, local_cell);
+ if ( code ) goto loop_cleanup;
+
+ realm = afs_realm_of_cell(&cellconfig); // do not free
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString("Realm: ");
+ OutputDebugString(realm);
+ OutputDebugString("\n");
+ }
+
+ code = pkrb5_build_principal(ctx, &service, strlen(realm),
+ realm, "afs", cell, NULL);
+ if (!code) {
+ memset(&mcreds, 0, sizeof(krb5_creds));
+ mcreds.client = princ;
+ mcreds.server = service;
+
+ code = pkrb5_cc_retrieve_cred(ctx, cc, 0, &mcreds, &creds);
+ if (!code) {
+ if ( IsDebuggerPresent() ) {
+ char * cname, *sname;
+ pkrb5_unparse_name(ctx, creds.client, &cname);
+ pkrb5_unparse_name(ctx, creds.server, &sname);
+ OutputDebugString("Removing credential for client \"");
+ OutputDebugString(cname);
+ OutputDebugString("\" and service \"");
+ OutputDebugString(sname);
+ OutputDebugString("\"\n");
+ pkrb5_free_unparsed_name(ctx,cname);
+ pkrb5_free_unparsed_name(ctx,sname);
+ }
+
+ code = pkrb5_cc_remove_cred(ctx, cc, 0, &creds);
+ pkrb5_free_principal(ctx, creds.client);
+ pkrb5_free_principal(ctx, creds.server);
+ }
+ }
+ code = KFW_AFS_klog(ctx, cc, "afs", cell, (char *)realm, pLeash_get_default_lifetime());
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"KFW_AFS_klog() returns: %d\n",code);
+ OutputDebugString(message);
+ }
+
+ loop_cleanup:
+ if (cc) {
+ pkrb5_cc_close(ctx, cc);
+ cc = 0;
+ }
+ if (princ) {
+ pkrb5_free_principal(ctx, princ);
+ princ = 0;
+ }
+ if (service) {
+ pkrb5_free_principal(ctx, service);
+ princ = 0;
+ }
+
+ KFW_AFS_update_cell_princ_map(ctx, cell, principals[count], code ? FALSE : TRUE);
+ free(principals[count]);
+ }
+ free(principals);
+ } else
+ code = -1; // we did not renew the tokens
+
+ cleanup:
+ pkrb5_free_context(ctx);
+ return (code ? FALSE : TRUE);
+
+}
+
+int
+KFW_AFS_renew_tokens_for_all_cells(void)
+{
+ struct cell_principal_map * next = cell_princ_map;
+
+ if ( IsDebuggerPresent() )
+ OutputDebugString("KFW_AFS_renew_tokens_for_all()\n");
+
+ if ( !next )
+ return 0;
+
+ for ( ; next ; next = next->next ) {
+ if ( next->active )
+ KFW_AFS_renew_token_for_cell(next->cell);
+ }
+ return 0;
+}
+
+int
+KFW_renew(krb5_context alt_ctx, krb5_ccache alt_cc)
+{
+ krb5_error_code code = 0;
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ krb5_principal me = 0;
+ krb5_principal server = 0;
+ krb5_creds my_creds;
+ krb5_data *realm = 0;
+
+ memset(&my_creds, 0, sizeof(krb5_creds));
+
+ if ( alt_ctx ) {
+ ctx = alt_ctx;
+ } else {
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+ }
+
+ if ( alt_cc ) {
+ cc = alt_cc;
+ } else {
+ code = pkrb5_cc_default(ctx, &cc);
+ if (code) goto cleanup;
+ }
+
+ code = pkrb5_cc_get_principal(ctx, cc, &me);
+ if (code) goto cleanup;
+
+ realm = krb5_princ_realm(ctx, me);
+
+ code = pkrb5_build_principal_ext(ctx, &server,
+ realm->length,realm->data,
+ KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME,
+ realm->length,realm->data,
+ 0);
+ if ( code )
+ goto cleanup;
+
+ if ( IsDebuggerPresent() ) {
+ char * cname, *sname;
+ pkrb5_unparse_name(ctx, me, &cname);
+ pkrb5_unparse_name(ctx, server, &sname);
+ OutputDebugString("Renewing credential for client \"");
+ OutputDebugString(cname);
+ OutputDebugString("\" and service \"");
+ OutputDebugString(sname);
+ OutputDebugString("\"\n");
+ pkrb5_free_unparsed_name(ctx,cname);
+ pkrb5_free_unparsed_name(ctx,sname);
+ }
+
+ my_creds.client = me;
+ my_creds.server = server;
+
+ code = pkrb5_get_renewed_creds(ctx, &my_creds, me, cc, NULL);
+ if (code) {
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"krb5_get_renewed_creds() failed: %d\n",code);
+ OutputDebugString(message);
+ }
+ goto cleanup;
+ }
+
+ code = pkrb5_cc_initialize(ctx, cc, me);
+ if (code) {
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"krb5_cc_initialize() failed: %d\n",code);
+ OutputDebugString(message);
+ }
+ goto cleanup;
+ }
+
+ code = pkrb5_cc_store_cred(ctx, cc, &my_creds);
+ if (code) {
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"krb5_cc_store_cred() failed: %d\n",code);
+ OutputDebugString(message);
+ }
+ goto cleanup;
+ }
+
+ cleanup:
+ if (my_creds.client == me)
+ my_creds.client = 0;
+ if (my_creds.server == server)
+ my_creds.server = 0;
+ pkrb5_free_cred_contents(ctx, &my_creds);
+ if (me)
+ pkrb5_free_principal(ctx, me);
+ if (server)
+ pkrb5_free_principal(ctx, server);
+ if (cc && (cc != alt_cc))
+ pkrb5_cc_close(ctx, cc);
+ if (ctx && (ctx != alt_ctx))
+ pkrb5_free_context(ctx);
+ return(code);
+}
+
+int
+KFW_kinit( krb5_context alt_ctx,
+ krb5_ccache alt_cc,
+ HWND hParent,
+ char *principal_name,
+ char *password,
+ krb5_deltat lifetime,
+ DWORD forwardable,
+ DWORD proxiable,
+ krb5_deltat renew_life,
+ DWORD addressless,
+ DWORD publicIP
+ )
+{
+ krb5_error_code code = 0;
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ krb5_principal me = 0;
+ char* name = 0;
+ krb5_creds my_creds;
+ krb5_get_init_creds_opt options;
+ krb5_address ** addrs = NULL;
+ int i = 0, addr_count = 0;
+
+ if (!pkrb5_init_context)
+ return 0;
+
+ pkrb5_get_init_creds_opt_init(&options);
+ memset(&my_creds, 0, sizeof(my_creds));
+
+ if (alt_ctx)
+ {
+ ctx = alt_ctx;
+ }
+ else
+ {
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+ }
+
+ if ( alt_cc ) {
+ cc = alt_cc;
+ } else {
+ code = pkrb5_cc_default(ctx, &cc);
+ if (code) goto cleanup;
+ }
+
+ code = pkrb5_parse_name(ctx, principal_name, &me);
+ if (code)
+ goto cleanup;
+
+ code = pkrb5_unparse_name(ctx, me, &name);
+ if (code)
+ goto cleanup;
+
+ if (lifetime == 0)
+ lifetime = pLeash_get_default_lifetime();
+ else
+ lifetime *= 5*60;
+
+ if (renew_life > 0)
+ renew_life *= 5*60;
+
+ if (lifetime)
+ pkrb5_get_init_creds_opt_set_tkt_life(&options, lifetime);
+ pkrb5_get_init_creds_opt_set_forwardable(&options,
+ forwardable ? 1 : 0);
+ pkrb5_get_init_creds_opt_set_proxiable(&options,
+ proxiable ? 1 : 0);
+ pkrb5_get_init_creds_opt_set_renew_life(&options,
+ renew_life);
+ if (addressless)
+ pkrb5_get_init_creds_opt_set_address_list(&options,NULL);
+ else {
+ if (publicIP)
+ {
+ // we are going to add the public IP address specified by the user
+ // to the list provided by the operating system
+ krb5_address ** local_addrs=NULL;
+ DWORD netIPAddr;
+
+ pkrb5_os_localaddr(ctx, &local_addrs);
+ while ( local_addrs[i++] );
+ addr_count = i + 1;
+
+ addrs = (krb5_address **) malloc((addr_count+1) * sizeof(krb5_address *));
+ if ( !addrs ) {
+ pkrb5_free_addresses(ctx, local_addrs);
+ goto cleanup;
+ }
+ memset(addrs, 0, sizeof(krb5_address *) * (addr_count+1));
+ i = 0;
+ while ( local_addrs[i] ) {
+ addrs[i] = (krb5_address *)malloc(sizeof(krb5_address));
+ if (addrs[i] == NULL) {
+ pkrb5_free_addresses(ctx, local_addrs);
+ goto cleanup;
+ }
+
+ addrs[i]->magic = local_addrs[i]->magic;
+ addrs[i]->addrtype = local_addrs[i]->addrtype;
+ addrs[i]->length = local_addrs[i]->length;
+ addrs[i]->contents = (unsigned char *)malloc(addrs[i]->length);
+ if (!addrs[i]->contents) {
+ pkrb5_free_addresses(ctx, local_addrs);
+ goto cleanup;
+ }
+
+ memcpy(addrs[i]->contents,local_addrs[i]->contents,
+ local_addrs[i]->length); /* safe */
+ i++;
+ }
+ pkrb5_free_addresses(ctx, local_addrs);
+
+ addrs[i] = (krb5_address *)malloc(sizeof(krb5_address));
+ if (addrs[i] == NULL)
+ goto cleanup;
+
+ addrs[i]->magic = KV5M_ADDRESS;
+ addrs[i]->addrtype = AF_INET;
+ addrs[i]->length = 4;
+ addrs[i]->contents = (unsigned char *)malloc(addrs[i]->length);
+ if (!addrs[i]->contents)
+ goto cleanup;
+
+ netIPAddr = htonl(publicIP);
+ memcpy(addrs[i]->contents,&netIPAddr,4);
+
+ pkrb5_get_init_creds_opt_set_address_list(&options,addrs);
+
+ }
+ }
+
+ code = pkrb5_get_init_creds_password(ctx,
+ &my_creds,
+ me,
+ password, // password
+ KRB5_prompter, // prompter
+ hParent, // prompter data
+ 0, // start time
+ 0, // service name
+ &options);
+ if (code)
+ goto cleanup;
+
+ code = pkrb5_cc_initialize(ctx, cc, me);
+ if (code)
+ goto cleanup;
+
+ code = pkrb5_cc_store_cred(ctx, cc, &my_creds);
+ if (code)
+ goto cleanup;
+
+ cleanup:
+ if ( addrs ) {
+ for ( i=0;i<addr_count;i++ ) {
+ if ( addrs[i] ) {
+ if ( addrs[i]->contents )
+ free(addrs[i]->contents);
+ free(addrs[i]);
+ }
+ }
+ }
+ if (my_creds.client == me)
+ my_creds.client = 0;
+ pkrb5_free_cred_contents(ctx, &my_creds);
+ if (name)
+ pkrb5_free_unparsed_name(ctx, name);
+ if (me)
+ pkrb5_free_principal(ctx, me);
+ if (cc && (cc != alt_cc))
+ pkrb5_cc_close(ctx, cc);
+ if (ctx && (ctx != alt_ctx))
+ pkrb5_free_context(ctx);
+ return(code);
+}
+
+
+int
+KFW_kdestroy(krb5_context alt_ctx, krb5_ccache alt_cc)
+{
+ krb5_context ctx;
+ krb5_ccache cc;
+ krb5_error_code code;
+
+ if (alt_ctx)
+ {
+ ctx = alt_ctx;
+ }
+ else
+ {
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+ }
+
+ if ( alt_cc ) {
+ cc = alt_cc;
+ } else {
+ code = pkrb5_cc_default(ctx, &cc);
+ if (code) goto cleanup;
+ }
+
+ code = pkrb5_cc_destroy(ctx, cc);
+ if ( !code ) cc = 0;
+
+ cleanup:
+ if (cc && (cc != alt_cc))
+ pkrb5_cc_close(ctx, cc);
+ if (ctx && (ctx != alt_ctx))
+ pkrb5_free_context(ctx);
+
+ return(code);
+}
+
+
+#ifdef USE_MS2MIT
+static BOOL
+GetSecurityLogonSessionData(PSECURITY_LOGON_SESSION_DATA * ppSessionData)
+{
+ NTSTATUS Status = 0;
+ HANDLE TokenHandle;
+ TOKEN_STATISTICS Stats;
+ DWORD ReqLen;
+ BOOL Success;
+
+ if (!ppSessionData)
+ return FALSE;
+ *ppSessionData = NULL;
+
+ Success = OpenProcessToken( GetCurrentProcess(), TOKEN_QUERY, &TokenHandle );
+ if ( !Success )
+ return FALSE;
+
+ Success = GetTokenInformation( TokenHandle, TokenStatistics, &Stats, sizeof(TOKEN_STATISTICS), &ReqLen );
+ CloseHandle( TokenHandle );
+ if ( !Success )
+ return FALSE;
+
+ Status = pLsaGetLogonSessionData( &Stats.AuthenticationId, ppSessionData );
+ if ( FAILED(Status) || !ppSessionData )
+ return FALSE;
+
+ return TRUE;
+}
+
+//
+// MSLSA_IsKerberosLogon() does not validate whether or not there are valid tickets in the
+// cache. It validates whether or not it is reasonable to assume that if we
+// attempted to retrieve valid tickets we could do so. Microsoft does not
+// automatically renew expired tickets. Therefore, the cache could contain
+// expired or invalid tickets. Microsoft also caches the user's password
+// and will use it to retrieve new TGTs if the cache is empty and tickets
+// are requested.
+
+static BOOL
+MSLSA_IsKerberosLogon(VOID)
+{
+ PSECURITY_LOGON_SESSION_DATA pSessionData = NULL;
+ BOOL Success = FALSE;
+
+ if ( GetSecurityLogonSessionData(&pSessionData) ) {
+ if ( pSessionData->AuthenticationPackage.Buffer ) {
+ WCHAR buffer[256];
+ WCHAR *usBuffer;
+ int usLength;
+
+ Success = FALSE;
+ usBuffer = (pSessionData->AuthenticationPackage).Buffer;
+ usLength = (pSessionData->AuthenticationPackage).Length;
+ if (usLength < 256)
+ {
+ lstrcpynW (buffer, usBuffer, usLength);
+ lstrcatW (buffer,L"");
+ if ( !lstrcmpW(L"Kerberos",buffer) )
+ Success = TRUE;
+ }
+ }
+ pLsaFreeReturnBuffer(pSessionData);
+ }
+ return Success;
+}
+#endif /* USE_MS2MIT */
+
+static BOOL CALLBACK
+MultiInputDialogProc( HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ int i;
+
+ switch ( message ) {
+ case WM_INITDIALOG:
+ if ( GetDlgCtrlID((HWND) wParam) != ID_MID_TEXT )
+ {
+ SetFocus(GetDlgItem( hDialog, ID_MID_TEXT));
+ return FALSE;
+ }
+ for ( i=0; i < mid_cnt ; i++ ) {
+ if (mid_tb[i].echo == 0)
+ SendDlgItemMessage(hDialog, ID_MID_TEXT+i, EM_SETPASSWORDCHAR, 32, 0);
+ else if (mid_tb[i].echo == 2)
+ SendDlgItemMessage(hDialog, ID_MID_TEXT+i, EM_SETPASSWORDCHAR, '*', 0);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch ( LOWORD(wParam) ) {
+ case IDOK:
+ for ( i=0; i < mid_cnt ; i++ ) {
+ if ( !GetDlgItemText(hDialog, ID_MID_TEXT+i, mid_tb[i].buf, mid_tb[i].len) )
+ *mid_tb[i].buf = '\0';
+ }
+ /* fallthrough */
+ case IDCANCEL:
+ EndDialog(hDialog, LOWORD(wParam));
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static LPWORD
+lpwAlign( LPWORD lpIn )
+{
+ ULONG ul;
+
+ ul = (ULONG) lpIn;
+ ul += 3;
+ ul >>=2;
+ ul <<=2;
+ return (LPWORD) ul;;
+}
+
+/*
+ * dialog widths are measured in 1/4 character widths
+ * dialog height are measured in 1/8 character heights
+ */
+
+static LRESULT
+MultiInputDialog( HINSTANCE hinst, HWND hwndOwner,
+ char * ptext[], int numlines, int width,
+ int tb_cnt, struct textField * tb)
+{
+ HGLOBAL hgbl;
+ LPDLGTEMPLATE lpdt;
+ LPDLGITEMTEMPLATE lpdit;
+ LPWORD lpw;
+ LPWSTR lpwsz;
+ LRESULT ret;
+ int nchar, i, pwid;
+
+ hgbl = GlobalAlloc(GMEM_ZEROINIT, 4096);
+ if (!hgbl)
+ return -1;
+
+ mid_cnt = tb_cnt;
+ mid_tb = tb;
+
+ lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl);
+
+ // Define a dialog box.
+
+ lpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU
+ | DS_MODALFRAME | WS_CAPTION | DS_CENTER
+ | DS_SETFOREGROUND | DS_3DLOOK
+ | DS_SETFONT | DS_FIXEDSYS | DS_NOFAILCREATE;
+ lpdt->cdit = numlines + (2 * tb_cnt) + 2; // number of controls
+ lpdt->x = 10;
+ lpdt->y = 10;
+ lpdt->cx = 20 + width * 4;
+ lpdt->cy = 20 + (numlines + tb_cnt + 4) * 14;
+
+ lpw = (LPWORD) (lpdt + 1);
+ *lpw++ = 0; // no menu
+ *lpw++ = 0; // predefined dialog box class (by default)
+
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, "", -1, lpwsz, 128);
+ lpw += nchar;
+ *lpw++ = 8; // font size (points)
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, "MS Shell Dlg",
+ -1, lpwsz, 128);
+ lpw += nchar;
+
+ //-----------------------
+ // Define an OK button.
+ //-----------------------
+ lpw = lpwAlign (lpw); // align DLGITEMTEMPLATE on DWORD boundary
+ lpdit = (LPDLGITEMTEMPLATE) lpw;
+ lpdit->style = WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON | WS_TABSTOP | WS_BORDER;
+ lpdit->dwExtendedStyle = 0;
+ lpdit->x = (lpdt->cx - 14)/4 - 20;
+ lpdit->y = 10 + (numlines + tb_cnt + 2) * 14;
+ lpdit->cx = 40;
+ lpdit->cy = 14;
+ lpdit->id = IDOK; // OK button identifier
+
+ lpw = (LPWORD) (lpdit + 1);
+ *lpw++ = 0xFFFF;
+ *lpw++ = 0x0080; // button class
+
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, "OK", -1, lpwsz, 50);
+ lpw += nchar;
+ *lpw++ = 0; // no creation data
+
+ //-----------------------
+ // Define an Cancel button.
+ //-----------------------
+ lpw = lpwAlign (lpw); // align DLGITEMTEMPLATE on DWORD boundary
+ lpdit = (LPDLGITEMTEMPLATE) lpw;
+ lpdit->style = WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_TABSTOP | WS_BORDER;
+ lpdit->dwExtendedStyle = 0;
+ lpdit->x = (lpdt->cx - 14)*3/4 - 20;
+ lpdit->y = 10 + (numlines + tb_cnt + 2) * 14;
+ lpdit->cx = 40;
+ lpdit->cy = 14;
+ lpdit->id = IDCANCEL; // CANCEL button identifier
+
+ lpw = (LPWORD) (lpdit + 1);
+ *lpw++ = 0xFFFF;
+ *lpw++ = 0x0080; // button class
+
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, "Cancel", -1, lpwsz, 50);
+ lpw += nchar;
+ *lpw++ = 0; // no creation data
+
+ /* Add controls for preface data */
+ for ( i=0; i<numlines; i++) {
+ /*-----------------------
+ * Define a static text control.
+ *-----------------------*/
+ lpw = lpwAlign (lpw); /* align DLGITEMTEMPLATE on DWORD boundary */
+ lpdit = (LPDLGITEMTEMPLATE) lpw;
+ lpdit->style = WS_CHILD | WS_VISIBLE | SS_LEFT;
+ lpdit->dwExtendedStyle = 0;
+ lpdit->x = 10;
+ lpdit->y = 10 + i * 14;
+ lpdit->cx = strlen(ptext[i]) * 4 + 10;
+ lpdit->cy = 14;
+ lpdit->id = ID_TEXT + i; // text identifier
+
+ lpw = (LPWORD) (lpdit + 1);
+ *lpw++ = 0xFFFF;
+ *lpw++ = 0x0082; // static class
+
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, ptext[i],
+ -1, lpwsz, 2*width);
+ lpw += nchar;
+ *lpw++ = 0; // no creation data
+ }
+
+ for ( i=0, pwid = 0; i<tb_cnt; i++) {
+ if ( pwid < strlen(tb[i].label) )
+ pwid = strlen(tb[i].label);
+ }
+
+ for ( i=0; i<tb_cnt; i++) {
+ /* Prompt */
+ /*-----------------------
+ * Define a static text control.
+ *-----------------------*/
+ lpw = lpwAlign (lpw); /* align DLGITEMTEMPLATE on DWORD boundary */
+ lpdit = (LPDLGITEMTEMPLATE) lpw;
+ lpdit->style = WS_CHILD | WS_VISIBLE | SS_LEFT;
+ lpdit->dwExtendedStyle = 0;
+ lpdit->x = 10;
+ lpdit->y = 10 + (numlines + i + 1) * 14;
+ lpdit->cx = pwid * 4;
+ lpdit->cy = 14;
+ lpdit->id = ID_TEXT + numlines + i; // text identifier
+
+ lpw = (LPWORD) (lpdit + 1);
+ *lpw++ = 0xFFFF;
+ *lpw++ = 0x0082; // static class
+
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, tb[i].label ? tb[i].label : "",
+ -1, lpwsz, 128);
+ lpw += nchar;
+ *lpw++ = 0; // no creation data
+
+ /*-----------------------
+ * Define an edit control.
+ *-----------------------*/
+ lpw = lpwAlign (lpw); /* align DLGITEMTEMPLATE on DWORD boundary */
+ lpdit = (LPDLGITEMTEMPLATE) lpw;
+ lpdit->style = WS_CHILD | WS_VISIBLE | ES_LEFT | WS_TABSTOP | WS_BORDER | (tb[i].echo == 1 ? 0L : ES_PASSWORD);
+ lpdit->dwExtendedStyle = 0;
+ lpdit->x = 10 + (pwid + 1) * 4;
+ lpdit->y = 10 + (numlines + i + 1) * 14;
+ lpdit->cx = (width - (pwid + 1)) * 4;
+ lpdit->cy = 14;
+ lpdit->id = ID_MID_TEXT + i; // identifier
+
+ lpw = (LPWORD) (lpdit + 1);
+ *lpw++ = 0xFFFF;
+ *lpw++ = 0x0081; // edit class
+
+ lpwsz = (LPWSTR) lpw;
+ nchar = MultiByteToWideChar (CP_ACP, 0, tb[i].def ? tb[i].def : "",
+ -1, lpwsz, 128);
+ lpw += nchar;
+ *lpw++ = 0; // no creation data
+ }
+
+ GlobalUnlock(hgbl);
+ ret = DialogBoxIndirect(hinst, (LPDLGTEMPLATE) hgbl,
+ hwndOwner, (DLGPROC) MultiInputDialogProc);
+ GlobalFree(hgbl);
+
+ switch ( ret ) {
+ case 0: /* Timeout */
+ return -1;
+ case IDOK:
+ return 1;
+ case IDCANCEL:
+ return 0;
+ default: {
+ char buf[256];
+ sprintf(buf,"DialogBoxIndirect() failed: %d",GetLastError());
+ MessageBox(hwndOwner,
+ buf,
+ "GetLastError()",
+ MB_OK | MB_ICONINFORMATION | MB_TASKMODAL);
+ return -1;
+ }
+ }
+}
+
+static int
+multi_field_dialog(HWND hParent, char * preface, int n, struct textField tb[])
+{
+ HINSTANCE hInst = 0;
+ int maxwidth = 0;
+ int numlines = 0;
+ int len;
+ char * plines[16], *p = preface ? preface : "";
+ int i;
+
+ for ( i=0; i<16; i++ )
+ plines[i] = NULL;
+
+ while (*p && numlines < 16) {
+ plines[numlines++] = p;
+ for ( ;*p && *p != '\r' && *p != '\n'; p++ );
+ if ( *p == '\r' && *(p+1) == '\n' ) {
+ *p++ = '\0';
+ p++;
+ } else if ( *p == '\n' ) {
+ *p++ = '\0';
+ }
+ if ( strlen(plines[numlines-1]) > maxwidth )
+ maxwidth = strlen(plines[numlines-1]);
+ }
+
+ for ( i=0;i<n;i++ ) {
+ len = strlen(tb[i].label) + 1 + (tb[i].len > 40 ? 40 : tb[i].len);
+ if ( maxwidth < len )
+ maxwidth = len;
+ }
+
+ return(MultiInputDialog(hInst, hParent, plines, numlines, maxwidth, n, tb));
+}
+
+static krb5_error_code KRB5_CALLCONV
+KRB5_prompter( krb5_context context,
+ void *data,
+ const char *name,
+ const char *banner,
+ int num_prompts,
+ krb5_prompt prompts[])
+{
+ krb5_error_code errcode = 0;
+ int i;
+ struct textField * tb = NULL;
+ int len = 0, blen=0, nlen=0;
+ HWND hParent = (HWND)data;
+
+ if (name)
+ nlen = strlen(name)+2;
+
+ if (banner)
+ blen = strlen(banner)+2;
+
+ tb = (struct textField *) malloc(sizeof(struct textField) * num_prompts);
+ if ( tb != NULL ) {
+ int ok;
+ memset(tb,0,sizeof(struct textField) * num_prompts);
+ for ( i=0; i < num_prompts; i++ ) {
+ tb[i].buf = prompts[i].reply->data;
+ tb[i].len = prompts[i].reply->length;
+ tb[i].label = prompts[i].prompt;
+ tb[i].def = NULL;
+ tb[i].echo = (prompts[i].hidden ? 2 : 1);
+ }
+
+ ok = multi_field_dialog(hParent,(char *)banner,num_prompts,tb);
+ if ( ok ) {
+ for ( i=0; i < num_prompts; i++ )
+ prompts[i].reply->length = strlen(prompts[i].reply->data);
+ } else
+ errcode = -2;
+ }
+
+ if ( tb )
+ free(tb);
+ if (errcode) {
+ for (i = 0; i < num_prompts; i++) {
+ memset(prompts[i].reply->data, 0, prompts[i].reply->length);
+ }
+ }
+ return errcode;
+}
+
+BOOL
+KFW_AFS_wait_for_service_start(void)
+{
+ char HostName[64];
+ DWORD CurrentState;
+
+ CurrentState = SERVICE_START_PENDING;
+ memset(HostName, '\0', sizeof(HostName));
+ gethostname(HostName, sizeof(HostName));
+
+ while (CurrentState != SERVICE_RUNNING || CurrentState != SERVICE_STOPPED)
+ {
+ if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR)
+ return(0);
+ if ( IsDebuggerPresent() ) {
+ switch ( CurrentState ) {
+ case SERVICE_STOPPED:
+ OutputDebugString("SERVICE_STOPPED\n");
+ break;
+ case SERVICE_START_PENDING:
+ OutputDebugString("SERVICE_START_PENDING\n");
+ break;
+ case SERVICE_STOP_PENDING:
+ OutputDebugString("SERVICE_STOP_PENDING\n");
+ break;
+ case SERVICE_RUNNING:
+ OutputDebugString("SERVICE_RUNNING\n");
+ break;
+ case SERVICE_CONTINUE_PENDING:
+ OutputDebugString("SERVICE_CONTINUE_PENDING\n");
+ break;
+ case SERVICE_PAUSE_PENDING:
+ OutputDebugString("SERVICE_PAUSE_PENDING\n");
+ break;
+ case SERVICE_PAUSED:
+ OutputDebugString("SERVICE_PAUSED\n");
+ break;
+ default:
+ OutputDebugString("UNKNOWN Service State\n");
+ }
+ }
+ if (CurrentState == SERVICE_STOPPED)
+ return(0);
+ if (CurrentState == SERVICE_RUNNING)
+ return(1);
+ Sleep(500);
+ }
+ return(0);
+}
+
+
+int
+KFW_AFS_unlog(void)
+{
+ long rc;
+ char HostName[64];
+ DWORD CurrentState;
+
+ CurrentState = 0;
+ memset(HostName, '\0', sizeof(HostName));
+ gethostname(HostName, sizeof(HostName));
+ if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR)
+ return(0);
+ if (CurrentState != SERVICE_RUNNING)
+ return(0);
+
+ rc = pktc_ForgetAllTokens();
+
+ return(0);
+}
+
+int
+KFW_AFS_klog(
+ krb5_context alt_ctx,
+ krb5_ccache alt_cc,
+ char *service,
+ char *cell,
+ char *realm,
+ int LifeTime
+ )
+{
+ long rc = 0;
+ CREDENTIALS creds;
+ KTEXT_ST ticket;
+ struct ktc_principal aserver;
+ struct ktc_principal aclient;
+ char username[BUFSIZ]; /* To hold client username structure */
+ char realm_of_user[REALM_SZ]; /* Kerberos realm of user */
+ char realm_of_cell[REALM_SZ]; /* Kerberos realm of cell */
+ char local_cell[MAXCELLCHARS+1];
+ char Dmycell[MAXCELLCHARS+1];
+ struct ktc_token atoken;
+ struct ktc_token btoken;
+ afsconf_cell ak_cellconfig; /* General information about the cell */
+ char RealmName[128];
+ char CellName[128];
+ char ServiceName[128];
+ DWORD CurrentState;
+ char HostName[64];
+ BOOL try_krb5 = 0;
+ krb5_context ctx = 0;
+ krb5_ccache cc = 0;
+ krb5_creds increds;
+ krb5_creds * k5creds = 0;
+ krb5_error_code code;
+ krb5_principal client_principal = 0;
+ int i, retry = 0;
+
+ CurrentState = 0;
+ memset(HostName, '\0', sizeof(HostName));
+ gethostname(HostName, sizeof(HostName));
+ if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR) {
+ if ( IsDebuggerPresent() )
+ OutputDebugString("Unable to retrieve AFSD Service Status\n");
+ return(-1);
+ }
+ if (CurrentState != SERVICE_RUNNING) {
+ if ( IsDebuggerPresent() )
+ OutputDebugString("AFSD Service NOT RUNNING\n");
+ return(-2);
+ }
+
+ memset(RealmName, '\0', sizeof(RealmName));
+ memset(CellName, '\0', sizeof(CellName));
+ memset(ServiceName, '\0', sizeof(ServiceName));
+ memset(realm_of_user, '\0', sizeof(realm_of_user));
+ memset(realm_of_cell, '\0', sizeof(realm_of_cell));
+ if (cell && cell[0])
+ strcpy(Dmycell, cell);
+ else
+ memset(Dmycell, '\0', sizeof(Dmycell));
+
+ // NULL or empty cell returns information on local cell
+ if (rc = get_cellconfig(Dmycell, &ak_cellconfig, local_cell))
+ {
+ KFW_AFS_error(rc, "get_cellconfig()");
+ return(rc);
+ }
+
+ if ( alt_ctx ) {
+ ctx = alt_ctx;
+ } else {
+ code = pkrb5_init_context(&ctx);
+ if (code) goto cleanup;
+ }
+
+ if ( alt_cc ) {
+ cc = alt_cc;
+ } else {
+ code = pkrb5_cc_default(ctx, &cc);
+ if (code) goto skip_krb5_init;
+ }
+
+ memset((char *)&increds, 0, sizeof(increds));
+
+ code = pkrb5_cc_get_principal(ctx, cc, &client_principal);
+ if (code) {
+ if ( code == KRB5_CC_NOTFOUND && IsDebuggerPresent() )
+ {
+ OutputDebugString("Principal Not Found for ccache\n");
+ }
+ goto skip_krb5_init;
+ }
+ i = krb5_princ_realm(ctx, client_principal)->length;
+ if (i > REALM_SZ-1)
+ i = REALM_SZ-1;
+ strncpy(realm_of_user,krb5_princ_realm(ctx, client_principal)->data,i);
+ realm_of_user[i] = 0;
+ try_krb5 = 1;
+
+ skip_krb5_init:
+#ifdef USE_KRB4
+ if ( !try_krb5 || !realm_of_user[0] ) {
+ if ((rc = (*pkrb_get_tf_realm)((*ptkt_string)(), realm_of_user)) != KSUCCESS)
+ {
+ goto cleanup;
+ }
+ }
+#else
+ goto cleanup;
+#endif
+ strcpy(realm_of_cell, afs_realm_of_cell(&ak_cellconfig));
+
+ if (strlen(service) == 0)
+ strcpy(ServiceName, "afs");
+ else
+ strcpy(ServiceName, service);
+
+ if (strlen(cell) == 0)
+ strcpy(CellName, local_cell);
+ else
+ strcpy(CellName, cell);
+
+ if (strlen(realm) == 0)
+ strcpy(RealmName, realm_of_cell);
+ else
+ strcpy(RealmName, realm);
+
+ memset(&creds, '\0', sizeof(creds));
+
+ if ( try_krb5 ) {
+ /* First try service/cell@REALM */
+ if (code = pkrb5_build_principal(ctx, &increds.server,
+ strlen(RealmName),
+ RealmName,
+ ServiceName,
+ CellName,
+ 0))
+ {
+ goto cleanup;
+ }
+
+ increds.client = client_principal;
+ increds.times.endtime = 0;
+ /* Ask for DES since that is what V4 understands */
+ increds.keyblock.enctype = ENCTYPE_DES_CBC_CRC;
+
+ if ( IsDebuggerPresent() ) {
+ char * cname, *sname;
+ pkrb5_unparse_name(ctx, increds.client, &cname);
+ pkrb5_unparse_name(ctx, increds.server, &sname);
+ OutputDebugString("Getting credentials for \"");
+ OutputDebugString(cname);
+ OutputDebugString("\" and service \"");
+ OutputDebugString(sname);
+ OutputDebugString("\"\n");
+ pkrb5_free_unparsed_name(ctx,cname);
+ pkrb5_free_unparsed_name(ctx,sname);
+ }
+
+ code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds);
+ if (code == KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN ||
+ code == KRB5KRB_ERR_GENERIC /* heimdal */) {
+ /* Or service@REALM */
+ pkrb5_free_principal(ctx,increds.server);
+ increds.server = 0;
+ code = pkrb5_build_principal(ctx, &increds.server,
+ strlen(RealmName),
+ RealmName,
+ ServiceName,
+ 0);
+
+ if ( IsDebuggerPresent() ) {
+ char * cname, *sname;
+ pkrb5_unparse_name(ctx, increds.client, &cname);
+ pkrb5_unparse_name(ctx, increds.server, &sname);
+ OutputDebugString("krb5_get_credentials() returned Service Principal Unknown\n");
+ OutputDebugString("Trying again: getting credentials for \"");
+ OutputDebugString(cname);
+ OutputDebugString("\" and service \"");
+ OutputDebugString(sname);
+ OutputDebugString("\"\n");
+ pkrb5_free_unparsed_name(ctx,cname);
+ pkrb5_free_unparsed_name(ctx,sname);
+ }
+
+ if (!code)
+ code = pkrb5_get_credentials(ctx, 0, cc, &increds, &k5creds);
+ }
+
+ if (code) {
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"krb5_get_credentials returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ try_krb5 = 0;
+ goto use_krb4;
+ }
+ /* This requires krb524d to be running with the KDC */
+ code = pkrb524_convert_creds_kdc(ctx, k5creds, &creds);
+ pkrb5_free_creds(ctx, k5creds);
+ if (code) {
+ if ( IsDebuggerPresent() ) {
+ char message[256];
+ sprintf(message,"krb524_convert_creds_kdc returns: %d\n",code);
+ OutputDebugString(message);
+ }
+ try_krb5 = 0;
+ goto use_krb4;
+ }
+ } else {
+ use_krb4:
+#ifdef USE_KRB4
+ rc = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds);
+ if (rc == NO_TKT_FIL) {
+ // if the problem is that we have no krb4 tickets
+ // do not attempt to continue
+ goto cleanup;
+ }
+ if (rc != KSUCCESS)
+ rc = (*pkrb_get_cred)(ServiceName, "", RealmName, &creds);
+
+ if (rc != KSUCCESS)
+ {
+ if ((rc = (*pkrb_mk_req)(&ticket, ServiceName, CellName, RealmName, 0)) == KSUCCESS)
+ {
+ if ((rc = (*pkrb_get_cred)(ServiceName, CellName, RealmName, &creds)) != KSUCCESS)
+ {
+ goto cleanup;
+ }
+ }
+ else if ((rc = (*pkrb_mk_req)(&ticket, ServiceName, "", RealmName, 0)) == KSUCCESS)
+ {
+ if ((rc = (*pkrb_get_cred)(ServiceName, "", RealmName, &creds)) != KSUCCESS)
+ {
+ goto cleanup;
+ }
+ }
+ else
+ {
+ goto cleanup;
+ }
+ }
+#else
+ goto cleanup;
+#endif
+ }
+
+ memset(&aserver, '\0', sizeof(aserver));
+ strncpy(aserver.name, ServiceName, MAXKTCNAMELEN - 1);
+ strncpy(aserver.cell, CellName, MAXKTCREALMLEN - 1);
+
+ strcpy(username, creds.pname);
+ if (creds.pinst[0])
+ {
+ strcat(username, ".");
+ strcat(username, creds.pinst);
+ }
+
+ memset(&atoken, '\0', sizeof(atoken));
+ atoken.kvno = creds.kvno;
+ atoken.startTime = creds.issue_date;
+ atoken.endTime = creds.issue_date + (creds.lifetime * 300);
+ memcpy(&atoken.sessionKey, creds.session, 8);
+ atoken.ticketLen = creds.ticket_st.length;
+ memcpy(atoken.ticket, creds.ticket_st.dat, atoken.ticketLen);
+
+ retry_gettoken:
+ rc = pktc_GetToken(&aserver, &btoken, sizeof(btoken), &aclient);
+ if (rc != 0 && rc != KTC_NOENT && rc != KTC_NOCELL) {
+ if ( rc == KTC_NOCM && retry < 20 ) {
+ Sleep(500);
+ retry++;
+ goto retry_gettoken;
+ }
+ KFW_AFS_error(rc, "ktc_GetToken()");
+ code = rc;
+ goto cleanup;
+ }
+
+ if (atoken.kvno == btoken.kvno &&
+ atoken.ticketLen == btoken.ticketLen &&
+ !memcmp(&atoken.sessionKey, &btoken.sessionKey, sizeof(atoken.sessionKey)) &&
+ !memcmp(atoken.ticket, btoken.ticket, atoken.ticketLen))
+ {
+ goto cleanup;
+ }
+
+ // * Reset the "aclient" structure before we call ktc_SetToken.
+ // * This structure was first set by the ktc_GetToken call when
+ // * we were comparing whether identical tokens already existed.
+
+ strncpy(aclient.name, username, MAXKTCNAMELEN - 1);
+ strcpy(aclient.instance, "");
+ strncpy(aclient.cell, creds.realm, MAXKTCREALMLEN - 1);
+
+ if (rc = pktc_SetToken(&aserver, &atoken, &aclient, 0))
+ {
+ KFW_AFS_error(rc, "ktc_SetToken()");
+ code = rc;
+ goto cleanup;
+ }
+
+ cleanup:
+ if (client_principal)
+ pkrb5_free_principal(ctx,client_principal);
+ /* increds.client == client_principal */
+ if (increds.server)
+ pkrb5_free_principal(ctx,increds.server);
+ if (cc && (cc != alt_cc))
+ pkrb5_cc_close(ctx, cc);
+ if (ctx && (ctx != alt_ctx))
+ pkrb5_free_context(ctx);
+
+ return(code);
+}
+
+/**************************************/
+/* afs_realm_of_cell(): */
+/**************************************/
+static char *
+afs_realm_of_cell(afsconf_cell *cellconfig)
+{
+ static char krbrlm[REALM_SZ+1]="";
+ krb5_context ctx = 0;
+ char ** realmlist=NULL;
+ krb5_error_code r;
+
+ if (!cellconfig)
+ return 0;
+
+ r = pkrb5_init_context(&ctx);
+ if ( !r )
+ r = pkrb5_get_host_realm(ctx, cellconfig->hostName[0], &realmlist);
+ if ( !r && realmlist && realmlist[0] ) {
+ strcpy(krbrlm, realmlist[0]);
+ pkrb5_free_host_realm(ctx, realmlist);
+ }
+ if (ctx)
+ pkrb5_free_context(ctx);
+
+ if ( !krbrlm[0] )
+ {
+ char *s = krbrlm;
+ char *t = cellconfig->name;
+ int c;
+
+ while (c = *t++)
+ {
+ if (islower(c)) c=toupper(c);
+ *s++ = c;
+ }
+ *s++ = 0;
+ }
+ return(krbrlm);
+}
+
+/**************************************/
+/* get_cellconfig(): */
+/**************************************/
+static int
+get_cellconfig(char *cell, afsconf_cell *cellconfig, char *local_cell)
+{
+ int rc;
+ char newcell[MAXCELLCHARS+1];
+
+ local_cell[0] = (char)0;
+ memset(cellconfig, 0, sizeof(*cellconfig));
+
+ /* WIN32: cm_GetRootCellName(local_cell) - NOTE: no way to get max chars */
+ if (rc = pcm_GetRootCellName(local_cell))
+ {
+ return(rc);
+ }
+
+ if (strlen(cell) == 0)
+ strcpy(cell, local_cell);
+
+ /* WIN32: cm_SearchCellFile(cell, pcallback, pdata) */
+ strcpy(cellconfig->name, cell);
+
+ return pcm_SearchCellFile(cell, newcell, get_cellconfig_callback, (void*)cellconfig);
+}
+
+/**************************************/
+/* get_cellconfig_callback(): */
+/**************************************/
+static long
+get_cellconfig_callback(void *cellconfig, struct sockaddr_in *addrp, char *namep)
+{
+ afsconf_cell *cc = (afsconf_cell *)cellconfig;
+
+ cc->hostAddr[cc->numServers] = *addrp;
+ strcpy(cc->hostName[cc->numServers], namep);
+ cc->numServers++;
+ return(0);
+}
+
+
+/**************************************/
+/* KFW_AFS_error(): */
+/**************************************/
+void
+KFW_AFS_error(LONG rc, LPCSTR FailedFunctionName)
+{
+ char message[256];
+ const char *errText;
+
+ // Using AFS defines as error messages for now, until Transarc
+ // gets back to me with "string" translations of each of these
+ // const. defines.
+ if (rc == KTC_ERROR)
+ errText = "KTC_ERROR";
+ else if (rc == KTC_TOOBIG)
+ errText = "KTC_TOOBIG";
+ else if (rc == KTC_INVAL)
+ errText = "KTC_INVAL";
+ else if (rc == KTC_NOENT)
+ errText = "KTC_NOENT";
+ else if (rc == KTC_PIOCTLFAIL)
+ errText = "KTC_PIOCTLFAIL";
+ else if (rc == KTC_NOPIOCTL)
+ errText = "KTC_NOPIOCTL";
+ else if (rc == KTC_NOCELL)
+ errText = "KTC_NOCELL";
+ else if (rc == KTC_NOCM)
+ errText = "KTC_NOCM: The service, Transarc AFS Daemon, most likely is not started!";
+ else
+ errText = "Unknown error!";
+
+ sprintf(message, "%s\n(%s failed)", errText, FailedFunctionName);
+
+ if ( IsDebuggerPresent() ) {
+ OutputDebugString(message);
+ OutputDebugString("\n");
+ }
+ MessageBox(NULL, message, "AFS", MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND);
+ return;
+}
+
+static DWORD
+GetServiceStatus(
+ LPSTR lpszMachineName,
+ LPSTR lpszServiceName,
+ DWORD *lpdwCurrentState)
+{
+ DWORD hr = NOERROR;
+ SC_HANDLE schSCManager = NULL;
+ SC_HANDLE schService = NULL;
+ DWORD fdwDesiredAccess = 0;
+ SERVICE_STATUS ssServiceStatus = {0};
+ BOOL fRet = FALSE;
+
+ *lpdwCurrentState = 0;
+
+ fdwDesiredAccess = GENERIC_READ;
+
+ schSCManager = OpenSCManager(lpszMachineName,
+ NULL,
+ fdwDesiredAccess);
+
+ if(schSCManager == NULL)
+ {
+ hr = GetLastError();
+ goto cleanup;
+ }
+
+ schService = OpenService(schSCManager,
+ lpszServiceName,
+ fdwDesiredAccess);
+
+ if(schService == NULL)
+ {
+ hr = GetLastError();
+ goto cleanup;
+ }
+
+ fRet = QueryServiceStatus(schService,
+ &ssServiceStatus);
+
+ if(fRet == FALSE)
+ {
+ hr = GetLastError();
+ goto cleanup;
+ }
+
+ *lpdwCurrentState = ssServiceStatus.dwCurrentState;
+
+cleanup:
+
+ CloseServiceHandle(schService);
+ CloseServiceHandle(schSCManager);
+
+ return(hr);
+}
+
+void
+UnloadFuncs(
+ FUNC_INFO fi[],
+ HINSTANCE h
+ )
+{
+ int n;
+ if (fi)
+ for (n = 0; fi[n].func_ptr_var; n++)
+ *(fi[n].func_ptr_var) = 0;
+ if (h) FreeLibrary(h);
+}
+
+int
+LoadFuncs(
+ const char* dll_name,
+ FUNC_INFO fi[],
+ HINSTANCE* ph, // [out, optional] - DLL handle
+ int* pindex, // [out, optional] - index of last func loaded (-1 if none)
+ int cleanup, // cleanup function pointers and unload on error
+ int go_on, // continue loading even if some functions cannot be loaded
+ int silent // do not pop-up a system dialog if DLL cannot be loaded
+ )
+{
+ HINSTANCE h;
+ int i, n, last_i;
+ int error = 0;
+ UINT em;
+
+ if (ph) *ph = 0;
+ if (pindex) *pindex = -1;
+
+ for (n = 0; fi[n].func_ptr_var; n++)
+ *(fi[n].func_ptr_var) = 0;
+
+ if (silent)
+ em = SetErrorMode(SEM_FAILCRITICALERRORS);
+ h = LoadLibrary(dll_name);
+ if (silent)
+ SetErrorMode(em);
+
+ if (!h)
+ return 0;
+
+ last_i = -1;
+ for (i = 0; (go_on || !error) && (i < n); i++)
+ {
+ void* p = (void*)GetProcAddress(h, fi[i].func_name);
+ if (!p)
+ error = 1;
+ else
+ {
+ last_i = i;
+ *(fi[i].func_ptr_var) = p;
+ }
+ }
+ if (pindex) *pindex = last_i;
+ if (error && cleanup && !go_on) {
+ for (i = 0; i < n; i++) {
+ *(fi[i].func_ptr_var) = 0;
+ }
+ FreeLibrary(h);
+ return 0;
+ }
+ if (ph) *ph = h;
+ if (error) return 0;
+ return 1;
+}
+
+#ifdef USE_FSPROBE
+// Cell Accessibility Functions
+// based on work originally submitted to the CMU Computer Club
+// by Jeffrey Hutzelman
+//
+// These would work great if the fsProbe interface had been
+// ported to Windows
+
+static
+void probeComplete()
+{
+ fsprobe_Cleanup(1);
+ rx_Finalize();
+}
+
+struct ping_params {
+ unsigned short port; // in
+ int retry_delay; // in seconds
+ int verbose; // in
+ struct {
+ int wait; // in seconds
+ int retry; // in attempts
+ } host;
+ int max_hosts; // in
+ int hosts_attempted; // out
+}
+
+// the fsHandler is where we receive the answer to the probe
+static
+int fsHandler(void)
+{
+ ping_count = fsprobe_Results.probeNum;
+ if (!*fsprobe_Results.probeOK)
+ {
+ ok_count++;
+ if (waiting) complete();
+ }
+ if (ping_count == retry)
+ complete();
+ return 0;
+}
+
+// ping_fs is a callback routine meant to be called from within
+// cm_SearchCellFile() or cm_SearchCellDNS()
+static long
+pingFS(void *ping_params, struct sockaddr_in *addrp, char *namep)
+{
+ int rc;
+ struct ping_params * pp = (struct ping_params *) ping_params;
+
+ if ( pp->max_hosts && pp->hosts_attempted >= pp->max_hosts )
+ return 0;
+
+ pp->hosts_attempted++;
+
+ if (pp->port && addrp->sin_port != htons(pp->port))
+ addrp->sin_port = htons(pp->port);
+
+ rc = fsprobe_Init(1, addrp, pp->retry_delay, fsHandler, pp->verbose);
+ if (rc)
+ {
+ fprintf(stderr, "fsprobe_Init failed (%d)\n", rc);
+ fsprobe_Cleanup(1);
+ return 0;
+ }
+
+ for (;;)
+ {
+ tv.tv_sec = pp->host.wait;
+ tv.tv_usec = 0;
+ if (IOMGR_Select(0, 0, 0, 0, &tv))
+ break;
+ }
+ probeComplete();
+ return(0);
+}
+
+
+static BOOL
+pingCell(char *cell)
+{
+ int rc;
+ char rootcell[MAXCELLCHARS+1];
+ char newcell[MAXCELLCHARS+1];
+ struct ping_params pp;
+
+ memset(&pp, 0, sizeof(struct ping_params));
+
+ if (!cell || strlen(cell) == 0) {
+ /* WIN32 NOTE: no way to get max chars */
+ if (rc = pcm_GetRootCellName(rootcell))
+ return(FALSE);
+ cell = rootcell;
+ }
+
+ pp.port = 7000; // AFS FileServer
+ pp.retry_delay = 10;
+ pp.max_hosts = 3;
+ pp.host.wait = 30;
+ pp.host.retry = 0;
+ pp.verbose = 1;
+
+ /* WIN32: cm_SearchCellFile(cell, pcallback, pdata) */
+ rc = pcm_SearchCellFile(cell, newcell, pingFS, (void *)&pp);
+}
+#endif /* USE_FSPROBE */
+
+// These two items are imported from afscreds.h
+// but it cannot be included without causing conflicts
+#define c100ns1SECOND (LONGLONG)10000000
+static void
+TimeToSystemTime (SYSTEMTIME *pst, time_t TimeT)
+{
+ struct tm *pTime;
+ memset (pst, 0x00, sizeof(SYSTEMTIME));
+
+ if ((pTime = localtime (&TimeT)) != NULL)
+ {
+ pst->wYear = pTime->tm_year + 1900;
+ pst->wMonth = pTime->tm_mon + 1;
+ pst->wDayOfWeek = pTime->tm_wday;
+ pst->wDay = pTime->tm_mday;
+ pst->wHour = pTime->tm_hour;
+ pst->wMinute = pTime->tm_min;
+ pst->wSecond = pTime->tm_sec;
+ pst->wMilliseconds = 0;
+ }
+}
+
+void
+ObtainTokensFromUserIfNeeded(HWND hWnd)
+{
+ char * rootcell = NULL;
+ char cell[MAXCELLCHARS+1] = "";
+ char password[PROBE_PASSWORD_LEN+1];
+ krb5_data pwdata;
+ afsconf_cell cellconfig;
+ struct ktc_principal aserver;
+ struct ktc_principal aclient;
+ struct ktc_token atoken;
+ krb5_context ctx;
+ krb5_timestamp now = 0;
+ krb5_error_code code;
+ int serverReachable = 0;
+ int rc;
+#ifndef USE_FSPROBE
+ krb5_ccache cc = 0;
+ const char * realm = 0;
+ krb5_principal principal = 0;
+ char * pname = 0;
+#endif /* USE_FSPROBE */
+ DWORD CurrentState;
+ char HostName[64];
+
+ CurrentState = 0;
+ memset(HostName, '\0', sizeof(HostName));
+ gethostname(HostName, sizeof(HostName));
+ if (GetServiceStatus(HostName, TRANSARCAFSDAEMON, &CurrentState) != NOERROR)
+ return;
+ if (CurrentState != SERVICE_RUNNING) {
+ SendMessage(hWnd, WM_START_SERVICE, FALSE, 0L);
+ return;
+ }
+
+ if ( KFW_is_available() ) {
+ code = pkrb5_init_context(&ctx);
+ if ( code ) goto cleanup;
+ }
+
+ rootcell = (char *)GlobalAlloc(GPTR,MAXCELLCHARS+1);
+ if ( !rootcell ) goto cleanup;
+
+ code = get_cellconfig(cell, (void*)&cellconfig, rootcell);
+ if ( code ) goto cleanup;
+
+ memset(&aserver, '\0', sizeof(aserver));
+ strcpy(aserver.name, "afs");
+ strcpy(aserver.cell, rootcell);
+
+ rc = pktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient);
+
+ if ( KFW_is_available() ) {
+ code = pkrb5_timeofday(ctx, &now);
+ if ( code )
+ now = 0;
+
+ if (!rc && (now < atoken.endTime))
+ goto cleanup;
+ } else {
+ SYSTEMTIME stNow;
+ FILETIME ftNow;
+ FILETIME ftExpires;
+ LONGLONG llNow;
+ LONGLONG llExpires;
+ SYSTEMTIME stExpires;
+
+ TimeToSystemTime (&stExpires, atoken.endTime);
+ GetLocalTime (&stNow);
+ SystemTimeToFileTime (&stNow, &ftNow);
+ SystemTimeToFileTime (&stExpires, &ftExpires);
+
+ llNow = (((LONGLONG)ftNow.dwHighDateTime) << 32) + (LONGLONG)(ftNow.dwLowDateTime);
+ llExpires = (((LONGLONG)ftExpires.dwHighDateTime) << 32) + (LONGLONG)(ftExpires.dwLowDateTime);
+
+ llNow /= c100ns1SECOND;
+ llExpires /= c100ns1SECOND;
+
+ if (!rc && (llNow < llExpires))
+ goto cleanup;
+ }
+
+
+#ifdef USE_FSPROBE
+ serverReachable = cellPing(NULL);
+#else
+ if ( KFW_is_available() ) {
+ // If we can't use the FSProbe interface we can attempt to forge
+ // a kinit and if we can back an invalid user error we know the
+ // kdc is at least reachable
+ realm = afs_realm_of_cell(&cellconfig); // do not free
+
+ code = pkrb5_build_principal(ctx, &principal, strlen(realm),
+ realm, PROBE_USERNAME, NULL, NULL);
+ if ( code ) goto cleanup;
+
+ code = KFW_get_ccache(ctx, principal, &cc);
+ if ( code ) goto cleanup;
+
+ code = pkrb5_unparse_name(ctx, principal, &pname);
+ if ( code ) goto cleanup;
+
+ pwdata.data = password;
+ pwdata.length = PROBE_PASSWORD_LEN;
+ code = pkrb5_c_random_make_octets(ctx, &pwdata);
+ if (code) {
+ int i;
+ for ( i=0 ; i<PROBE_PASSWORD_LEN ; i )
+ password[i] = 'x';
+ }
+ password[PROBE_PASSWORD_LEN] = '\0';
+
+ code = KFW_kinit(NULL, NULL, HWND_DESKTOP,
+ pname,
+ password,
+ 5,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0);
+ switch ( code ) {
+ case KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN:
+ case KRB5KDC_ERR_CLIENT_REVOKED:
+ case KRB5KDC_ERR_CLIENT_NOTYET:
+ case KRB5KDC_ERR_PREAUTH_FAILED:
+ case KRB5KDC_ERR_PREAUTH_REQUIRED:
+ case KRB5KDC_ERR_PADATA_TYPE_NOSUPP:
+ serverReachable = TRUE;
+ break;
+ default:
+ serverReachable = FALSE;
+ }
+ } else {
+ int i;
+ for ( i=0 ; i<PROBE_PASSWORD_LEN ; i )
+ password[i] = 'x';
+
+ code = ObtainNewCredentials(rootcell, PROBE_USERNAME, password);
+ serverReachable = 1;
+ }
+#endif
+ if ( !serverReachable )
+ goto cleanup;
+
+ if ( KFW_is_available() ) {
+#ifdef USE_MS2MIT
+ KFW_import_windows_lsa();
+#endif /* USE_MS2MIT */
+ KFW_AFS_renew_expiring_credentials();
+ KFW_AFS_renew_token_for_cell(rootcell);
+
+ rc = pktc_GetToken(&aserver, &atoken, sizeof(atoken), &aclient);
+ if (!rc && (now < atoken.endTime))
+ goto cleanup;
+ }
+
+ SendMessage(hWnd, WM_OBTAIN_TOKENS, FALSE, (long)rootcell);
+ rootcell = NULL; // rootcell freed by message receiver
+
+ cleanup:
+ if (rootcell)
+ GlobalFree(rootcell);
+
+#ifndef USE_FSPROBE
+ if ( pname )
+ pkrb5_free_unparsed_name(ctx,pname);
+ if ( principal )
+ pkrb5_free_principal(ctx,principal);
+ if (cc)
+ pkrb5_cc_close(ctx,cc);
+#endif /* USE_FSPROBE */
+ if (ctx)
+ pkrb5_free_context(ctx);
+ return;
+}
+
+// IP Change Monitoring Functions
+#include <Iphlpapi.h>
+
+DWORD
+GetNumOfIpAddrs(void)
+{
+ PMIB_IPADDRTABLE pIpAddrTable = NULL;
+ ULONG dwSize;
+ DWORD code;
+ DWORD index;
+ DWORD validAddrs = 0;
+
+ dwSize = 0;
+ code = GetIpAddrTable(NULL, &dwSize, 0);
+ if (code == ERROR_INSUFFICIENT_BUFFER) {
+ pIpAddrTable = malloc(dwSize);
+ code = GetIpAddrTable(pIpAddrTable, &dwSize, 0);
+ for ( index=0; index < pIpAddrTable->dwNumEntries; index++ ) {
+ if (pIpAddrTable->table[index].dwAddr != 0)
+ validAddrs++;
+ }
+ free(pIpAddrTable);
+ }
+ return validAddrs;
+}
+
+void
+IpAddrChangeMonitor(void * hWnd)
+{
+#ifdef USE_OVERLAPPED
+ HANDLE Handle = INVALID_HANDLE_VALUE;
+ OVERLAPPED Ovlap;
+#endif /* USE_OVERLAPPED */
+ DWORD Result;
+ DWORD prevNumOfAddrs = GetNumOfIpAddrs();
+ DWORD NumOfAddrs;
+
+ if ( !hWnd )
+ return;
+
+ while ( TRUE ) {
+#ifdef USE_OVERLAPPED
+ ZeroMemory(&Ovlap, sizeof(OVERLAPPED));
+
+ Result = NotifyAddrChange(&Handle,&Ovlap);
+ if (Result != ERROR_IO_PENDING)
+ {
+ printf("NotifyAddrChange() failed with error %d \n", Result);
+ break;
+ }
+
+ if ((Result = WaitForSingleObject(Handle,INFINITE)) == WAIT_FAILED)
+ {
+ printf("WaitForSingleObject() failed with error %d\n",
+ GetLastError());
+ continue;
+ }
+
+ if (GetOverlappedResult(Handle, &Ovlap,
+ &DataTransfered, TRUE) == 0)
+ {
+ printf("GetOverlapped result failed %d \n",
+ GetLastError());
+ break;
+ }
+
+#else
+ Result = NotifyAddrChange(NULL,NULL);
+#endif
+
+ NumOfAddrs = GetNumOfIpAddrs();
+ if ( NumOfAddrs != prevNumOfAddrs ) {
+ // Give AFS Client Service a chance to notice and die
+ // Or for network services to startup
+ Sleep(2000);
+ // this call should probably be mutex protected
+ ObtainTokensFromUserIfNeeded(hWnd);
+ }
+ prevNumOfAddrs = NumOfAddrs;
+ }
+
+#ifdef USE_OVERLAPPED
+ if (Handle != INVALID_HANDLE_VALUE)
+ CloseHandle(Handle);
+#endif
+}
+
+
+DWORD
+IpAddrChangeMonitorInit(HWND hWnd)
+{
+ DWORD status = ERROR_SUCCESS;
+ HANDLE thread;
+ ULONG threadID = 0;
+
+ thread = CreateThread(NULL, 0, (PTHREAD_START_ROUTINE)IpAddrChangeMonitor,
+ hWnd, 0, &threadID);
+
+ if (thread == NULL) {
+ status = GetLastError();
+ }
+ CloseHandle(thread);
+ return status;
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2003 SkyRope, LLC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - 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.
+ * - Neither the name of Skyrope, LLC nor the names of its contributors may be
+ * used to endorse or promote products derived from this software without
+ * specific prior written permission from Skyrope, LLC.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER
+ * 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.
+ *
+ */
+
+#ifndef AFSKFW_H
+#define AFSKFW_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+void KFW_initialize(void);
+void KFW_cleanup(void);
+int KFW_is_available(void);
+int KFW_AFS_destroy_tickets_for_cell(char *);
+int KFW_AFS_renew_expiring_credentials(void);
+int KFW_AFS_get_cred( char * username,
+ char * instance,
+ char * cell,
+ char * password,
+ int lifetime,
+ char ** reasonP );
+int KFW_AFS_renew_token_for_cell(char * cell);
+int KFW_AFS_renew_tokens_for_all_cells(void);
+BOOL KFW_AFS_wait_for_service_start(void);
+
+#define WM_OBTAIN_TOKENS (WM_USER+77)
+#define WM_START_SERVICE (WM_USER+78)
+void ObtainTokensFromUserIfNeeded(HWND hWnd);
+DWORD IpAddrChangeMonitorInit(HWND hWnd);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AFSKFW_H */
*/
#include "afscreds.h"
+#include "afskfw.h"
extern "C" {
#include <afs\stds.h>
CopyStringToAnsi (Principal.cell, pszCell);
CopyStringToAnsi (Principal.name, TEXT("afs"));
rc = ktc_ForgetToken (&Principal);
+ if ( KFW_is_available() )
+ KFW_AFS_destroy_tickets_for_cell(Principal.cell);
}
if (rc != 0)
int Expiration = 0;
- rc = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, szNameA, "", szCellA, szPasswordA, 0, &Expiration, 0, &Result);
+ if ( KFW_is_available() )
+ rc = KFW_AFS_get_cred(szNameA, NULL, szCellA, szPasswordA, 0, &Result);
+ else
+ rc = ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, szNameA, "", szCellA, szPasswordA, 0, &Expiration, 0, &Result);
}
if (rc != 0)
#include <stdlib.h>
#include <stdio.h>
#include "rxkad.h"
+#include "afskfw.h"
/*
* DEFINITIONS ________________________________________________________________
BOOL InitApp (LPSTR pszCmdLineA);
void ExitApp (void);
+void Quit (void);
void PumpMessage (MSG *pmsg);
BOOL IsServerInstalled (void);
BOOL fExit = FALSE;
BOOL fInstall = FALSE;
BOOL fUninstall = FALSE;
+ BOOL fAutoInit = FALSE;
+ BOOL fNetDetect = FALSE;
+ BOOL fRenewMaps = FALSE;
// Parse the command-line
//
switch (*(++pszCmdLineA))
{
+ case 'a':
+ case 'A':
+ fAutoInit = TRUE;
+ break;
+ case 'm':
+ case 'M':
+ fRenewMaps = TRUE;
+ break;
+ case 'n':
+ case 'N':
+ fNetDetect = TRUE;
+ break;
case 's':
case 'S':
fShow = TRUE;
lock_InitializeMutex(&g.expirationCheckLock, "expiration check lock");
lock_InitializeMutex(&g.credsLock, "global creds lock");
+ KFW_AFS_wait_for_service_start();
+
if ( IsDebuggerPresent() ) {
if ( !g.fIsWinNT )
OutputDebugString("No Service Present on non-NT systems\n");
OutputDebugString("AFSD Service stopped\n");
if ( !IsServiceConfigured() )
OutputDebugString("AFSD Service not configured\n");
+ else if ( fAutoInit )
+ OutputDebugString("AFSD Service will be started\n");
}
}
}
+ // If the service isn't started yet, and autoInit start the service
+ if ( g.fIsWinNT && !IsServiceRunning() && IsServiceConfigured() && fAutoInit ) {
+ SC_HANDLE hManager;
+
+ if ((hManager = OpenSCManager( NULL, NULL,
+ SC_MANAGER_CONNECT |
+ SC_MANAGER_ENUMERATE_SERVICE |
+ SC_MANAGER_QUERY_LOCK_STATUS)) != NULL )
+ {
+ SC_HANDLE hService;
+ if ((hService = OpenService( hManager, TEXT("TransarcAFSDaemon"),
+ SERVICE_CHANGE_CONFIG | SERVICE_QUERY_CONFIG |
+ SERVICE_QUERY_STATUS) ) != NULL)
+ {
+ if (StartService(hService, 0, 0)) {
+ if ( IsDebuggerPresent() )
+ OutputDebugString("AFSD Service start successful\n");
+ fRenewMaps = TRUE;
+ } else if ( IsDebuggerPresent() )
+ OutputDebugString("AFSD Service start failed\n");
+
+ CloseServiceHandle (hService);
+ }
+
+ CloseServiceHandle (hManager);
+ }
+ KFW_AFS_wait_for_service_start();
+ }
+
+ KFW_initialize();
+
// Create a main window. All further initialization will be done during
// processing of WM_INITDIALOG.
//
Message (MB_ICONHAND, IDS_UNCONFIG_TITLE, IDS_UNCONFIG_DESC);
}
if (IsServiceRunning()) {
+ if ( fRenewMaps )
+ {
+ if ( IsDebuggerPresent() )
+ OutputDebugString("Renewing Drive Maps\n");
+ TestAndDoMapShare(SERVICE_START_PENDING);
+ TestAndDoMapShare(SERVICE_RUNNING);
+ }
if (fShow)
{
if ( IsDebuggerPresent() )
OutputDebugString("Displaying Main window\n");
Main_Show (TRUE);
}
+ // If the root cell is reachable and we have no tokens
+ // display the Obtain Tokens dialog to the user
+ if ( fAutoInit ) {
+ if ( IsDebuggerPresent() )
+ OutputDebugString("Obtaining Tokens (if needed)\n");
+ ObtainTokensFromUserIfNeeded(g.hMain);
+ }
} else if ( IsDebuggerPresent() )
- OutputDebugString("Displaying Main window\n");
+ OutputDebugString("AFSD Service Stopped\n");
+
+ if ( fNetDetect ) {
+ // Start IP Address Change Monitor
+ if ( IsDebuggerPresent() )
+ OutputDebugString("Activating Network Change Monitor\n");
+ IpAddrChangeMonitorInit(g.hMain);
+ }
+ Main_EnableRemindTimer(TRUE);
return TRUE;
}
void ExitApp (void)
{
+ KFW_cleanup();
g.hMain = NULL;
}
}
}
+ WriteActiveMap(List.aDriveMap[ iDriveSel ].chDrive, fChecked && List.aDriveMap[ iDriveSel ].fPersistent );
FreeDriveMapList (&List);
}
return;
}
- if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) && /*TEXT("/afs")*/
- (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) ) /*TEXT("\\afs")*/
- {
- Message (MB_ICONHAND, IDS_BADMAP_TITLE, IDS_BADMAP_DESC);
- return;
- }
+ if ( (lstrncmpi (pMap->szMapping, cm_slash_mount_root, lstrlen(cm_slash_mount_root))) && /*TEXT("/afs")*/
+ (lstrncmpi (pMap->szMapping, cm_back_slash_mount_root, lstrlen(cm_back_slash_mount_root))) ) /*TEXT("\\afs")*/
+ {
+ Message (MB_ICONHAND, IDS_BADMAP_TITLE, IDS_BADMAP_DESC);
+ return;
+ }
+ WriteActiveMap(pMap->chDrive, pMap->fPersistent);
EndDialog (hDlg, IDOK);
}
#include <shellapi.h>
#include <shobjidl.h>
#include <shlguid.h>
+#include "afscreds.h"
#include "shortcut.h"
if (fAutoStart)
{
- Shortcut_Create (szShortcut, szSource, "Autostart Authentication Agent");
+ Shortcut_Create (szShortcut, szSource, "Autostart Authentication Agent", AFSCREDS_SHORTCUT_OPTIONS);
}
else // (!g.fAutoStart)
{
}
#include "afscreds.h"
+#include "afskfw.h"
/*
break;
}
break;
+ case WM_OBTAIN_TOKENS:
+ if ( InterlockedIncrement (&g.fShowingMessage) != 1 )
+ InterlockedDecrement (&g.fShowingMessage);
+ else
+ ShowObtainCreds (wp, (char *)lp);
+ GlobalFree((void *)lp);
+ break;
+
+ case WM_START_SERVICE:
+ {
+ SC_HANDLE hManager;
+ if ((hManager = OpenSCManager ( NULL, NULL,
+ SC_MANAGER_CONNECT |
+ SC_MANAGER_ENUMERATE_SERVICE |
+ SC_MANAGER_QUERY_LOCK_STATUS)) != NULL)
+ {
+ SC_HANDLE hService;
+ if ((hService = OpenService ( hManager, TEXT("TransarcAFSDaemon"),
+ SERVICE_CHANGE_CONFIG | SERVICE_QUERY_CONFIG |
+ SERVICE_QUERY_STATUS)) != NULL)
+ {
+ if (StartService (hService, 0, 0))
+ TestAndDoMapShare(SERVICE_START_PENDING);
+ if ( KFW_is_available() && KFW_AFS_wait_for_service_start() ) {
+ KFW_AFS_renew_tokens_for_all_cells();
+ }
+
+ CloseServiceHandle (hService);
+ }
+
+ CloseServiceHandle (hManager);
+ }
+ KFW_AFS_wait_for_service_start();
+ ObtainTokensFromUserIfNeeded(g.hMain);
+ }
+ break;
}
return FALSE;
{
size_t retval = (size_t) -1;
lock_ObtainMutex(&g.expirationCheckLock);
+ if ( KFW_is_available() )
+ KFW_AFS_renew_expiring_credentials();
lock_ObtainMutex(&g.credsLock);
for (size_t iCreds = 0; iCreds < g.cCreds; ++iCreds)
{
llExpires /= c100ns1SECOND;
if (llExpires <= (llNow + (LONGLONG)cminREMIND_WARN * csec1MINUTE))
+ {
+ if ( KFW_is_available() &&
+ KFW_AFS_renew_token_for_cell(g.aCreds[ iCreds ].szCell) )
+ continue;
retval = (size_t) iCreds;
break;
+ }
}
lock_ReleaseMutex(&g.credsLock);
blob.out_size = MAXSIZE;
blob.out = space;
- code = pioctl(PCCHAR(strPath), VIOC_FILE_CELL_NAME, &blob, 1);
- if (code) {
- if ((errno == EINVAL) || (errno == ENOENT)) return FALSE;
- }
+ code = pioctl((LPTSTR)((LPCTSTR)strPath), VIOC_FILE_CELL_NAME, &blob, 1);
+ if (code)
+ return FALSE;
return TRUE;
}
BOOL CPartitionInfoDlg::OnInitDialog()
{
+ double percentUsed; // because partition sizes are big
+
CDialog::OnInitDialog();
- ASSERT(m_nFree != 0);
+ ASSERT(m_nSize != 0);
CString strSize;
strSize.Format("%ld", m_nSize);
m_Size.SetWindowText(strSize);
m_Free.SetWindowText(strFree);
- m_PercentUsed.SetWindowText(strPerUsed);
+ percentUsed = ( double(m_nSize - m_nFree) * 100.0l ) / double(m_nSize);
+ strPerUsed.Format("%2.2lf", percentUsed );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
// Don't add any menu items if we're being asked to deal with this file as a shortcut.
if (uFlags & CMF_VERBSONLY)
- return ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_NULL, (USHORT)0));
+ return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, (USHORT)0);
// Check to see if there's already an AFS menu here; if so, remove it
int nItemsNow = GetMenuItemCount (hMenu);
// Add a separator after us
::InsertMenu (hMenu, indexMenu + indexShellMenu++, MF_STRING | MF_BYPOSITION | MF_SEPARATOR, 0, TEXT(""));
- return ResultFromScode(MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_NULL,
- (USHORT)indexAfsMenu + indexVolPartMenu + indexMountPointMenu + indexShellMenu + indexSymbolicMenu));
+ return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL,
+ (USHORT)indexAfsMenu + indexVolPartMenu + indexMountPointMenu + indexShellMenu + indexSymbolicMenu);
}
STDMETHODIMP CShellExt::XMenuExt::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
// Use the given IDataObject to get a list of filenames (CF_HDROP)
hres = pdobj->GetData(&fmte, &medium);
- if (FAILED(hres))
+ if (FAILED(hres)) {
return E_FAIL;
+ }
int nNumFiles = DragQueryFile((HDROP)medium.hGlobal, 0xFFFFFFFF, NULL, 0);
if (nNumFiles == 0)
}
if (pThis->m_astrFileNames.GetSize() > 0)
- hres = S_OK;
+ hres = NOERROR;
else
hres = E_FAIL;
}
// IShellExtInit interface
BEGIN_INTERFACE_PART(ShellInit, IShellExtInit)
- STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder,LPDATAOBJECT lpdobj, HKEY hkeyProgID);
+ STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder,IDataObject *lpdobj, HKEY hkeyProgID);
END_INTERFACE_PART(ShellInit)
BEGIN_INTERFACE_PART(IconExt, IShellIconOverlayIdentifier)
!IFDEF OSIEVENT
$(INCFILEDIR)\osievent.h \
!ENDIF
- $(INCFILEDIR)\osithrdnt.h
+ $(INCFILEDIR)\osithrdnt.h \
+ $(INCFILEDIR)\largeint.h
$(INCFILEDIR)\dbrpc.h: dbrpc.h
--- /dev/null
+/*--
+
+Module Name:
+
+ largeint.h
+
+Abstract:
+
+ Include file for sample Large Integer Arithmetic routines.
+ This file includes all of the prototypes for the routines found in
+ largeint.lib. For complete descriptions of these functions, see the
+ largeint.s source file for MIPS, or the divlarge.c and largeint.asm
+ source files for x86.
+
+Revision History:
+
+--*/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+//Large integer arithmetic routines.
+//
+
+//
+// Large integer add - 64-bits + 64-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerAdd (
+ LARGE_INTEGER Addend1,
+ LARGE_INTEGER Addend2
+ );
+
+//
+// Enlarged integer multiply - 32-bits * 32-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+EnlargedIntegerMultiply (
+ LONG Multiplicand,
+ LONG Multiplier
+ );
+
+//
+// Unsigned enlarged integer multiply - 32-bits * 32-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+EnlargedUnsignedMultiply (
+ ULONG Multiplicand,
+ ULONG Multiplier
+ );
+
+//
+// Enlarged integer divide - 64-bits / 32-bits > 32-bits
+//
+
+ULONG
+WINAPI
+EnlargedUnsignedDivide (
+ IN ULARGE_INTEGER Dividend,
+ IN ULONG Divisor,
+ IN PULONG Remainder
+ );
+
+//
+// Extended large integer magic divide - 64-bits / 32-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+ExtendedMagicDivide (
+ LARGE_INTEGER Dividend,
+ LARGE_INTEGER MagicDivisor,
+ CCHAR ShiftCount
+ );
+
+//
+// Large Integer divide - 64-bits / 32-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+ExtendedLargeIntegerDivide (
+ LARGE_INTEGER Dividend,
+ ULONG Divisor,
+ PULONG Remainder
+ );
+
+//
+// Large Integer divide - 64-bits / 32-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerDivide (
+ LARGE_INTEGER Dividend,
+ LARGE_INTEGER Divisor,
+ PLARGE_INTEGER Remainder
+ );
+
+//
+// Extended integer multiply - 32-bits * 64-bits -> 64-bits
+//
+
+LARGE_INTEGER
+WINAPI
+ExtendedIntegerMultiply (
+ LARGE_INTEGER Multiplicand,
+ LONG Multiplier
+ );
+
+//
+// Large integer negation - -(64-bits)
+//
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerNegate (
+ LARGE_INTEGER Subtrahend
+ );
+
+//
+// Large integer subtract - 64-bits - 64-bits -> 64-bits.
+//
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerSubtract (
+ LARGE_INTEGER Minuend,
+ LARGE_INTEGER Subtrahend
+ );
+
+//
+// Large integer and - 64-bite & 64-bits -> 64-bits.
+//
+
+#define LargeIntegerAnd(Result, Source, Mask) \
+ { \
+ Result.HighPart = Source.HighPart & Mask.HighPart; \
+ Result.LowPart = Source.LowPart & Mask.LowPart; \
+ }
+
+
+//
+// Large integer conversion routines.
+//
+
+//
+// Convert signed integer to large integer.
+//
+
+LARGE_INTEGER
+WINAPI
+ConvertLongToLargeInteger (
+ LONG SignedInteger
+ );
+
+//
+// Convert unsigned integer to large integer.
+//
+
+LARGE_INTEGER
+WINAPI
+ConvertUlongToLargeInteger (
+ ULONG UnsignedInteger
+ );
+
+
+//
+// Large integer shift routines.
+//
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerShiftLeft (
+ LARGE_INTEGER LargeInteger,
+ CCHAR ShiftCount
+ );
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerShiftRight (
+ LARGE_INTEGER LargeInteger,
+ CCHAR ShiftCount
+ );
+
+LARGE_INTEGER
+WINAPI
+LargeIntegerArithmeticShift (
+ LARGE_INTEGER LargeInteger,
+ CCHAR ShiftCount
+ );
+
+#define LargeIntegerGreaterThan(X,Y) ( \
+ (((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \
+ ((X).HighPart > (Y).HighPart) \
+)
+
+#define LargeIntegerGreaterThanOrEqualTo(X,Y) ( \
+ (((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \
+ ((X).HighPart > (Y).HighPart) \
+)
+
+#define LargeIntegerEqualTo(X,Y) ( \
+ !(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \
+)
+
+#define LargeIntegerNotEqualTo(X,Y) ( \
+ (((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \
+)
+
+#define LargeIntegerLessThan(X,Y) ( \
+ (((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \
+ ((X).HighPart < (Y).HighPart) \
+)
+
+#define LargeIntegerLessThanOrEqualTo(X,Y) ( \
+ (((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \
+ ((X).HighPart < (Y).HighPart) \
+)
+
+#define LargeIntegerGreaterThanZero(X) ( \
+ (((X).HighPart == 0) && ((X).LowPart > 0)) || \
+ ((X).HighPart > 0 ) \
+)
+
+#define LargeIntegerGreaterOrEqualToZero(X) ( \
+ (X).HighPart >= 0 \
+)
+
+#define LargeIntegerEqualToZero(X) ( \
+ !((X).LowPart | (X).HighPart) \
+)
+
+#define LargeIntegerNotEqualToZero(X) ( \
+ ((X).LowPart | (X).HighPart) \
+)
+
+#define LargeIntegerLessThanZero(X) ( \
+ ((X).HighPart < 0) \
+)
+
+#define LargeIntegerLessOrEqualToZero(X) ( \
+ ((X).HighPart < 0) || !((X).LowPart | (X).HighPart) \
+)
+
+#ifdef __cplusplus
+}
+#endif
+
osi_InitTraceOption @61
osi_LogEvent0 @62
osi_LogEvent @63
+ osi_HexifyString @64
#ifndef DJGPP
#include <rpc.h>
#if !defined(_MSC_VER) || (_MSC_VER < 1300)
-#include <largeint.h>
+#include "largeint.h"
#endif
#include "osithrdnt.h"
#else /* DJGPP */
lep->parms[1] = p1;
lep->parms[2] = p2;
lep->parms[3] = p3;
+
+#ifdef NOTSERVICE
+ printf( "%9ld:", lep->micros );
+ printf( formatp, p0, p1, p2, p3);
+ printf( "\n" );
+#endif
+
thrd_LeaveCrit(&logp->cs);
}
DeregisterEventSource(h);
va_end(marker);
}
+
+char *osi_HexifyString(char *s) {
+ int len,c;
+ char *hex = "0123456789abcdef";
+ char *buf, *counter, *bufp;
+
+ len = strlen(s);
+
+ bufp = buf = malloc( len * 3 ); /* [xx.xx.xx.xx\0] */
+
+ if(!buf) return NULL;
+
+ for(counter = s; *counter; counter ++) {
+ if(counter != s) *bufp++ = '.';
+ c = *counter;
+ *bufp++ = hex[(c>>4) & 0xf];
+ *bufp++ = hex[c & 0xf];
+ }
+ *bufp = 0;
+
+ return buf;
+}
+
extern void osi_InitTraceOption();
extern void osi_LogEvent0(char *a,char *b);
extern void osi_LogEvent(char *a,char *b,char *c,...);
+extern char *osi_HexifyString(char *s);
/* define macros */
#define osi_Log0(l,f) osi_LogAdd((l), (f), 0, 0, 0, 0)
#include "osibasel.h"
#if !defined(_MSC_VER) || (_MSC_VER < 1300)
-#include <largeint.h>
+#include "largeint.h"
#endif
#include "osiqueue.h"
-:Base AFS-CC.HLP\r
-:Title IBM AFS Control Center\r
-1 AFS Control Center Configuration\r
-2 Default Cell\r
-3 Setting a Default AFS Cell to Administer=Cell_Membership>main\r
-2 Cell Database\r
-3 Overview=Cell_Database_Overview>main\r
-3 Adding Cells to Your Cell Database=Adding_Cells_to_Your_Cell_Database>main\r
-3 Changing Cell Information=Changing_Cell_Information>main\r
-3 Removing Cells From Your Cell Database=Removing_Cells_From_Your_Cell_Database>main\r
+:Base AFS-CC.HLP
+:Title IBM AFS Control Center
+1 AFS Control Center Configuration
+2 Default Cell
+3 Setting a Default AFS Cell to Administer=Cell_Membership>main
+2 Cell Database
+3 Overview=Cell_Database_Overview>main
+3 Adding Cells to Your Cell Database=Adding_Cells_to_Your_Cell_Database>main
+3 Changing Cell Information=Changing_Cell_Information>main
+3 Removing Cells From Your Cell Database=Removing_Cells_From_Your_Cell_Database>main
-:Base AFS-LIGHT.HLP\r
-:Title IBM AFS Light\r
-1 Overview\r
-2 About AFS=Working_in_AFS>main\r
-2 AFS Storage Concepts=AFSFileStorageConcepts>main\r
-2 AFS Security Concepts=AFS_security_concepts>main\r
-2 About AFS Light=AFS_Client>main\r
-2 About Help=Audience_and_Purpose>main\r
-1 Getting Started\r
-2 Overview=Running_AFS>main\r
-2 Identifying an AFS Light Gateway=Adding_your_Client_to_a_Cell>main\r
-2 Mounting the AFS Filespace=Mapping_Drives_Overview>main\r
-2 Authenticating to AFS=Authentication>main\r
-2 Verifying Authentication=VerifyingAuthentication@AFS-LIGHT.HLP>main\r
-2 Unauthenticating from AFS=UnauthenticatingfromAFS@AFS-LIGHT.HLP>main\r
-1 Managing AFS\r
-2 Overview=AccessingAFS@AFS-LIGHT.HLP>main\r
-2 AFS Menu=FileManagerAFSMenu>main\r
-2 AFS Light Configuration Utility=AFS_Client_Configuration_Utility>main\r
-2 AFS Light Program Group=The_AFS_Client_Program_Group>main\r
-2 AFS Light Property Box=AFS_Credentials_utility.>main\r
-2 Command Prompt Commands=CommandPromptCommands@AFS-LIGHT.HLP>main\r
-1 Using AFS\r
-2 Access Control Lists\r
-3 Overview\r
-4 Access Control Lists=ProtectingFilesandDirectories>main\r
-4 Directory-Level Access Control=Directory.LevelAccessControl>main\r
-4 AFS Access Permissions=AFSAccessPermissions>main\r
-4 Additional Access Permissions=OtherVariablePermissions>main\r
-4 Normal and Negative Entries=NormalandNegativeEntries>main\r
-3 Using Access Control Lists\r
-4 Setting ACLs=AccessControlLists>main\r
-4 Adding ACL Entries=AddACLEntry>main\r
-4 Removing ACL Entries=Removing_ACL_Entries>main\r
-4 Copying ACLs=CopyACL>main\r
-2 Volumes and Partitions\r
-3 Overview=Volumes_and_Partitions>main\r
-3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main\r
-3 Refresh name/ID map=Refreshname.IDmap>main\r
-2 Mount Points\r
-3 Overview=Mount_Point_first_page>main\r
-3 Displaying Mount Points=Displaying_Mount_Points>main\r
-3 Removing Mount Points=Removing_Mount_Points>main\r
-3 Making Mount Points=Making_Mount_Points>main\r
-2 Cached Files\r
-3 Overview=Cached_Files>main\r
-3 Flushing Files and Directories=Flushing_files_or_directories>main\r
-3 Flushing Volumes=Flushing_Volumes>main\r
-2 Server Information\r
-3 Overview=ListingFileServerInformation>main\r
-3 Showing File Servers=Showing_File_Servers>main\r
-3 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main\r
-2 Cells\r
-3 Listing Information\r
-4 Showing Cells=Showing_Cell>main\r
-3 Cell Database\r
-4 Overview=Cells>main\r
-4 Adding Cells=Adding_Cells_to_your_Cell_Database>main\r
-4 Changing Cell Information=Changing_Cell_Information>main\r
-4 Removing Cells=Deleting_Cell_Information>main\r
-1 Reference\r
-2 Glossary=Glossary>main\r
-2 How To...=How_To...>main\r
+:Base AFS-LIGHT.HLP
+:Title IBM AFS Light
+1 Overview
+2 About AFS=Working_in_AFS>main
+2 AFS Storage Concepts=AFSFileStorageConcepts>main
+2 AFS Security Concepts=AFS_security_concepts>main
+2 About AFS Light=AFS_Client>main
+2 About Help=Audience_and_Purpose>main
+1 Getting Started
+2 Overview=Running_AFS>main
+2 Identifying an AFS Light Gateway=Adding_your_Client_to_a_Cell>main
+2 Mounting the AFS Filespace=Mapping_Drives_Overview>main
+2 Authenticating to AFS=Authentication>main
+2 Verifying Authentication=VerifyingAuthentication@AFS-LIGHT.HLP>main
+2 Unauthenticating from AFS=UnauthenticatingfromAFS@AFS-LIGHT.HLP>main
+1 Managing AFS
+2 Overview=AccessingAFS@AFS-LIGHT.HLP>main
+2 AFS Menu=FileManagerAFSMenu>main
+2 AFS Light Configuration Utility=AFS_Client_Configuration_Utility>main
+2 AFS Light Program Group=The_AFS_Client_Program_Group>main
+2 AFS Light Property Box=AFS_Credentials_utility.>main
+2 Command Prompt Commands=CommandPromptCommands@AFS-LIGHT.HLP>main
+1 Using AFS
+2 Access Control Lists
+3 Overview
+4 Access Control Lists=ProtectingFilesandDirectories>main
+4 Directory-Level Access Control=Directory.LevelAccessControl>main
+4 AFS Access Permissions=AFSAccessPermissions>main
+4 Additional Access Permissions=OtherVariablePermissions>main
+4 Normal and Negative Entries=NormalandNegativeEntries>main
+3 Using Access Control Lists
+4 Setting ACLs=AccessControlLists>main
+4 Adding ACL Entries=AddACLEntry>main
+4 Removing ACL Entries=Removing_ACL_Entries>main
+4 Copying ACLs=CopyACL>main
+2 Volumes and Partitions
+3 Overview=Volumes_and_Partitions>main
+3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main
+3 Refresh name/ID map=Refreshname.IDmap>main
+2 Mount Points
+3 Overview=Mount_Point_first_page>main
+3 Displaying Mount Points=Displaying_Mount_Points>main
+3 Removing Mount Points=Removing_Mount_Points>main
+3 Making Mount Points=Making_Mount_Points>main
+2 Cached Files
+3 Overview=Cached_Files>main
+3 Flushing Files and Directories=Flushing_files_or_directories>main
+3 Flushing Volumes=Flushing_Volumes>main
+2 Server Information
+3 Overview=ListingFileServerInformation>main
+3 Showing File Servers=Showing_File_Servers>main
+3 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main
+2 Cells
+3 Listing Information
+4 Showing Cells=Showing_Cell>main
+3 Cell Database
+4 Overview=Cells>main
+4 Adding Cells=Adding_Cells_to_your_Cell_Database>main
+4 Changing Cell Information=Changing_Cell_Information>main
+4 Removing Cells=Deleting_Cell_Information>main
+1 Reference
+2 Glossary=Glossary>main
+2 How To...=How_To...>main
-:Base AFS-NT.HLP\r
-:Title IBM AFS Client\r
-1 Overview\r
-2 About AFS=Working_in_AFS>main\r
-2 AFS Storage Concepts=AFSFileStorageConcepts>main\r
-2 AFS Security Concepts=AFS_security_concepts>main\r
-2 About the AFS Client=AFS_Client>main\r
-2 About Help=Audience_and_Purpose>main\r
-1 Getting Started\r
-2 Overview=Running_AFS>main\r
-2 Making your AFS Client a Member of a Cell=Adding_your_Client_to_a_Cell>main\r
-2 AFS Client Wizard=IDH_AFSCREDS_WIZ_START>main\r
-2 Starting and Stopping the AFS Client=StartingandStoppingtheAFSClient@afs-nt.hlp>main\r
-2 Changing the Startup Type of Your AFS Client=ChangingtheStartupTypeofYourAFSClient@afs-nt.hlp>main\r
-2 Mounting the AFS Filespace=Mapping_Drives_Overview>main\r
-2 Authenticating to AFS=Authentication>main\r
-2 Verifying Authentication=VerifyingAuthentication@afs-nt.hlp>main\r
-2 Unauthenticating from AFS=UnauthenticatingfromAFS@afs-nt.hlp>main\r
-1 Managing AFS\r
-2 Overview=AccessingAFS@afs-nt.hlp>main\r
-2 AFS Menu=FileManagerAFSMenu>main\r
-2 AFS Client Configuration Utility=AFS_Client_Configuration_Utility>main\r
-2 AFS Client Program Group=The_AFS_Client_Program_Group>main\r
-2 AFS Client Property Box=AFS_Credentials_utility.>main\r
-2 Command Prompt Commands=CommandPromptCommands@afs-nt.hlp>main\r
-1 Using AFS\r
-2 Access Control Lists\r
-3 Overview\r
-4 Access Control Lists=ProtectingFilesandDirectories>main\r
-4 Directory-Level Access Control=Directory.LevelAccessControl>main\r
-4 AFS Access Permissions=AFSAccessPermissions>main\r
-4 Additional Access Permissions=OtherVariablePermissions>main\r
-4 Normal and Negative Entries=NormalandNegativeEntries>main\r
-3 Using Access Control Lists\r
-4 Setting ACLs=AccessControlLists>main\r
-4 Adding ACL Entries=AddACLEntry>main\r
-4 Removing ACL Entries=Removing_ACL_Entries>main\r
-4 Copying ACLs=CopyACL>main\r
-2 Volumes and Partitions\r
-3 Overview=Volumes_and_Partitions>main\r
-3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main\r
-3 Refreshing Name/Volume ID Mappings=Refreshname.IDmap>main\r
-2 Mount Points\r
-3 Overview=Mount_Point_first_page>main\r
-3 Displaying Mount Point Information=Displaying_Mount_Points>main\r
-3 Removing Mount Points=Removing_Mount_Points>main\r
-3 Creating Mount Points=Making_Mount_Points>main\r
-2 Cached Files\r
-3 Overview=Cached_Files>main\r
-3 Flushing Files and Directories=Flushing_files_or_directories>main\r
-3 Flushing Volumes=Flushing_Volumes>main\r
-2 Servers\r
-3 Listing Information\r
-4 Overview=ListingFileServerInformation>main\r
-4 Showing File Servers=Showing_File_Servers>main\r
-4 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main\r
-3 Server Preferences\r
-4 Overview=Server_Prefs_Overview>main\r
-4 Viewing Server Preferences=Viewing_Server_Preferences>main\r
-4 Adding Server Preferences=Adding_Server_Preferences>main\r
-4 Modifying Server Preferences=Modifying_Server_Preferences>main\r
-2 Cells\r
-3 Listing Information\r
-4 Showing Cells=Showing_Cell>main\r
-3 Cell Database\r
-4 Overview=Cells>main\r
-4 Adding Cells=Adding_Cells_to_your_Cell_Database>main\r
-4 Changing Cell Information=Changing_Cell_Information>main\r
-4 Removing Cells=Deleting_Cell_Information>main\r
-2 Submounts\r
-3 Overview=Submounts_Overview>main\r
-3 Creating Submounts=Creating_Submounts>main\r
-3 Modifying Submounts=Change_or_Edit_Submounts>main\r
-3 Removing Submounts=Delete_Submounts>main\r
-1 Reference\r
-2 Glossary=Glossary>main\r
-2 How To...=How_To...>main\r
+:Base AFS-NT.HLP
+:Title IBM AFS Client
+1 Overview
+2 About AFS=Working_in_AFS>main
+2 AFS Storage Concepts=AFSFileStorageConcepts>main
+2 AFS Security Concepts=AFS_security_concepts>main
+2 About the AFS Client=AFS_Client>main
+2 About Help=Audience_and_Purpose>main
+1 Getting Started
+2 Overview=Running_AFS>main
+2 Making your AFS Client a Member of a Cell=Adding_your_Client_to_a_Cell>main
+2 AFS Client Wizard=IDH_AFSCREDS_WIZ_START>main
+2 Starting and Stopping the AFS Client=StartingandStoppingtheAFSClient@afs-nt.hlp>main
+2 Changing the Startup Type of Your AFS Client=ChangingtheStartupTypeofYourAFSClient@afs-nt.hlp>main
+2 Mounting the AFS Filespace=Mapping_Drives_Overview>main
+2 Authenticating to AFS=Authentication>main
+2 Verifying Authentication=VerifyingAuthentication@afs-nt.hlp>main
+2 Unauthenticating from AFS=UnauthenticatingfromAFS@afs-nt.hlp>main
+1 Managing AFS
+2 Overview=AccessingAFS@afs-nt.hlp>main
+2 AFS Menu=FileManagerAFSMenu>main
+2 AFS Client Configuration Utility=AFS_Client_Configuration_Utility>main
+2 AFS Client Program Group=The_AFS_Client_Program_Group>main
+2 AFS Client Property Box=AFS_Credentials_utility.>main
+2 Command Prompt Commands=CommandPromptCommands@afs-nt.hlp>main
+1 Using AFS
+2 Access Control Lists
+3 Overview
+4 Access Control Lists=ProtectingFilesandDirectories>main
+4 Directory-Level Access Control=Directory.LevelAccessControl>main
+4 AFS Access Permissions=AFSAccessPermissions>main
+4 Additional Access Permissions=OtherVariablePermissions>main
+4 Normal and Negative Entries=NormalandNegativeEntries>main
+3 Using Access Control Lists
+4 Setting ACLs=AccessControlLists>main
+4 Adding ACL Entries=AddACLEntry>main
+4 Removing ACL Entries=Removing_ACL_Entries>main
+4 Copying ACLs=CopyACL>main
+2 Volumes and Partitions
+3 Overview=Volumes_and_Partitions>main
+3 Displaying Volume and Partition Information=Displaying_Volume_and_Partition_information>main
+3 Refreshing Name/Volume ID Mappings=Refreshname.IDmap>main
+2 Mount Points
+3 Overview=Mount_Point_first_page>main
+3 Displaying Mount Point Information=Displaying_Mount_Points>main
+3 Removing Mount Points=Removing_Mount_Points>main
+3 Creating Mount Points=Making_Mount_Points>main
+2 Cached Files
+3 Overview=Cached_Files>main
+3 Flushing Files and Directories=Flushing_files_or_directories>main
+3 Flushing Volumes=Flushing_Volumes>main
+2 Servers
+3 Listing Information
+4 Overview=ListingFileServerInformation>main
+4 Showing File Servers=Showing_File_Servers>main
+4 Showing the Status of File Servers=Showing_the_Status_of_File_Servers>main
+3 Server Preferences
+4 Overview=Server_Prefs_Overview>main
+4 Viewing Server Preferences=Viewing_Server_Preferences>main
+4 Adding Server Preferences=Adding_Server_Preferences>main
+4 Modifying Server Preferences=Modifying_Server_Preferences>main
+2 Cells
+3 Listing Information
+4 Showing Cells=Showing_Cell>main
+3 Cell Database
+4 Overview=Cells>main
+4 Adding Cells=Adding_Cells_to_your_Cell_Database>main
+4 Changing Cell Information=Changing_Cell_Information>main
+4 Removing Cells=Deleting_Cell_Information>main
+2 Submounts
+3 Overview=Submounts_Overview>main
+3 Creating Submounts=Creating_Submounts>main
+3 Modifying Submounts=Change_or_Edit_Submounts>main
+3 Removing Submounts=Delete_Submounts>main
+1 Reference
+2 Glossary=Glossary>main
+2 How To...=How_To...>main
-:Base TAAFSCFG.HLP\r
-:Title IBM AFS Server Configuration\r
-1 AFS Server Configuration Help\r
-2 About AFS and the AFS Server and AFS Control Center=About_AFS_and_the_AFS_Server_and_AFS_Control_Center\r
-2 Configuring the AFS Server\r
-3 Overview=Configuring_the_AFS_Server\r
-3 The AFS Server Configuration Wizard=The_AFS_Server_Configuration_Wizard\r
-3 To Configure the AFS Server into an Existing Cell=Configuring_the_AFS_Server_into_an_Existing_Cell\r
-3 To Configure the AFS Server as the First AFS Server in a Cell=Configuring_the_AFS_Server_as_the_First_AFS_Server_in_a_Cell\r
-3 Accessing AFS Data=Accessing_AFS_Data\r
-2 The AFS Server Configuration Dialog Box\r
-3 Overview=The_AFS_Server_Configuration_Dialog_Box\r
-3 To Access the AFS Server Configuration Dialog Box=To_Access_the_AFS_Server_Configuration_Dialog_Box\r
-3 Partitions Tab\r
-4 Overview=IDH_PARTITIONS_PAGE\r
-4 Setting Up AFS Partitions\r
-5 Overview=Setting_Up_AFS_Partitions\r
-5 To Create an AFS Partition=To_Create_an_AFS_Partion\r
-4 Administering AFS Partitions\r
-5 Overview=Administering_AFS_Partitions\r
-5 Salvaging an AFS Partition\r
-6 Overview=Salvaging_an_AFS_Partition\r
-6 To Salvage an AFS Partition=To_Salvage_an_AFS_Partition\r
-5 Removing AFS Partitions\r
-6 Overview=Removing_AFS_Partitions\r
-6 To Remove an AFS Partition=To_Remove_an_AFS_Partition\r
-3 Services Tab\r
-4 Overview=IDH_SERVICES_PAGE\r
-4 AFS Server Roles=AFS_Server_Roles\r
-4 AFS Services=AFS_Services\r
-4 To Configure and Start an AFS Service=To_Configure_and_Start_an_AFS_Service\r
-4 To Stop and Unconfigure an AFS Service=To_Stop_and_Unconfigure_an_AFS_Service\r
+:Base TAAFSCFG.HLP
+:Title IBM AFS Server Configuration
+1 AFS Server Configuration Help
+2 About AFS and the AFS Server and AFS Control Center=About_AFS_and_the_AFS_Server_and_AFS_Control_Center
+2 Configuring the AFS Server
+3 Overview=Configuring_the_AFS_Server
+3 The AFS Server Configuration Wizard=The_AFS_Server_Configuration_Wizard
+3 To Configure the AFS Server into an Existing Cell=Configuring_the_AFS_Server_into_an_Existing_Cell
+3 To Configure the AFS Server as the First AFS Server in a Cell=Configuring_the_AFS_Server_as_the_First_AFS_Server_in_a_Cell
+3 Accessing AFS Data=Accessing_AFS_Data
+2 The AFS Server Configuration Dialog Box
+3 Overview=The_AFS_Server_Configuration_Dialog_Box
+3 To Access the AFS Server Configuration Dialog Box=To_Access_the_AFS_Server_Configuration_Dialog_Box
+3 Partitions Tab
+4 Overview=IDH_PARTITIONS_PAGE
+4 Setting Up AFS Partitions
+5 Overview=Setting_Up_AFS_Partitions
+5 To Create an AFS Partition=To_Create_an_AFS_Partion
+4 Administering AFS Partitions
+5 Overview=Administering_AFS_Partitions
+5 Salvaging an AFS Partition
+6 Overview=Salvaging_an_AFS_Partition
+6 To Salvage an AFS Partition=To_Salvage_an_AFS_Partition
+5 Removing AFS Partitions
+6 Overview=Removing_AFS_Partitions
+6 To Remove an AFS Partition=To_Remove_an_AFS_Partition
+3 Services Tab
+4 Overview=IDH_SERVICES_PAGE
+4 AFS Server Roles=AFS_Server_Roles
+4 AFS Services=AFS_Services
+4 To Configure and Start an AFS Service=To_Configure_and_Start_an_AFS_Service
+4 To Stop and Unconfigure an AFS Service=To_Stop_and_Unconfigure_an_AFS_Service
-:Base TAAFSSVRMGR.HLP\r
-:Title IBM AFS Server Manager\r
-1 AFS Server Manager\r
-2 Overview of AFS\r
-3 AFS: Overview=AFS__Overview\r
-3 AFS Cells=DCE_Cells\r
-2 AFS Server Manager\r
-3 AFS Server Manager: Overview=DFS_Server_Manager\r
-2 Authenticating to AFS\r
-3 To Authenticate to AFS=To_Obtain_DCE_Credentials\r
-3 To Choose an AFS Cell to Administer=To_Choose_a_DCE_Cell_to_Administer\r
-2 AFS Servers\r
-3 Servers: Overview=Servers__An_Overview\r
-3 Maintaining AFS Servers=Setting_Up_and_Maintaining_DFS_Servers\r
-3 Monitoring Server Subsets=Monitoring_Server_Subsets\r
-3 Server Properties=Server_Properties\r
-3 Server Warnings=Server_Warnings\r
-3 Administrators for a Server\r
-4 Administrators for a Server: Overview=Administrators_for_a_Server\r
-4 To Add or Remove a User from the Administrators List for a Server=To_Edit_an_Administrative_List\r
-3 Server Encryption Keys\r
-4 Server Encryption Keys: Overview=Server_Encryption_Keys\r
-4 To Add a New Server Encryption Key=To_Add_a_New_Server_Key\r
-4 To Remove a Server Encryption Key=To_Remove_a_Server_Encryption_Key\r
-3 Server Files\r
-4 To Install a New File on a Server=To_Install_New_Files_on_a_Server\r
-4 To Install the Former Versions of Binary Files on a Server=To_Install_Former_Versions_of_Binary_Files_on_a_Server\r
-4 To Prune Files from a Server=To_Prune_Files_from_a_Server\r
-4 To Get File Dates=To_Get_File_Dates\r
-3 Synchronizing the VLDB on a Server\r
-4 Synchronizing the VLDB=Synchronizing_the_FLDB\r
-4 To Synchronize the VLDB on a Server=To_Synchronize_the_FLDB\r
-2 AFS Partitions\r
-3 Partitions: Overview=Partitions__An_Overview\r
-3 Partitions Properties=Partition_Properties\r
-3 Partitions Warnings=Partition_Warnings\r
-2 AFS Volumes\r
-3 Volumes: Overview=Filesets__An_Overview\r
-3 The Different Types of Volumes =Read__Write_and_Read_Only_Filesets\r
-3 The Volume Location Database (VLDB)=FLDB__Fileset_Location_Database_\r
-3 Volume Properties=Fileset_Properties\r
-3 To Create a Volume =To_Create_a_Fileset\r
-3 To Rename a Volume =To_Rename_a_Fileset\r
-3 To Delete a Volume =To_Delete_a_Fileset\r
-3 Moving Volumes\r
-4 Moving Volumes: Overview=Moving_Filesets\r
-4 To Move a Volume =To_Move_a_Fileset\r
-3 Creating Backup Versions of Volumes\r
-4 To Create a Backup Version of a Volume=IDH_SVRMGR_CLONE_OVERVIEW\r
-4 To Create Backup Versions of Multiple Volumes=To_Clone_Multiple_Filesets\r
-3 Locking and Unlocking Volumes\r
-4 Locking and Unlocking VLDB Entries=Locking_and_Unlocking_Filesets\r
-4 To Determine if a Volume is Locked=To_Determine_Whether_a_Fileset_Entry_is_Locked\r
-4 To Lock a Volume =To_Lock_a_Fileset\r
-4 To Unlock a Volume =To_Unlock_a_Fileset\r
-3 Dumping and Restoring Volumes\r
-4 Dumping Volumes=Dumping_and_Restoring_Filesets\r
-4 To Dump a Volume =To_Dump_a_Fileset\r
-4 Restoring Volumes=Restoring_Filesets\r
-4 Restoring Incremental Volume Dumps =Restoring_Multiple_Incremental_Dumps_of_a_Fileset\r
-4 To Restore a Dump File=To_Restore_a_Dump_File_to_a_New_Fileset\r
-3 Volume Warnings=Fileset_Warnings\r
-2 AFS Volume Replication\r
-3 Replicating Volumes=Replicating_Filesets\r
-3 To Create a New Volume Replication Site=To_Create_a_New_Fileset_Replication_Site\r
-3 To Replicate a Volume =To_Replicate_a_Fileset\r
-3 Updating Volume Replicas=Updating_Replicas\r
-2 AFS Services\r
-3 Services: Overview=Services__An_Overview\r
-3 Setting Up and Maintaining AFS Services=Setting_Up_and_Maintaining_DFS_Services\r
-3 Service Properties=Service_Properties\r
-3 To Create a Service=To_Create_a_Service\r
-3 To Delete a Service=To_Delete_a_Service\r
-3 To Start a Service=To_Start_a_Service\r
-3 To Stop a Service=To_Stop_a_Service\r
-3 To Restart a Service=To_Restart_a_Service\r
-3 To Set BOS Service Restart Dates=To_Set_BOS_Service_Restart_Dates_and_Times\r
-3 To View Service Status and Details=To_View_Service_Status_and_Details\r
-3 Service Log Files\r
-4 Log Files=Log_Files\r
-4 To View a Service Log File=To_View_Service_Log\r
-2 Salvaging Volumes\r
-3 Salvaging Volumes: Overview=Salvaging_Volumes\r
-3 To Salvage all Volumes on a File Server=To_Salvage_all_Volumes_on_a_File_Server\r
-3 To Salvage all Volumes on a Partition=To_Salvage_all_Volumes_on_a_Partition\r
-3 To Salvage a Volume=To_Salvage_a_Volume\r
-2 AFS Command Reference\r
-3 Reference for AFS UNIX Users=UNIX_Command_Reference\r
-3 AFS Command Prompt Commands=AFS_Command_Prompt_Commands\r
+:Base TAAFSSVRMGR.HLP
+:Title IBM AFS Server Manager
+1 AFS Server Manager
+2 Overview of AFS
+3 AFS: Overview=AFS__Overview
+3 AFS Cells=DCE_Cells
+2 AFS Server Manager
+3 AFS Server Manager: Overview=DFS_Server_Manager
+2 Authenticating to AFS
+3 To Authenticate to AFS=To_Obtain_DCE_Credentials
+3 To Choose an AFS Cell to Administer=To_Choose_a_DCE_Cell_to_Administer
+2 AFS Servers
+3 Servers: Overview=Servers__An_Overview
+3 Maintaining AFS Servers=Setting_Up_and_Maintaining_DFS_Servers
+3 Monitoring Server Subsets=Monitoring_Server_Subsets
+3 Server Properties=Server_Properties
+3 Server Warnings=Server_Warnings
+3 Administrators for a Server
+4 Administrators for a Server: Overview=Administrators_for_a_Server
+4 To Add or Remove a User from the Administrators List for a Server=To_Edit_an_Administrative_List
+3 Server Encryption Keys
+4 Server Encryption Keys: Overview=Server_Encryption_Keys
+4 To Add a New Server Encryption Key=To_Add_a_New_Server_Key
+4 To Remove a Server Encryption Key=To_Remove_a_Server_Encryption_Key
+3 Server Files
+4 To Install a New File on a Server=To_Install_New_Files_on_a_Server
+4 To Install the Former Versions of Binary Files on a Server=To_Install_Former_Versions_of_Binary_Files_on_a_Server
+4 To Prune Files from a Server=To_Prune_Files_from_a_Server
+4 To Get File Dates=To_Get_File_Dates
+3 Synchronizing the VLDB on a Server
+4 Synchronizing the VLDB=Synchronizing_the_FLDB
+4 To Synchronize the VLDB on a Server=To_Synchronize_the_FLDB
+2 AFS Partitions
+3 Partitions: Overview=Partitions__An_Overview
+3 Partitions Properties=Partition_Properties
+3 Partitions Warnings=Partition_Warnings
+2 AFS Volumes
+3 Volumes: Overview=Filesets__An_Overview
+3 The Different Types of Volumes =Read__Write_and_Read_Only_Filesets
+3 The Volume Location Database (VLDB)=FLDB__Fileset_Location_Database_
+3 Volume Properties=Fileset_Properties
+3 To Create a Volume =To_Create_a_Fileset
+3 To Rename a Volume =To_Rename_a_Fileset
+3 To Delete a Volume =To_Delete_a_Fileset
+3 Moving Volumes
+4 Moving Volumes: Overview=Moving_Filesets
+4 To Move a Volume =To_Move_a_Fileset
+3 Creating Backup Versions of Volumes
+4 To Create a Backup Version of a Volume=IDH_SVRMGR_CLONE_OVERVIEW
+4 To Create Backup Versions of Multiple Volumes=To_Clone_Multiple_Filesets
+3 Locking and Unlocking Volumes
+4 Locking and Unlocking VLDB Entries=Locking_and_Unlocking_Filesets
+4 To Determine if a Volume is Locked=To_Determine_Whether_a_Fileset_Entry_is_Locked
+4 To Lock a Volume =To_Lock_a_Fileset
+4 To Unlock a Volume =To_Unlock_a_Fileset
+3 Dumping and Restoring Volumes
+4 Dumping Volumes=Dumping_and_Restoring_Filesets
+4 To Dump a Volume =To_Dump_a_Fileset
+4 Restoring Volumes=Restoring_Filesets
+4 Restoring Incremental Volume Dumps =Restoring_Multiple_Incremental_Dumps_of_a_Fileset
+4 To Restore a Dump File=To_Restore_a_Dump_File_to_a_New_Fileset
+3 Volume Warnings=Fileset_Warnings
+2 AFS Volume Replication
+3 Replicating Volumes=Replicating_Filesets
+3 To Create a New Volume Replication Site=To_Create_a_New_Fileset_Replication_Site
+3 To Replicate a Volume =To_Replicate_a_Fileset
+3 Updating Volume Replicas=Updating_Replicas
+2 AFS Services
+3 Services: Overview=Services__An_Overview
+3 Setting Up and Maintaining AFS Services=Setting_Up_and_Maintaining_DFS_Services
+3 Service Properties=Service_Properties
+3 To Create a Service=To_Create_a_Service
+3 To Delete a Service=To_Delete_a_Service
+3 To Start a Service=To_Start_a_Service
+3 To Stop a Service=To_Stop_a_Service
+3 To Restart a Service=To_Restart_a_Service
+3 To Set BOS Service Restart Dates=To_Set_BOS_Service_Restart_Dates_and_Times
+3 To View Service Status and Details=To_View_Service_Status_and_Details
+3 Service Log Files
+4 Log Files=Log_Files
+4 To View a Service Log File=To_View_Service_Log
+2 Salvaging Volumes
+3 Salvaging Volumes: Overview=Salvaging_Volumes
+3 To Salvage all Volumes on a File Server=To_Salvage_all_Volumes_on_a_File_Server
+3 To Salvage all Volumes on a Partition=To_Salvage_all_Volumes_on_a_Partition
+3 To Salvage a Volume=To_Salvage_a_Volume
+2 AFS Command Reference
+3 Reference for AFS UNIX Users=UNIX_Command_Reference
+3 AFS Command Prompt Commands=AFS_Command_Prompt_Commands
-:Base TAAFSUSRMGR.HLP\r
-:Title IBM AFS Account Manager\r
-1 AFS Account Manager \r
-2 AFS User Accounts\r
-3 Creating AFS Accounts\r
-4 Creating AFS User Accounts=Creating_User_Entries\r
-4 To create a new AFS user account=To_create_a_single_user_account\r
-3 Password Authentication and Security\r
-4 Improving Password/Authentication Security=Improving_Password_Authentication_Security\r
-4 To limit the number of consecutive failed login attempts by a user=To_limit_the_number_of_consecutive_failed_login_attempts\r
-4 To unlock a locked user account=To_unlock_a_locked_user_account\r
-4 To set the password lifetime for an AFS user account=To_set_password_lifetime\r
-4 To restrict reuse of passwords by a user=To_restrict_reuse_of_passwords\r
-3 Changing Passwords\r
-4 Changing Passwords=Changing_Passwords\r
-4 To change a user's AFS password=To_change_a_password_in_the_Authentication_Database\r
-3 Removing User Accounts\r
-4 Removing User Accounts=Removing_User_Accounts\r
-4 To delete an AFS user account=To_remove_a_user_account\r
-2 AFS Groups\r
-3 About the Protection Database=AFS_Protection_Database\r
-3 Protection Database Entries=Protection_Database_Entries\r
-3 Using Groups\r
-4 Using Groups Effectively=Using_Groups_Effectively\r
-4 Using Prefix-Less AFS Groups=Using_Prefix_Less_Groups\r
-4 Placing IP Addresses in Groups=Placing_Machines_in_Groups\r
-4 The Standard System Groups=The_Standard_System_Groups\r
-4 Listing Information about Groups\r
-5 Listing Information about Groups=Listing_Information_about_Groups\r
-5 To view a list of the members of an AFS group=To_list_the_members_of_a_group\r
-5 To view information about an AFS group=To_examine_a_Protection_Database_group_entry\r
-5 To view a list of the groups that an AFS group owns=To_list_the_groups_that_a_group_owns\r
-4 Listing Group-Related Information about Users and Machine Entries\r
-5 Listing Group-Related Information about Users and Machine Entries=Listing_Group_Related_Information_about_Users_and_Machine_Entries\r
-5 To view a list of the groups to which an AFS user belongs=To_examine_a_Protection_Database_entry_for_a_user_or_machine\r
-5 To view a list of the groups that an AFS user owns=To_view_a_list_of_the_groups_that_an_AFS_user_owns\r
-5 To view a list of the groups that an IP address account owns=To_view_a_list_of_the_groups_that_an_IP_address_account_owns\r
-5 To view a list of the groups to which an IP address account belongs=To_view_a_list_of_the_groups_to_which_an_IP_address_account_belongs\r
-4 Creating User Entries\r
-5 Creating AFS User Accounts=Creating_User_Entries\r
-5 To create a new AFS user account=To_create_a_single_user_account\r
-4 Creating Machine Entries\r
-5 Creating IP Address Entries=Creating_Machine_Entries\r
-5 To create an IP address account in the AFS Protection Database=To_create_a_single_machine_entry_in_the_Protection_Database\r
-4 Creating Regular and Prefix-Less Groups\r
-5 Creating Regular and Prefix-Less AFS Groups=Creating_Regular_and_Prefix_Less_Groups\r
-5 To create a new regular AFS group=To_create_a_single_regular_group_entry\r
-5 To create a new prefix-less AFS group=To_create_a_single_prefix_less_group_entry\r
-4 Adding Members to Groups and Removing Them from Groups\r
-5 Adding Members to Groups and Removing Them from Groups=Adding_Members_to_Groups_and_Removing_Them_from_Groups\r
-5 To add a user or IP address account to a group=To_add_users_and_machines_to_groups\r
-5 To remove a user, IP address account, or group from an AFS group=To_remove_users_and_machines_from_groups\r
-3 Deleting Entries from the Protection Database\r
-4 Deleting Entries from the Protection Database=Deleting_Entries_from_the_Protection_Database\r
-4 To delete an AFS group=To_delete_user_and_group_entries\r
-3 Changing the Owner of an Entry\r
-4 Changing the Owner of an AFS Group=Changing_the_Owner_of_an_Entry\r
-4 The Name-Changing Implications of Changing Ownership=The_Name_Changing_Implications_of_Changing_Ownership\r
-4 To change the owner of an AFS group=To_change_the_owner_of_a_group_entry\r
-3 Changing the Name of an Entry\r
-4 Changing the Name of an AFS Group=Changing_the_Name_of_an_Entry\r
-4 To change the name of an AFS group=To_change_the_name_of_a_group_entry\r
-3 Changing Group Creation Quota\r
-4 Changing Group Creation Quota=Changing_Group_Creation_Quota\r
-4 To view the group creation quota of an AFS user=To_examine_group_creation_quota\r
-4 To change the group creation quota of an AFS user=To_change_group_creation_quota\r
+:Base TAAFSUSRMGR.HLP
+:Title IBM AFS Account Manager
+1 AFS Account Manager
+2 AFS User Accounts
+3 Creating AFS Accounts
+4 Creating AFS User Accounts=Creating_User_Entries
+4 To create a new AFS user account=To_create_a_single_user_account
+3 Password Authentication and Security
+4 Improving Password/Authentication Security=Improving_Password_Authentication_Security
+4 To limit the number of consecutive failed login attempts by a user=To_limit_the_number_of_consecutive_failed_login_attempts
+4 To unlock a locked user account=To_unlock_a_locked_user_account
+4 To set the password lifetime for an AFS user account=To_set_password_lifetime
+4 To restrict reuse of passwords by a user=To_restrict_reuse_of_passwords
+3 Changing Passwords
+4 Changing Passwords=Changing_Passwords
+4 To change a user's AFS password=To_change_a_password_in_the_Authentication_Database
+3 Removing User Accounts
+4 Removing User Accounts=Removing_User_Accounts
+4 To delete an AFS user account=To_remove_a_user_account
+2 AFS Groups
+3 About the Protection Database=AFS_Protection_Database
+3 Protection Database Entries=Protection_Database_Entries
+3 Using Groups
+4 Using Groups Effectively=Using_Groups_Effectively
+4 Using Prefix-Less AFS Groups=Using_Prefix_Less_Groups
+4 Placing IP Addresses in Groups=Placing_Machines_in_Groups
+4 The Standard System Groups=The_Standard_System_Groups
+4 Listing Information about Groups
+5 Listing Information about Groups=Listing_Information_about_Groups
+5 To view a list of the members of an AFS group=To_list_the_members_of_a_group
+5 To view information about an AFS group=To_examine_a_Protection_Database_group_entry
+5 To view a list of the groups that an AFS group owns=To_list_the_groups_that_a_group_owns
+4 Listing Group-Related Information about Users and Machine Entries
+5 Listing Group-Related Information about Users and Machine Entries=Listing_Group_Related_Information_about_Users_and_Machine_Entries
+5 To view a list of the groups to which an AFS user belongs=To_examine_a_Protection_Database_entry_for_a_user_or_machine
+5 To view a list of the groups that an AFS user owns=To_view_a_list_of_the_groups_that_an_AFS_user_owns
+5 To view a list of the groups that an IP address account owns=To_view_a_list_of_the_groups_that_an_IP_address_account_owns
+5 To view a list of the groups to which an IP address account belongs=To_view_a_list_of_the_groups_to_which_an_IP_address_account_belongs
+4 Creating User Entries
+5 Creating AFS User Accounts=Creating_User_Entries
+5 To create a new AFS user account=To_create_a_single_user_account
+4 Creating Machine Entries
+5 Creating IP Address Entries=Creating_Machine_Entries
+5 To create an IP address account in the AFS Protection Database=To_create_a_single_machine_entry_in_the_Protection_Database
+4 Creating Regular and Prefix-Less Groups
+5 Creating Regular and Prefix-Less AFS Groups=Creating_Regular_and_Prefix_Less_Groups
+5 To create a new regular AFS group=To_create_a_single_regular_group_entry
+5 To create a new prefix-less AFS group=To_create_a_single_prefix_less_group_entry
+4 Adding Members to Groups and Removing Them from Groups
+5 Adding Members to Groups and Removing Them from Groups=Adding_Members_to_Groups_and_Removing_Them_from_Groups
+5 To add a user or IP address account to a group=To_add_users_and_machines_to_groups
+5 To remove a user, IP address account, or group from an AFS group=To_remove_users_and_machines_from_groups
+3 Deleting Entries from the Protection Database
+4 Deleting Entries from the Protection Database=Deleting_Entries_from_the_Protection_Database
+4 To delete an AFS group=To_delete_user_and_group_entries
+3 Changing the Owner of an Entry
+4 Changing the Owner of an AFS Group=Changing_the_Owner_of_an_Entry
+4 The Name-Changing Implications of Changing Ownership=The_Name_Changing_Implications_of_Changing_Ownership
+4 To change the owner of an AFS group=To_change_the_owner_of_a_group_entry
+3 Changing the Name of an Entry
+4 Changing the Name of an AFS Group=Changing_the_Name_of_an_Entry
+4 To change the name of an AFS group=To_change_the_name_of_a_group_entry
+3 Changing Group Creation Quota
+4 Changing Group Creation Quota=Changing_Group_Creation_Quota
+4 To view the group creation quota of an AFS user=To_examine_group_creation_quota
+4 To change the group creation quota of an AFS user=To_change_group_creation_quota
--- /dev/null
+/*
+
+Copyright © 1996 by Project Mandarin, Inc.
+
+Error codes copyright 1996 by Massachusetts Institute of Technology
+
+*/
+
+#include "kcmacerr.h"
+
+#if defined(_WIN32)
+/* unfortunately the 32-bit compiler doesn't allow a function */
+/* to be declared as __stdcall AND __declspec(dllexport), so */
+/* I have to use a .def file for the export part */
+#define KC_CALLTYPE __stdcall
+#define KC_EXPORT
+#else
+#define KC_CALLTYPE WINAPI
+#define KC_EXPORT _export
+#endif
+
+BOOL KC_CALLTYPE GetTicketForService (LPSTR, LPSTR, LPDWORD) ;
+BOOL KC_CALLTYPE GetTicketGrantingTicket (void) ;
+BOOL KC_CALLTYPE DeleteAllSessions (void) ;
+BOOL KC_CALLTYPE SetUserName (LPSTR) ;
+#if defined(_WIN32)
+BOOL KC_CALLTYPE KCGetUserName (LPSTR) ;
+#else
+BOOL KC_CALLTYPE GetUserName (LPSTR) ;
+#endif
+BOOL KC_CALLTYPE ListTickets (HWND) ;
+void KC_CALLTYPE SetTicketLifeTime (int) ;
+void KC_CALLTYPE SetKrbdllMode (BOOL) ;
+BOOL KC_CALLTYPE TgtExist (void) ;
+#if !defined(KLITE)
+BOOL KC_CALLTYPE ChangePassword (void) ;
+#endif
+// the following two functions will exist ONLY until the other functions
+// are revised to return OSErr themselves. this minimizes the API
+// change for this release.
+OSErr KC_CALLTYPE KClientErrno(void) ;
+signed long KC_CALLTYPE KClientKerberosErrno(void) ;
+
+BOOL KC_CALLTYPE SendTicketForService(LPSTR service, LPSTR version, int fd);
+
+#ifdef _WIN32
+DWORD KC_CALLTYPE _KCGetNumInUse();
+#endif
--- /dev/null
+
+/* Error codes from Mac version of Project Mandarin Kerberos Client */
+/* Copyright © 1995 Project Mandarin, Inc. */
+
+typedef signed short OSErr;
+
+enum {
+ cKrbCorruptedFile = -1024, /* couldn't find a needed resource */
+ cKrbNoKillIO, /* can't killIO because all calls sync */
+ cKrbBadSelector, /* csCode passed doesn't select a recognized function */
+ cKrbCantClose, /* we must always remain open */
+ cKrbMapDoesntExist, /* tried to access a map that doesn't exist (index too large,
+ or criteria doesn't match anything) */
+ cKrbSessDoesntExist, /* tried to access a session that doesn't exist */
+ cKrbCredsDontExist, /* tried to access credentials that don't exist */
+ cKrbTCPunavailable, /* couldn't open MacTCP driver */
+ cKrbUserCancelled, /* user cancelled a log in operation */
+ cKrbConfigurationErr, /* Kerberos Preference file is not configured properly */
+ cKrbServerRejected, /* A server rejected our ticket */
+ cKrbServerImposter, /* Server appears to be a phoney */
+ cKrbServerRespIncomplete, /* Server response is not complete */
+ cKrbNotLoggedIn, /* Returned by cKrbGetUserName if user is not logged in */
+ cKrbOldDriver, /* old version of the driver */
+ cKrbDriverInUse, /* driver is not reentrant */
+ cKrbAppInBkgnd, /* driver won't put up password dialog when in background */
+ cKrbInvalidSession, /* invalid structure passed to KClient/KServer routine */
+
+ cKrbKerberosErrBlock = -20000 /* start of block of 256 kerberos error numbers */
+};
+
+
+/* the following are borrowed from MacTCPCommonTypes.h */
+/* MacTCP return Codes in the range -23000 through -23049 */
+#define ipBadLapErr -23000 /* bad network configuration */
+#define ipBadCnfgErr -23001 /* bad IP configuration error */
+#define ipNoCnfgErr -23002 /* missing IP or LAP configuration error */
+#define ipLoadErr -23003 /* error in MacTCP load */
+#define ipBadAddr -23004 /* error in getting address */
+#define connectionClosing -23005 /* connection is closing */
+#define invalidLength -23006
+#define connectionExists -23007 /* request conflicts with existing connection */
+#define connectionDoesntExist -23008 /* connection does not exist */
+#define insufficientResources -23009 /* insufficient resources to perform request */
+#define invalidStreamPtr -23010
+#define streamAlreadyOpen -23011
+#define connectionTerminated -23012
+#define invalidBufPtr -23013
+#define invalidRDS -23014
+#define invalidWDS -23014
+#define openFailed -23015
+#define commandTimeout -23016
+#define duplicateSocket -23017
+
+/* Error codes from internal IP functions */
+#define ipDontFragErr -23032 /* Packet too large to send w/o fragmenting */
+#define ipDestDeadErr -23033 /* destination not responding */
+#define ipNoFragMemErr -23036 /* no memory to send fragmented pkt */
+#define ipRouteErr -23037 /* can't route packet off-net */
+
+#define nameSyntaxErr -23041
+#define cacheFault -23042
+#define noResultProc -23043
+#define noNameServer -23044
+#define authNameErr -23045
+#define noAnsErr -23046
+#define dnrErr -23047
+#define outOfMemory -23048
+
--- /dev/null
+/*
+ * HA HA HA HA!!!! THIS IS A COM_ERR SUBSTITUTE!!!! HA HA HA HA!!!!
+ */
+
+#ifndef _DCNS_MIT_COM_ERR_H
+#define _DCNS_MIT_COM_ERR_H
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+#include <stdarg.h>
+
+#if !defined(WINDOWS) && !defined(_WIN32)
+#define FAR
+#define LPSTR char *
+#endif
+
+typedef LPSTR (*err_func)(int, long);
+
+#ifdef WIN16
+#define COMEXP __far __export
+int COMEXP com_err_export (LPSTR, long, LPSTR, ...);
+LPSTR COMEXP error_message_export (long);
+LPSTR COMEXP error_table_name_export(long num);
+extern int (*com_err) (LPSTR, long, LPSTR, ...);
+int mbprintf (LPSTR, LPSTR, ...);
+LPSTR (*error_message) (long);
+int (*set_com_err_hook (int (*) (LPSTR, long, LPSTR, va_list)))
+ (LPSTR, long, LPSTR, va_list);
+extern int (*reset_com_err_hook ()) (LPSTR, long, LPSTR, va_list);
+
+// extern LPSTR (*error_table_name)(long num);
+LPSTR (*error_table_name)(long num);
+
+#else
+#define COMEXP
+int com_err (LPSTR, long, LPSTR, ...);
+int mbprintf (LPSTR, LPSTR, ...);
+LPSTR error_message (long);
+int (*set_com_err_hook (int (*) (LPSTR, long, LPSTR, va_list)))
+ (LPSTR, long, LPSTR, va_list);
+int (*reset_com_err_hook ()) (LPSTR, long, LPSTR, va_list);
+LPSTR error_table_name(long num);
+
+#endif
+
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // _DCNS_MIT_COM_ERR_H
+
--- /dev/null
+/*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Machine-type definitions: IBM PC 8086
+ */
+
+#if defined(_WIN32) && !defined(WIN32)
+#define WIN32
+#endif
+
+#if ( defined(WIN16) || defined(WIN32) || defined(_WINDOWS)) && !defined(WINDOWS)
+#define WINDOWS
+#endif
+
+#if defined(__OS2__) && !defined(OS2)
+#define OS2
+#endif
+
+#ifdef WIN16
+#define BITS16
+#else
+#ifdef MSDOS
+#define BITS16
+#else
+#define BITS32
+#endif
+#endif
+#define LSBFIRST
+
+#define index(s,c) strchr(s,c) /* PC version of index */
+#define rindex(s,c) strrchr(s,c)
+#if !defined(OS2) && !defined(LWP) /* utils.h under OS/2 */
+#define bcmp(s1,s2,n) memcmp((s1),(s2),(n))
+#define bcopy(a,b,c) memcpy( (b), (a), (c) )
+#define bzero(a,b) memset( (a), 0, (b) )
+#endif
+
+typedef unsigned char u_char;
+typedef unsigned long u_long;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+#define NO_UIDGID_T
+
+#if !defined(WINDOWS) && !defined(DWORD)
+typedef long DWORD;
+#endif
+
+#if defined(PC)&&!defined(WINDOWS)
+#ifndef LPSTR
+typedef char *LPSTR;
+typedef char *LPBYTE;
+typedef char *CHARPTR;
+typedef char *LPINT;
+typedef unsigned int WORD;
+#endif
+#define LONG long
+#define FAR
+#define PASCAL
+#define EXPORT
+#endif
+
+#ifdef OS2
+#include <utils.h>
+#define lstrcpy strcpy
+#define lstrlen strlen
+#define lstrcmp strcmp
+#define lstrcpyn strncpy
+#endif
+
+#ifdef WIN32
+#define _export
+#endif
+
+#if defined(BITS32)
+#define far
+#define near
+#endif
+
+#ifdef WINDOWS
+#include <windows.h>
+#endif
+
+#ifdef WIN32
+#include <windowsx.h>
+#endif
+
+#ifdef WIN16
+#pragma message ( "WIN16 in " __FILE__ )
+#include <time.h>
+#include <process.h>
+#ifndef KRB_INT32
+#define KRB_INT32 long
+#endif
+#ifndef KRB_UINT32
+#define KRB_UINT32 unsigned KRB_INT32
+#endif
+#endif
+
+
+#define RANDOM_KRB_INT32_1 ((KRB_INT32) time(NULL))
+#define RANDOM_KRB_INT32_2 ((KRB_INT32) getpid())
+#define TIME_GMT_UNIXSEC unix_time_gmt_unixsec((unsigned KRB_INT32 *)0);
+#ifndef MAXPATHLEN
+#define MAXPATHLEN _MAX_PATH
+#endif
--- /dev/null
+/*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Configuration info for operating system, hardware description,
+ * language implementation, C library, etc.
+ *
+ * This file should be included in (almost) every file in the Kerberos
+ * sources, and probably should *not* be needed outside of those
+ * sources. (How do we deal with /usr/include/des.h and
+ * /usr/include/krb.h?)
+ */
+
+#ifndef _CONF_H_
+#define _CONF_H_
+
+#include "osconf.h"
+
+#ifdef SHORTNAMES
+#include "names.h"
+#endif
+
+/*
+ * Language implementation-specific definitions
+ */
+
+/* special cases */
+#ifdef __HIGHC__
+/* broken implementation of ANSI C */
+#undef __STDC__
+#endif
+
+#if !defined(__STDC__) && !defined(PC)
+#define const
+#define volatile
+#define signed
+typedef char *pointer; /* pointer to generic data */
+#ifndef PROTOTYPE
+#define PROTOTYPE(p) ()
+#endif
+#else
+typedef void *pointer;
+#ifndef PROTOTYPE
+#define PROTOTYPE(p) p
+#endif
+#endif
+
+/* Does your compiler understand "void"? */
+#ifdef notdef
+#define void int
+#endif
+
+/*
+ * A few checks to see that necessary definitions are included.
+ */
+
+#ifndef MSBFIRST
+#ifndef LSBFIRST
+#error byte order not defined
+#endif
+#endif
+
+/* machine size */
+#ifndef BITS16
+#ifndef BITS32
+#error number of bits?
+#endif
+#endif
+
+/* end of checks */
+
+#endif /* _CONF_H_ */
--- /dev/null
+/*
+ * des.h
+ *
+ * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Include file for the Data Encryption Standard library.
+ */
+
+/* only do the whole thing once */
+#ifndef DES_DEFS
+#define DES_DEFS
+
+#include "mit_copy.h"
+#include "conf.h"
+
+#ifndef KRB_INT32
+#define KRB_INT32 long
+#endif
+#ifndef KRB_UINT32
+#define KRB_UINT32 unsigned KRB_INT32
+#endif
+
+/* There are some declarations in the system-specific header files which
+ can't be done until KRB_INT32 is defined. So they are in a macro,
+ which we expand here if defined. */
+
+#ifdef DECL_THAT_NEEDS_KRB_INT32
+DECL_THAT_NEEDS_KRB_INT32
+#endif
+
+typedef unsigned char des_cblock[8]; /* crypto-block size */
+/* Key schedule */
+typedef struct des_ks_struct { union { KRB_INT32 pad; des_cblock _;} __; } des_key_schedule[16];
+
+#define DES_KEY_SZ (sizeof(des_cblock))
+#define DES_ENCRYPT 1
+#define DES_DECRYPT 0
+
+#ifndef NCOMPAT
+#define C_Block des_cblock
+#define Key_schedule des_key_schedule
+#define ENCRYPT DES_ENCRYPT
+#define DECRYPT DES_DECRYPT
+#define KEY_SZ DES_KEY_SZ
+#define string_to_key des_string_to_key
+#define read_pw_string des_read_pw_string
+#define random_key des_random_key
+#define pcbc_encrypt des_pcbc_encrypt
+#define key_sched des_key_sched
+#define cbc_encrypt des_cbc_encrypt
+#define cbc_cksum des_cbc_cksum
+#define C_Block_print des_cblock_print
+#define quad_cksum des_quad_cksum
+typedef struct des_ks_struct bit_64;
+#endif
+
+#define des_cblock_print(x) des_cblock_print_file(x, stdout)
+
+/* Function declarations */
+
+#define DES_CALLCONV_C
+
+extern unsigned long DES_CALLCONV_C
+quad_cksum PROTOTYPE ((
+ unsigned char *in, /* input block */
+ unsigned KRB_INT32 *out,/* optional longer output */
+ long length, /* original length in bytes */
+ int out_count, /* number of iterations */
+ des_cblock *c_seed)); /* secret seed, 8 bytes */
+
+int DES_CALLCONV_C
+des_key_sched PROTOTYPE ((des_cblock FAR, des_key_schedule FAR));
+
+int DES_CALLCONV_C
+des_ecb_encrypt PROTOTYPE ((des_cblock FAR *, des_cblock FAR *,
+ des_key_schedule FAR, int));
+
+int DES_CALLCONV_C
+des_pcbc_encrypt PROTOTYPE ((des_cblock FAR *, des_cblock FAR *, long,
+ des_key_schedule FAR, des_cblock FAR *, int));
+
+int DES_CALLCONV_C
+des_is_weak_key PROTOTYPE ((des_cblock FAR));
+
+void DES_CALLCONV_C
+des_fixup_key_parity PROTOTYPE ((des_cblock FAR));
+
+int DES_CALLCONV_C
+des_check_key_parity PROTOTYPE ((des_cblock FAR));
+
+/*
+ These random_key routines are made external here
+ for the Macintosh Driver which exports pointers to them
+ to applications via a driver level interface.
+ Preserved for KClient compatability.
+*/
+
+int DES_CALLCONV_C
+des_new_random_key PROTOTYPE (( des_cblock ));
+
+void DES_CALLCONV_C
+des_init_random_number_generator PROTOTYPE (( des_cblock ));
+
+void DES_CALLCONV_C
+des_set_random_generator_seed PROTOTYPE (( des_cblock ));
+
+unsigned long DES_CALLCONV_C
+des_cbc_cksum PROTOTYPE ((des_cblock *,des_cblock *,long,des_key_schedule,des_cblock));
+
+/* FIXME, put the rest of the function declarations here */
+
+#endif /* DES_DEFS */
--- /dev/null
+/*
+ * kadm_err.h
+ * This file is the #include file for kadm_err.et.
+ * Please do not edit it as it is automatically generated.
+ */
+
+#define KADM_RCSID (-1783126272L)
+#define KADM_NO_REALM (-1783126271L)
+#define KADM_NO_CRED (-1783126270L)
+#define KADM_BAD_KEY (-1783126269L)
+#define KADM_NO_ENCRYPT (-1783126268L)
+#define KADM_NO_AUTH (-1783126267L)
+#define KADM_WRONG_REALM (-1783126266L)
+#define KADM_NO_ROOM (-1783126265L)
+#define KADM_BAD_VER (-1783126264L)
+#define KADM_BAD_CHK (-1783126263L)
+#define KADM_NO_READ (-1783126262L)
+#define KADM_NO_OPCODE (-1783126261L)
+#define KADM_NO_HOST (-1783126260L)
+#define KADM_UNK_HOST (-1783126259L)
+#define KADM_NO_SERV (-1783126258L)
+#define KADM_NO_SOCK (-1783126257L)
+#define KADM_NO_CONN (-1783126256L)
+#define KADM_NO_HERE (-1783126255L)
+#define KADM_NO_MAST (-1783126254L)
+#define KADM_NO_VERI (-1783126253L)
+#define KADM_INUSE (-1783126252L)
+#define KADM_UK_SERROR (-1783126251L)
+#define KADM_UK_RERROR (-1783126250L)
+#define KADM_UNAUTH (-1783126249L)
+#define KADM_DATA (-1783126248L)
+#define KADM_NOENTRY (-1783126247L)
+#define KADM_NOMEM (-1783126246L)
+#define KADM_NO_HOSTNAME (-1783126245L)
+#define KADM_NO_BIND (-1783126244L)
+#define KADM_LENGTH_ERROR (-1783126243L)
+#define KADM_ILL_WILDCARD (-1783126242L)
+#define KADM_DB_INUSE (-1783126241L)
+#define KADM_INSECURE_PW (-1783126240L)
+#define KADM_PW_MISMATCH (-1783126239L)
+#ifdef WINDOWS
+extern void initialize_kadm_error_table(HANDLE *);
+#else
+extern void initialize_kadm_error_table(struct et_list **);
+#endif
+#define ERROR_TABLE_BASE_kadm (-1783126272L)
+
+/* for compatibility with older versions... */
+#define init_kadm_err_tbl() initialize_kadm_error_table(&_et_list)
+#define kadm_err_base ERROR_TABLE_BASE_kadm
+
+#ifdef WINDOWS
+extern HANDLE _et_list;
+#else
+extern struct et_list *_et_list;
+#endif
--- /dev/null
+/*
+ * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Include file for the Kerberos library.
+ */
+
+/* Only one time, please */
+#ifndef KRB_DEFS
+#define KRB_DEFS
+
+#include <conf.h>
+
+/* Need some defs from des.h */
+#include <des.h>
+
+/* Text describing error codes */
+#define MAX_KRB_ERRORS 256
+extern char *krb_err_txt[MAX_KRB_ERRORS];
+
+/* General definitions */
+#define KSUCCESS 0
+#define KFAILURE 255
+
+#ifdef NO_UIDGID_T
+typedef unsigned short uid_t;
+typedef unsigned short gid_t;
+#endif /* NO_UIDGID_T */
+
+/*
+ * Kerberos specific definitions
+ *
+ * KRBLOG is the log file for the kerberos master server. KRB_CONF is
+ * the configuration file where different host machines running master
+ * and slave servers can be found. KRB_MASTER is the name of the
+ * machine with the master database. The admin_server runs on this
+ * machine, and all changes to the db (as opposed to read-only
+ * requests, which can go to slaves) must go to it. KRB_HOST is the
+ * default machine * when looking for a kerberos slave server. Other
+ * possibilities are * in the KRB_CONF file. KRB_REALM is the name of
+ * the realm.
+ */
+
+#ifdef notdef
+/* this is server - only, does not belong here; */
+#define KRBLOG "/kerberos/kerberos.log"
+/* are these used anyplace? */
+#define VX_KRB_HSTFILE "/etc/krbhst"
+#define PC_KRB_HSTFILE "\\kerberos\\krbhst"
+#endif
+
+#ifdef PC
+
+#define KRB_CONF "krb.con"
+#define KRB_RLM_TRANS "krbrealm.con"
+
+#else
+
+#define KRB_CONF "/etc/krb.conf"
+#define KRB_RLM_TRANS "/etc/krb.realms"
+
+#endif /* PC */
+
+/* Resources? XXX */
+#define KRB_MASTER "kerberos.mit.edu"
+#define KRB_REALM "ATHENA.MIT.EDU"
+#define KRB_HOST KRB_MASTER
+
+/* The maximum sizes for aname, realm, sname, and instance +1 */
+#define ANAME_SZ 40
+#define REALM_SZ 40
+#define SNAME_SZ 40
+#define INST_SZ 40
+#define ADDR_SZ 40
+/* include space for '.' and '@' */
+#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2)
+#define KKEY_SZ 100
+#define VERSION_SZ 1
+#define MSG_TYPE_SZ 1
+#define DATE_SZ 26 /* RTI date output */
+
+#define MAX_HSTNM 100
+
+#ifndef DEFAULT_TKT_LIFE /* allow compile-time override */
+#define DEFAULT_TKT_LIFE 120 /* default lifetime for krb_mk_req
+ & co., 10 hrs */
+#endif
+
+/* Definition of text structure used to pass text around */
+#define MAX_KTXT_LEN 1250
+
+struct ktext {
+ int length; /* Length of the text */
+ unsigned char dat[MAX_KTXT_LEN]; /* The data itself */
+ unsigned long mbz; /* zero to catch runaway strings */
+};
+
+typedef struct ktext far *KTEXT;
+typedef struct ktext far *KTEXT_FP;
+typedef struct ktext KTEXT_ST;
+
+
+/* Definitions for send_to_kdc */
+#define CLIENT_KRB_TIMEOUT 10 /* time between retries */ /* changed from 4, 8-14-94 pbh */
+#define CLIENT_KRB_RETRY 5 /* retry this many times */
+#define CLIENT_KRB_BUFLEN 512 /* max unfragmented packet */
+
+/* Definitions for ticket file utilities */
+#define R_TKT_FIL 0
+#define W_TKT_FIL 1
+
+/* Definitions for cl_get_tgt */
+#ifdef PC
+#define CL_GTGT_INIT_FILE "\\kerberos\\k_in_tkts" /* WTF??!? */
+#else
+#define CL_GTGT_INIT_FILE "/etc/k_in_tkts"
+#endif /* PC */
+
+/* Parameters for rd_ap_req */
+/* Maximum alloable clock skew in seconds */
+#define CLOCK_SKEW 5*60
+/* Filename for readservkey */
+#define KEYFILE "/etc/srvtab"
+
+/* Structure definition for rd_ap_req */
+
+struct auth_dat {
+ unsigned char k_flags; /* Flags from ticket */
+ char pname[ANAME_SZ]; /* Principal's name */
+ char pinst[INST_SZ]; /* His Instance */
+ char prealm[REALM_SZ]; /* His Realm */
+ unsigned long checksum; /* Data checksum (opt) */
+ C_Block session; /* Session Key */
+ int life; /* Life of ticket */
+ unsigned long time_sec; /* Time ticket issued */
+ unsigned long address; /* Address in ticket */
+ KTEXT_ST reply; /* Auth reply (opt) */
+};
+
+typedef struct auth_dat AUTH_DAT;
+
+/* Structure definition for credentials returned by get_cred */
+
+struct credentials {
+ char service[ANAME_SZ]; /* Service name */
+ char instance[INST_SZ]; /* Instance */
+ char realm[REALM_SZ]; /* Auth domain */
+ C_Block session; /* Session key */
+ int lifetime; /* Lifetime */
+ int kvno; /* Key version number */
+ KTEXT_ST ticket_st; /* The ticket itself */
+ long issue_date; /* The issue time */
+ char pname[ANAME_SZ]; /* Principal's name */
+ char pinst[INST_SZ]; /* Principal's instance */
+ char address[ADDR_SZ]; /* IP Address in ticket */
+};
+
+typedef struct credentials CREDENTIALS;
+
+/* Structure definition for rd_private_msg and rd_safe_msg */
+
+struct msg_dat {
+ unsigned char far *app_data; /* pointer to appl data */
+ unsigned long app_length; /* length of appl data */
+ unsigned long hash; /* hash to lookup replay */
+ int swap; /* swap bytes? */
+ long time_sec; /* msg timestamp seconds */
+ unsigned char time_5ms; /* msg timestamp 5ms units */
+};
+
+typedef struct msg_dat MSG_DAT;
+
+
+/* Location of ticket file for save_cred and get_cred */
+#define TKT_FILE tkt_string()
+
+#define TKT_ENV "KERBEROS_TICKETS"
+typedef struct {
+ unsigned buf_size;
+ unsigned dummy;
+ unsigned eof_ptr;
+ int sema; /* semaphore 0 - OK, -1 - lock write, +ve lock read */
+} tkt_header;
+
+tkt_header far *tkt_ptr(void);
+
+#define KM_TKFILE 0
+#define KM_KRBMEM 1
+
+#define TKT_ROOT "/tmp/tkt"
+
+/* Error codes returned from the KDC */
+#define KDC_OK 0 /* Request OK */
+#define KDC_NAME_EXP 1 /* Principal expired */
+#define KDC_SERVICE_EXP 2 /* Service expired */
+#define KDC_AUTH_EXP 3 /* Auth expired */
+#define KDC_PKT_VER 4 /* Protocol version unknown */
+#define KDC_P_MKEY_VER 5 /* Wrong master key version */
+#define KDC_S_MKEY_VER 6 /* Wrong master key version */
+#define KDC_BYTE_ORDER 7 /* Byte order unknown */
+#define KDC_PR_UNKNOWN 8 /* Principal unknown */
+#define KDC_PR_N_UNIQUE 9 /* Principal not unique */
+#define KDC_NULL_KEY 10 /* Principal has null key */
+#define KDC_GEN_ERR 20 /* Generic error from KDC */
+
+/* Values returned by get_credentials */
+#define GC_OK 0 /* Retrieve OK */
+#define RET_OK 0 /* Retrieve OK */
+#define GC_TKFIL 21 /* Can't read ticket file */
+#define RET_TKFIL 21 /* Can't read ticket file */
+#define GC_NOTKT 22 /* Can't find ticket or TGT */
+#define RET_NOTKT 22 /* Can't find ticket or TGT */
+
+/* Values returned by mk_ap_req */
+#define MK_AP_OK 0 /* Success */
+#define MK_AP_TGTEXP 26 /* TGT Expired */
+
+/* Values returned by rd_ap_req */
+#define RD_AP_OK 0 /* Request authentic */
+#define RD_AP_UNDEC 31 /* Can't decode authenticator */
+#define RD_AP_EXP 32 /* Ticket expired */
+#define RD_AP_NYV 33 /* Ticket not yet valid */
+#define RD_AP_REPEAT 34 /* Repeated request */
+#define RD_AP_NOT_US 35 /* The ticket isn't for us */
+#define RD_AP_INCON 36 /* Request is inconsistent */
+#define RD_AP_TIME 37 /* delta_t too big */
+#define RD_AP_BADD 38 /* Incorrect net address */
+#define RD_AP_VERSION 39 /* protocol version mismatch */
+#define RD_AP_MSG_TYPE 40 /* invalid msg type */
+#define RD_AP_MODIFIED 41 /* message stream modified */
+#define RD_AP_ORDER 42 /* message out of order */
+#define RD_AP_UNAUTHOR 43 /* unauthorized request */
+
+/* Values returned by get_pw_tkt */
+#define GT_PW_OK 0 /* Got password changing tkt */
+#define GT_PW_NULL 51 /* Current PW is null */
+#define GT_PW_BADPW 52 /* Incorrect current password */
+#define GT_PW_PROT 53 /* Protocol Error */
+#define GT_PW_KDCERR 54 /* Error returned by KDC */
+#define GT_PW_NULLTKT 55 /* Null tkt returned by KDC */
+
+/* Values returned by send_to_kdc */
+#define SKDC_OK 0 /* Response received */
+#define SKDC_RETRY 56 /* Retry count exceeded */
+#define SKDC_CANT 57 /* Can't send request */
+
+/*
+ * Values returned by get_intkt
+ * (can also return SKDC_* and KDC errors)
+ */
+
+#define INTK_OK 0 /* Ticket obtained */
+#define INTK_PW_NULL 51 /* Current PW is null */
+#define INTK_W_NOTALL 61 /* Not ALL tickets returned */
+#define INTK_BADPW 62 /* Incorrect password */
+#define INTK_PROT 63 /* Protocol Error */
+#define INTK_ERR 70 /* Other error */
+
+/* Values returned by get_adtkt */
+#define AD_OK 0 /* Ticket Obtained */
+#define AD_NOTGT 71 /* Don't have tgt */
+
+/* Error codes returned by ticket file utilities */
+#define NO_TKT_FIL 76 /* No ticket file found */
+#define TKT_FIL_ACC 77 /* Couldn't access tkt file */
+#define TKT_FIL_LCK 78 /* Couldn't lock ticket file */
+#define TKT_FIL_FMT 79 /* Bad ticket file format */
+#define TKT_FIL_INI 80 /* tf_init not called first */
+
+/* Error code returned by kparse_name */
+#define KNAME_FMT 81 /* Bad Kerberos name format */
+
+/* Error code returned by krb_mk_safe */
+#define SAFE_PRIV_ERROR -1 /* syscall error */
+
+/*
+ * macros for byte swapping; also scratch space
+ * u_quad 0-->7, 1-->6, 2-->5, 3-->4, 4-->3, 5-->2, 6-->1, 7-->0
+ * u_long 0-->3, 1-->2, 2-->1, 3-->0
+ * u_short 0-->1, 1-->0
+ */
+
+#define swap_u_16(x) {\
+ unsigned long _krb_swap_tmp[4];\
+ _swab(((char *) x) +0, ((char *) _krb_swap_tmp) +14 ,2); \
+ _swab(((char *) x) +2, ((char *) _krb_swap_tmp) +12 ,2); \
+ _swab(((char *) x) +4, ((char *) _krb_swap_tmp) +10 ,2); \
+ _swab(((char *) x) +6, ((char *) _krb_swap_tmp) +8 ,2); \
+ _swab(((char *) x) +8, ((char *) _krb_swap_tmp) +6 ,2); \
+ _swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \
+ _swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \
+ _swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \
+ bcopy((char *)_krb_swap_tmp,(char *)x,16);\
+ }
+
+#define swap_u_12(x) {\
+ unsigned long _krb_swap_tmp[4];\
+ _swab(( char *) x, ((char *) _krb_swap_tmp) +10 ,2); \
+ _swab(((char *) x) +2, ((char *) _krb_swap_tmp) +8 ,2); \
+ _swab(((char *) x) +4, ((char *) _krb_swap_tmp) +6 ,2); \
+ _swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \
+ _swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \
+ _swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \
+ bcopy((char *)_krb_swap_tmp,(char *)x,12);\
+ }
+
+#define swap_C_Block(x) {\
+ unsigned long _krb_swap_tmp[4];\
+ _swab(( char *) x, ((char *) _krb_swap_tmp) +6 ,2); \
+ _swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \
+ _swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \
+ _swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \
+ bcopy((char *)_krb_swap_tmp,(char *)x,8);\
+ }
+#define swap_u_quad(x) {\
+ unsigned long _krb_swap_tmp[4];\
+ _swab(( char *) &x, ((char *) _krb_swap_tmp) +6 ,2); \
+ _swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \
+ _swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \
+ _swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \
+ bcopy((char *)_krb_swap_tmp,(char *)&x,8);\
+ }
+
+#define swap_u_long(x) {\
+ unsigned long _krb_swap_tmp[4];\
+ _swab((char *) &x, ((char *) _krb_swap_tmp) +2 ,2); \
+ _swab(((char *) &x) +2,((char *) _krb_swap_tmp),2); \
+ x = _krb_swap_tmp[0]; \
+ }
+
+#define swap_u_short(x) {\
+ unsigned short _krb_swap_sh_tmp; \
+ _swab((char *) &x, ( &_krb_swap_sh_tmp) ,2); \
+ x = (unsigned short) _krb_swap_sh_tmp; \
+ }
+
+/* Kerberos ticket flag field bit definitions */
+#define K_FLAG_ORDER 0 /* bit 0 --> lsb */
+#define K_FLAG_1 /* reserved */
+#define K_FLAG_2 /* reserved */
+#define K_FLAG_3 /* reserved */
+#define K_FLAG_4 /* reserved */
+#define K_FLAG_5 /* reserved */
+#define K_FLAG_6 /* reserved */
+#define K_FLAG_7 /* reserved, bit 7 --> msb */
+
+#ifdef OLDNAMES
+#define krb_mk_req mk_ap_req
+#define krb_rd_req rd_ap_req
+#define krb_kntoln an_to_ln
+#define krb_set_key set_serv_key
+#define krb_get_cred get_credentials
+#define krb_mk_priv mk_private_msg
+#define krb_rd_priv rd_private_msg
+#define krb_mk_safe mk_safe_msg
+#define krb_rd_safe rd_safe_msg
+#define krb_mk_err mk_appl_err_msg
+#define krb_rd_err rd_appl_err_msg
+#define krb_ck_repl check_replay
+#define krb_get_pw_in_tkt get_in_tkt
+#define krb_get_svc_in_tkt get_svc_in_tkt
+#define krb_get_pw_tkt get_pw_tkt
+#define krb_realmofhost krb_getrealm
+#define krb_get_phost get_phost
+#define krb_get_krbhst get_krbhst
+#define krb_get_lrealm get_krbrlm
+#endif /* OLDNAMES */
+
+#define decomp_ticket k_decomp_ticket
+/* Defines for krb_sendauth and krb_recvauth */
+
+#define KOPT_DONT_MK_REQ 0x00000001 /* don't call krb_mk_req */
+#define KOPT_DO_MUTUAL 0x00000002 /* do mutual auth */
+
+#define KOPT_DONT_CANON 0x00000004 /*
+ * don't canonicalize inst as
+ * a hostname
+ */
+
+#define KRB_SENDAUTH_VLEN 8 /* length for version strings */
+
+#ifdef ATHENA_COMPAT
+#define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */
+#endif /* ATHENA_COMPAT */
+
+char *tkt_string();
+
+int gettimeofday(struct timeval *tv, struct timezone *tz);
+
+int PASCAL krb_sendauth(long, int, KTEXT, char *, char *, char *,
+ unsigned long, MSG_DAT *, CREDENTIALS *,
+ Key_schedule *, struct sockaddr_in *,
+ struct sockaddr_in FAR *, char *);
+int PASCAL krb_mk_req(KTEXT, char *, char *, char *, long);
+char * PASCAL krb_getrealm(char *host);
+
+void tkt_free(tkt_header FAR* hdr);
+int krb_get_tf_fullname(char FAR *, char FAR *, char FAR *, char FAR *);
+int krb_get_tf_realm(char FAR *,char FAR *);
+int tf_init(char FAR*,int);
+
+long LocalHostAddr();
+int tf_get_pname(char FAR*);
+int tf_get_pinst(char FAR*);
+int tf_get_cred(CREDENTIALS FAR*);
+void tf_close(void);
+int tf_save_cred(char FAR*,char FAR*,char FAR*,C_Block,int,int,KTEXT,long);
+BOOL k_isinst(char FAR *s);
+BOOL k_isrealm(char FAR *s);
+BOOL k_isname(char FAR *s);
+
+char ** get_krb_err_txt(void); /* 2-22-93, pbh */
+
+/* Warning, unique to Windows! */
+int set_krb_debug(int);
+int set_krb_ap_req_debug(int);
+char * PASCAL get_krb_err_txt_entry(int i);
+char * krb_err_func(int offset, long code);
+int PASCAL k_decomp_ticket(KTEXT, unsigned char *, char *, char *, char *,
+ unsigned long *, C_Block, int *, unsigned long *,
+ char *, char *, C_Block, Key_schedule);
+int PASCAL krb_mk_req(KTEXT,char *,char *,char *,long);
+char * PASCAL krb_getrealm(char *host);
+char * PASCAL krb_realmofhost(char *host);
+char * krb_get_phost(char *host);
+
+int kname_parse(char *, char *, char *, char *);
+int krb_get_pw_in_tkt(char *, char *, char *, char *, char *, int, char *);
+int dest_tkt(void);
+int krb_get_lrealm(char *, int);
+
+int krb_use_kerbmem();
+int krb_check_tgt();
+int krb_check_serv(char *);
+
+int krb_get_cred(char *, char *, char *, CREDENTIALS *);
+int send_to_kdc(KTEXT, KTEXT, char *);
+
+int create_ciph(KTEXT, C_Block, char *, char *, char *, unsigned long, int,
+ KTEXT, unsigned long, C_Block *);
+
+char *krb_get_krbconf2(char *, size_t *);
+char *krb_get_krbrealm2(char *, size_t *);
+
+int krb_save_credentials(char *service, char *instance, char *realm,
+ C_Block session, int lifetime, int kvno,
+ KTEXT ticket, long issue_date);
+
+#define krb_get_err_text get_krb_err_txt_entry
+
+int krb_in_tkt(char *pname, char *pinst, char *prealm);
+
+#endif /* KRB_DEFS */
--- /dev/null
+/*
+ * krberr.h
+ * This file is the #include file for krberr.et.
+ * Please do not edit it as it is automatically generated.
+ */
+
+#ifdef WINDOWS
+extern void initialize_krb_error_func(err_func func,HANDLE *);
+#else
+extern void initialize_krb_error_func(err_func func,struct et_list **);
+#endif
+#define ERROR_TABLE_BASE_krb (39525376L)
+
+/* for compatibility with older versions... */
+#define init_krb_err_func(erf) initialize_krb_error_func(erf,&_et_list)
+#define krb_err_base ERROR_TABLE_BASE_krb
+
+#ifdef WINDOWS
+extern HANDLE _et_list;
+#else
+extern struct et_list *_et_list;
+#endif
--- /dev/null
+/*
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 by the Massachusetts Institute of Technology
+
+ Export of this software from the United States of America is assumed
+ to 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. 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.
+
+ */
--- /dev/null
+/*
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ * Athena configuration.
+ */
+
+#ifndef _OSCONF_H_
+#define _OSCONF_H_
+
+#ifndef PC
+#if defined(IBMPC) || defined(__MSDOS__) || defined(OS2) || defined(_MSDOS) || defined(_WIN32)
+#define PC
+#endif
+#endif
+
+#ifdef tahoe
+#include "conf-bsdtahoe.h"
+#else /* !tahoe */
+#ifdef vax
+#include "conf-bsdvax.h"
+#else /* !vax */
+#if defined(mips) && defined(ultrix)
+#include "conf-ultmips2.h"
+#else /* !Ultrix MIPS-2 */
+#ifdef ibm032
+#include "conf-bsdibm032.h"
+#else /* !ibm032 */
+#ifdef apollo
+#include "conf-bsdapollo.h"
+#else /* !apollo */
+#ifdef sun
+#ifdef sparc
+#include "conf-bsdsparc.h"
+#else /* sun but not sparc */
+#ifdef i386
+#include "conf-bsd386i.h"
+#else /* sun but not (sparc or 386i) */
+#include "conf-bsdm68k.h"
+#endif /* i386 */
+#endif /* sparc */
+#else /* !sun */
+#ifdef pyr
+#include "conf-pyr.h"
+#else
+#if defined(PC) || defined(__MSDOS__) || defined(OS2) || defined(_MSDOS) || defined(_WIN32)
+#include "conf-pc.h"
+#endif /* PC */
+#endif /* pyr */
+#endif /* sun */
+#endif /* apollo */
+#endif /* ibm032 */
+#endif /* mips */
+#endif /* vax */
+#endif /* tahoe */
+
+#endif /* _OSCONF_H_ */
--- /dev/null
+/*
+ * include/kerberosIV/des.h
+ *
+ * Copyright 1987, 1988, 1994, 2002 by the Massachusetts Institute of
+ * Technology. All Rights Reserved.
+ *
+ * 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.
+ *
+ * Include file for the Data Encryption Standard library.
+ */
+
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+# include <TargetConditionals.h>
+# if TARGET_RT_MAC_CFM
+# error "Use KfM 4.0 SDK headers for CFM compilation."
+# endif
+#endif
+
+#ifdef __cplusplus
+#ifndef KRBINT_BEGIN_DECLS
+#define KRBINT_BEGIN_DECLS extern "C" {
+#define KRBINT_END_DECLS }
+#endif
+#else
+#define KRBINT_BEGIN_DECLS
+#define KRBINT_END_DECLS
+#endif
+
+#ifndef KRB5INT_DES_TYPES_DEFINED
+#define KRB5INT_DES_TYPES_DEFINED
+
+#include <limits.h>
+
+KRBINT_BEGIN_DECLS
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import on
+# endif
+# pragma options align=mac68k
+#endif
+
+#if UINT_MAX >= 0xFFFFFFFFUL
+#define DES_INT32 int
+#define DES_UINT32 unsigned int
+#else
+#define DES_INT32 long
+#define DES_UINT32 unsigned long
+#endif
+
+typedef unsigned char des_cblock[8]; /* crypto-block size */
+/*
+ * Key schedule.
+ *
+ * This used to be
+ *
+ * typedef struct des_ks_struct {
+ * union { DES_INT32 pad; des_cblock _;} __;
+ * } des_key_schedule[16];
+ *
+ * but it would cause trouble if DES_INT32 were ever more than 4
+ * bytes. The reason is that all the encryption functions cast it to
+ * (DES_INT32 *), and treat it as if it were DES_INT32[32]. If
+ * 2*sizeof(DES_INT32) is ever more than sizeof(des_cblock), the
+ * caller-allocated des_key_schedule will be overflowed by the key
+ * scheduling functions. We can't assume that every platform will
+ * have an exact 32-bit int, and nothing should be looking inside a
+ * des_key_schedule anyway.
+ */
+typedef struct des_ks_struct { DES_INT32 _[2]; } des_key_schedule[16];
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma enumsalwaysint reset
+# pragma import reset
+# endif
+# pragma options align=reset
+#endif
+
+KRBINT_END_DECLS
+
+#endif /* KRB5INT_DES_TYPES_DEFINED */
+
+/* only do the whole thing once */
+#ifndef DES_DEFS
+/*
+ * lib/crypto/des/des_int.h defines KRB5INT_CRYPTO_DES_INT temporarily
+ * to avoid including the defintions and declarations below. The
+ * reason that the crypto library needs to include this file is that
+ * it needs to have its types aligned with krb4's types.
+ */
+#ifndef KRB5INT_CRYPTO_DES_INT
+#define DES_DEFS
+
+#if defined(_WIN32)
+#ifndef KRB4
+#define KRB4 1
+#endif
+#include <win-mac.h>
+#endif
+#include <stdio.h> /* need FILE for des_cblock_print_file */
+
+KRBINT_BEGIN_DECLS
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import on
+# pragma enumsalwaysint on
+# endif
+# pragma options align=mac68k
+#endif
+
+/* Windows declarations */
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#endif
+
+#define DES_KEY_SZ (sizeof(des_cblock))
+#define DES_ENCRYPT 1
+#define DES_DECRYPT 0
+
+#ifndef NCOMPAT
+#define C_Block des_cblock
+#define Key_schedule des_key_schedule
+#define ENCRYPT DES_ENCRYPT
+#define DECRYPT DES_DECRYPT
+#define KEY_SZ DES_KEY_SZ
+#define string_to_key des_string_to_key
+#define read_pw_string des_read_pw_string
+#define random_key des_random_key
+#define pcbc_encrypt des_pcbc_encrypt
+#define key_sched des_key_sched
+#define cbc_encrypt des_cbc_encrypt
+#define cbc_cksum des_cbc_cksum
+#define C_Block_print des_cblock_print
+#define quad_cksum des_quad_cksum
+typedef struct des_ks_struct bit_64;
+#endif
+
+#define des_cblock_print(x) des_cblock_print_file(x, stdout)
+
+/*
+ * Function Prototypes
+ */
+
+int KRB5_CALLCONV des_key_sched (C_Block, Key_schedule);
+
+int KRB5_CALLCONV
+des_pcbc_encrypt (C_Block *in, C_Block *out, long length,
+ const des_key_schedule schedule, C_Block *ivec,
+ int enc);
+
+unsigned long KRB5_CALLCONV
+des_quad_cksum (const unsigned char *in, unsigned DES_INT32 *out,
+ long length, int out_count, C_Block *seed);
+/*
+ * XXX ABI change: used to return void; also, cns/kfm have signed long
+ * instead of unsigned long length.
+ */
+unsigned long KRB5_CALLCONV
+des_cbc_cksum(const des_cblock *, des_cblock *, unsigned long,
+ const des_key_schedule, const des_cblock *);
+int KRB5_CALLCONV des_string_to_key (const char *, C_Block);
+void afs_string_to_key(char *, char *, des_cblock);
+
+/* XXX ABI change: used to return krb5_error_code */
+int KRB5_CALLCONV des_read_password(des_cblock *, char *, int);
+int KRB5_CALLCONV des_ecb_encrypt(des_cblock *, des_cblock *,
+ const des_key_schedule, int);
+/* XXX kfm/cns have signed long length */
+int des_cbc_encrypt(des_cblock *, des_cblock *, unsigned long,
+ const des_key_schedule, const des_cblock *, int);
+void des_fixup_key_parity(des_cblock);
+int des_check_key_parity(des_cblock);
+int KRB5_CALLCONV des_new_random_key(des_cblock);
+void des_init_random_number_generator(des_cblock);
+int des_random_key(des_cblock *);
+int des_is_weak_key(des_cblock);
+void des_cblock_print_file(des_cblock *, FILE *fp);
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import reset
+# endif
+# pragma options align=reset
+#endif
+
+KRBINT_END_DECLS
+
+#endif /* KRB5INT_CRYPTO_DES_INT */
+#endif /* DES_DEFS */
--- /dev/null
+/*
+ * include//kerberosIV/kadm_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define KADM_RCSID (-1783126272L)
+#define KADM_NO_REALM (-1783126271L)
+#define KADM_NO_CRED (-1783126270L)
+#define KADM_BAD_KEY (-1783126269L)
+#define KADM_NO_ENCRYPT (-1783126268L)
+#define KADM_NO_AUTH (-1783126267L)
+#define KADM_WRONG_REALM (-1783126266L)
+#define KADM_NO_ROOM (-1783126265L)
+#define KADM_BAD_VER (-1783126264L)
+#define KADM_BAD_CHK (-1783126263L)
+#define KADM_NO_READ (-1783126262L)
+#define KADM_NO_OPCODE (-1783126261L)
+#define KADM_NO_HOST (-1783126260L)
+#define KADM_UNK_HOST (-1783126259L)
+#define KADM_NO_SERV (-1783126258L)
+#define KADM_NO_SOCK (-1783126257L)
+#define KADM_NO_CONN (-1783126256L)
+#define KADM_NO_HERE (-1783126255L)
+#define KADM_NO_MAST (-1783126254L)
+#define KADM_NO_VERI (-1783126253L)
+#define KADM_INUSE (-1783126252L)
+#define KADM_UK_SERROR (-1783126251L)
+#define KADM_UK_RERROR (-1783126250L)
+#define KADM_UNAUTH (-1783126249L)
+#define KADM_DATA (-1783126248L)
+#define KADM_NOENTRY (-1783126247L)
+#define KADM_NOMEM (-1783126246L)
+#define KADM_NO_HOSTNAME (-1783126245L)
+#define KADM_NO_BIND (-1783126244L)
+#define KADM_LENGTH_ERROR (-1783126243L)
+#define KADM_ILL_WILDCARD (-1783126242L)
+#define KADM_DB_INUSE (-1783126241L)
+#define KADM_INSECURE_PW (-1783126240L)
+#define KADM_PW_MISMATCH (-1783126239L)
+#define KADM_NOT_SERV_PRINC (-1783126238L)
+#define KADM_REALM_TOO_LONG (-1783126237L)
+#define ERROR_TABLE_BASE_kadm (-1783126272L)
+
+extern const struct error_table et_kadm_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_kadm_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_kadm_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_kadm_err_tbl initialize_kadm_error_table
+#define kadm_err_base ERROR_TABLE_BASE_kadm
+#endif
--- /dev/null
+/*
+ * include/kerberosIV/krb.h
+ *
+ * Copyright 1987, 1988, 1994, 2001, 2002 by the Massachusetts
+ * Institute of Technology. All Rights Reserved.
+ *
+ * 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.
+ *
+ * Include file for the Kerberos V4 library.
+ */
+
+/* Only one time, please */
+#ifndef KRB_DEFS
+#define KRB_DEFS
+
+/*
+ * For MacOS, don't expose prototypes of various private functions.
+ * Unfortuantely, they've leaked out everywhere else.
+ */
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+# include <TargetConditionals.h>
+# if TARGET_RT_MAC_CFM
+# error "Use KfM 4.0 SDK headers for CFM compilation."
+# endif
+# ifndef KRB_PRIVATE
+# define KRB_PRIVATE 0
+# endif
+#else
+# ifndef KRB_PRIVATE
+# define KRB_PRIVATE 1
+# endif
+#endif
+
+/* Define u_char, u_short, u_int, and u_long. */
+/* XXX these typdef names are not standardized! */
+#include <sys/types.h>
+
+/* Need some defs from des.h */
+#include <kerberosIV/des.h>
+#include <kerberosIV/krb_err.h>
+#include <profile.h>
+
+#ifdef _WIN32
+#include <time.h>
+#endif /* _WIN32 */
+
+#ifdef __cplusplus
+#ifndef KRBINT_BEGIN_DECLS
+#define KRBINT_BEGIN_DECLS extern "C" {
+#define KRBINT_END_DECLS }
+#endif
+#else
+#define KRBINT_BEGIN_DECLS
+#define KRBINT_END_DECLS
+#endif
+KRBINT_BEGIN_DECLS
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import on
+# pragma enumsalwaysint on
+# endif
+# pragma options align=mac68k
+#endif
+
+#define KRB4_32 DES_INT32
+#define KRB_INT32 DES_INT32
+#define KRB_UINT32 DES_UINT32
+
+#define MAX_KRB_ERRORS 256
+
+#if TARGET_OS_MAC
+/* ABI divergence on Mac for backwards compatibility. */
+extern const char * const * const krb_err_txt;
+#else
+extern const char * const krb_err_txt[MAX_KRB_ERRORS];
+#endif
+
+/* General definitions */
+#define KSUCCESS 0
+#define KFAILURE 255
+
+/*
+ * Kerberos specific definitions
+ *
+ * KRBLOG is the log file for the kerberos master server. KRB_CONF is
+ * the configuration file where different host machines running master
+ * and slave servers can be found. KRB_MASTER is the name of the
+ * machine with the master database. The admin_server runs on this
+ * machine, and all changes to the db (as opposed to read-only
+ * requests, which can go to slaves) must go to it. KRB_HOST is the
+ * default machine * when looking for a kerberos slave server. Other
+ * possibilities are * in the KRB_CONF file. KRB_REALM is the name of
+ * the realm.
+ */
+
+#define KRB_CONF "/etc/krb.conf"
+#define KRB_RLM_TRANS "/etc/krb.realms"
+#define KRB_MASTER "kerberos"
+#define KRB_HOST KRB_MASTER
+#define KRB_REALM "ATHENA.MIT.EDU"
+
+/* The maximum sizes for aname, realm, sname, and instance +1 */
+#define ANAME_SZ 40
+#define REALM_SZ 40
+#define SNAME_SZ 40
+#define INST_SZ 40
+#define ADDR_SZ 40
+/*
+ * NB: This overcounts due to NULs.
+ */
+/* include space for '.' and '@' */
+#define MAX_K_NAME_SZ (ANAME_SZ + INST_SZ + REALM_SZ + 2)
+#define KKEY_SZ 100
+#define VERSION_SZ 1
+#define MSG_TYPE_SZ 1
+#define DATE_SZ 26 /* RTI date output */
+
+#define MAX_HSTNM 100
+
+#ifndef DEFAULT_TKT_LIFE /* allow compile-time override */
+#define DEFAULT_TKT_LIFE 120 /* default lifetime for krb_mk_req */
+#endif
+
+#define KRB_TICKET_GRANTING_TICKET "krbtgt"
+
+/* Definition of text structure used to pass text around */
+#define MAX_KTXT_LEN 1250
+
+struct ktext {
+ int length; /* Length of the text */
+ unsigned char dat[MAX_KTXT_LEN]; /* The data itself */
+ unsigned long mbz; /* zero to catch runaway strings */
+};
+
+typedef struct ktext *KTEXT;
+typedef struct ktext KTEXT_ST;
+
+
+/* Definitions for send_to_kdc */
+#define CLIENT_KRB_TIMEOUT 4 /* time between retries */
+#define CLIENT_KRB_RETRY 5 /* retry this many times */
+#define CLIENT_KRB_BUFLEN 512 /* max unfragmented packet */
+
+/* Definitions for ticket file utilities */
+#define R_TKT_FIL 0
+#define W_TKT_FIL 1
+
+/* Definitions for cl_get_tgt */
+#ifdef PC
+#define CL_GTGT_INIT_FILE "\\kerberos\\k_in_tkts"
+#else
+#define CL_GTGT_INIT_FILE "/etc/k_in_tkts"
+#endif /* PC */
+
+/* Parameters for rd_ap_req */
+/* Maximum allowable clock skew in seconds */
+#define CLOCK_SKEW 5*60
+/* Filename for readservkey */
+#define KEYFILE ((char*)krb__get_srvtabname("/etc/srvtab"))
+
+/* Structure definition for rd_ap_req */
+
+struct auth_dat {
+ unsigned char k_flags; /* Flags from ticket */
+ char pname[ANAME_SZ]; /* Principal's name */
+ char pinst[INST_SZ]; /* His Instance */
+ char prealm[REALM_SZ]; /* His Realm */
+ unsigned KRB4_32 checksum; /* Data checksum (opt) */
+ C_Block session; /* Session Key */
+ int life; /* Life of ticket */
+ unsigned KRB4_32 time_sec; /* Time ticket issued */
+ unsigned KRB4_32 address; /* Address in ticket */
+ KTEXT_ST reply; /* Auth reply (opt) */
+};
+
+typedef struct auth_dat AUTH_DAT;
+
+/* Structure definition for credentials returned by get_cred */
+
+struct credentials {
+ char service[ANAME_SZ]; /* Service name */
+ char instance[INST_SZ]; /* Instance */
+ char realm[REALM_SZ]; /* Auth domain */
+ C_Block session; /* Session key */
+ int lifetime; /* Lifetime */
+ int kvno; /* Key version number */
+ KTEXT_ST ticket_st; /* The ticket itself */
+ KRB4_32 issue_date; /* The issue time */
+ char pname[ANAME_SZ]; /* Principal's name */
+ char pinst[INST_SZ]; /* Principal's instance */
+#if TARGET_OS_MAC
+ KRB_UINT32 address; /* Address in ticket */
+ KRB_UINT32 stk_type; /* string_to_key function needed */
+#endif
+#ifdef _WIN32
+ char address[ADDR_SZ]; /* Address in ticket */
+#endif
+};
+
+typedef struct credentials CREDENTIALS;
+
+/* Structure definition for rd_private_msg and rd_safe_msg */
+
+struct msg_dat {
+ unsigned char *app_data; /* pointer to appl data */
+ unsigned KRB4_32 app_length; /* length of appl data */
+ unsigned KRB4_32 hash; /* hash to lookup replay */
+ int swap; /* swap bytes? */
+ KRB4_32 time_sec; /* msg timestamp seconds */
+ unsigned char time_5ms; /* msg timestamp 5ms units */
+};
+
+typedef struct msg_dat MSG_DAT;
+
+
+/* Location of ticket file for save_cred and get_cred */
+#ifdef _WIN32
+#define TKT_FILE "\\kerberos\\ticket.ses"
+#else
+#define TKT_FILE tkt_string()
+#define TKT_ROOT "/tmp/tkt"
+#endif /* _WIN32 */
+
+/*
+ * Error codes are now defined as offsets from com_err (krb_err.et)
+ * values.
+ */
+#define KRB_ET(x) ((KRBET_ ## x) - ERROR_TABLE_BASE_krb)
+
+/* Error codes returned from the KDC */
+#define KDC_OK KRB_ET(KSUCCESS) /* 0 - Request OK */
+#define KDC_NAME_EXP KRB_ET(KDC_NAME_EXP) /* 1 - Principal expired */
+#define KDC_SERVICE_EXP KRB_ET(KDC_SERVICE_EXP) /* 2 - Service expired */
+#define KDC_AUTH_EXP KRB_ET(KDC_AUTH_EXP) /* 3 - Auth expired */
+#define KDC_PKT_VER KRB_ET(KDC_PKT_VER) /* 4 - Prot version unknown */
+#define KDC_P_MKEY_VER KRB_ET(KDC_P_MKEY_VER) /* 5 - Wrong mkey version */
+#define KDC_S_MKEY_VER KRB_ET(KDC_S_MKEY_VER) /* 6 - Wrong mkey version */
+#define KDC_BYTE_ORDER KRB_ET(KDC_BYTE_ORDER) /* 7 - Byte order unknown */
+#define KDC_PR_UNKNOWN KRB_ET(KDC_PR_UNKNOWN) /* 8 - Princ unknown */
+#define KDC_PR_N_UNIQUE KRB_ET(KDC_PR_N_UNIQUE) /* 9 - Princ not unique */
+#define KDC_NULL_KEY KRB_ET(KDC_NULL_KEY) /* 10 - Princ has null key */
+#define KDC_GEN_ERR KRB_ET(KDC_GEN_ERR) /* 20 - Generic err frm KDC */
+
+/* Values returned by get_credentials */
+#define GC_OK KRB_ET(KSUCCESS) /* 0 - Retrieve OK */
+#define RET_OK KRB_ET(KSUCCESS) /* 0 - Retrieve OK */
+#define GC_TKFIL KRB_ET(GC_TKFIL) /* 21 - Can't rd tkt file */
+#define RET_TKFIL KRB_ET(GC_TKFIL) /* 21 - Can't rd tkt file */
+#define GC_NOTKT KRB_ET(GC_NOTKT) /* 22 - Can't find tkt|TGT */
+#define RET_NOTKT KRB_ET(GC_NOTKT) /* 22 - Can't find tkt|TGT */
+
+/* Values returned by mk_ap_req */
+#define MK_AP_OK KRB_ET(KSUCCESS) /* 0 - Success */
+#define MK_AP_TGTEXP KRB_ET(MK_AP_TGTEXP) /* 26 - TGT Expired */
+
+/* Values returned by rd_ap_req */
+#define RD_AP_OK KRB_ET(KSUCCESS) /* 0 - Request authentic */
+#define RD_AP_UNDEC KRB_ET(RD_AP_UNDEC) /* 31 - Can't decode authent */
+#define RD_AP_EXP KRB_ET(RD_AP_EXP) /* 32 - Ticket expired */
+#define RD_AP_NYV KRB_ET(RD_AP_NYV) /* 33 - Ticket not yet valid */
+#define RD_AP_REPEAT KRB_ET(RD_AP_REPEAT) /* 34 - Repeated request */
+#define RD_AP_NOT_US KRB_ET(RD_AP_NOT_US) /* 35 - Ticket isn't for us */
+#define RD_AP_INCON KRB_ET(RD_AP_INCON) /* 36 - Request inconsistent */
+#define RD_AP_TIME KRB_ET(RD_AP_TIME) /* 37 - delta_t too big */
+#define RD_AP_BADD KRB_ET(RD_AP_BADD) /* 38 - Incorrect net addr */
+#define RD_AP_VERSION KRB_ET(RD_AP_VERSION) /* 39 - prot vers mismatch */
+#define RD_AP_MSG_TYPE KRB_ET(RD_AP_MSG_TYPE) /* 40 - invalid msg type */
+#define RD_AP_MODIFIED KRB_ET(RD_AP_MODIFIED) /* 41 - msg stream modified */
+#define RD_AP_ORDER KRB_ET(RD_AP_ORDER) /* 42 - message out of order */
+#define RD_AP_UNAUTHOR KRB_ET(RD_AP_UNAUTHOR) /* 43 - unauthorized request */
+
+/* Values returned by get_pw_tkt */
+#define GT_PW_OK KRB_ET(KSUCCESS) /* 0 - Got passwd chg tkt */
+#define GT_PW_NULL KRB_ET(GT_PW_NULL) /* 51 - Current PW is null */
+#define GT_PW_BADPW KRB_ET(GT_PW_BADPW) /* 52 - Wrong passwd */
+#define GT_PW_PROT KRB_ET(GT_PW_PROT) /* 53 - Protocol Error */
+#define GT_PW_KDCERR KRB_ET(GT_PW_KDCERR) /* 54 - Error ret by KDC */
+#define GT_PW_NULLTKT KRB_ET(GT_PW_NULLTKT) /* 55 - Null tkt ret by KDC */
+
+/* Values returned by send_to_kdc */
+#define SKDC_OK KRB_ET(KSUCCESS) /* 0 - Response received */
+#define SKDC_RETRY KRB_ET(SKDC_RETRY) /* 56 - Retry count exceeded */
+#define SKDC_CANT KRB_ET(SKDC_CANT) /* 57 - Can't send request */
+
+/*
+ * Values returned by get_intkt
+ * (can also return SKDC_* and KDC errors)
+ */
+
+#define INTK_OK KRB_ET(KSUCCESS) /* 0 - Ticket obtained */
+#define INTK_PW_NULL KRB_ET(GT_PW_NULL) /* 51 - Current PW is null */
+#define INTK_W_NOTALL KRB_ET(INTK_W_NOTALL) /* 61 - Not ALL tkts retd */
+#define INTK_BADPW KRB_ET(INTK_BADPW) /* 62 - Incorrect password */
+#define INTK_PROT KRB_ET(INTK_PROT) /* 63 - Protocol Error */
+#define INTK_ERR KRB_ET(INTK_ERR) /* 70 - Other error */
+
+/* Values returned by get_adtkt */
+#define AD_OK KRB_ET(KSUCCESS) /* 0 - Ticket Obtained */
+#define AD_NOTGT KRB_ET(AD_NOTGT) /* 71 - Don't have tgt */
+
+/* Error codes returned by ticket file utilities */
+#define NO_TKT_FIL KRB_ET(NO_TKT_FIL) /* 76 - No ticket file found */
+#define TKT_FIL_ACC KRB_ET(TKT_FIL_ACC) /* 77 - Can't acc tktfile */
+#define TKT_FIL_LCK KRB_ET(TKT_FIL_LCK) /* 78 - Can't lck tkt file */
+#define TKT_FIL_FMT KRB_ET(TKT_FIL_FMT) /* 79 - Bad tkt file format */
+#define TKT_FIL_INI KRB_ET(TKT_FIL_INI) /* 80 - tf_init not called */
+
+/* Error code returned by kparse_name */
+#define KNAME_FMT KRB_ET(KNAME_FMT) /* 81 - Bad krb name fmt */
+
+/* Error code returned by krb_mk_safe */
+#define SAFE_PRIV_ERROR (-1) /* syscall error */
+
+/* Kerberos ticket flag field bit definitions */
+#define K_FLAG_ORDER 0 /* bit 0 --> lsb */
+#define K_FLAG_1 /* reserved */
+#define K_FLAG_2 /* reserved */
+#define K_FLAG_3 /* reserved */
+#define K_FLAG_4 /* reserved */
+#define K_FLAG_5 /* reserved */
+#define K_FLAG_6 /* reserved */
+#define K_FLAG_7 /* reserved, bit 7 --> msb */
+
+/* Are these needed anymore? */
+#ifdef OLDNAMES
+#define krb_mk_req mk_ap_req
+#define krb_rd_req rd_ap_req
+#define krb_kntoln an_to_ln
+#define krb_set_key set_serv_key
+#define krb_get_cred get_credentials
+#define krb_mk_priv mk_private_msg
+#define krb_rd_priv rd_private_msg
+#define krb_mk_safe mk_safe_msg
+#define krb_rd_safe rd_safe_msg
+#define krb_mk_err mk_appl_err_msg
+#define krb_rd_err rd_appl_err_msg
+#define krb_ck_repl check_replay
+#define krb_get_pw_in_tkt get_in_tkt
+#define krb_get_svc_in_tkt get_svc_in_tkt
+#define krb_get_pw_tkt get_pw_tkt
+#define krb_realmofhost krb_getrealm
+#define krb_get_phost get_phost
+#define krb_get_krbhst get_krbhst
+#define krb_get_lrealm get_krbrlm
+#endif /* OLDNAMES */
+
+/* Defines for krb_sendauth and krb_recvauth */
+
+#define KOPT_DONT_MK_REQ 0x00000001 /* don't call krb_mk_req */
+#define KOPT_DO_MUTUAL 0x00000002 /* do mutual auth */
+#define KOPT_DONT_CANON 0x00000004 /* don't canonicalize inst as a host */
+
+#define KRB_SENDAUTH_VLEN 8 /* length for version strings */
+
+#ifdef ATHENA_COMPAT
+#define KOPT_DO_OLDSTYLE 0x00000008 /* use the old-style protocol */
+#endif /* ATHENA_COMPAT */
+
+
+#ifdef _WIN32
+#define TIME_GMT_UNIXSEC win_time_gmt_unixsec((unsigned KRB4_32 *)0)
+#define TIME_GMT_UNIXSEC_US(us) win_time_gmt_unixsec((us))
+#define CONVERT_TIME_EPOCH win_time_get_epoch()
+#else
+/* until we do V4 compat under DOS, just turn this off */
+#define _fmemcpy memcpy
+#define _fstrncpy strncpy
+#define far_fputs fputs
+/* and likewise, just drag in the unix time interface */
+#define TIME_GMT_UNIXSEC unix_time_gmt_unixsec((unsigned KRB4_32 *)0)
+#define TIME_GMT_UNIXSEC_US(us) unix_time_gmt_unixsec((us))
+#define CONVERT_TIME_EPOCH ((long)0) /* Unix epoch is Krb epoch */
+#endif /* _WIN32 */
+
+/* Constants for KerberosProfileLib */
+#define REALMS_V4_PROF_REALMS_SECTION "v4 realms"
+#define REALMS_V4_PROF_KDC "kdc"
+#define REALMS_V4_PROF_ADMIN_KDC "admin_server"
+#define REALMS_V4_PROF_KPASSWD_KDC "kpasswd_server"
+#define REALMS_V4_PROF_DOMAIN_SECTION "v4 domain_realm"
+#define REALMS_V4_PROF_LIBDEFAULTS_SECTION "libdefaults"
+#define REALMS_V4_PROF_LOCAL_REALM "default_realm"
+#define REALMS_V4_PROF_STK "string_to_key_type"
+#define REALMS_V4_MIT_STK "mit_string_to_key"
+#define REALMS_V4_AFS_STK "afs_string_to_key"
+#define REALMS_V4_COLUMBIA_STK "columbia_string_to_key"
+#define REALMS_V4_DEFAULT_REALM "default_realm"
+#define REALMS_V4_NO_ADDRESSES "noaddresses"
+
+/* ask to disable IP address checking in the library */
+extern int krb_ignore_ip_address;
+
+/* Debugging printfs shouldn't even be compiled on many systems that don't
+ support printf! Use it like DEB (("Oops - %s\n", string)); */
+
+#ifdef DEBUG
+#define DEB(x) if (krb_debug) printf x
+extern int krb_debug;
+#else
+#define DEB(x) /* nothing */
+#endif
+
+/* Define a couple of function types including parameters. These
+ are needed on MS-Windows to convert arguments of the function pointers
+ to the proper types during calls. */
+
+typedef int (KRB5_CALLCONV *key_proc_type)
+ (char *, char *, char *,
+ char *, C_Block);
+#define KEY_PROC_TYPE_DEFINED
+
+typedef int (KRB5_CALLCONV *decrypt_tkt_type)
+ (char *, char *, char *,
+ char *, key_proc_type, KTEXT *);
+#define DECRYPT_TKT_TYPE_DEFINED
+
+extern struct _krb5_context * krb5__krb4_context;
+
+/*
+ * Function Prototypes for Kerberos V4.
+ */
+
+struct sockaddr_in;
+
+/* dest_tkt.c */
+int KRB5_CALLCONV dest_tkt
+ (void);
+/* err_txt.c */
+const char * KRB5_CALLCONV krb_get_err_text
+ (int errnum);
+/* g_ad_tkt.c */
+/* Previously not KRB5_CALLCONV */
+int KRB5_CALLCONV get_ad_tkt
+ (char *service, char *sinst, char *realm, int lifetime);
+/* g_admhst.c */
+int KRB5_CALLCONV krb_get_admhst
+ (char *host, char *realm, int idx);
+/* g_cred.c */
+int KRB5_CALLCONV krb_get_cred
+ (char *service, char *instance, char *realm,
+ CREDENTIALS *c);
+/* g_in_tkt.c */
+/* Previously not KRB5_CALLCONV */
+int KRB5_CALLCONV krb_get_in_tkt
+ (char *k_user, char *instance, char *realm,
+ char *service, char *sinst, int life,
+ key_proc_type, decrypt_tkt_type, char *arg);
+#if KRB_PRIVATE
+/* Previously not KRB5_CALLCONV */
+int KRB5_CALLCONV krb_get_in_tkt_preauth
+ (char *k_user, char *instance, char *realm,
+ char *service, char *sinst, int life,
+ key_proc_type, decrypt_tkt_type, char *arg,
+ char *preauth_p, int preauth_len);
+#endif
+/* From KfM */
+int KRB5_CALLCONV krb_get_in_tkt_creds(char *, char *, char *, char *, char *,
+ int, key_proc_type, decrypt_tkt_type, char *, CREDENTIALS *);
+
+/* g_krbhst.c */
+int KRB5_CALLCONV krb_get_krbhst
+ (char *host, const char *realm, int idx);
+/* g_krbrlm.c */
+int KRB5_CALLCONV krb_get_lrealm
+ (char *realm, int idx);
+/* g_phost.c */
+char * KRB5_CALLCONV krb_get_phost
+ (char * alias);
+/* get_pw_tkt */
+int KRB5_CALLCONV get_pw_tkt
+ (char *, char *, char *, char *);
+/* g_pw_in_tkt.c */
+int KRB5_CALLCONV krb_get_pw_in_tkt
+ (char *k_user, char *instance, char *realm,
+ char *service, char *sinstance,
+ int life, char *password);
+#if KRB_PRIVATE
+int KRB5_CALLCONV krb_get_pw_in_tkt_preauth
+ (char *k_user, char *instance, char *realm,
+ char *service, char *sinstance,
+ int life, char *password);
+#endif
+int KRB5_CALLCONV
+krb_get_pw_in_tkt_creds(char *, char *, char *,
+ char *, char *, int, char *, CREDENTIALS *);
+
+/* g_svc_in_tkt.c */
+int KRB5_CALLCONV krb_get_svc_in_tkt
+ (char *k_user, char *instance, char *realm,
+ char *service, char *sinstance,
+ int life, char *srvtab);
+
+/* g_tf_fname.c */
+int KRB5_CALLCONV krb_get_tf_fullname
+ (const char *ticket_file, char *name, char *inst, char *realm);
+/* g_tf_realm.c */
+int KRB5_CALLCONV krb_get_tf_realm
+ (const char *ticket_file, char *realm);
+/* g_tkt_svc.c */
+int KRB5_CALLCONV krb_get_ticket_for_service
+ (char *serviceName,
+ char *buf, unsigned KRB4_32 *buflen,
+ int checksum, des_cblock, Key_schedule,
+ char *version, int includeVersion);
+#if KRB_PRIVATE
+/* in_tkt.c */
+int KRB5_CALLCONV in_tkt
+ (char *name, char *inst);
+int KRB5_CALLCONV krb_in_tkt
+ (char *pname, char *pinst, char *realm);
+#endif
+
+/* kname_parse.c */
+int KRB5_CALLCONV kname_parse
+ (char *name, char *inst, char *realm,
+ char *fullname);
+/* Merged from KfM */
+int KRB5_CALLCONV kname_unparse
+ (char *, const char *, const char *, const char *);
+
+int KRB5_CALLCONV k_isname
+ (char *);
+int KRB5_CALLCONV k_isinst
+ (char *);
+int KRB5_CALLCONV k_isrealm
+ (char *);
+
+
+/* kuserok.c */
+int KRB5_CALLCONV kuserok
+ (AUTH_DAT *kdata, char *luser);
+
+/* lifetime.c */
+KRB4_32 KRB5_CALLCONV krb_life_to_time
+ (KRB4_32 start, int life);
+int KRB5_CALLCONV krb_time_to_life
+ (KRB4_32 start, KRB4_32 end);
+
+/* mk_auth.c */
+int KRB5_CALLCONV krb_check_auth
+ (KTEXT, unsigned KRB4_32 cksum, MSG_DAT *,
+ C_Block, Key_schedule,
+ struct sockaddr_in * local_addr,
+ struct sockaddr_in * foreign_addr);
+int KRB5_CALLCONV krb_mk_auth
+ (long k4_options, KTEXT ticket,
+ char *service, char *inst, char *realm,
+ unsigned KRB4_32 checksum, char *version, KTEXT buf);
+/* mk_err.c */
+long KRB5_CALLCONV krb_mk_err
+ (u_char *out, KRB4_32 k4_code, char *text);
+#if KRB_PRIVATE
+/* mk_preauth.c */
+int krb_mk_preauth
+ (char **preauth_p, int *preauth_len, key_proc_type,
+ char *name, char *inst, char *realm, char *password,
+ C_Block);
+void krb_free_preauth
+ (char * preauth_p, int len);
+#endif
+/* mk_priv.c */
+long KRB5_CALLCONV krb_mk_priv
+ (u_char *in, u_char *out,
+ unsigned KRB4_32 length,
+ Key_schedule, C_Block *,
+ struct sockaddr_in * sender,
+ struct sockaddr_in * receiver);
+/* mk_req.c */
+int KRB5_CALLCONV krb_mk_req
+ (KTEXT authent,
+ char *service, char *instance, char *realm,
+ KRB4_32 checksum);
+/* Merged from KfM */
+int KRB5_CALLCONV krb_mk_req_creds(KTEXT, CREDENTIALS *, KRB_INT32);
+
+/* Added CALLCONV (KfM exports w/o INTERFACE, but KfW doesn't export?) */
+int KRB5_CALLCONV krb_set_lifetime(int newval);
+
+/* mk_safe.c */
+long KRB5_CALLCONV krb_mk_safe
+ (u_char *in, u_char *out, unsigned KRB4_32 length,
+ C_Block *,
+ struct sockaddr_in *sender,
+ struct sockaddr_in *receiver);
+#if KRB_PRIVATE
+/* netread.c */
+int krb_net_read
+ (int fd, char *buf, int len);
+/* netwrite.c */
+int krb_net_write
+ (int fd, char *buf, int len);
+/* pkt_clen.c */
+int pkt_clen
+ (KTEXT);
+#endif
+
+/* put_svc_key.c */
+int KRB5_CALLCONV put_svc_key
+ (char *sfile,
+ char *name, char *inst, char *realm,
+ int newvno, char *key);
+
+/* rd_err.c */
+int KRB5_CALLCONV krb_rd_err
+ (u_char *in, u_long in_length,
+ long *k4_code, MSG_DAT *m_data);
+/* rd_priv.c */
+long KRB5_CALLCONV krb_rd_priv
+ (u_char *in,unsigned KRB4_32 in_length,
+ Key_schedule, C_Block *,
+ struct sockaddr_in *sender,
+ struct sockaddr_in *receiver,
+ MSG_DAT *m_data);
+/* rd_req.c */
+int KRB5_CALLCONV krb_rd_req
+ (KTEXT, char *service, char *inst,
+ unsigned KRB4_32 from_addr, AUTH_DAT *,
+ char *srvtab);
+/* Merged from KfM */
+int KRB5_CALLCONV
+krb_rd_req_int(KTEXT, char *, char *, KRB_UINT32, AUTH_DAT *, C_Block);
+
+/* rd_safe.c */
+long KRB5_CALLCONV krb_rd_safe
+ (u_char *in, unsigned KRB4_32 in_length,
+ C_Block *,
+ struct sockaddr_in *sender,
+ struct sockaddr_in *receiver,
+ MSG_DAT *m_data);
+/* rd_svc_key.c */
+int KRB5_CALLCONV read_service_key
+ (char *service, char *instance, char *realm,
+ int kvno, char *file, char *key);
+int KRB5_CALLCONV get_service_key
+ (char *service, char *instance, char *realm,
+ int *kvno, char *file, char *key);
+
+/* realmofhost.c */
+char * KRB5_CALLCONV krb_realmofhost
+ (char *host);
+/* recvauth.c */
+int KRB5_CALLCONV krb_recvauth
+ (long k4_options, int fd, KTEXT ticket,
+ char *service, char *instance,
+ struct sockaddr_in *foreign_addr,
+ struct sockaddr_in *local_addr,
+ AUTH_DAT *kdata, char *srvtab,
+ Key_schedule schedule, char *version);
+/* sendauth.c */
+int KRB5_CALLCONV krb_sendauth
+ (long k4_options, int fd, KTEXT ticket,
+ char *service, char *inst, char *realm,
+ unsigned KRB4_32 checksum, MSG_DAT *msg_data,
+ CREDENTIALS *cred, Key_schedule schedule,
+ struct sockaddr_in *laddr, struct sockaddr_in *faddr,
+ char *version);
+
+#if KRB_PRIVATE
+/* save_creds.c */
+int KRB5_CALLCONV krb_save_credentials
+ (char *service, char *instance, char *realm,
+ C_Block session, int lifetime, int kvno,
+ KTEXT ticket, long issue_date);
+/* send_to_kdc.c */
+/* XXX PRIVATE? KfM doesn't export. */
+int send_to_kdc
+ (KTEXT pkt, KTEXT rpkt, char *realm);
+#endif
+
+/* tkt_string.c */
+/* Used to return pointer to non-const char */
+const char * KRB5_CALLCONV tkt_string
+ (void);
+/* Previously not KRB5_CALLCONV, and previously took pointer to non-const. */
+void KRB5_CALLCONV krb_set_tkt_string
+ (const char *);
+
+#if KRB_PRIVATE
+/* tf_util.c */
+int KRB5_CALLCONV tf_init (const char *tf_name, int rw);
+
+int KRB5_CALLCONV tf_get_pname (char *p);
+
+int KRB5_CALLCONV tf_get_pinst (char *p);
+
+int KRB5_CALLCONV tf_get_cred (CREDENTIALS *c);
+
+void KRB5_CALLCONV tf_close (void);
+#endif
+
+#if KRB_PRIVATE
+/* unix_time.c */
+unsigned KRB4_32 KRB5_CALLCONV unix_time_gmt_unixsec
+ (unsigned KRB4_32 *);
+
+/*
+ * Internal prototypes
+ */
+extern int krb_set_key
+ (char *key, int cvt);
+
+/* This is exported by KfM. It was previously not KRB5_CALLCONV. */
+extern int KRB5_CALLCONV decomp_ticket
+ (KTEXT tkt, unsigned char *flags, char *pname,
+ char *pinstance, char *prealm, unsigned KRB4_32 *paddress,
+ C_Block session, int *life, unsigned KRB4_32 *time_sec,
+ char *sname, char *sinstance, C_Block,
+ Key_schedule key_s);
+
+
+extern void cr_err_reply(KTEXT pkt, char *pname, char *pinst, char *prealm,
+ u_long time_ws, u_long e, char *e_string);
+
+extern int create_ciph(KTEXT c, C_Block session, char *service,
+ char *instance, char *realm, unsigned long life,
+ int kvno, KTEXT tkt, unsigned long kdc_time,
+ C_Block key);
+
+
+extern int krb_create_ticket(KTEXT tkt, unsigned int flags, char *pname,
+ char *pinstance, char *prealm, long paddress,
+ char *session, int life, long time_sec,
+ char *sname, char *sinstance, C_Block key);
+
+#endif /* KRB_PRIVATE */
+
+/* This function is used by KEYFILE above. Do not call it directly */
+extern char * krb__get_srvtabname(const char *);
+
+#if KRB_PRIVATE
+
+extern int krb_kntoln(AUTH_DAT *, char *);
+
+#ifdef KRB5_GENERAL__
+extern int krb_cr_tkt_krb5(KTEXT tkt, unsigned int flags, char *pname,
+ char *pinstance, char *prealm, long paddress,
+ char *session, int life, long time_sec,
+ char *sname, char *sinstance,
+ krb5_keyblock *k5key);
+
+extern int krb_set_key_krb5(krb5_context ctx, krb5_keyblock *key);
+
+#endif
+
+#endif /* KRB_PRIVATE */
+
+/*
+ * krb_change_password -- merged from KfM
+ */
+/* change_password.c */
+int KRB5_CALLCONV krb_change_password(char *, char *, char *, char *, char *);
+
+/*
+ * RealmsConfig-glue.c -- merged from KfM
+ */
+int KRB5_CALLCONV krb_get_profile(profile_t *);
+
+#ifdef _WIN32
+HINSTANCE get_lib_instance(void);
+unsigned int krb_get_notification_message(void);
+char * KRB5_CALLCONV krb_get_default_user(void);
+int KRB5_CALLCONV krb_set_default_user(char *);
+unsigned KRB4_32 win_time_gmt_unixsec(unsigned KRB4_32 *);
+long win_time_get_epoch(void);
+#endif
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import reset
+# endif
+# pragma options align=reset
+#endif
+
+KRBINT_END_DECLS
+
+#endif /* KRB_DEFS */
--- /dev/null
+/*
+ * include//kerberosIV/krb_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define KRBET_KSUCCESS (39525376L)
+#define KRBET_KDC_NAME_EXP (39525377L)
+#define KRBET_KDC_SERVICE_EXP (39525378L)
+#define KRBET_KDC_AUTH_EXP (39525379L)
+#define KRBET_KDC_PKT_VER (39525380L)
+#define KRBET_KDC_P_MKEY_VER (39525381L)
+#define KRBET_KDC_S_MKEY_VER (39525382L)
+#define KRBET_KDC_BYTE_ORDER (39525383L)
+#define KRBET_KDC_PR_UNKNOWN (39525384L)
+#define KRBET_KDC_PR_N_UNIQUE (39525385L)
+#define KRBET_KDC_NULL_KEY (39525386L)
+#define KRBET_KRB_RES11 (39525387L)
+#define KRBET_KRB_RES12 (39525388L)
+#define KRBET_KRB_RES13 (39525389L)
+#define KRBET_KRB_RES14 (39525390L)
+#define KRBET_KRB_RES15 (39525391L)
+#define KRBET_KRB_RES16 (39525392L)
+#define KRBET_KRB_RES17 (39525393L)
+#define KRBET_KRB_RES18 (39525394L)
+#define KRBET_KRB_RES19 (39525395L)
+#define KRBET_KDC_GEN_ERR (39525396L)
+#define KRBET_GC_TKFIL (39525397L)
+#define KRBET_GC_NOTKT (39525398L)
+#define KRBET_KRB_RES23 (39525399L)
+#define KRBET_KRB_RES24 (39525400L)
+#define KRBET_KRB_RES25 (39525401L)
+#define KRBET_MK_AP_TGTEXP (39525402L)
+#define KRBET_KRB_RES27 (39525403L)
+#define KRBET_KRB_RES28 (39525404L)
+#define KRBET_KRB_RES29 (39525405L)
+#define KRBET_KRB_RES30 (39525406L)
+#define KRBET_RD_AP_UNDEC (39525407L)
+#define KRBET_RD_AP_EXP (39525408L)
+#define KRBET_RD_AP_NYV (39525409L)
+#define KRBET_RD_AP_REPEAT (39525410L)
+#define KRBET_RD_AP_NOT_US (39525411L)
+#define KRBET_RD_AP_INCON (39525412L)
+#define KRBET_RD_AP_TIME (39525413L)
+#define KRBET_RD_AP_BADD (39525414L)
+#define KRBET_RD_AP_VERSION (39525415L)
+#define KRBET_RD_AP_MSG_TYPE (39525416L)
+#define KRBET_RD_AP_MODIFIED (39525417L)
+#define KRBET_RD_AP_ORDER (39525418L)
+#define KRBET_RD_AP_UNAUTHOR (39525419L)
+#define KRBET_KRB_RES44 (39525420L)
+#define KRBET_KRB_RES45 (39525421L)
+#define KRBET_KRB_RES46 (39525422L)
+#define KRBET_KRB_RES47 (39525423L)
+#define KRBET_KRB_RES48 (39525424L)
+#define KRBET_KRB_RES49 (39525425L)
+#define KRBET_KRB_RES50 (39525426L)
+#define KRBET_GT_PW_NULL (39525427L)
+#define KRBET_GT_PW_BADPW (39525428L)
+#define KRBET_GT_PW_PROT (39525429L)
+#define KRBET_GT_PW_KDCERR (39525430L)
+#define KRBET_GT_PW_NULLTKT (39525431L)
+#define KRBET_SKDC_RETRY (39525432L)
+#define KRBET_SKDC_CANT (39525433L)
+#define KRBET_KRB_RES58 (39525434L)
+#define KRBET_KRB_RES59 (39525435L)
+#define KRBET_KRB_RES60 (39525436L)
+#define KRBET_INTK_W_NOTALL (39525437L)
+#define KRBET_INTK_BADPW (39525438L)
+#define KRBET_INTK_PROT (39525439L)
+#define KRBET_KRB_RES64 (39525440L)
+#define KRBET_KRB_RES65 (39525441L)
+#define KRBET_KRB_RES66 (39525442L)
+#define KRBET_KRB_RES67 (39525443L)
+#define KRBET_KRB_RES68 (39525444L)
+#define KRBET_KRB_RES69 (39525445L)
+#define KRBET_INTK_ERR (39525446L)
+#define KRBET_AD_NOTGT (39525447L)
+#define KRBET_KRB_RES72 (39525448L)
+#define KRBET_KRB_RES73 (39525449L)
+#define KRBET_KRB_RES74 (39525450L)
+#define KRBET_KRB_RES75 (39525451L)
+#define KRBET_NO_TKT_FIL (39525452L)
+#define KRBET_TKT_FIL_ACC (39525453L)
+#define KRBET_TKT_FIL_LCK (39525454L)
+#define KRBET_TKT_FIL_FMT (39525455L)
+#define KRBET_TKT_FIL_INI (39525456L)
+#define KRBET_KNAME_FMT (39525457L)
+#define KRBET_RES82 (39525458L)
+#define KRBET_RES83 (39525459L)
+#define KRBET_RES84 (39525460L)
+#define KRBET_RES85 (39525461L)
+#define KRBET_RES86 (39525462L)
+#define KRBET_RES87 (39525463L)
+#define KRBET_RES88 (39525464L)
+#define KRBET_RES89 (39525465L)
+#define KRBET_RES90 (39525466L)
+#define KRBET_RES91 (39525467L)
+#define KRBET_RES92 (39525468L)
+#define KRBET_RES93 (39525469L)
+#define KRBET_RES94 (39525470L)
+#define KRBET_RES95 (39525471L)
+#define KRBET_RES96 (39525472L)
+#define KRBET_RES97 (39525473L)
+#define KRBET_RES98 (39525474L)
+#define KRBET_RES99 (39525475L)
+#define KRBET_RES100 (39525476L)
+#define KRBET_RES101 (39525477L)
+#define KRBET_RES102 (39525478L)
+#define KRBET_RES103 (39525479L)
+#define KRBET_RES104 (39525480L)
+#define KRBET_RES105 (39525481L)
+#define KRBET_RES106 (39525482L)
+#define KRBET_RES107 (39525483L)
+#define KRBET_RES108 (39525484L)
+#define KRBET_RES109 (39525485L)
+#define KRBET_RES110 (39525486L)
+#define KRBET_RES111 (39525487L)
+#define KRBET_RES112 (39525488L)
+#define KRBET_RES113 (39525489L)
+#define KRBET_RES114 (39525490L)
+#define KRBET_RES115 (39525491L)
+#define KRBET_RES116 (39525492L)
+#define KRBET_RES117 (39525493L)
+#define KRBET_RES118 (39525494L)
+#define KRBET_RES119 (39525495L)
+#define KRBET_RES120 (39525496L)
+#define KRBET_RES121 (39525497L)
+#define KRBET_RES122 (39525498L)
+#define KRBET_RES123 (39525499L)
+#define KRBET_RES124 (39525500L)
+#define KRBET_RES125 (39525501L)
+#define KRBET_RES126 (39525502L)
+#define KRBET_RES127 (39525503L)
+#define KRBET_RES128 (39525504L)
+#define KRBET_RES129 (39525505L)
+#define KRBET_RES130 (39525506L)
+#define KRBET_RES131 (39525507L)
+#define KRBET_RES132 (39525508L)
+#define KRBET_RES133 (39525509L)
+#define KRBET_RES134 (39525510L)
+#define KRBET_RES135 (39525511L)
+#define KRBET_RES136 (39525512L)
+#define KRBET_RES137 (39525513L)
+#define KRBET_RES138 (39525514L)
+#define KRBET_RES139 (39525515L)
+#define KRBET_RES140 (39525516L)
+#define KRBET_RES141 (39525517L)
+#define KRBET_RES142 (39525518L)
+#define KRBET_RES143 (39525519L)
+#define KRBET_RES144 (39525520L)
+#define KRBET_RES145 (39525521L)
+#define KRBET_RES146 (39525522L)
+#define KRBET_RES147 (39525523L)
+#define KRBET_RES148 (39525524L)
+#define KRBET_RES149 (39525525L)
+#define KRBET_RES150 (39525526L)
+#define KRBET_RES151 (39525527L)
+#define KRBET_RES152 (39525528L)
+#define KRBET_RES153 (39525529L)
+#define KRBET_RES154 (39525530L)
+#define KRBET_RES155 (39525531L)
+#define KRBET_RES156 (39525532L)
+#define KRBET_RES157 (39525533L)
+#define KRBET_RES158 (39525534L)
+#define KRBET_RES159 (39525535L)
+#define KRBET_RES160 (39525536L)
+#define KRBET_RES161 (39525537L)
+#define KRBET_RES162 (39525538L)
+#define KRBET_RES163 (39525539L)
+#define KRBET_RES164 (39525540L)
+#define KRBET_RES165 (39525541L)
+#define KRBET_RES166 (39525542L)
+#define KRBET_RES167 (39525543L)
+#define KRBET_RES168 (39525544L)
+#define KRBET_RES169 (39525545L)
+#define KRBET_RES170 (39525546L)
+#define KRBET_RES171 (39525547L)
+#define KRBET_RES172 (39525548L)
+#define KRBET_RES173 (39525549L)
+#define KRBET_RES174 (39525550L)
+#define KRBET_RES175 (39525551L)
+#define KRBET_RES176 (39525552L)
+#define KRBET_RES177 (39525553L)
+#define KRBET_RES178 (39525554L)
+#define KRBET_RES179 (39525555L)
+#define KRBET_RES180 (39525556L)
+#define KRBET_RES181 (39525557L)
+#define KRBET_RES182 (39525558L)
+#define KRBET_RES183 (39525559L)
+#define KRBET_RES184 (39525560L)
+#define KRBET_RES185 (39525561L)
+#define KRBET_RES186 (39525562L)
+#define KRBET_RES187 (39525563L)
+#define KRBET_RES188 (39525564L)
+#define KRBET_RES189 (39525565L)
+#define KRBET_RES190 (39525566L)
+#define KRBET_RES191 (39525567L)
+#define KRBET_RES192 (39525568L)
+#define KRBET_RES193 (39525569L)
+#define KRBET_RES194 (39525570L)
+#define KRBET_RES195 (39525571L)
+#define KRBET_RES196 (39525572L)
+#define KRBET_RES197 (39525573L)
+#define KRBET_RES198 (39525574L)
+#define KRBET_RES199 (39525575L)
+#define KRBET_RES200 (39525576L)
+#define KRBET_RES201 (39525577L)
+#define KRBET_RES202 (39525578L)
+#define KRBET_RES203 (39525579L)
+#define KRBET_RES204 (39525580L)
+#define KRBET_RES205 (39525581L)
+#define KRBET_RES206 (39525582L)
+#define KRBET_RES207 (39525583L)
+#define KRBET_RES208 (39525584L)
+#define KRBET_RES209 (39525585L)
+#define KRBET_RES210 (39525586L)
+#define KRBET_RES211 (39525587L)
+#define KRBET_RES212 (39525588L)
+#define KRBET_RES213 (39525589L)
+#define KRBET_RES214 (39525590L)
+#define KRBET_RES215 (39525591L)
+#define KRBET_RES216 (39525592L)
+#define KRBET_RES217 (39525593L)
+#define KRBET_RES218 (39525594L)
+#define KRBET_RES219 (39525595L)
+#define KRBET_RES220 (39525596L)
+#define KRBET_RES221 (39525597L)
+#define KRBET_RES222 (39525598L)
+#define KRBET_RES223 (39525599L)
+#define KRBET_RES224 (39525600L)
+#define KRBET_RES225 (39525601L)
+#define KRBET_RES226 (39525602L)
+#define KRBET_RES227 (39525603L)
+#define KRBET_RES228 (39525604L)
+#define KRBET_RES229 (39525605L)
+#define KRBET_RES230 (39525606L)
+#define KRBET_RES231 (39525607L)
+#define KRBET_RES232 (39525608L)
+#define KRBET_RES233 (39525609L)
+#define KRBET_RES234 (39525610L)
+#define KRBET_RES235 (39525611L)
+#define KRBET_RES236 (39525612L)
+#define KRBET_RES237 (39525613L)
+#define KRBET_RES238 (39525614L)
+#define KRBET_RES239 (39525615L)
+#define KRBET_RES240 (39525616L)
+#define KRBET_RES241 (39525617L)
+#define KRBET_RES242 (39525618L)
+#define KRBET_RES243 (39525619L)
+#define KRBET_RES244 (39525620L)
+#define KRBET_RES245 (39525621L)
+#define KRBET_RES246 (39525622L)
+#define KRBET_RES247 (39525623L)
+#define KRBET_RES248 (39525624L)
+#define KRBET_RES249 (39525625L)
+#define KRBET_RES250 (39525626L)
+#define KRBET_RES251 (39525627L)
+#define KRBET_RES252 (39525628L)
+#define KRBET_RES253 (39525629L)
+#define KRBET_RES254 (39525630L)
+#define KRBET_KFAILURE (39525631L)
+#define ERROR_TABLE_BASE_krb (39525376L)
+
+extern const struct error_table et_krb_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_krb_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_krb_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_krb_err_tbl initialize_krb_error_table
+#define krb_err_base ERROR_TABLE_BASE_krb
+#endif
--- /dev/null
+/*
+ Copyright (C) 1989 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.
+
+ */
--- /dev/null
+/*
+ * Header file for common error description library.
+ *
+ * Copyright 1988, Student Information Processing Board of the
+ * Massachusetts Institute of Technology.
+ *
+ * Copyright 1995 by Cygnus Support.
+ *
+ * For copyright and distribution info, see the documentation supplied
+ * with this package.
+ */
+
+#ifndef __COM_ERR_H
+
+#if defined(_WIN32)
+#include <win-mac.h>
+#endif
+
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#endif
+
+#include <stdarg.h>
+
+typedef long errcode_t;
+typedef void (*et_old_error_hook_func) (const char *, errcode_t,
+ const char *, va_list ap);
+
+struct error_table {
+ /*@shared@*/ char const * const * msgs;
+ long base;
+ unsigned int n_msgs;
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Public interfaces */
+extern void KRB5_CALLCONV_C com_err
+ (const char *, errcode_t, const char *, ...);
+extern void KRB5_CALLCONV com_err_va
+ (const char *whoami, errcode_t code, const char *fmt,
+ va_list ap);
+extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message
+ (errcode_t)
+ /*@modifies internalState@*/;
+extern errcode_t KRB5_CALLCONV add_error_table
+ (/*@dependent@*/ const struct error_table *)
+ /*@modifies internalState@*/;
+extern errcode_t KRB5_CALLCONV remove_error_table
+ (const struct error_table *)
+ /*@modifies internalState@*/;
+
+#if !defined(_WIN32)
+/*
+ * The display routine should be application specific. A global hook,
+ * may cause inappropriate display procedures to be called between
+ * applications under non-Unix environments.
+ */
+
+extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func);
+extern et_old_error_hook_func reset_com_err_hook (void);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#define __COM_ERR_H
+#endif /* ! defined(__COM_ERR_H) */
--- /dev/null
+/*
+ * Copyright 1993 by OpenVision Technologies, Inc.
+ *
+ * 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 appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of OpenVision not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. OpenVision makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _GSSAPI_H_
+#define _GSSAPI_H_
+
+/*
+ * Determine platform-dependent configuration.
+ */
+
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+# include <TargetConditionals.h>
+# if TARGET_RT_MAC_CFM
+# error "Use KfM 4.0 SDK headers for CFM compilation."
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import on
+# endif
+# pragma options align=mac68k
+#endif
+
+#if defined(_MSDOS) || defined(_WIN32)
+#include <win-mac.h>
+#endif
+
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#endif
+
+#define GSS_SIZEOF_INT SIZEOF_INT
+#define GSS_SIZEOF_LONG SIZEOF_LONG
+#define GSS_SIZEOF_SHORT SIZEOF_SHORT
+
+/*
+ * First, include stddef.h to get size_t defined.
+ */
+#if HAVE_STDDEF_H
+#include <stddef.h>
+#endif /* HAVE_STDDEF_H */
+
+/*
+ * POSIX says that sys/types.h is where size_t is defined.
+ */
+#include <sys/types.h>
+
+/*
+ * If the platform supports the xom.h header file, it should be included here.
+ */
+#if HAVE_XOM_H
+#include <xom.h>
+#endif /* HAVE_XOM_H */
+
+/*
+ * $Id$
+ */
+
+/*
+ * First, define the three platform-dependent pointer types.
+ */
+
+typedef void * gss_name_t;
+typedef void * gss_cred_id_t;
+typedef void * gss_ctx_id_t;
+
+/*
+ * The following type must be defined as the smallest natural unsigned integer
+ * supported by the platform that has at least 32 bits of precision.
+ */
+#if (GSS_SIZEOF_SHORT == 4)
+typedef unsigned short gss_uint32;
+typedef short gss_int32;
+#elif (GSS_SIZEOF_INT == 4)
+typedef unsigned int gss_uint32;
+typedef int gss_int32;
+#elif (GSS_SIZEOF_LONG == 4)
+typedef unsigned long gss_uint32;
+typedef long gss_int32;
+#endif
+
+#ifdef OM_STRING
+/*
+ * We have included the xom.h header file. Use the definition for
+ * OM_object identifier.
+ */
+typedef OM_object_identifier gss_OID_desc, *gss_OID;
+#else /* OM_STRING */
+/*
+ * We can't use X/Open definitions, so roll our own.
+ */
+typedef gss_uint32 OM_uint32;
+
+typedef struct gss_OID_desc_struct {
+ OM_uint32 length;
+ void *elements;
+} gss_OID_desc, *gss_OID;
+#endif /* OM_STRING */
+
+typedef struct gss_OID_set_desc_struct {
+ size_t count;
+ gss_OID elements;
+} gss_OID_set_desc, *gss_OID_set;
+
+typedef struct gss_buffer_desc_struct {
+ size_t length;
+ void *value;
+} gss_buffer_desc, *gss_buffer_t;
+
+typedef struct gss_channel_bindings_struct {
+ OM_uint32 initiator_addrtype;
+ gss_buffer_desc initiator_address;
+ OM_uint32 acceptor_addrtype;
+ gss_buffer_desc acceptor_address;
+ gss_buffer_desc application_data;
+} *gss_channel_bindings_t;
+
+/*
+ * For now, define a QOP-type as an OM_uint32 (pending resolution of ongoing
+ * discussions).
+ */
+typedef OM_uint32 gss_qop_t;
+typedef int gss_cred_usage_t;
+
+/*
+ * Flag bits for context-level services.
+ */
+#define GSS_C_DELEG_FLAG 1
+#define GSS_C_MUTUAL_FLAG 2
+#define GSS_C_REPLAY_FLAG 4
+#define GSS_C_SEQUENCE_FLAG 8
+#define GSS_C_CONF_FLAG 16
+#define GSS_C_INTEG_FLAG 32
+#define GSS_C_ANON_FLAG 64
+#define GSS_C_PROT_READY_FLAG 128
+#define GSS_C_TRANS_FLAG 256
+
+/*
+ * Credential usage options
+ */
+#define GSS_C_BOTH 0
+#define GSS_C_INITIATE 1
+#define GSS_C_ACCEPT 2
+
+/*
+ * Status code types for gss_display_status
+ */
+#define GSS_C_GSS_CODE 1
+#define GSS_C_MECH_CODE 2
+
+/*
+ * The constant definitions for channel-bindings address families
+ */
+#define GSS_C_AF_UNSPEC 0
+#define GSS_C_AF_LOCAL 1
+#define GSS_C_AF_INET 2
+#define GSS_C_AF_IMPLINK 3
+#define GSS_C_AF_PUP 4
+#define GSS_C_AF_CHAOS 5
+#define GSS_C_AF_NS 6
+#define GSS_C_AF_NBS 7
+#define GSS_C_AF_ECMA 8
+#define GSS_C_AF_DATAKIT 9
+#define GSS_C_AF_CCITT 10
+#define GSS_C_AF_SNA 11
+#define GSS_C_AF_DECnet 12
+#define GSS_C_AF_DLI 13
+#define GSS_C_AF_LAT 14
+#define GSS_C_AF_HYLINK 15
+#define GSS_C_AF_APPLETALK 16
+#define GSS_C_AF_BSC 17
+#define GSS_C_AF_DSS 18
+#define GSS_C_AF_OSI 19
+#define GSS_C_AF_X25 21
+
+#define GSS_C_AF_NULLADDR 255
+
+/*
+ * Various Null values.
+ */
+#define GSS_C_NO_NAME ((gss_name_t) 0)
+#define GSS_C_NO_BUFFER ((gss_buffer_t) 0)
+#define GSS_C_NO_OID ((gss_OID) 0)
+#define GSS_C_NO_OID_SET ((gss_OID_set) 0)
+#define GSS_C_NO_CONTEXT ((gss_ctx_id_t) 0)
+#define GSS_C_NO_CREDENTIAL ((gss_cred_id_t) 0)
+#define GSS_C_NO_CHANNEL_BINDINGS ((gss_channel_bindings_t) 0)
+#define GSS_C_EMPTY_BUFFER {0, NULL}
+
+/*
+ * Some alternate names for a couple of the above values. These are defined
+ * for V1 compatibility.
+ */
+#define GSS_C_NULL_OID GSS_C_NO_OID
+#define GSS_C_NULL_OID_SET GSS_C_NO_OID_SET
+
+/*
+ * Define the default Quality of Protection for per-message services. Note
+ * that an implementation that offers multiple levels of QOP may either reserve
+ * a value (for example zero, as assumed here) to mean "default protection", or
+ * alternatively may simply equate GSS_C_QOP_DEFAULT to a specific explicit
+ * QOP value. However a value of 0 should always be interpreted by a GSSAPI
+ * implementation as a request for the default protection level.
+ */
+#define GSS_C_QOP_DEFAULT 0
+
+/*
+ * Expiration time of 2^32-1 seconds means infinite lifetime for a
+ * credential or security context
+ */
+#define GSS_C_INDEFINITE ((OM_uint32) 0xfffffffful)
+
+
+/* Major status codes */
+
+#define GSS_S_COMPLETE 0
+
+/*
+ * Some "helper" definitions to make the status code macros obvious.
+ */
+#define GSS_C_CALLING_ERROR_OFFSET 24
+#define GSS_C_ROUTINE_ERROR_OFFSET 16
+#define GSS_C_SUPPLEMENTARY_OFFSET 0
+#define GSS_C_CALLING_ERROR_MASK ((OM_uint32) 0377ul)
+#define GSS_C_ROUTINE_ERROR_MASK ((OM_uint32) 0377ul)
+#define GSS_C_SUPPLEMENTARY_MASK ((OM_uint32) 0177777ul)
+
+/*
+ * The macros that test status codes for error conditions. Note that the
+ * GSS_ERROR() macro has changed slightly from the V1 GSSAPI so that it now
+ * evaluates its argument only once.
+ */
+#define GSS_CALLING_ERROR(x) \
+ ((x) & (GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET))
+#define GSS_ROUTINE_ERROR(x) \
+ ((x) & (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET))
+#define GSS_SUPPLEMENTARY_INFO(x) \
+ ((x) & (GSS_C_SUPPLEMENTARY_MASK << GSS_C_SUPPLEMENTARY_OFFSET))
+#define GSS_ERROR(x) \
+ ((x) & ((GSS_C_CALLING_ERROR_MASK << GSS_C_CALLING_ERROR_OFFSET) | \
+ (GSS_C_ROUTINE_ERROR_MASK << GSS_C_ROUTINE_ERROR_OFFSET)))
+
+/*
+ * Now the actual status code definitions
+ */
+
+/*
+ * Calling errors:
+ */
+#define GSS_S_CALL_INACCESSIBLE_READ \
+ (((OM_uint32) 1ul) << GSS_C_CALLING_ERROR_OFFSET)
+#define GSS_S_CALL_INACCESSIBLE_WRITE \
+ (((OM_uint32) 2ul) << GSS_C_CALLING_ERROR_OFFSET)
+#define GSS_S_CALL_BAD_STRUCTURE \
+ (((OM_uint32) 3ul) << GSS_C_CALLING_ERROR_OFFSET)
+
+/*
+ * Routine errors:
+ */
+#define GSS_S_BAD_MECH (((OM_uint32) 1ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_NAME (((OM_uint32) 2ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_NAMETYPE (((OM_uint32) 3ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_BINDINGS (((OM_uint32) 4ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_STATUS (((OM_uint32) 5ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_SIG (((OM_uint32) 6ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NO_CRED (((OM_uint32) 7ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NO_CONTEXT (((OM_uint32) 8ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DEFECTIVE_TOKEN (((OM_uint32) 9ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DEFECTIVE_CREDENTIAL \
+ (((OM_uint32) 10ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_CREDENTIALS_EXPIRED \
+ (((OM_uint32) 11ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_CONTEXT_EXPIRED \
+ (((OM_uint32) 12ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_FAILURE (((OM_uint32) 13ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_BAD_QOP (((OM_uint32) 14ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_UNAUTHORIZED (((OM_uint32) 15ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_UNAVAILABLE (((OM_uint32) 16ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_DUPLICATE_ELEMENT \
+ (((OM_uint32) 17ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+#define GSS_S_NAME_NOT_MN \
+ (((OM_uint32) 18ul) << GSS_C_ROUTINE_ERROR_OFFSET)
+
+/*
+ * Supplementary info bits:
+ */
+#define GSS_S_CONTINUE_NEEDED (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 0))
+#define GSS_S_DUPLICATE_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 1))
+#define GSS_S_OLD_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 2))
+#define GSS_S_UNSEQ_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 3))
+#define GSS_S_GAP_TOKEN (1 << (GSS_C_SUPPLEMENTARY_OFFSET + 4))
+
+
+/*
+ * Finally, function prototypes for the GSSAPI routines.
+ */
+
+#if defined (_WIN32) && defined (_MSC_VER)
+# ifdef GSS_DLL_FILE
+# define GSS_DLLIMP __declspec(dllexport)
+# else
+# define GSS_DLLIMP __declspec(dllimport)
+# endif
+#else
+# define GSS_DLLIMP
+#endif
+
+/* Reserved static storage for GSS_oids. Comments are quotes from RFC 2744.
+ *
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x01"},
+ * corresponding to an object-identifier value of
+ * {iso(1) member-body(2) United States(840) mit(113554)
+ * infosys(1) gssapi(2) generic(1) user_name(1)}. The constant
+ * GSS_C_NT_USER_NAME should be initialized to point
+ * to that gss_OID_desc.
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_USER_NAME;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x02"},
+ * corresponding to an object-identifier value of
+ * {iso(1) member-body(2) United States(840) mit(113554)
+ * infosys(1) gssapi(2) generic(1) machine_uid_name(2)}.
+ * The constant GSS_C_NT_MACHINE_UID_NAME should be
+ * initialized to point to that gss_OID_desc.
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_MACHINE_UID_NAME;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x01\x03"},
+ * corresponding to an object-identifier value of
+ * {iso(1) member-body(2) United States(840) mit(113554)
+ * infosys(1) gssapi(2) generic(1) string_uid_name(3)}.
+ * The constant GSS_C_NT_STRING_UID_NAME should be
+ * initialized to point to that gss_OID_desc.
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_STRING_UID_NAME;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {6, (void *)"\x2b\x06\x01\x05\x06\x02"},
+ * corresponding to an object-identifier value of
+ * {iso(1) org(3) dod(6) internet(1) security(5)
+ * nametypes(6) gss-host-based-services(2)). The constant
+ * GSS_C_NT_HOSTBASED_SERVICE_X should be initialized to point
+ * to that gss_OID_desc. This is a deprecated OID value, and
+ * implementations wishing to support hostbased-service names
+ * should instead use the GSS_C_NT_HOSTBASED_SERVICE OID,
+ * defined below, to identify such names;
+ * GSS_C_NT_HOSTBASED_SERVICE_X should be accepted a synonym
+ * for GSS_C_NT_HOSTBASED_SERVICE when presented as an input
+ * parameter, but should not be emitted by GSS-API
+ * implementations
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE_X;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {10, (void *)"\x2a\x86\x48\x86\xf7\x12"
+ * "\x01\x02\x01\x04"}, corresponding to an
+ * object-identifier value of {iso(1) member-body(2)
+ * Unites States(840) mit(113554) infosys(1) gssapi(2)
+ * generic(1) service_name(4)}. The constant
+ * GSS_C_NT_HOSTBASED_SERVICE should be initialized
+ * to point to that gss_OID_desc.
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_HOSTBASED_SERVICE;
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {6, (void *)"\x2b\x06\01\x05\x06\x03"},
+ * corresponding to an object identifier value of
+ * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
+ * 6(nametypes), 3(gss-anonymous-name)}. The constant
+ * and GSS_C_NT_ANONYMOUS should be initialized to point
+ * to that gss_OID_desc.
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_ANONYMOUS;
+
+
+/*
+ * The implementation must reserve static storage for a
+ * gss_OID_desc object containing the value
+ * {6, (void *)"\x2b\x06\x01\x05\x06\x04"},
+ * corresponding to an object-identifier value of
+ * {1(iso), 3(org), 6(dod), 1(internet), 5(security),
+ * 6(nametypes), 4(gss-api-exported-name)}. The constant
+ * GSS_C_NT_EXPORT_NAME should be initialized to point
+ * to that gss_OID_desc.
+ */
+GSS_DLLIMP extern gss_OID GSS_C_NT_EXPORT_NAME;
+
+/* Function Prototypes */
+
+OM_uint32 KRB5_CALLCONV gss_acquire_cred
+(OM_uint32 *, /* minor_status */
+ gss_name_t, /* desired_name */
+ OM_uint32, /* time_req */
+ gss_OID_set, /* desired_mechs */
+ gss_cred_usage_t, /* cred_usage */
+ gss_cred_id_t *, /* output_cred_handle */
+ gss_OID_set *, /* actual_mechs */
+ OM_uint32 * /* time_rec */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_release_cred
+(OM_uint32 *, /* minor_status */
+ gss_cred_id_t * /* cred_handle */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_init_sec_context
+(OM_uint32 *, /* minor_status */
+ gss_cred_id_t, /* claimant_cred_handle */
+ gss_ctx_id_t *, /* context_handle */
+ gss_name_t, /* target_name */
+ gss_OID, /* mech_type (used to be const) */
+ OM_uint32, /* req_flags */
+ OM_uint32, /* time_req */
+ gss_channel_bindings_t, /* input_chan_bindings */
+ gss_buffer_t, /* input_token */
+ gss_OID *, /* actual_mech_type */
+ gss_buffer_t, /* output_token */
+ OM_uint32 *, /* ret_flags */
+ OM_uint32 * /* time_rec */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_accept_sec_context
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t *, /* context_handle */
+ gss_cred_id_t, /* acceptor_cred_handle */
+ gss_buffer_t, /* input_token_buffer */
+ gss_channel_bindings_t, /* input_chan_bindings */
+ gss_name_t *, /* src_name */
+ gss_OID *, /* mech_type */
+ gss_buffer_t, /* output_token */
+ OM_uint32 *, /* ret_flags */
+ OM_uint32 *, /* time_rec */
+ gss_cred_id_t * /* delegated_cred_handle */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_process_context_token
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t /* token_buffer */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_delete_sec_context
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t *, /* context_handle */
+ gss_buffer_t /* output_token */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_context_time
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ OM_uint32 * /* time_rec */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_get_mic
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_qop_t, /* qop_req */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t /* message_token */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_verify_mic
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t, /* message_token */
+ gss_qop_t * /* qop_state */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_wrap
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* conf_req_flag */
+ gss_qop_t, /* qop_req */
+ gss_buffer_t, /* input_message_buffer */
+ int *, /* conf_state */
+ gss_buffer_t /* output_message_buffer */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_unwrap
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* input_message_buffer */
+ gss_buffer_t, /* output_message_buffer */
+ int *, /* conf_state */
+ gss_qop_t * /* qop_state */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_display_status
+(OM_uint32 *, /* minor_status */
+ OM_uint32, /* status_value */
+ int, /* status_type */
+ gss_OID, /* mech_type (used to be const) */
+ OM_uint32 *, /* message_context */
+ gss_buffer_t /* status_string */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_indicate_mechs
+(OM_uint32 *, /* minor_status */
+ gss_OID_set * /* mech_set */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_compare_name
+(OM_uint32 *, /* minor_status */
+ gss_name_t, /* name1 */
+ gss_name_t, /* name2 */
+ int * /* name_equal */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_display_name
+(OM_uint32 *, /* minor_status */
+ gss_name_t, /* input_name */
+ gss_buffer_t, /* output_name_buffer */
+ gss_OID * /* output_name_type */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_import_name
+(OM_uint32 *, /* minor_status */
+ gss_buffer_t, /* input_name_buffer */
+ gss_OID, /* input_name_type(used to be const) */
+ gss_name_t * /* output_name */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_release_name
+(OM_uint32 *, /* minor_status */
+ gss_name_t * /* input_name */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_release_buffer
+(OM_uint32 *, /* minor_status */
+ gss_buffer_t /* buffer */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_release_oid_set
+(OM_uint32 *, /* minor_status */
+ gss_OID_set * /* set */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_inquire_cred
+(OM_uint32 *, /* minor_status */
+ gss_cred_id_t, /* cred_handle */
+ gss_name_t *, /* name */
+ OM_uint32 *, /* lifetime */
+ gss_cred_usage_t *, /* cred_usage */
+ gss_OID_set * /* mechanisms */
+ );
+
+/* Last argument new for V2 */
+OM_uint32 KRB5_CALLCONV gss_inquire_context
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_name_t *, /* src_name */
+ gss_name_t *, /* targ_name */
+ OM_uint32 *, /* lifetime_rec */
+ gss_OID *, /* mech_type */
+ OM_uint32 *, /* ctx_flags */
+ int *, /* locally_initiated */
+ int * /* open */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_wrap_size_limit
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* conf_req_flag */
+ gss_qop_t, /* qop_req */
+ OM_uint32, /* req_output_size */
+ OM_uint32 * /* max_input_size */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_import_name_object
+(OM_uint32 *, /* minor_status */
+ void *, /* input_name */
+ gss_OID, /* input_name_type */
+ gss_name_t * /* output_name */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_export_name_object
+(OM_uint32 *, /* minor_status */
+ gss_name_t, /* input_name */
+ gss_OID, /* desired_name_type */
+ void ** /* output_name */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_add_cred
+(OM_uint32 *, /* minor_status */
+ gss_cred_id_t, /* input_cred_handle */
+ gss_name_t, /* desired_name */
+ gss_OID, /* desired_mech */
+ gss_cred_usage_t, /* cred_usage */
+ OM_uint32, /* initiator_time_req */
+ OM_uint32, /* acceptor_time_req */
+ gss_cred_id_t *, /* output_cred_handle */
+ gss_OID_set *, /* actual_mechs */
+ OM_uint32 *, /* initiator_time_rec */
+ OM_uint32 * /* acceptor_time_rec */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_inquire_cred_by_mech
+(OM_uint32 *, /* minor_status */
+ gss_cred_id_t, /* cred_handle */
+ gss_OID, /* mech_type */
+ gss_name_t *, /* name */
+ OM_uint32 *, /* initiator_lifetime */
+ OM_uint32 *, /* acceptor_lifetime */
+ gss_cred_usage_t * /* cred_usage */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_export_sec_context
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t *, /* context_handle */
+ gss_buffer_t /* interprocess_token */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_import_sec_context
+(OM_uint32 *, /* minor_status */
+ gss_buffer_t, /* interprocess_token */
+ gss_ctx_id_t * /* context_handle */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_release_oid
+(OM_uint32 *, /* minor_status */
+ gss_OID * /* oid */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_create_empty_oid_set
+(OM_uint32 *, /* minor_status */
+ gss_OID_set * /* oid_set */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_add_oid_set_member
+(OM_uint32 *, /* minor_status */
+ gss_OID, /* member_oid */
+ gss_OID_set * /* oid_set */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_test_oid_set_member
+(OM_uint32 *, /* minor_status */
+ gss_OID, /* member */
+ gss_OID_set, /* set */
+ int * /* present */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_str_to_oid
+(OM_uint32 *, /* minor_status */
+ gss_buffer_t, /* oid_str */
+ gss_OID * /* oid */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_oid_to_str
+(OM_uint32 *, /* minor_status */
+ gss_OID, /* oid */
+ gss_buffer_t /* oid_str */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_inquire_names_for_mech
+(OM_uint32 *, /* minor_status */
+ gss_OID, /* mechanism */
+ gss_OID_set * /* name_types */
+ );
+
+/*
+ * The following routines are obsolete variants of gss_get_mic, gss_wrap,
+ * gss_verify_mic and gss_unwrap. They should be provided by GSSAPI V2
+ * implementations for backwards compatibility with V1 applications. Distinct
+ * entrypoints (as opposed to #defines) should be provided, to allow GSSAPI
+ * V1 applications to link against GSSAPI V2 implementations.
+ */
+OM_uint32 KRB5_CALLCONV gss_sign
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* qop_req */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t /* message_token */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_verify
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* message_buffer */
+ gss_buffer_t, /* token_buffer */
+ int * /* qop_state */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_seal
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ int, /* conf_req_flag */
+ int, /* qop_req */
+ gss_buffer_t, /* input_message_buffer */
+ int *, /* conf_state */
+ gss_buffer_t /* output_message_buffer */
+ );
+
+OM_uint32 KRB5_CALLCONV gss_unseal
+(OM_uint32 *, /* minor_status */
+ gss_ctx_id_t, /* context_handle */
+ gss_buffer_t, /* input_message_buffer */
+ gss_buffer_t, /* output_message_buffer */
+ int *, /* conf_state */
+ int * /* qop_state */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_export_name
+(OM_uint32 *, /* minor_status */
+ const gss_name_t, /* input_name */
+ gss_buffer_t /* exported_name */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_duplicate_name
+(OM_uint32 *, /* minor_status */
+ const gss_name_t, /* input_name */
+ gss_name_t * /* dest_name */
+ );
+
+/* New for V2 */
+OM_uint32 KRB5_CALLCONV gss_canonicalize_name
+(OM_uint32 *, /* minor_status */
+ const gss_name_t, /* input_name */
+ const gss_OID, /* mech_type */
+ gss_name_t * /* output_name */
+ );
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import reset
+# endif
+# pragma options align=reset
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/* XXXX these are not part of the GSSAPI C bindings! (but should be) */
+
+#define GSS_CALLING_ERROR_FIELD(x) \
+ (((x) >> GSS_C_CALLING_ERROR_OFFSET) & GSS_C_CALLING_ERROR_MASK)
+#define GSS_ROUTINE_ERROR_FIELD(x) \
+ (((x) >> GSS_C_ROUTINE_ERROR_OFFSET) & GSS_C_ROUTINE_ERROR_MASK)
+#define GSS_SUPPLEMENTARY_INFO_FIELD(x) \
+ (((x) >> GSS_C_SUPPLEMENTARY_OFFSET) & GSS_C_SUPPLEMENTARY_MASK)
+
+/* XXXX This is a necessary evil until the spec is fixed */
+#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
+
+#endif /* _GSSAPI_H_ */
--- /dev/null
+/*
+ * Copyright 1993 by OpenVision Technologies, Inc.
+ *
+ * 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 appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of OpenVision not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. OpenVision makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _GSSAPI_GENERIC_H_
+#define _GSSAPI_GENERIC_H_
+
+/*
+ * $Id$
+ */
+
+#include <gssapi/gssapi.h>
+
+#if defined(__cplusplus) && !defined(GSSAPIGENERIC_BEGIN_DECLS)
+#define GSSAPIGENERIC_BEGIN_DECLS extern "C" {
+#define GSSAPIGENERIC_END_DECLS }
+#else
+#define GSSAPIGENERIC_BEGIN_DECLS
+#define GSSAPIGENERIC_END_DECLS
+#endif
+
+GSSAPIGENERIC_BEGIN_DECLS
+
+/* Deprecated MIT krb5 oid names provided for compatibility.
+ * The correct oids (GSS_C_NT_USER_NAME, etc) from rfc 2744
+ * are defined in gssapi.h. */
+
+GSS_DLLIMP extern gss_OID gss_nt_user_name;
+GSS_DLLIMP extern gss_OID gss_nt_machine_uid_name;
+GSS_DLLIMP extern gss_OID gss_nt_string_uid_name;
+extern gss_OID gss_nt_service_name_v2;
+GSS_DLLIMP extern gss_OID gss_nt_service_name;
+extern gss_OID gss_nt_exported_name;
+
+GSSAPIGENERIC_END_DECLS
+
+#endif /* _GSSAPI_GENERIC_H_ */
--- /dev/null
+/*
+ * Copyright 1993 by OpenVision Technologies, Inc.
+ *
+ * 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 appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of OpenVision not be used
+ * in advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. OpenVision makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+ * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _GSSAPI_KRB5_H_
+#define _GSSAPI_KRB5_H_
+
+#include <gssapi/gssapi.h>
+#include <krb5.h>
+
+/* C++ friendlyness */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Reserved static storage for GSS_oids. See rfc 1964 for more details. */
+
+/* 2.1.1. Kerberos Principal Name Form: */
+GSS_DLLIMP extern const gss_OID_desc * const GSS_KRB5_NT_PRINCIPAL_NAME;
+/* This name form shall be represented by the Object Identifier {iso(1)
+ * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
+ * krb5(2) krb5_name(1)}. The recommended symbolic name for this type
+ * is "GSS_KRB5_NT_PRINCIPAL_NAME". */
+
+/* 2.1.2. Host-Based Service Name Form */
+#define GSS_KRB5_NT_HOSTBASED_SERVICE_NAME GSS_C_NT_HOSTBASED_SERVICE
+/* This name form shall be represented by the Object Identifier {iso(1)
+ * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
+ * generic(1) service_name(4)}. The previously recommended symbolic
+ * name for this type is "GSS_KRB5_NT_HOSTBASED_SERVICE_NAME". The
+ * currently preferred symbolic name for this type is
+ * "GSS_C_NT_HOSTBASED_SERVICE". */
+
+/* 2.2.1. User Name Form */
+#define GSS_KRB5_NT_USER_NAME GSS_C_NT_USER_NAME
+/* This name form shall be represented by the Object Identifier {iso(1)
+ * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
+ * generic(1) user_name(1)}. The recommended symbolic name for this
+ * type is "GSS_KRB5_NT_USER_NAME". */
+
+/* 2.2.2. Machine UID Form */
+#define GSS_KRB5_NT_MACHINE_UID_NAME GSS_C_NT_MACHINE_UID_NAME
+/* This name form shall be represented by the Object Identifier {iso(1)
+ * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
+ * generic(1) machine_uid_name(2)}. The recommended symbolic name for
+ * this type is "GSS_KRB5_NT_MACHINE_UID_NAME". */
+
+/* 2.2.3. String UID Form */
+#define GSS_KRB5_NT_STRING_UID_NAME GSS_C_NT_STRING_UID_NAME
+/* This name form shall be represented by the Object Identifier {iso(1)
+ * member-body(2) United States(840) mit(113554) infosys(1) gssapi(2)
+ * generic(1) string_uid_name(3)}. The recommended symbolic name for
+ * this type is "GSS_KRB5_NT_STRING_UID_NAME". */
+
+extern const gss_OID_desc * const gss_mech_krb5;
+extern const gss_OID_desc * const gss_mech_krb5_old;
+extern const gss_OID_set_desc * const gss_mech_set_krb5;
+extern const gss_OID_set_desc * const gss_mech_set_krb5_old;
+extern const gss_OID_set_desc * const gss_mech_set_krb5_both;
+
+extern const gss_OID_desc * const gss_nt_krb5_name;
+extern const gss_OID_desc * const gss_nt_krb5_principal;
+
+extern const gss_OID_desc krb5_gss_oid_array[];
+
+#define gss_krb5_nt_general_name gss_nt_krb5_name
+#define gss_krb5_nt_principal gss_nt_krb5_principal
+#define gss_krb5_nt_service_name gss_nt_service_name
+#define gss_krb5_nt_user_name gss_nt_user_name
+#define gss_krb5_nt_machine_uid_name gss_nt_machine_uid_name
+#define gss_krb5_nt_string_uid_name gss_nt_string_uid_name
+
+/* Alias for Heimdal compat. */
+#define gsskrb5_register_acceptor_identity krb5_gss_register_acceptor_identity
+
+OM_uint32 KRB5_CALLCONV krb5_gss_register_acceptor_identity(const char *);
+
+OM_uint32 KRB5_CALLCONV gss_krb5_get_tkt_flags
+ (OM_uint32 *minor_status,
+ gss_ctx_id_t context_handle,
+ krb5_flags *ticket_flags);
+
+OM_uint32 KRB5_CALLCONV gss_krb5_copy_ccache
+ (OM_uint32 *minor_status,
+ gss_cred_id_t cred_handle,
+ krb5_ccache out_ccache);
+
+OM_uint32 KRB5_CALLCONV gss_krb5_ccache_name
+ (OM_uint32 *minor_status, const char *name,
+ const char **out_name);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _GSSAPI_KRB5_H_ */
--- /dev/null
+/*
+ * include/krb5.h
+ *
+ * Copyright 1989,1990,1995,2001, 2003 by the Massachusetts Institute of Technology.
+ * All Rights Reserved.
+ *
+ * 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.
+ *
+ *
+ * General definitions for Kerberos version 5.
+ */
+
+/*
+ * Copyright (C) 1998 by the FundsXpress, INC.
+ *
+ * All rights reserved.
+ *
+ * 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 FundsXpress. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission. FundsXpress makes no representations about the suitability of
+ * this software for any purpose. It is provided "as is" without express
+ * or implied warranty.
+ *
+ * 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.
+ */
+
+#ifndef KRB5_GENERAL__
+#define KRB5_GENERAL__
+
+/* By default, do not expose deprecated interfaces. */
+#ifndef KRB5_DEPRECATED
+#define KRB5_DEPRECATED 0
+#endif
+/* Do not expose private interfaces. Build system will override. */
+#ifndef KRB5_PRIVATE
+#define KRB5_PRIVATE 0
+#endif
+
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+# include <TargetConditionals.h>
+# if TARGET_RT_MAC_CFM
+# error "Use KfM 4.0 SDK headers for CFM compilation."
+# endif
+#endif
+
+#if defined(_MSDOS) || defined(_WIN32)
+#include <win-mac.h>
+#endif
+
+#ifndef KRB5_CONFIG__
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#endif /* !KRB5_CALLCONV */
+#endif /* !KRB5_CONFIG__ */
+
+#ifndef KRB5_CALLCONV_WRONG
+#define KRB5_CALLCONV_WRONG
+#endif
+
+#ifndef THREEPARAMOPEN
+#define THREEPARAMOPEN(x,y,z) open(x,y,z)
+#endif
+
+#define KRB5_OLD_CRYPTO
+
+#include <stdlib.h>
+#include <limits.h> /* for *_MAX */
+
+#ifndef KRB5INT_BEGIN_DECLS
+#if defined(__cplusplus)
+#define KRB5INT_BEGIN_DECLS extern "C" {
+#define KRB5INT_END_DECLS }
+#else
+#define KRB5INT_BEGIN_DECLS
+#define KRB5INT_END_DECLS
+#endif
+#endif
+
+KRB5INT_BEGIN_DECLS
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import on
+# endif
+# pragma options align=mac68k
+#endif
+
+/* from profile.h */
+struct _profile_t;
+/* typedef struct _profile_t *profile_t; */
+
+/*
+ * begin wordsize.h
+ */
+
+/*
+ * Word-size related definition.
+ */
+
+typedef unsigned char krb5_octet;
+
+#if INT_MAX == 0x7fff
+typedef int krb5_int16;
+typedef unsigned int krb5_ui_2;
+#elif SHRT_MAX == 0x7fff
+typedef short krb5_int16;
+typedef unsigned short krb5_ui_2;
+#else
+#error undefined 16 bit type
+#endif
+
+#if INT_MAX == 0x7fffffffL
+typedef int krb5_int32;
+typedef unsigned int krb5_ui_4;
+#elif LONG_MAX == 0x7fffffffL
+typedef long krb5_int32;
+typedef unsigned long krb5_ui_4;
+#elif SHRT_MAX == 0x7fffffffL
+typedef short krb5_int32;
+typedef unsigned short krb5_ui_4;
+#else
+#error: undefined 32 bit type
+#endif
+
+#define VALID_INT_BITS INT_MAX
+#define VALID_UINT_BITS UINT_MAX
+
+#define KRB5_INT32_MAX 2147483647
+/* this strange form is necessary since - is a unary operator, not a sign
+ indicator */
+#define KRB5_INT32_MIN (-KRB5_INT32_MAX-1)
+
+#define KRB5_INT16_MAX 65535
+/* this strange form is necessary since - is a unary operator, not a sign
+ indicator */
+#define KRB5_INT16_MIN (-KRB5_INT16_MAX-1)
+
+/*
+ * end wordsize.h
+ */
+
+/*
+ * begin "base-defs.h"
+ */
+
+/*
+ * Basic definitions for Kerberos V5 library
+ */
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+
+typedef unsigned int krb5_boolean;
+typedef unsigned int krb5_msgtype;
+typedef unsigned int krb5_kvno;
+
+typedef krb5_int32 krb5_addrtype;
+typedef krb5_int32 krb5_enctype;
+typedef krb5_int32 krb5_cksumtype;
+typedef krb5_int32 krb5_authdatatype;
+typedef krb5_int32 krb5_keyusage;
+
+typedef krb5_int32 krb5_preauthtype; /* This may change, later on */
+typedef krb5_int32 krb5_flags;
+typedef krb5_int32 krb5_timestamp;
+typedef krb5_int32 krb5_error_code;
+typedef krb5_int32 krb5_deltat;
+
+typedef krb5_error_code krb5_magic;
+
+typedef struct _krb5_data {
+ krb5_magic magic;
+ unsigned int length;
+ char *data;
+} krb5_data;
+
+/*
+ * Hack length for crypto library to use the afs_string_to_key It is
+ * equivalent to -1 without possible sign extension
+ * We also overload for an unset salt type length - which is also -1, but
+ * hey, why not....
+*/
+#define SALT_TYPE_AFS_LENGTH UINT_MAX
+#define SALT_TYPE_NO_LENGTH UINT_MAX
+
+typedef void * krb5_pointer;
+typedef void const * krb5_const_pointer;
+
+typedef struct krb5_principal_data {
+ krb5_magic magic;
+ krb5_data realm;
+ krb5_data *data; /* An array of strings */
+ krb5_int32 length;
+ krb5_int32 type;
+} krb5_principal_data;
+
+typedef krb5_principal_data * krb5_principal;
+
+/*
+ * Per V5 spec on definition of principal types
+ */
+
+/* Name type not known */
+#define KRB5_NT_UNKNOWN 0
+/* Just the name of the principal as in DCE, or for users */
+#define KRB5_NT_PRINCIPAL 1
+/* Service and other unique instance (krbtgt) */
+#define KRB5_NT_SRV_INST 2
+/* Service with host name as instance (telnet, rcommands) */
+#define KRB5_NT_SRV_HST 3
+/* Service with host as remaining components */
+#define KRB5_NT_SRV_XHST 4
+/* Unique ID */
+#define KRB5_NT_UID 5
+
+/* constant version thereof: */
+typedef const krb5_principal_data *krb5_const_principal;
+
+#define krb5_princ_realm(context, princ) (&(princ)->realm)
+#define krb5_princ_set_realm(context, princ,value) ((princ)->realm = *(value))
+#define krb5_princ_set_realm_length(context, princ,value) (princ)->realm.length = (value)
+#define krb5_princ_set_realm_data(context, princ,value) (princ)->realm.data = (value)
+#define krb5_princ_size(context, princ) (princ)->length
+#define krb5_princ_type(context, princ) (princ)->type
+#define krb5_princ_name(context, princ) (princ)->data
+#define krb5_princ_component(context, princ,i) \
+ (((i) < krb5_princ_size(context, princ)) \
+ ? (princ)->data + (i) \
+ : NULL)
+
+/*
+ * end "base-defs.h"
+ */
+
+/*
+ * begin "hostaddr.h"
+ */
+
+/* structure for address */
+typedef struct _krb5_address {
+ krb5_magic magic;
+ krb5_addrtype addrtype;
+ unsigned int length;
+ krb5_octet *contents;
+} krb5_address;
+
+/* per Kerberos v5 protocol spec */
+#define ADDRTYPE_INET 0x0002
+#define ADDRTYPE_CHAOS 0x0005
+#define ADDRTYPE_XNS 0x0006
+#define ADDRTYPE_ISO 0x0007
+#define ADDRTYPE_DDP 0x0010
+#define ADDRTYPE_INET6 0x0018
+/* not yet in the spec... */
+#define ADDRTYPE_ADDRPORT 0x0100
+#define ADDRTYPE_IPPORT 0x0101
+
+/* macros to determine if a type is a local type */
+#define ADDRTYPE_IS_LOCAL(addrtype) (addrtype & 0x8000)
+
+/*
+ * end "hostaddr.h"
+ */
+
+
+struct _krb5_context;
+typedef struct _krb5_context * krb5_context;
+
+struct _krb5_auth_context;
+typedef struct _krb5_auth_context * krb5_auth_context;
+
+struct _krb5_cryptosystem_entry;
+
+/*
+ * begin "encryption.h"
+ */
+
+typedef struct _krb5_keyblock {
+ krb5_magic magic;
+ krb5_enctype enctype;
+ unsigned int length;
+ krb5_octet *contents;
+} krb5_keyblock;
+
+#ifdef KRB5_OLD_CRYPTO
+typedef struct _krb5_encrypt_block {
+ krb5_magic magic;
+ krb5_enctype crypto_entry; /* to call krb5_encrypt_size, you need
+ this. it was a pointer, but it
+ doesn't have to be. gross. */
+ krb5_keyblock *key;
+} krb5_encrypt_block;
+#endif
+
+typedef struct _krb5_checksum {
+ krb5_magic magic;
+ krb5_cksumtype checksum_type; /* checksum type */
+ unsigned int length;
+ krb5_octet *contents;
+} krb5_checksum;
+
+typedef struct _krb5_enc_data {
+ krb5_magic magic;
+ krb5_enctype enctype;
+ krb5_kvno kvno;
+ krb5_data ciphertext;
+} krb5_enc_data;
+
+/* per Kerberos v5 protocol spec */
+#define ENCTYPE_NULL 0x0000
+#define ENCTYPE_DES_CBC_CRC 0x0001 /* DES cbc mode with CRC-32 */
+#define ENCTYPE_DES_CBC_MD4 0x0002 /* DES cbc mode with RSA-MD4 */
+#define ENCTYPE_DES_CBC_MD5 0x0003 /* DES cbc mode with RSA-MD5 */
+#define ENCTYPE_DES_CBC_RAW 0x0004 /* DES cbc mode raw */
+/* XXX deprecated? */
+#define ENCTYPE_DES3_CBC_SHA 0x0005 /* DES-3 cbc mode with NIST-SHA */
+#define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */
+#define ENCTYPE_DES_HMAC_SHA1 0x0008
+#define ENCTYPE_DES3_CBC_SHA1 0x0010
+#define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011
+#define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012
+#define ENCTYPE_ARCFOUR_HMAC 0x0017
+#define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018
+#define ENCTYPE_UNKNOWN 0x01ff
+/* local crud */
+/* marc's DES-3 with 32-bit length */
+#define ENCTYPE_LOCAL_DES3_HMAC_SHA1 0x7007
+
+#define CKSUMTYPE_CRC32 0x0001
+#define CKSUMTYPE_RSA_MD4 0x0002
+#define CKSUMTYPE_RSA_MD4_DES 0x0003
+#define CKSUMTYPE_DESCBC 0x0004
+/* des-mac-k */
+/* rsa-md4-des-k */
+#define CKSUMTYPE_RSA_MD5 0x0007
+#define CKSUMTYPE_RSA_MD5_DES 0x0008
+#define CKSUMTYPE_NIST_SHA 0x0009
+#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c
+#define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f
+#define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010
+#define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /*Microsoft md5 hmac cksumtype*/
+
+/* The following are entropy source designations. Whenever
+ * krb5_C_random_add_entropy is called, one of these source ids is passed
+ * in. This allows the library to better estimate bits of
+ * entropy in the sample and to keep track of what sources of entropy have
+ * contributed enough entropy. Sources marked internal MUST NOT be
+ * used by applications outside the Kerberos library
+*/
+
+enum {
+ KRB5_C_RANDSOURCE_OLDAPI = 0, /*calls to krb5_C_RANDOM_SEED (INTERNAL)*/
+ KRB5_C_RANDSOURCE_OSRAND = 1, /* /dev/random or equivalent (internal)*/
+ KRB5_C_RANDSOURCE_TRUSTEDPARTY = 2, /* From KDC or other trusted party*/
+ /*This source should be used carefully; data in this category
+ * should be from a third party trusted to give random bits
+ * For example keys issued by the KDC in the application server.
+ */
+ KRB5_C_RANDSOURCE_TIMING = 3, /* Timing of operations*/
+ KRB5_C_RANDSOURCE_EXTERNAL_PROTOCOL = 4, /*Protocol data possibly from attacker*/
+ KRB5_C_RANDSOURCE_MAX = 5 /*Do not use; maximum source ID*/
+};
+
+#ifndef krb5_roundup
+/* round x up to nearest multiple of y */
+#define krb5_roundup(x, y) ((((x) + (y) - 1)/(y))*(y))
+#endif /* roundup */
+
+/* macro function definitions to help clean up code */
+
+#if 1
+#define krb5_x(ptr,args) ((ptr)?((*(ptr)) args):(abort(),1))
+#define krb5_xc(ptr,args) ((ptr)?((*(ptr)) args):(abort(),(char*)0))
+#else
+#define krb5_x(ptr,args) ((*(ptr)) args)
+#define krb5_xc(ptr,args) ((*(ptr)) args)
+#endif
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_encrypt
+ (krb5_context context, const krb5_keyblock *key,
+ krb5_keyusage usage, const krb5_data *cipher_state,
+ const krb5_data *input, krb5_enc_data *output);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_decrypt
+ (krb5_context context, const krb5_keyblock *key,
+ krb5_keyusage usage, const krb5_data *cipher_state,
+ const krb5_enc_data *input, krb5_data *output);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_encrypt_length
+ (krb5_context context, krb5_enctype enctype,
+ size_t inputlen, size_t *length);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_block_size
+ (krb5_context context, krb5_enctype enctype,
+ size_t *blocksize);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_init_state
+(krb5_context context,
+const krb5_keyblock *key, krb5_keyusage usage,
+krb5_data *new_state);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_free_state
+(krb5_context context, const krb5_keyblock *key, krb5_data *state);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_make_random_key
+ (krb5_context context, krb5_enctype enctype,
+ krb5_keyblock *k5_random_key);
+
+/* Register a new entropy sample with the PRNG. may cause
+* the PRNG to be reseeded, although this is not guaranteed. See previous randsource definitions
+* for information on how each source should be used.
+*/
+krb5_error_code KRB5_CALLCONV
+ krb5_c_random_add_entropy
+(krb5_context context, unsigned int randsource_id, const krb5_data *data);
+
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_random_make_octets
+ (krb5_context context, krb5_data *data);
+
+/*
+* Collect entropy from the OS if possible. strong requests that as strong
+* of a source of entropy as available be used. Setting strong may
+* increase the probability of blocking and should not be used for normal
+* applications. Good uses include seeding the PRNG for kadmind
+* and realm setup.
+* If successful is non-null, then successful is set to 1 if the OS provided
+* entropy else zero.
+*/
+krb5_error_code KRB5_CALLCONV
+krb5_c_random_os_entropy
+(krb5_context context, int strong, int *success);
+
+/*deprecated*/ krb5_error_code KRB5_CALLCONV
+ krb5_c_random_seed
+ (krb5_context context, krb5_data *data);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_string_to_key
+ (krb5_context context, krb5_enctype enctype,
+ const krb5_data *string, const krb5_data *salt,
+ krb5_keyblock *key);
+krb5_error_code KRB5_CALLCONV
+krb5_c_string_to_key_with_params(krb5_context context,
+ krb5_enctype enctype,
+ const krb5_data *string,
+ const krb5_data *salt,
+ const krb5_data *params,
+ krb5_keyblock *key);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_enctype_compare
+ (krb5_context context, krb5_enctype e1, krb5_enctype e2,
+ krb5_boolean *similar);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_make_checksum
+ (krb5_context context, krb5_cksumtype cksumtype,
+ const krb5_keyblock *key, krb5_keyusage usage,
+ const krb5_data *input, krb5_checksum *cksum);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_verify_checksum
+ (krb5_context context,
+ const krb5_keyblock *key, krb5_keyusage usage,
+ const krb5_data *data,
+ const krb5_checksum *cksum,
+ krb5_boolean *valid);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_checksum_length
+ (krb5_context context, krb5_cksumtype cksumtype,
+ size_t *length);
+
+krb5_error_code KRB5_CALLCONV
+ krb5_c_keyed_checksum_types
+ (krb5_context context, krb5_enctype enctype,
+ unsigned int *count, krb5_cksumtype **cksumtypes);
+
+#define KRB5_KEYUSAGE_AS_REQ_PA_ENC_TS 1
+#define KRB5_KEYUSAGE_KDC_REP_TICKET 2
+#define KRB5_KEYUSAGE_AS_REP_ENCPART 3
+#define KRB5_KEYUSAGE_TGS_REQ_AD_SESSKEY 4
+#define KRB5_KEYUSAGE_TGS_REQ_AD_SUBKEY 5
+#define KRB5_KEYUSAGE_TGS_REQ_AUTH_CKSUM 6
+#define KRB5_KEYUSAGE_TGS_REQ_AUTH 7
+#define KRB5_KEYUSAGE_TGS_REP_ENCPART_SESSKEY 8
+#define KRB5_KEYUSAGE_TGS_REP_ENCPART_SUBKEY 9
+#define KRB5_KEYUSAGE_AP_REQ_AUTH_CKSUM 10
+#define KRB5_KEYUSAGE_AP_REQ_AUTH 11
+#define KRB5_KEYUSAGE_AP_REP_ENCPART 12
+#define KRB5_KEYUSAGE_KRB_PRIV_ENCPART 13
+#define KRB5_KEYUSAGE_KRB_CRED_ENCPART 14
+#define KRB5_KEYUSAGE_KRB_SAFE_CKSUM 15
+#define KRB5_KEYUSAGE_APP_DATA_ENCRYPT 16
+#define KRB5_KEYUSAGE_APP_DATA_CKSUM 17
+#define KRB5_KEYUSAGE_KRB_ERROR_CKSUM 18
+#define KRB5_KEYUSAGE_AD_KDCISSUED_CKSUM 19
+#define KRB5_KEYUSAGE_AD_MTE 20
+#define KRB5_KEYUSAGE_AD_ITE 21
+
+/* XXX need to register these */
+
+#define KRB5_KEYUSAGE_GSS_TOK_MIC 22
+#define KRB5_KEYUSAGE_GSS_TOK_WRAP_INTEG 23
+#define KRB5_KEYUSAGE_GSS_TOK_WRAP_PRIV 24
+
+/* Defined in hardware preauth draft */
+
+#define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_CKSUM 25
+#define KRB5_KEYUSAGE_PA_SAM_CHALLENGE_TRACKID 26
+#define KRB5_KEYUSAGE_PA_SAM_RESPONSE 27
+
+krb5_boolean KRB5_CALLCONV krb5_c_valid_enctype
+ (krb5_enctype ktype);
+krb5_boolean KRB5_CALLCONV krb5_c_valid_cksumtype
+ (krb5_cksumtype ctype);
+krb5_boolean KRB5_CALLCONV krb5_c_is_coll_proof_cksum
+ (krb5_cksumtype ctype);
+krb5_boolean KRB5_CALLCONV krb5_c_is_keyed_cksum
+ (krb5_cksumtype ctype);
+
+#if KRB5_PRIVATE
+/* Use the above four instead. */
+krb5_boolean KRB5_CALLCONV valid_enctype
+ (krb5_enctype ktype);
+krb5_boolean KRB5_CALLCONV valid_cksumtype
+ (krb5_cksumtype ctype);
+krb5_boolean KRB5_CALLCONV is_coll_proof_cksum
+ (krb5_cksumtype ctype);
+krb5_boolean KRB5_CALLCONV is_keyed_cksum
+ (krb5_cksumtype ctype);
+#endif
+
+#ifdef KRB5_OLD_CRYPTO
+/*
+ * old cryptosystem routine prototypes. These are now layered
+ * on top of the functions above.
+ */
+krb5_error_code KRB5_CALLCONV krb5_encrypt
+ (krb5_context context,
+ krb5_const_pointer inptr,
+ krb5_pointer outptr,
+ size_t size,
+ krb5_encrypt_block * eblock,
+ krb5_pointer ivec);
+krb5_error_code KRB5_CALLCONV krb5_decrypt
+ (krb5_context context,
+ krb5_const_pointer inptr,
+ krb5_pointer outptr,
+ size_t size,
+ krb5_encrypt_block * eblock,
+ krb5_pointer ivec);
+krb5_error_code KRB5_CALLCONV krb5_process_key
+ (krb5_context context,
+ krb5_encrypt_block * eblock,
+ const krb5_keyblock * key);
+krb5_error_code KRB5_CALLCONV krb5_finish_key
+ (krb5_context context,
+ krb5_encrypt_block * eblock);
+krb5_error_code KRB5_CALLCONV krb5_string_to_key
+ (krb5_context context,
+ const krb5_encrypt_block * eblock,
+ krb5_keyblock * keyblock,
+ const krb5_data * data,
+ const krb5_data * salt);
+krb5_error_code KRB5_CALLCONV krb5_init_random_key
+ (krb5_context context,
+ const krb5_encrypt_block * eblock,
+ const krb5_keyblock * keyblock,
+ krb5_pointer * ptr);
+krb5_error_code KRB5_CALLCONV krb5_finish_random_key
+ (krb5_context context,
+ const krb5_encrypt_block * eblock,
+ krb5_pointer * ptr);
+krb5_error_code KRB5_CALLCONV krb5_random_key
+ (krb5_context context,
+ const krb5_encrypt_block * eblock,
+ krb5_pointer ptr,
+ krb5_keyblock ** keyblock);
+krb5_enctype KRB5_CALLCONV krb5_eblock_enctype
+ (krb5_context context,
+ const krb5_encrypt_block * eblock);
+krb5_error_code KRB5_CALLCONV krb5_use_enctype
+ (krb5_context context,
+ krb5_encrypt_block * eblock,
+ krb5_enctype enctype);
+size_t KRB5_CALLCONV krb5_encrypt_size
+ (size_t length,
+ krb5_enctype crypto);
+size_t KRB5_CALLCONV krb5_checksum_size
+ (krb5_context context,
+ krb5_cksumtype ctype);
+krb5_error_code KRB5_CALLCONV krb5_calculate_checksum
+ (krb5_context context,
+ krb5_cksumtype ctype,
+ krb5_const_pointer in, size_t in_length,
+ krb5_const_pointer seed, size_t seed_length,
+ krb5_checksum * outcksum);
+krb5_error_code KRB5_CALLCONV krb5_verify_checksum
+ (krb5_context context,
+ krb5_cksumtype ctype,
+ const krb5_checksum * cksum,
+ krb5_const_pointer in, size_t in_length,
+ krb5_const_pointer seed, size_t seed_length);
+
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_random_confounder
+ (size_t, krb5_pointer);
+
+krb5_error_code krb5_encrypt_data
+ (krb5_context context, krb5_keyblock *key,
+ krb5_pointer ivec, krb5_data *data,
+ krb5_enc_data *enc_data);
+
+krb5_error_code krb5_decrypt_data
+ (krb5_context context, krb5_keyblock *key,
+ krb5_pointer ivec, krb5_enc_data *data,
+ krb5_data *enc_data);
+#endif
+
+#endif /* KRB5_OLD_CRYPTO */
+
+/*
+ * end "encryption.h"
+ */
+
+/*
+ * begin "fieldbits.h"
+ */
+
+/* kdc_options for kdc_request */
+/* options is 32 bits; each host is responsible to put the 4 bytes
+ representing these bits into net order before transmission */
+/* #define KDC_OPT_RESERVED 0x80000000 */
+#define KDC_OPT_FORWARDABLE 0x40000000
+#define KDC_OPT_FORWARDED 0x20000000
+#define KDC_OPT_PROXIABLE 0x10000000
+#define KDC_OPT_PROXY 0x08000000
+#define KDC_OPT_ALLOW_POSTDATE 0x04000000
+#define KDC_OPT_POSTDATED 0x02000000
+/* #define KDC_OPT_UNUSED 0x01000000 */
+#define KDC_OPT_RENEWABLE 0x00800000
+/* #define KDC_OPT_UNUSED 0x00400000 */
+/* #define KDC_OPT_RESERVED 0x00200000 */
+/* #define KDC_OPT_RESERVED 0x00100000 */
+/* #define KDC_OPT_RESERVED 0x00080000 */
+/* #define KDC_OPT_RESERVED 0x00040000 */
+#define KDC_OPT_REQUEST_ANONYMOUS 0x00020000
+/* #define KDC_OPT_RESERVED 0x00010000 */
+/* #define KDC_OPT_RESERVED 0x00008000 */
+/* #define KDC_OPT_RESERVED 0x00004000 */
+/* #define KDC_OPT_RESERVED 0x00002000 */
+/* #define KDC_OPT_RESERVED 0x00001000 */
+/* #define KDC_OPT_RESERVED 0x00000800 */
+/* #define KDC_OPT_RESERVED 0x00000400 */
+/* #define KDC_OPT_RESERVED 0x00000200 */
+/* #define KDC_OPT_RESERVED 0x00000100 */
+/* #define KDC_OPT_RESERVED 0x00000080 */
+/* #define KDC_OPT_RESERVED 0x00000040 */
+#define KDC_OPT_DISABLE_TRANSITED_CHECK 0x00000020
+#define KDC_OPT_RENEWABLE_OK 0x00000010
+#define KDC_OPT_ENC_TKT_IN_SKEY 0x00000008
+/* #define KDC_OPT_UNUSED 0x00000004 */
+#define KDC_OPT_RENEW 0x00000002
+#define KDC_OPT_VALIDATE 0x00000001
+
+/*
+ * Mask of ticket flags in the TGT which should be converted into KDC
+ * options when using the TGT to get derivitive tickets.
+ *
+ * New mask = KDC_OPT_FORWARDABLE | KDC_OPT_PROXIABLE |
+ * KDC_OPT_ALLOW_POSTDATE | KDC_OPT_RENEWABLE
+ */
+#define KDC_TKT_COMMON_MASK 0x54800000
+
+/* definitions for ap_options fields */
+/* ap_options are 32 bits; each host is responsible to put the 4 bytes
+ representing these bits into net order before transmission */
+#define AP_OPTS_RESERVED 0x80000000
+#define AP_OPTS_USE_SESSION_KEY 0x40000000
+#define AP_OPTS_MUTUAL_REQUIRED 0x20000000
+/* #define AP_OPTS_RESERVED 0x10000000 */
+/* #define AP_OPTS_RESERVED 0x08000000 */
+/* #define AP_OPTS_RESERVED 0x04000000 */
+/* #define AP_OPTS_RESERVED 0x02000000 */
+/* #define AP_OPTS_RESERVED 0x01000000 */
+/* #define AP_OPTS_RESERVED 0x00800000 */
+/* #define AP_OPTS_RESERVED 0x00400000 */
+/* #define AP_OPTS_RESERVED 0x00200000 */
+/* #define AP_OPTS_RESERVED 0x00100000 */
+/* #define AP_OPTS_RESERVED 0x00080000 */
+/* #define AP_OPTS_RESERVED 0x00040000 */
+/* #define AP_OPTS_RESERVED 0x00020000 */
+/* #define AP_OPTS_RESERVED 0x00010000 */
+/* #define AP_OPTS_RESERVED 0x00008000 */
+/* #define AP_OPTS_RESERVED 0x00004000 */
+/* #define AP_OPTS_RESERVED 0x00002000 */
+/* #define AP_OPTS_RESERVED 0x00001000 */
+/* #define AP_OPTS_RESERVED 0x00000800 */
+/* #define AP_OPTS_RESERVED 0x00000400 */
+/* #define AP_OPTS_RESERVED 0x00000200 */
+/* #define AP_OPTS_RESERVED 0x00000100 */
+/* #define AP_OPTS_RESERVED 0x00000080 */
+/* #define AP_OPTS_RESERVED 0x00000040 */
+/* #define AP_OPTS_RESERVED 0x00000020 */
+/* #define AP_OPTS_RESERVED 0x00000010 */
+/* #define AP_OPTS_RESERVED 0x00000008 */
+/* #define AP_OPTS_RESERVED 0x00000004 */
+/* #define AP_OPTS_RESERVED 0x00000002 */
+#define AP_OPTS_USE_SUBKEY 0x00000001
+
+#define AP_OPTS_WIRE_MASK 0xfffffff0
+
+/* definitions for ad_type fields. */
+#define AD_TYPE_RESERVED 0x8000
+#define AD_TYPE_EXTERNAL 0x4000
+#define AD_TYPE_REGISTERED 0x2000
+
+#define AD_TYPE_FIELD_TYPE_MASK 0x1fff
+
+/* Ticket flags */
+/* flags are 32 bits; each host is responsible to put the 4 bytes
+ representing these bits into net order before transmission */
+/* #define TKT_FLG_RESERVED 0x80000000 */
+#define TKT_FLG_FORWARDABLE 0x40000000
+#define TKT_FLG_FORWARDED 0x20000000
+#define TKT_FLG_PROXIABLE 0x10000000
+#define TKT_FLG_PROXY 0x08000000
+#define TKT_FLG_MAY_POSTDATE 0x04000000
+#define TKT_FLG_POSTDATED 0x02000000
+#define TKT_FLG_INVALID 0x01000000
+#define TKT_FLG_RENEWABLE 0x00800000
+#define TKT_FLG_INITIAL 0x00400000
+#define TKT_FLG_PRE_AUTH 0x00200000
+#define TKT_FLG_HW_AUTH 0x00100000
+#define TKT_FLG_TRANSIT_POLICY_CHECKED 0x00080000
+#define TKT_FLG_OK_AS_DELEGATE 0x00040000
+#define TKT_FLG_ANONYMOUS 0x00020000
+/* #define TKT_FLG_RESERVED 0x00010000 */
+/* #define TKT_FLG_RESERVED 0x00008000 */
+/* #define TKT_FLG_RESERVED 0x00004000 */
+/* #define TKT_FLG_RESERVED 0x00002000 */
+/* #define TKT_FLG_RESERVED 0x00001000 */
+/* #define TKT_FLG_RESERVED 0x00000800 */
+/* #define TKT_FLG_RESERVED 0x00000400 */
+/* #define TKT_FLG_RESERVED 0x00000200 */
+/* #define TKT_FLG_RESERVED 0x00000100 */
+/* #define TKT_FLG_RESERVED 0x00000080 */
+/* #define TKT_FLG_RESERVED 0x00000040 */
+/* #define TKT_FLG_RESERVED 0x00000020 */
+/* #define TKT_FLG_RESERVED 0x00000010 */
+/* #define TKT_FLG_RESERVED 0x00000008 */
+/* #define TKT_FLG_RESERVED 0x00000004 */
+/* #define TKT_FLG_RESERVED 0x00000002 */
+/* #define TKT_FLG_RESERVED 0x00000001 */
+
+/* definitions for lr_type fields. */
+#define LR_TYPE_THIS_SERVER_ONLY 0x8000
+
+#define LR_TYPE_INTERPRETATION_MASK 0x7fff
+
+/* definitions for ad_type fields. */
+#define AD_TYPE_EXTERNAL 0x4000
+#define AD_TYPE_REGISTERED 0x2000
+
+#define AD_TYPE_FIELD_TYPE_MASK 0x1fff
+#define AD_TYPE_INTERNAL_MASK 0x3fff
+
+/* definitions for msec direction bit for KRB_SAFE, KRB_PRIV */
+#define MSEC_DIRBIT 0x8000
+#define MSEC_VAL_MASK 0x7fff
+
+/*
+ * end "fieldbits.h"
+ */
+
+/*
+ * begin "proto.h"
+ */
+
+/* Protocol version number */
+#define KRB5_PVNO 5
+
+/* Message types */
+
+#define KRB5_AS_REQ ((krb5_msgtype)10) /* Req for initial authentication */
+#define KRB5_AS_REP ((krb5_msgtype)11) /* Response to KRB_AS_REQ request */
+#define KRB5_TGS_REQ ((krb5_msgtype)12) /* TGS request to server */
+#define KRB5_TGS_REP ((krb5_msgtype)13) /* Response to KRB_TGS_REQ req */
+#define KRB5_AP_REQ ((krb5_msgtype)14) /* application request to server */
+#define KRB5_AP_REP ((krb5_msgtype)15) /* Response to KRB_AP_REQ_MUTUAL */
+#define KRB5_SAFE ((krb5_msgtype)20) /* Safe application message */
+#define KRB5_PRIV ((krb5_msgtype)21) /* Private application message */
+#define KRB5_CRED ((krb5_msgtype)22) /* Credential forwarding message */
+#define KRB5_ERROR ((krb5_msgtype)30) /* Error response */
+
+/* LastReq types */
+#define KRB5_LRQ_NONE 0
+#define KRB5_LRQ_ALL_LAST_TGT 1
+#define KRB5_LRQ_ONE_LAST_TGT (-1)
+#define KRB5_LRQ_ALL_LAST_INITIAL 2
+#define KRB5_LRQ_ONE_LAST_INITIAL (-2)
+#define KRB5_LRQ_ALL_LAST_TGT_ISSUED 3
+#define KRB5_LRQ_ONE_LAST_TGT_ISSUED (-3)
+#define KRB5_LRQ_ALL_LAST_RENEWAL 4
+#define KRB5_LRQ_ONE_LAST_RENEWAL (-4)
+#define KRB5_LRQ_ALL_LAST_REQ 5
+#define KRB5_LRQ_ONE_LAST_REQ (-5)
+#define KRB5_LRQ_ALL_PW_EXPTIME 6
+#define KRB5_LRQ_ONE_PW_EXPTIME (-6)
+
+/* PADATA types */
+#define KRB5_PADATA_NONE 0
+#define KRB5_PADATA_AP_REQ 1
+#define KRB5_PADATA_TGS_REQ KRB5_PADATA_AP_REQ
+#define KRB5_PADATA_ENC_TIMESTAMP 2
+#define KRB5_PADATA_PW_SALT 3
+#if 0 /* Not used */
+#define KRB5_PADATA_ENC_ENCKEY 4 /* Key encrypted within itself */
+#endif
+#define KRB5_PADATA_ENC_UNIX_TIME 5 /* timestamp encrypted in key */
+#define KRB5_PADATA_ENC_SANDIA_SECURID 6 /* SecurId passcode */
+#define KRB5_PADATA_SESAME 7 /* Sesame project */
+#define KRB5_PADATA_OSF_DCE 8 /* OSF DCE */
+#define KRB5_CYBERSAFE_SECUREID 9 /* Cybersafe */
+#define KRB5_PADATA_AFS3_SALT 10 /* Cygnus */
+#define KRB5_PADATA_ETYPE_INFO 11 /* Etype info for preauth */
+#define KRB5_PADATA_SAM_CHALLENGE 12 /* draft challenge system */
+#define KRB5_PADATA_SAM_RESPONSE 13 /* draft challenge system response */
+#define KRB5_PADATA_PK_AS_REQ 14 /* PKINIT */
+#define KRB5_PADATA_PK_AS_REP 15 /* PKINIT */
+#define KRB5_PADATA_ETYPE_INFO2 19
+#define KRB5_PADATA_SAM_CHALLENGE_2 30 /* draft challenge system, updated */
+#define KRB5_PADATA_SAM_RESPONSE_2 31 /* draft challenge system, updated */
+
+#define KRB5_SAM_USE_SAD_AS_KEY 0x80000000
+#define KRB5_SAM_SEND_ENCRYPTED_SAD 0x40000000
+#define KRB5_SAM_MUST_PK_ENCRYPT_SAD 0x20000000 /* currently must be zero */
+
+/* Reserved for SPX pre-authentication. */
+#define KRB5_PADATA_DASS 16
+
+/* Transited encoding types */
+#define KRB5_DOMAIN_X500_COMPRESS 1
+
+/* alternate authentication types */
+#define KRB5_ALTAUTH_ATT_CHALLENGE_RESPONSE 64
+
+/* authorization data types */
+#define KRB5_AUTHDATA_OSF_DCE 64
+#define KRB5_AUTHDATA_SESAME 65
+
+/* password change constants */
+
+#define KRB5_KPASSWD_SUCCESS 0
+#define KRB5_KPASSWD_MALFORMED 1
+#define KRB5_KPASSWD_HARDERROR 2
+#define KRB5_KPASSWD_AUTHERROR 3
+#define KRB5_KPASSWD_SOFTERROR 4
+/* These are Microsoft's extensions in RFC 3244, and it looks like
+ they'll become standardized, possibly with other additions. */
+#define KRB5_KPASSWD_ACCESSDENIED 5 /* unused */
+#define KRB5_KPASSWD_BAD_VERSION 6
+#define KRB5_KPASSWD_INITIAL_FLAG_NEEDED 7 /* unused */
+
+/*
+ * end "proto.h"
+ */
+
+/* Time set */
+typedef struct _krb5_ticket_times {
+ krb5_timestamp authtime; /* XXX ? should ktime in KDC_REP == authtime
+ in ticket? otherwise client can't get this */
+ krb5_timestamp starttime; /* optional in ticket, if not present,
+ use authtime */
+ krb5_timestamp endtime;
+ krb5_timestamp renew_till;
+} krb5_ticket_times;
+
+/* structure for auth data */
+typedef struct _krb5_authdata {
+ krb5_magic magic;
+ krb5_authdatatype ad_type;
+ unsigned int length;
+ krb5_octet *contents;
+} krb5_authdata;
+
+/* structure for transited encoding */
+typedef struct _krb5_transited {
+ krb5_magic magic;
+ krb5_octet tr_type;
+ krb5_data tr_contents;
+} krb5_transited;
+
+typedef struct _krb5_enc_tkt_part {
+ krb5_magic magic;
+ /* to-be-encrypted portion */
+ krb5_flags flags; /* flags */
+ krb5_keyblock *session; /* session key: includes enctype */
+ krb5_principal client; /* client name/realm */
+ krb5_transited transited; /* list of transited realms */
+ krb5_ticket_times times; /* auth, start, end, renew_till */
+ krb5_address **caddrs; /* array of ptrs to addresses */
+ krb5_authdata **authorization_data; /* auth data */
+} krb5_enc_tkt_part;
+
+typedef struct _krb5_ticket {
+ krb5_magic magic;
+ /* cleartext portion */
+ krb5_principal server; /* server name/realm */
+ krb5_enc_data enc_part; /* encryption type, kvno, encrypted
+ encoding */
+ krb5_enc_tkt_part *enc_part2; /* ptr to decrypted version, if
+ available */
+} krb5_ticket;
+
+/* the unencrypted version */
+typedef struct _krb5_authenticator {
+ krb5_magic magic;
+ krb5_principal client; /* client name/realm */
+ krb5_checksum *checksum; /* checksum, includes type, optional */
+ krb5_int32 cusec; /* client usec portion */
+ krb5_timestamp ctime; /* client sec portion */
+ krb5_keyblock *subkey; /* true session key, optional */
+ krb5_ui_4 seq_number; /* sequence #, optional */
+ krb5_authdata **authorization_data; /* New add by Ari, auth data */
+} krb5_authenticator;
+
+typedef struct _krb5_tkt_authent {
+ krb5_magic magic;
+ krb5_ticket *ticket;
+ krb5_authenticator *authenticator;
+ krb5_flags ap_options;
+} krb5_tkt_authent;
+
+/* credentials: Ticket, session key, etc. */
+typedef struct _krb5_creds {
+ krb5_magic magic;
+ krb5_principal client; /* client's principal identifier */
+ krb5_principal server; /* server's principal identifier */
+ krb5_keyblock keyblock; /* session encryption key info */
+ krb5_ticket_times times; /* lifetime info */
+ krb5_boolean is_skey; /* true if ticket is encrypted in
+ another ticket's skey */
+ krb5_flags ticket_flags; /* flags in ticket */
+ krb5_address **addresses; /* addrs in ticket */
+ krb5_data ticket; /* ticket string itself */
+ krb5_data second_ticket; /* second ticket, if related to
+ ticket (via DUPLICATE-SKEY or
+ ENC-TKT-IN-SKEY) */
+ krb5_authdata **authdata; /* authorization data */
+} krb5_creds;
+
+/* Last request fields */
+typedef struct _krb5_last_req_entry {
+ krb5_magic magic;
+ krb5_int32 lr_type;
+ krb5_timestamp value;
+} krb5_last_req_entry;
+
+/* pre-authentication data */
+typedef struct _krb5_pa_data {
+ krb5_magic magic;
+ krb5_preauthtype pa_type;
+ unsigned int length;
+ krb5_octet *contents;
+} krb5_pa_data;
+
+typedef struct _krb5_kdc_req {
+ krb5_magic magic;
+ krb5_msgtype msg_type; /* AS_REQ or TGS_REQ? */
+ krb5_pa_data **padata; /* e.g. encoded AP_REQ */
+ /* real body */
+ krb5_flags kdc_options; /* requested options */
+ krb5_principal client; /* includes realm; optional */
+ krb5_principal server; /* includes realm (only used if no
+ client) */
+ krb5_timestamp from; /* requested starttime */
+ krb5_timestamp till; /* requested endtime */
+ krb5_timestamp rtime; /* (optional) requested renew_till */
+ krb5_int32 nonce; /* nonce to match request/response */
+ int nktypes; /* # of ktypes, must be positive */
+ krb5_enctype *ktype; /* requested enctype(s) */
+ krb5_address **addresses; /* requested addresses, optional */
+ krb5_enc_data authorization_data; /* encrypted auth data; OPTIONAL */
+ krb5_authdata **unenc_authdata; /* unencrypted auth data,
+ if available */
+ krb5_ticket **second_ticket;/* second ticket array; OPTIONAL */
+} krb5_kdc_req;
+
+typedef struct _krb5_enc_kdc_rep_part {
+ krb5_magic magic;
+ /* encrypted part: */
+ krb5_msgtype msg_type; /* krb5 message type */
+ krb5_keyblock *session; /* session key */
+ krb5_last_req_entry **last_req; /* array of ptrs to entries */
+ krb5_int32 nonce; /* nonce from request */
+ krb5_timestamp key_exp; /* expiration date */
+ krb5_flags flags; /* ticket flags */
+ krb5_ticket_times times; /* lifetime info */
+ krb5_principal server; /* server's principal identifier */
+ krb5_address **caddrs; /* array of ptrs to addresses,
+ optional */
+} krb5_enc_kdc_rep_part;
+
+typedef struct _krb5_kdc_rep {
+ krb5_magic magic;
+ /* cleartext part: */
+ krb5_msgtype msg_type; /* AS_REP or KDC_REP? */
+ krb5_pa_data **padata; /* preauthentication data from KDC */
+ krb5_principal client; /* client's principal identifier */
+ krb5_ticket *ticket; /* ticket */
+ krb5_enc_data enc_part; /* encryption type, kvno, encrypted
+ encoding */
+ krb5_enc_kdc_rep_part *enc_part2;/* unencrypted version, if available */
+} krb5_kdc_rep;
+
+/* error message structure */
+typedef struct _krb5_error {
+ krb5_magic magic;
+ /* some of these may be meaningless in certain contexts */
+ krb5_timestamp ctime; /* client sec portion; optional */
+ krb5_int32 cusec; /* client usec portion; optional */
+ krb5_int32 susec; /* server usec portion */
+ krb5_timestamp stime; /* server sec portion */
+ krb5_ui_4 error; /* error code (protocol error #'s) */
+ krb5_principal client; /* client's principal identifier;
+ optional */
+ krb5_principal server; /* server's principal identifier */
+ krb5_data text; /* descriptive text */
+ krb5_data e_data; /* additional error-describing data */
+} krb5_error;
+
+typedef struct _krb5_ap_req {
+ krb5_magic magic;
+ krb5_flags ap_options; /* requested options */
+ krb5_ticket *ticket; /* ticket */
+ krb5_enc_data authenticator; /* authenticator (already encrypted) */
+} krb5_ap_req;
+
+typedef struct _krb5_ap_rep {
+ krb5_magic magic;
+ krb5_enc_data enc_part;
+} krb5_ap_rep;
+
+typedef struct _krb5_ap_rep_enc_part {
+ krb5_magic magic;
+ krb5_timestamp ctime; /* client time, seconds portion */
+ krb5_int32 cusec; /* client time, microseconds portion */
+ krb5_keyblock *subkey; /* true session key, optional */
+ krb5_ui_4 seq_number; /* sequence #, optional */
+} krb5_ap_rep_enc_part;
+
+typedef struct _krb5_response {
+ krb5_magic magic;
+ krb5_octet message_type;
+ krb5_data response;
+ krb5_int32 expected_nonce; /* The expected nonce for KDC_REP messages */
+ krb5_timestamp request_time; /* When we made the request */
+} krb5_response;
+
+typedef struct _krb5_cred_info {
+ krb5_magic magic;
+ krb5_keyblock *session; /* session key used to encrypt */
+ /* ticket */
+ krb5_principal client; /* client name/realm, optional */
+ krb5_principal server; /* server name/realm, optional */
+ krb5_flags flags; /* ticket flags, optional */
+ krb5_ticket_times times; /* auth, start, end, renew_till, */
+ /* optional */
+ krb5_address **caddrs; /* array of ptrs to addresses */
+} krb5_cred_info;
+
+typedef struct _krb5_cred_enc_part {
+ krb5_magic magic;
+ krb5_int32 nonce; /* nonce, optional */
+ krb5_timestamp timestamp; /* client time */
+ krb5_int32 usec; /* microsecond portion of time */
+ krb5_address *s_address; /* sender address, optional */
+ krb5_address *r_address; /* recipient address, optional */
+ krb5_cred_info **ticket_info;
+} krb5_cred_enc_part;
+
+typedef struct _krb5_cred {
+ krb5_magic magic;
+ krb5_ticket **tickets; /* tickets */
+ krb5_enc_data enc_part; /* encrypted part */
+ krb5_cred_enc_part *enc_part2; /* unencrypted version, if available*/
+} krb5_cred;
+
+/* Sandia password generation structures */
+typedef struct _passwd_phrase_element {
+ krb5_magic magic;
+ krb5_data *passwd;
+ krb5_data *phrase;
+} passwd_phrase_element;
+
+typedef struct _krb5_pwd_data {
+ krb5_magic magic;
+ int sequence_count;
+ passwd_phrase_element **element;
+} krb5_pwd_data;
+
+/* these need to be here so the typedefs are available for the prototypes */
+
+/*
+ * begin "safepriv.h"
+ */
+
+#define KRB5_AUTH_CONTEXT_DO_TIME 0x00000001
+#define KRB5_AUTH_CONTEXT_RET_TIME 0x00000002
+#define KRB5_AUTH_CONTEXT_DO_SEQUENCE 0x00000004
+#define KRB5_AUTH_CONTEXT_RET_SEQUENCE 0x00000008
+#define KRB5_AUTH_CONTEXT_PERMIT_ALL 0x00000010
+#define KRB5_AUTH_CONTEXT_USE_SUBKEY 0x00000020
+
+typedef struct krb5_replay_data {
+ krb5_timestamp timestamp;
+ krb5_int32 usec;
+ krb5_ui_4 seq;
+} krb5_replay_data;
+
+/* flags for krb5_auth_con_genaddrs() */
+#define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_ADDR 0x00000001
+#define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_ADDR 0x00000002
+#define KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR 0x00000004
+#define KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR 0x00000008
+
+/* type of function used as a callback to generate checksum data for
+ * mk_req */
+
+typedef krb5_error_code
+(KRB5_CALLCONV * krb5_mk_req_checksum_func) (krb5_context, krb5_auth_context , void *,
+ krb5_data **);
+
+/*
+ * end "safepriv.h"
+ */
+
+
+/*
+ * begin "ccache.h"
+ */
+
+typedef krb5_pointer krb5_cc_cursor; /* cursor for sequential lookup */
+
+struct _krb5_ccache;
+typedef struct _krb5_ccache *krb5_ccache;
+struct _krb5_cc_ops;
+typedef struct _krb5_cc_ops krb5_cc_ops;
+
+/* for retrieve_cred */
+#define KRB5_TC_MATCH_TIMES 0x00000001
+#define KRB5_TC_MATCH_IS_SKEY 0x00000002
+#define KRB5_TC_MATCH_FLAGS 0x00000004
+#define KRB5_TC_MATCH_TIMES_EXACT 0x00000008
+#define KRB5_TC_MATCH_FLAGS_EXACT 0x00000010
+#define KRB5_TC_MATCH_AUTHDATA 0x00000020
+#define KRB5_TC_MATCH_SRV_NAMEONLY 0x00000040
+#define KRB5_TC_MATCH_2ND_TKT 0x00000080
+#define KRB5_TC_MATCH_KTYPE 0x00000100
+#define KRB5_TC_SUPPORTED_KTYPES 0x00000200
+
+/* for set_flags and other functions */
+#define KRB5_TC_OPENCLOSE 0x00000001
+
+const char * KRB5_CALLCONV
+krb5_cc_get_name (krb5_context context, krb5_ccache cache);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_gen_new (krb5_context context, krb5_ccache *cache);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_initialize(krb5_context context, krb5_ccache cache,
+ krb5_principal principal);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_destroy (krb5_context context, krb5_ccache cache);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_close (krb5_context context, krb5_ccache cache);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_store_cred (krb5_context context, krb5_ccache cache,
+ krb5_creds *creds);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_retrieve_cred (krb5_context context, krb5_ccache cache,
+ krb5_flags flags, krb5_creds *mcreds,
+ krb5_creds *creds);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_get_principal (krb5_context context, krb5_ccache cache,
+ krb5_principal *principal);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_start_seq_get (krb5_context context, krb5_ccache cache,
+ krb5_cc_cursor *cursor);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_next_cred (krb5_context context, krb5_ccache cache,
+ krb5_cc_cursor *cursor, krb5_creds *creds);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_end_seq_get (krb5_context context, krb5_ccache cache,
+ krb5_cc_cursor *cursor);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_remove_cred (krb5_context context, krb5_ccache cache, krb5_flags flags,
+ krb5_creds *creds);
+
+krb5_error_code KRB5_CALLCONV
+krb5_cc_set_flags (krb5_context context, krb5_ccache cache, krb5_flags flags);
+
+const char * KRB5_CALLCONV
+krb5_cc_get_type (krb5_context context, krb5_ccache cache);
+
+/*
+ * end "ccache.h"
+ */
+
+/*
+ * begin "rcache.h"
+ */
+
+struct krb5_rc_st;
+typedef struct krb5_rc_st *krb5_rcache;
+
+#if KRB5_PRIVATE
+typedef struct _krb5_donot_replay {
+ krb5_magic magic;
+ char *server; /* null-terminated */
+ char *client; /* null-terminated */
+ krb5_int32 cusec;
+ krb5_timestamp ctime;
+} krb5_donot_replay;
+
+krb5_error_code krb5_rc_default
+ (krb5_context,
+ krb5_rcache *);
+krb5_error_code krb5_rc_resolve_type
+ (krb5_context,
+ krb5_rcache *,char *);
+krb5_error_code krb5_rc_resolve_full
+ (krb5_context,
+ krb5_rcache *,char *);
+char * krb5_rc_get_type
+ (krb5_context,
+ krb5_rcache);
+char * krb5_rc_default_type
+ (krb5_context);
+char * krb5_rc_default_name
+ (krb5_context);
+krb5_error_code krb5_auth_to_rep
+ (krb5_context,
+ krb5_tkt_authent *,
+ krb5_donot_replay *);
+
+
+krb5_error_code KRB5_CALLCONV krb5_rc_initialize
+ (krb5_context, krb5_rcache,krb5_deltat);
+krb5_error_code KRB5_CALLCONV krb5_rc_recover
+ (krb5_context, krb5_rcache);
+krb5_error_code KRB5_CALLCONV krb5_rc_destroy
+ (krb5_context, krb5_rcache);
+krb5_error_code KRB5_CALLCONV krb5_rc_close
+ (krb5_context, krb5_rcache);
+krb5_error_code KRB5_CALLCONV krb5_rc_store
+ (krb5_context, krb5_rcache,krb5_donot_replay *);
+krb5_error_code KRB5_CALLCONV krb5_rc_expunge
+ (krb5_context, krb5_rcache);
+krb5_error_code KRB5_CALLCONV krb5_rc_get_lifespan
+ (krb5_context, krb5_rcache,krb5_deltat *);
+char *KRB5_CALLCONV krb5_rc_get_name
+ (krb5_context, krb5_rcache);
+krb5_error_code KRB5_CALLCONV krb5_rc_resolve
+ (krb5_context, krb5_rcache, char *);
+#endif /* KRB5_PRIVATE */
+/*
+ * end "rcache.h"
+ */
+
+/*
+ * begin "keytab.h"
+ */
+
+
+/* XXX */
+#define MAX_KEYTAB_NAME_LEN 1100 /* Long enough for MAXPATHLEN + some extra */
+
+typedef krb5_pointer krb5_kt_cursor; /* XXX */
+
+typedef struct krb5_keytab_entry_st {
+ krb5_magic magic;
+ krb5_principal principal; /* principal of this key */
+ krb5_timestamp timestamp; /* time entry written to keytable */
+ krb5_kvno vno; /* key version number */
+ krb5_keyblock key; /* the secret key */
+} krb5_keytab_entry;
+
+#if KRB5_PRIVATE
+struct _krb5_kt_ops;
+typedef struct _krb5_kt { /* should move into k5-int.h */
+ krb5_magic magic;
+ const struct _krb5_kt_ops *ops;
+ krb5_pointer data;
+} *krb5_keytab;
+#else
+struct _krb5_kt;
+typedef struct _krb5_kt *krb5_keytab;
+#endif
+
+char * KRB5_CALLCONV
+krb5_kt_get_type (krb5_context, krb5_keytab keytab);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_get_name(krb5_context context, krb5_keytab keytab, char *name,
+ unsigned int namelen);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_close(krb5_context context, krb5_keytab keytab);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_get_entry(krb5_context context, krb5_keytab keytab,
+ krb5_const_principal principal, krb5_kvno vno,
+ krb5_enctype enctype, krb5_keytab_entry *entry);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_start_seq_get(krb5_context context, krb5_keytab keytab,
+ krb5_kt_cursor *cursor);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_next_entry(krb5_context context, krb5_keytab keytab,
+ krb5_keytab_entry *entry, krb5_kt_cursor *cursor);
+krb5_error_code KRB5_CALLCONV
+krb5_kt_end_seq_get(krb5_context context, krb5_keytab keytab,
+ krb5_kt_cursor *cursor);
+
+/*
+ * end "keytab.h"
+ */
+
+/*
+ * begin "func-proto.h"
+ */
+
+krb5_error_code KRB5_CALLCONV krb5_init_context
+ (krb5_context *);
+krb5_error_code KRB5_CALLCONV krb5_init_secure_context
+ (krb5_context *);
+void KRB5_CALLCONV krb5_free_context
+ (krb5_context);
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_set_default_in_tkt_ktypes
+ (krb5_context,
+ const krb5_enctype *);
+krb5_error_code krb5_get_default_in_tkt_ktypes
+ (krb5_context,
+ krb5_enctype **);
+
+krb5_error_code krb5_set_default_tgs_ktypes
+ (krb5_context,
+ const krb5_enctype *);
+#endif
+
+krb5_error_code KRB5_CALLCONV
+krb5_set_default_tgs_enctypes
+ (krb5_context,
+ const krb5_enctype *);
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_get_tgs_ktypes
+ (krb5_context,
+ krb5_const_principal,
+ krb5_enctype **);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_get_permitted_enctypes
+ (krb5_context, krb5_enctype **);
+
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_ktypes
+ (krb5_context, krb5_enctype *);
+
+krb5_boolean krb5_is_permitted_enctype
+ (krb5_context, krb5_enctype);
+#endif
+
+/* libkrb.spec */
+#if KRB5_PRIVATE
+krb5_error_code krb5_kdc_rep_decrypt_proc
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_const_pointer,
+ krb5_kdc_rep * );
+krb5_error_code KRB5_CALLCONV krb5_decrypt_tkt_part
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_ticket * );
+krb5_error_code krb5_get_cred_from_kdc
+ (krb5_context,
+ krb5_ccache, /* not const, as reading may save
+ state */
+ krb5_creds *,
+ krb5_creds **,
+ krb5_creds *** );
+krb5_error_code krb5_get_cred_from_kdc_validate
+ (krb5_context,
+ krb5_ccache, /* not const, as reading may save
+ state */
+ krb5_creds *,
+ krb5_creds **,
+ krb5_creds *** );
+krb5_error_code krb5_get_cred_from_kdc_renew
+ (krb5_context,
+ krb5_ccache, /* not const, as reading may save
+ state */
+ krb5_creds *,
+ krb5_creds **,
+ krb5_creds *** );
+#endif
+
+void KRB5_CALLCONV krb5_free_tgt_creds
+ (krb5_context,
+ krb5_creds **); /* XXX too hard to do with const */
+
+#define KRB5_GC_USER_USER 1 /* want user-user ticket */
+#define KRB5_GC_CACHED 2 /* want cached ticket only */
+
+krb5_error_code KRB5_CALLCONV krb5_get_credentials
+ (krb5_context,
+ krb5_flags,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_creds **);
+krb5_error_code KRB5_CALLCONV krb5_get_credentials_validate
+ (krb5_context,
+ krb5_flags,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_creds **);
+krb5_error_code KRB5_CALLCONV krb5_get_credentials_renew
+ (krb5_context,
+ krb5_flags,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_creds **);
+#if KRB5_PRIVATE
+krb5_error_code krb5_get_cred_via_tkt
+ (krb5_context,
+ krb5_creds *,
+ krb5_flags,
+ krb5_address * const *,
+ krb5_creds *,
+ krb5_creds **);
+#endif
+krb5_error_code KRB5_CALLCONV krb5_mk_req
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_flags,
+ char *,
+ char *,
+ krb5_data *,
+ krb5_ccache,
+ krb5_data * );
+krb5_error_code KRB5_CALLCONV krb5_mk_req_extended
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_flags,
+ krb5_data *,
+ krb5_creds *,
+ krb5_data * );
+krb5_error_code KRB5_CALLCONV krb5_mk_rep
+ (krb5_context,
+ krb5_auth_context,
+ krb5_data *);
+krb5_error_code KRB5_CALLCONV krb5_rd_rep
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_ap_rep_enc_part **);
+krb5_error_code KRB5_CALLCONV krb5_mk_error
+ (krb5_context,
+ const krb5_error *,
+ krb5_data * );
+krb5_error_code KRB5_CALLCONV krb5_rd_error
+ (krb5_context,
+ const krb5_data *,
+ krb5_error ** );
+krb5_error_code KRB5_CALLCONV krb5_rd_safe
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *);
+krb5_error_code KRB5_CALLCONV krb5_rd_priv
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *);
+krb5_error_code KRB5_CALLCONV krb5_parse_name
+ (krb5_context,
+ const char *,
+ krb5_principal * );
+krb5_error_code KRB5_CALLCONV krb5_unparse_name
+ (krb5_context,
+ krb5_const_principal,
+ char ** );
+krb5_error_code KRB5_CALLCONV krb5_unparse_name_ext
+ (krb5_context,
+ krb5_const_principal,
+ char **,
+ unsigned int *);
+
+krb5_error_code KRB5_CALLCONV krb5_set_principal_realm
+ (krb5_context, krb5_principal, const char *);
+
+krb5_boolean KRB5_CALLCONV_WRONG krb5_address_search
+ (krb5_context,
+ const krb5_address *,
+ krb5_address * const *);
+krb5_boolean KRB5_CALLCONV krb5_address_compare
+ (krb5_context,
+ const krb5_address *,
+ const krb5_address *);
+int KRB5_CALLCONV krb5_address_order
+ (krb5_context,
+ const krb5_address *,
+ const krb5_address *);
+krb5_boolean KRB5_CALLCONV krb5_realm_compare
+ (krb5_context,
+ krb5_const_principal,
+ krb5_const_principal);
+krb5_boolean KRB5_CALLCONV krb5_principal_compare
+ (krb5_context,
+ krb5_const_principal,
+ krb5_const_principal);
+krb5_error_code KRB5_CALLCONV krb5_init_keyblock
+ (krb5_context, krb5_enctype enctype,
+ size_t length, krb5_keyblock **out);
+ /* Initialize a new keyblock and allocate storage
+ * for the contents of the key, which will be freed along
+ * with the keyblock when krb5_free_keyblock is called.
+ * It is legal to pass in a length of 0, in which
+ * case contents are left unallocated.
+ */
+krb5_error_code KRB5_CALLCONV krb5_copy_keyblock
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_keyblock **);
+krb5_error_code KRB5_CALLCONV krb5_copy_keyblock_contents
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_keyblock *);
+krb5_error_code KRB5_CALLCONV krb5_copy_creds
+ (krb5_context,
+ const krb5_creds *,
+ krb5_creds **);
+krb5_error_code KRB5_CALLCONV krb5_copy_data
+ (krb5_context,
+ const krb5_data *,
+ krb5_data **);
+krb5_error_code KRB5_CALLCONV krb5_copy_principal
+ (krb5_context,
+ krb5_const_principal,
+ krb5_principal *);
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_copy_addr
+ (krb5_context,
+ const krb5_address *,
+ krb5_address **);
+#endif
+krb5_error_code KRB5_CALLCONV krb5_copy_addresses
+ (krb5_context,
+ krb5_address * const *,
+ krb5_address ***);
+krb5_error_code KRB5_CALLCONV krb5_copy_ticket
+ (krb5_context,
+ const krb5_ticket *,
+ krb5_ticket **);
+krb5_error_code KRB5_CALLCONV krb5_copy_authdata
+ (krb5_context,
+ krb5_authdata * const *,
+ krb5_authdata ***);
+krb5_error_code KRB5_CALLCONV krb5_copy_authenticator
+ (krb5_context,
+ const krb5_authenticator *,
+ krb5_authenticator **);
+krb5_error_code KRB5_CALLCONV krb5_copy_checksum
+ (krb5_context,
+ const krb5_checksum *,
+ krb5_checksum **);
+#if KRB5_PRIVATE
+void krb5_init_ets
+ (krb5_context);
+void krb5_free_ets
+ (krb5_context);
+krb5_error_code krb5_generate_subkey
+ (krb5_context,
+ const krb5_keyblock *, krb5_keyblock **);
+krb5_error_code krb5_generate_seq_number
+ (krb5_context,
+ const krb5_keyblock *, krb5_ui_4 *);
+#endif
+krb5_error_code KRB5_CALLCONV krb5_get_server_rcache
+ (krb5_context,
+ const krb5_data *, krb5_rcache *);
+krb5_error_code KRB5_CALLCONV_C krb5_build_principal_ext
+ (krb5_context, krb5_principal *, unsigned int, const char *, ...);
+krb5_error_code KRB5_CALLCONV_C krb5_build_principal
+ (krb5_context, krb5_principal *, unsigned int, const char *, ...);
+#ifdef va_start
+/* XXX depending on varargs include file defining va_start... */
+krb5_error_code KRB5_CALLCONV krb5_build_principal_va
+ (krb5_context,
+ krb5_principal, unsigned int, const char *, va_list);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_425_conv_principal
+ (krb5_context,
+ const char *name,
+ const char *instance, const char *realm,
+ krb5_principal *princ);
+
+krb5_error_code KRB5_CALLCONV krb5_524_conv_principal
+ (krb5_context context, krb5_const_principal princ,
+ char *name, char *inst, char *realm);
+
+struct credentials;
+int KRB5_CALLCONV krb5_524_convert_creds
+ (krb5_context context, krb5_creds *v5creds,
+ struct credentials *v4creds);
+#if KRB5_DEPRECATED
+#define krb524_convert_creds_kdc krb5_524_convert_creds
+#define krb524_init_ets(x) (0)
+#endif
+
+/* libkt.spec */
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_kt_register
+ (krb5_context,
+ struct _krb5_kt_ops * );
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_kt_resolve
+ (krb5_context,
+ const char *,
+ krb5_keytab * );
+krb5_error_code KRB5_CALLCONV krb5_kt_default_name
+ (krb5_context,
+ char *,
+ int );
+krb5_error_code KRB5_CALLCONV krb5_kt_default
+ (krb5_context,
+ krb5_keytab * );
+krb5_error_code KRB5_CALLCONV krb5_free_keytab_entry_contents
+ (krb5_context,
+ krb5_keytab_entry * );
+#if KRB5_PRIVATE
+/* use krb5_free_keytab_entry_contents instead */
+krb5_error_code KRB5_CALLCONV krb5_kt_free_entry
+ (krb5_context,
+ krb5_keytab_entry * );
+#endif
+/* remove and add are functions, so that they can return NOWRITE
+ if not a writable keytab */
+krb5_error_code KRB5_CALLCONV krb5_kt_remove_entry
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry * );
+krb5_error_code KRB5_CALLCONV krb5_kt_add_entry
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry * );
+krb5_error_code krb5_principal2salt
+ (krb5_context,
+ krb5_const_principal, krb5_data *);
+#if KRB5_PRIVATE
+krb5_error_code krb5_principal2salt_norealm
+ (krb5_context,
+ krb5_const_principal, krb5_data *);
+#endif
+/* librc.spec--see rcache.h */
+
+/* libcc.spec */
+krb5_error_code KRB5_CALLCONV krb5_cc_resolve
+ (krb5_context,
+ const char *,
+ krb5_ccache * );
+const char * KRB5_CALLCONV krb5_cc_default_name
+ (krb5_context);
+krb5_error_code KRB5_CALLCONV krb5_cc_set_default_name
+ (krb5_context, const char *);
+krb5_error_code KRB5_CALLCONV krb5_cc_default
+ (krb5_context,
+ krb5_ccache *);
+#if KRB5_PRIVATE
+unsigned int KRB5_CALLCONV krb5_get_notification_message
+ (void);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_cc_copy_creds
+ (krb5_context context,
+ krb5_ccache incc,
+ krb5_ccache outcc);
+
+
+/* chk_trans.c */
+#if KRB5_PRIVATE
+krb5_error_code krb5_check_transited_list
+ (krb5_context, const krb5_data *trans,
+ const krb5_data *realm1, const krb5_data *realm2);
+#endif
+
+/* free_rtree.c */
+#if KRB5_PRIVATE
+void krb5_free_realm_tree
+ (krb5_context,
+ krb5_principal *);
+#endif
+
+/* krb5_free.c */
+void KRB5_CALLCONV krb5_free_principal
+ (krb5_context, krb5_principal );
+void KRB5_CALLCONV krb5_free_authenticator
+ (krb5_context, krb5_authenticator * );
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_authenticator_contents
+ (krb5_context, krb5_authenticator * );
+#endif
+void KRB5_CALLCONV krb5_free_addresses
+ (krb5_context, krb5_address ** );
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_address
+ (krb5_context, krb5_address * );
+#endif
+void KRB5_CALLCONV krb5_free_authdata
+ (krb5_context, krb5_authdata ** );
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_enc_tkt_part
+ (krb5_context, krb5_enc_tkt_part * );
+#endif
+void KRB5_CALLCONV krb5_free_ticket
+ (krb5_context, krb5_ticket * );
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_tickets
+ (krb5_context, krb5_ticket ** );
+void KRB5_CALLCONV krb5_free_kdc_req
+ (krb5_context, krb5_kdc_req * );
+void KRB5_CALLCONV krb5_free_kdc_rep
+ (krb5_context, krb5_kdc_rep * );
+void KRB5_CALLCONV krb5_free_last_req
+ (krb5_context, krb5_last_req_entry ** );
+void KRB5_CALLCONV krb5_free_enc_kdc_rep_part
+ (krb5_context, krb5_enc_kdc_rep_part * );
+#endif
+void KRB5_CALLCONV krb5_free_error
+ (krb5_context, krb5_error * );
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_ap_req
+ (krb5_context, krb5_ap_req * );
+void KRB5_CALLCONV krb5_free_ap_rep
+ (krb5_context, krb5_ap_rep * );
+void KRB5_CALLCONV krb5_free_cred
+ (krb5_context, krb5_cred *);
+#endif
+void KRB5_CALLCONV krb5_free_creds
+ (krb5_context, krb5_creds *);
+void KRB5_CALLCONV krb5_free_cred_contents
+ (krb5_context, krb5_creds *);
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_cred_enc_part
+ (krb5_context, krb5_cred_enc_part *);
+#endif
+void KRB5_CALLCONV krb5_free_checksum
+ (krb5_context, krb5_checksum *);
+void KRB5_CALLCONV krb5_free_checksum_contents
+ (krb5_context, krb5_checksum *);
+void KRB5_CALLCONV krb5_free_keyblock
+ (krb5_context, krb5_keyblock *);
+void KRB5_CALLCONV krb5_free_keyblock_contents
+ (krb5_context, krb5_keyblock *);
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_pa_data
+ (krb5_context, krb5_pa_data **);
+#endif
+void KRB5_CALLCONV krb5_free_ap_rep_enc_part
+ (krb5_context, krb5_ap_rep_enc_part *);
+#if KRB5_PRIVATE
+void KRB5_CALLCONV krb5_free_tkt_authent
+ (krb5_context, krb5_tkt_authent *);
+void KRB5_CALLCONV krb5_free_pwd_data
+ (krb5_context, krb5_pwd_data *);
+void KRB5_CALLCONV krb5_free_pwd_sequences
+ (krb5_context, passwd_phrase_element **);
+#endif
+void KRB5_CALLCONV krb5_free_data
+ (krb5_context, krb5_data *);
+void KRB5_CALLCONV krb5_free_data_contents
+ (krb5_context, krb5_data *);
+void KRB5_CALLCONV krb5_free_unparsed_name
+ (krb5_context, char *);
+void KRB5_CALLCONV krb5_free_cksumtypes
+ (krb5_context, krb5_cksumtype *);
+
+/* From krb5/os but needed but by the outside world */
+krb5_error_code KRB5_CALLCONV krb5_us_timeofday
+ (krb5_context,
+ krb5_int32 *,
+ krb5_int32 * );
+krb5_error_code KRB5_CALLCONV krb5_timeofday
+ (krb5_context,
+ krb5_int32 * );
+ /* get all the addresses of this host */
+krb5_error_code KRB5_CALLCONV krb5_os_localaddr
+ (krb5_context,
+ krb5_address ***);
+krb5_error_code KRB5_CALLCONV krb5_get_default_realm
+ (krb5_context,
+ char ** );
+krb5_error_code KRB5_CALLCONV krb5_set_default_realm
+ (krb5_context,
+ const char * );
+void KRB5_CALLCONV krb5_free_default_realm
+ (krb5_context,
+ char * );
+krb5_error_code KRB5_CALLCONV krb5_sname_to_principal
+ (krb5_context,
+ const char *,
+ const char *,
+ krb5_int32,
+ krb5_principal *);
+krb5_error_code KRB5_CALLCONV
+krb5_change_password
+ (krb5_context context, krb5_creds *creds, char *newpw,
+ int *result_code, krb5_data *result_code_string,
+ krb5_data *result_string);
+krb5_error_code KRB5_CALLCONV
+krb5_set_password
+ (krb5_context context, krb5_creds *creds, char *newpw, krb5_principal change_password_for,
+ int *result_code, krb5_data *result_code_string, krb5_data *result_string);
+krb5_error_code KRB5_CALLCONV
+krb5_set_password_using_ccache
+ (krb5_context context, krb5_ccache ccache, char *newpw, krb5_principal change_password_for,
+ int *result_code, krb5_data *result_code_string, krb5_data *result_string);
+
+#if KRB5_PRIVATE
+#ifndef macintosh
+krb5_error_code krb5_set_config_files
+ (krb5_context, const char **);
+
+krb5_error_code KRB5_CALLCONV krb5_get_default_config_files
+ (char ***filenames);
+
+void KRB5_CALLCONV krb5_free_config_files
+ (char **filenames);
+
+#endif
+#endif
+
+krb5_error_code KRB5_CALLCONV
+krb5_get_profile
+ (krb5_context, struct _profile_t * /* profile_t */ *);
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_send_tgs
+ (krb5_context,
+ krb5_flags,
+ const krb5_ticket_times *,
+ const krb5_enctype *,
+ krb5_const_principal,
+ krb5_address * const *,
+ krb5_authdata * const *,
+ krb5_pa_data * const *,
+ const krb5_data *,
+ krb5_creds *,
+ krb5_response * );
+#endif
+
+#if KRB5_DEPRECATED
+krb5_error_code KRB5_CALLCONV krb5_get_in_tkt
+ (krb5_context,
+ krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ krb5_error_code ( * )(krb5_context,
+ krb5_enctype,
+ krb5_data *,
+ krb5_const_pointer,
+ krb5_keyblock **),
+ krb5_const_pointer,
+ krb5_error_code ( * )(krb5_context,
+ const krb5_keyblock *,
+ krb5_const_pointer,
+ krb5_kdc_rep * ),
+ krb5_const_pointer,
+ krb5_creds *,
+ krb5_ccache,
+ krb5_kdc_rep ** );
+
+krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_password
+ (krb5_context,
+ krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ const char *,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_kdc_rep ** );
+
+krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_skey
+ (krb5_context,
+ krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ const krb5_keyblock *,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_kdc_rep ** );
+
+krb5_error_code KRB5_CALLCONV krb5_get_in_tkt_with_keytab
+ (krb5_context,
+ krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ krb5_keytab,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_kdc_rep ** );
+#endif /* KRB5_DEPRECATED */
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_decode_kdc_rep
+ (krb5_context,
+ krb5_data *,
+ const krb5_keyblock *,
+ krb5_kdc_rep ** );
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_rd_req
+ (krb5_context,
+ krb5_auth_context *,
+ const krb5_data *,
+ krb5_const_principal,
+ krb5_keytab,
+ krb5_flags *,
+ krb5_ticket **);
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_rd_req_decoded
+ (krb5_context,
+ krb5_auth_context *,
+ const krb5_ap_req *,
+ krb5_const_principal,
+ krb5_keytab,
+ krb5_flags *,
+ krb5_ticket **);
+
+krb5_error_code krb5_rd_req_decoded_anyflag
+ (krb5_context,
+ krb5_auth_context *,
+ const krb5_ap_req *,
+ krb5_const_principal,
+ krb5_keytab,
+ krb5_flags *,
+ krb5_ticket **);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_kt_read_service_key
+ (krb5_context,
+ krb5_pointer,
+ krb5_principal,
+ krb5_kvno,
+ krb5_enctype,
+ krb5_keyblock **);
+krb5_error_code KRB5_CALLCONV krb5_mk_safe
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *);
+krb5_error_code KRB5_CALLCONV krb5_mk_priv
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *);
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_cc_register
+ (krb5_context,
+ krb5_cc_ops *,
+ krb5_boolean );
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_sendauth
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_pointer,
+ char *,
+ krb5_principal,
+ krb5_principal,
+ krb5_flags,
+ krb5_data *,
+ krb5_creds *,
+ krb5_ccache,
+ krb5_error **,
+ krb5_ap_rep_enc_part **,
+ krb5_creds **);
+
+krb5_error_code KRB5_CALLCONV krb5_recvauth
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_pointer,
+ char *,
+ krb5_principal,
+ krb5_int32,
+ krb5_keytab,
+ krb5_ticket **);
+krb5_error_code KRB5_CALLCONV krb5_recvauth_version
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_pointer,
+ krb5_principal,
+ krb5_int32,
+ krb5_keytab,
+ krb5_ticket **,
+ krb5_data *);
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_walk_realm_tree
+ (krb5_context,
+ const krb5_data *,
+ const krb5_data *,
+ krb5_principal **,
+ int);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_mk_ncred
+ (krb5_context,
+ krb5_auth_context,
+ krb5_creds **,
+ krb5_data **,
+ krb5_replay_data *);
+
+krb5_error_code KRB5_CALLCONV krb5_mk_1cred
+ (krb5_context,
+ krb5_auth_context,
+ krb5_creds *,
+ krb5_data **,
+ krb5_replay_data *);
+
+krb5_error_code KRB5_CALLCONV krb5_rd_cred
+ (krb5_context,
+ krb5_auth_context,
+ krb5_data *,
+ krb5_creds ***,
+ krb5_replay_data *);
+
+krb5_error_code KRB5_CALLCONV krb5_fwd_tgt_creds
+ (krb5_context,
+ krb5_auth_context,
+ char *,
+ krb5_principal,
+ krb5_principal,
+ krb5_ccache,
+ int forwardable,
+ krb5_data *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_init
+ (krb5_context,
+ krb5_auth_context *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_free
+ (krb5_context,
+ krb5_auth_context);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_setflags
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getflags
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32 *);
+
+krb5_error_code KRB5_CALLCONV
+krb5_auth_con_set_checksum_func (krb5_context, krb5_auth_context,
+ krb5_mk_req_checksum_func, void *);
+
+krb5_error_code KRB5_CALLCONV
+krb5_auth_con_get_checksum_func( krb5_context, krb5_auth_context,
+ krb5_mk_req_checksum_func *, void **);
+
+krb5_error_code KRB5_CALLCONV_WRONG krb5_auth_con_setaddrs
+ (krb5_context,
+ krb5_auth_context,
+ krb5_address *,
+ krb5_address *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getaddrs
+ (krb5_context,
+ krb5_auth_context,
+ krb5_address **,
+ krb5_address **);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_setports
+ (krb5_context,
+ krb5_auth_context,
+ krb5_address *,
+ krb5_address *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_setuseruserkey
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getkey
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock **);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getsendsubkey(
+ krb5_context, krb5_auth_context, krb5_keyblock **);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getrecvsubkey(
+ krb5_context, krb5_auth_context, krb5_keyblock **);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_setsendsubkey(
+ krb5_context, krb5_auth_context, krb5_keyblock *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_setrecvsubkey(
+ krb5_context, krb5_auth_context, krb5_keyblock *);
+
+#if KRB5_DEPRECATED
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getlocalsubkey
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock **);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getremotesubkey
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock **);
+#endif
+
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_auth_con_set_req_cksumtype
+ (krb5_context,
+ krb5_auth_context,
+ krb5_cksumtype);
+
+krb5_error_code krb5_auth_con_set_safe_cksumtype
+ (krb5_context,
+ krb5_auth_context,
+ krb5_cksumtype);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getlocalseqnumber
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32 *);
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getremoteseqnumber
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32 *);
+
+#if KRB5_DEPRECATED
+krb5_error_code KRB5_CALLCONV krb5_auth_con_initivector
+ (krb5_context,
+ krb5_auth_context);
+#endif
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_auth_con_setivector
+ (krb5_context,
+ krb5_auth_context,
+ krb5_pointer);
+
+krb5_error_code krb5_auth_con_getivector
+ (krb5_context,
+ krb5_auth_context,
+ krb5_pointer *);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_setrcache
+ (krb5_context,
+ krb5_auth_context,
+ krb5_rcache);
+
+krb5_error_code KRB5_CALLCONV_WRONG krb5_auth_con_getrcache
+ (krb5_context,
+ krb5_auth_context,
+ krb5_rcache *);
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_auth_con_setpermetypes
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_enctype *);
+
+krb5_error_code krb5_auth_con_getpermetypes
+ (krb5_context,
+ krb5_auth_context,
+ krb5_enctype **);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_auth_con_getauthenticator
+ (krb5_context,
+ krb5_auth_context,
+ krb5_authenticator **);
+
+#define KRB5_REALM_BRANCH_CHAR '.'
+
+/*
+ * end "func-proto.h"
+ */
+
+/*
+ * begin stuff from libos.h
+ */
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_read_message (krb5_context, krb5_pointer, krb5_data *);
+krb5_error_code krb5_write_message (krb5_context, krb5_pointer, krb5_data *);
+int krb5_net_read (krb5_context, int , char *, int);
+int krb5_net_write (krb5_context, int , const char *, int);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_read_password
+ (krb5_context,
+ const char *,
+ const char *,
+ char *,
+ unsigned int * );
+krb5_error_code KRB5_CALLCONV krb5_aname_to_localname
+ (krb5_context,
+ krb5_const_principal,
+ int,
+ char * );
+krb5_error_code KRB5_CALLCONV krb5_get_host_realm
+ (krb5_context,
+ const char *,
+ char *** );
+krb5_error_code KRB5_CALLCONV krb5_free_host_realm
+ (krb5_context,
+ char * const * );
+#if KRB5_PRIVATE
+krb5_error_code KRB5_CALLCONV krb5_get_realm_domain
+ (krb5_context,
+ const char *,
+ char ** );
+#endif
+krb5_boolean KRB5_CALLCONV krb5_kuserok
+ (krb5_context,
+ krb5_principal, const char *);
+krb5_error_code KRB5_CALLCONV krb5_auth_con_genaddrs
+ (krb5_context,
+ krb5_auth_context,
+ int, int);
+#if KRB5_PRIVATE
+krb5_error_code krb5_gen_portaddr
+ (krb5_context,
+ const krb5_address *,
+ krb5_const_pointer,
+ krb5_address **);
+krb5_error_code krb5_gen_replay_name
+ (krb5_context,
+ const krb5_address *,
+ const char *,
+ char **);
+krb5_error_code krb5_make_fulladdr
+ (krb5_context,
+ krb5_address *,
+ krb5_address *,
+ krb5_address *);
+#endif
+
+krb5_error_code KRB5_CALLCONV krb5_set_real_time
+ (krb5_context, krb5_int32, krb5_int32);
+
+#if KRB5_PRIVATE
+krb5_error_code krb5_set_debugging_time
+ (krb5_context, krb5_int32, krb5_int32);
+krb5_error_code krb5_use_natural_time
+ (krb5_context);
+#endif
+krb5_error_code KRB5_CALLCONV krb5_get_time_offsets
+ (krb5_context, krb5_int32 *, krb5_int32 *);
+#if KRB5_PRIVATE
+krb5_error_code krb5_set_time_offsets
+ (krb5_context, krb5_int32, krb5_int32);
+#endif
+
+/* str_conv.c */
+krb5_error_code KRB5_CALLCONV krb5_string_to_enctype
+ (char *, krb5_enctype *);
+krb5_error_code KRB5_CALLCONV krb5_string_to_salttype
+ (char *, krb5_int32 *);
+krb5_error_code KRB5_CALLCONV krb5_string_to_cksumtype
+ (char *, krb5_cksumtype *);
+krb5_error_code KRB5_CALLCONV krb5_string_to_timestamp
+ (char *, krb5_timestamp *);
+krb5_error_code KRB5_CALLCONV krb5_string_to_deltat
+ (char *, krb5_deltat *);
+krb5_error_code KRB5_CALLCONV krb5_enctype_to_string
+ (krb5_enctype, char *, size_t);
+krb5_error_code KRB5_CALLCONV krb5_salttype_to_string
+ (krb5_int32, char *, size_t);
+krb5_error_code KRB5_CALLCONV krb5_cksumtype_to_string
+ (krb5_cksumtype, char *, size_t);
+krb5_error_code KRB5_CALLCONV krb5_timestamp_to_string
+ (krb5_timestamp, char *, size_t);
+krb5_error_code KRB5_CALLCONV krb5_timestamp_to_sfstring
+ (krb5_timestamp, char *, size_t, char *);
+krb5_error_code KRB5_CALLCONV krb5_deltat_to_string
+ (krb5_deltat, char *, size_t);
+
+
+
+/* The name of the Kerberos ticket granting service... and its size */
+#define KRB5_TGS_NAME "krbtgt"
+#define KRB5_TGS_NAME_SIZE 6
+
+/* flags for recvauth */
+#define KRB5_RECVAUTH_SKIP_VERSION 0x0001
+#define KRB5_RECVAUTH_BADAUTHVERS 0x0002
+/* initial ticket api functions */
+
+typedef struct _krb5_prompt {
+ char *prompt;
+ int hidden;
+ krb5_data *reply;
+} krb5_prompt;
+
+typedef krb5_error_code (KRB5_CALLCONV *krb5_prompter_fct)(krb5_context context,
+ void *data,
+ const char *name,
+ const char *banner,
+ int num_prompts,
+ krb5_prompt prompts[]);
+
+
+krb5_error_code KRB5_CALLCONV
+krb5_prompter_posix (krb5_context context,
+ void *data,
+ const char *name,
+ const char *banner,
+ int num_prompts,
+ krb5_prompt prompts[]);
+
+typedef struct _krb5_get_init_creds_opt {
+ krb5_flags flags;
+ krb5_deltat tkt_life;
+ krb5_deltat renew_life;
+ int forwardable;
+ int proxiable;
+ krb5_enctype *etype_list;
+ int etype_list_length;
+ krb5_address **address_list;
+ krb5_preauthtype *preauth_list;
+ int preauth_list_length;
+ krb5_data *salt;
+} krb5_get_init_creds_opt;
+
+#define KRB5_GET_INIT_CREDS_OPT_TKT_LIFE 0x0001
+#define KRB5_GET_INIT_CREDS_OPT_RENEW_LIFE 0x0002
+#define KRB5_GET_INIT_CREDS_OPT_FORWARDABLE 0x0004
+#define KRB5_GET_INIT_CREDS_OPT_PROXIABLE 0x0008
+#define KRB5_GET_INIT_CREDS_OPT_ETYPE_LIST 0x0010
+#define KRB5_GET_INIT_CREDS_OPT_ADDRESS_LIST 0x0020
+#define KRB5_GET_INIT_CREDS_OPT_PREAUTH_LIST 0x0040
+#define KRB5_GET_INIT_CREDS_OPT_SALT 0x0080
+
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_init
+(krb5_get_init_creds_opt *opt);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_tkt_life
+(krb5_get_init_creds_opt *opt,
+ krb5_deltat tkt_life);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_renew_life
+(krb5_get_init_creds_opt *opt,
+ krb5_deltat renew_life);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_forwardable
+(krb5_get_init_creds_opt *opt,
+ int forwardable);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_proxiable
+(krb5_get_init_creds_opt *opt,
+ int proxiable);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_etype_list
+(krb5_get_init_creds_opt *opt,
+ krb5_enctype *etype_list,
+ int etype_list_length);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_address_list
+(krb5_get_init_creds_opt *opt,
+ krb5_address **addresses);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_preauth_list
+(krb5_get_init_creds_opt *opt,
+ krb5_preauthtype *preauth_list,
+ int preauth_list_length);
+
+void KRB5_CALLCONV
+krb5_get_init_creds_opt_set_salt
+(krb5_get_init_creds_opt *opt,
+ krb5_data *salt);
+
+krb5_error_code KRB5_CALLCONV
+krb5_get_init_creds_password
+(krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ char *password,
+ krb5_prompter_fct prompter,
+ void *data,
+ krb5_deltat start_time,
+ char *in_tkt_service,
+ krb5_get_init_creds_opt *k5_gic_options);
+
+krb5_error_code KRB5_CALLCONV
+krb5_get_init_creds_keytab
+(krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ krb5_keytab arg_keytab,
+ krb5_deltat start_time,
+ char *in_tkt_service,
+ krb5_get_init_creds_opt *k5_gic_options);
+
+typedef struct _krb5_verify_init_creds_opt {
+ krb5_flags flags;
+ int ap_req_nofail;
+} krb5_verify_init_creds_opt;
+
+#define KRB5_VERIFY_INIT_CREDS_OPT_AP_REQ_NOFAIL 0x0001
+
+void KRB5_CALLCONV
+krb5_verify_init_creds_opt_init
+(krb5_verify_init_creds_opt *k5_vic_options);
+void KRB5_CALLCONV
+krb5_verify_init_creds_opt_set_ap_req_nofail
+(krb5_verify_init_creds_opt *k5_vic_options,
+ int ap_req_nofail);
+
+krb5_error_code KRB5_CALLCONV
+krb5_verify_init_creds
+(krb5_context context,
+ krb5_creds *creds,
+ krb5_principal ap_req_server,
+ krb5_keytab ap_req_keytab,
+ krb5_ccache *ccache,
+ krb5_verify_init_creds_opt *k5_vic_options);
+
+krb5_error_code KRB5_CALLCONV
+krb5_get_validated_creds
+(krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ krb5_ccache ccache,
+ char *in_tkt_service);
+
+krb5_error_code KRB5_CALLCONV
+krb5_get_renewed_creds
+(krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ krb5_ccache ccache,
+ char *in_tkt_service);
+
+krb5_error_code KRB5_CALLCONV
+krb5_decode_ticket
+(const krb5_data *code,
+ krb5_ticket **rep);
+
+void KRB5_CALLCONV
+krb5_appdefault_string
+(krb5_context context,
+ const char *appname,
+ const krb5_data *realm,
+ const char *option,
+ const char *default_value,
+ char ** ret_value);
+
+void KRB5_CALLCONV
+krb5_appdefault_boolean
+(krb5_context context,
+ const char *appname,
+ const krb5_data *realm,
+ const char *option,
+ int default_value,
+ int *ret_value);
+
+#if KRB5_PRIVATE
+/*
+ * The realm iterator functions
+ */
+
+krb5_error_code KRB5_CALLCONV krb5_realm_iterator_create
+ (krb5_context context, void **iter_p);
+
+krb5_error_code KRB5_CALLCONV krb5_realm_iterator
+ (krb5_context context, void **iter_p, char **ret_realm);
+
+void KRB5_CALLCONV krb5_realm_iterator_free
+ (krb5_context context, void **iter_p);
+
+void KRB5_CALLCONV krb5_free_realm_string
+ (krb5_context context, char *str);
+#endif
+
+/*
+ * Prompter enhancements
+ */
+
+#define KRB5_PROMPT_TYPE_PASSWORD 0x1
+#define KRB5_PROMPT_TYPE_NEW_PASSWORD 0x2
+#define KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN 0x3
+#define KRB5_PROMPT_TYPE_PREAUTH 0x4
+
+typedef krb5_int32 krb5_prompt_type;
+
+krb5_prompt_type* KRB5_CALLCONV krb5_get_prompt_types
+ (krb5_context context);
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import reset
+# endif
+# pragma options align=reset
+#endif
+
+KRB5INT_END_DECLS
+
+/* Don't use this! We're going to phase it out. It's just here to keep
+ applications from breaking right away. */
+#define krb5_const const
+
+#endif /* KRB5_GENERAL__ */
+
+/*
+ * include/krb5_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define KRB5KDC_ERR_NONE (-1765328384L)
+#define KRB5KDC_ERR_NAME_EXP (-1765328383L)
+#define KRB5KDC_ERR_SERVICE_EXP (-1765328382L)
+#define KRB5KDC_ERR_BAD_PVNO (-1765328381L)
+#define KRB5KDC_ERR_C_OLD_MAST_KVNO (-1765328380L)
+#define KRB5KDC_ERR_S_OLD_MAST_KVNO (-1765328379L)
+#define KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN (-1765328378L)
+#define KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN (-1765328377L)
+#define KRB5KDC_ERR_PRINCIPAL_NOT_UNIQUE (-1765328376L)
+#define KRB5KDC_ERR_NULL_KEY (-1765328375L)
+#define KRB5KDC_ERR_CANNOT_POSTDATE (-1765328374L)
+#define KRB5KDC_ERR_NEVER_VALID (-1765328373L)
+#define KRB5KDC_ERR_POLICY (-1765328372L)
+#define KRB5KDC_ERR_BADOPTION (-1765328371L)
+#define KRB5KDC_ERR_ETYPE_NOSUPP (-1765328370L)
+#define KRB5KDC_ERR_SUMTYPE_NOSUPP (-1765328369L)
+#define KRB5KDC_ERR_PADATA_TYPE_NOSUPP (-1765328368L)
+#define KRB5KDC_ERR_TRTYPE_NOSUPP (-1765328367L)
+#define KRB5KDC_ERR_CLIENT_REVOKED (-1765328366L)
+#define KRB5KDC_ERR_SERVICE_REVOKED (-1765328365L)
+#define KRB5KDC_ERR_TGT_REVOKED (-1765328364L)
+#define KRB5KDC_ERR_CLIENT_NOTYET (-1765328363L)
+#define KRB5KDC_ERR_SERVICE_NOTYET (-1765328362L)
+#define KRB5KDC_ERR_KEY_EXP (-1765328361L)
+#define KRB5KDC_ERR_PREAUTH_FAILED (-1765328360L)
+#define KRB5KDC_ERR_PREAUTH_REQUIRED (-1765328359L)
+#define KRB5KDC_ERR_SERVER_NOMATCH (-1765328358L)
+#define KRB5PLACEHOLD_27 (-1765328357L)
+#define KRB5PLACEHOLD_28 (-1765328356L)
+#define KRB5PLACEHOLD_29 (-1765328355L)
+#define KRB5PLACEHOLD_30 (-1765328354L)
+#define KRB5KRB_AP_ERR_BAD_INTEGRITY (-1765328353L)
+#define KRB5KRB_AP_ERR_TKT_EXPIRED (-1765328352L)
+#define KRB5KRB_AP_ERR_TKT_NYV (-1765328351L)
+#define KRB5KRB_AP_ERR_REPEAT (-1765328350L)
+#define KRB5KRB_AP_ERR_NOT_US (-1765328349L)
+#define KRB5KRB_AP_ERR_BADMATCH (-1765328348L)
+#define KRB5KRB_AP_ERR_SKEW (-1765328347L)
+#define KRB5KRB_AP_ERR_BADADDR (-1765328346L)
+#define KRB5KRB_AP_ERR_BADVERSION (-1765328345L)
+#define KRB5KRB_AP_ERR_MSG_TYPE (-1765328344L)
+#define KRB5KRB_AP_ERR_MODIFIED (-1765328343L)
+#define KRB5KRB_AP_ERR_BADORDER (-1765328342L)
+#define KRB5KRB_AP_ERR_ILL_CR_TKT (-1765328341L)
+#define KRB5KRB_AP_ERR_BADKEYVER (-1765328340L)
+#define KRB5KRB_AP_ERR_NOKEY (-1765328339L)
+#define KRB5KRB_AP_ERR_MUT_FAIL (-1765328338L)
+#define KRB5KRB_AP_ERR_BADDIRECTION (-1765328337L)
+#define KRB5KRB_AP_ERR_METHOD (-1765328336L)
+#define KRB5KRB_AP_ERR_BADSEQ (-1765328335L)
+#define KRB5KRB_AP_ERR_INAPP_CKSUM (-1765328334L)
+#define KRB5KRB_AP_PATH_NOT_ACCEPTED (-1765328333L)
+#define KRB5KRB_ERR_RESPONSE_TOO_BIG (-1765328332L)
+#define KRB5PLACEHOLD_53 (-1765328331L)
+#define KRB5PLACEHOLD_54 (-1765328330L)
+#define KRB5PLACEHOLD_55 (-1765328329L)
+#define KRB5PLACEHOLD_56 (-1765328328L)
+#define KRB5PLACEHOLD_57 (-1765328327L)
+#define KRB5PLACEHOLD_58 (-1765328326L)
+#define KRB5PLACEHOLD_59 (-1765328325L)
+#define KRB5KRB_ERR_GENERIC (-1765328324L)
+#define KRB5KRB_ERR_FIELD_TOOLONG (-1765328323L)
+#define KRB5PLACEHOLD_62 (-1765328322L)
+#define KRB5PLACEHOLD_63 (-1765328321L)
+#define KRB5PLACEHOLD_64 (-1765328320L)
+#define KRB5PLACEHOLD_65 (-1765328319L)
+#define KRB5PLACEHOLD_66 (-1765328318L)
+#define KRB5PLACEHOLD_67 (-1765328317L)
+#define KRB5PLACEHOLD_68 (-1765328316L)
+#define KRB5PLACEHOLD_69 (-1765328315L)
+#define KRB5PLACEHOLD_70 (-1765328314L)
+#define KRB5PLACEHOLD_71 (-1765328313L)
+#define KRB5PLACEHOLD_72 (-1765328312L)
+#define KRB5PLACEHOLD_73 (-1765328311L)
+#define KRB5PLACEHOLD_74 (-1765328310L)
+#define KRB5PLACEHOLD_75 (-1765328309L)
+#define KRB5PLACEHOLD_76 (-1765328308L)
+#define KRB5PLACEHOLD_77 (-1765328307L)
+#define KRB5PLACEHOLD_78 (-1765328306L)
+#define KRB5PLACEHOLD_79 (-1765328305L)
+#define KRB5PLACEHOLD_80 (-1765328304L)
+#define KRB5PLACEHOLD_81 (-1765328303L)
+#define KRB5PLACEHOLD_82 (-1765328302L)
+#define KRB5PLACEHOLD_83 (-1765328301L)
+#define KRB5PLACEHOLD_84 (-1765328300L)
+#define KRB5PLACEHOLD_85 (-1765328299L)
+#define KRB5PLACEHOLD_86 (-1765328298L)
+#define KRB5PLACEHOLD_87 (-1765328297L)
+#define KRB5PLACEHOLD_88 (-1765328296L)
+#define KRB5PLACEHOLD_89 (-1765328295L)
+#define KRB5PLACEHOLD_90 (-1765328294L)
+#define KRB5PLACEHOLD_91 (-1765328293L)
+#define KRB5PLACEHOLD_92 (-1765328292L)
+#define KRB5PLACEHOLD_93 (-1765328291L)
+#define KRB5PLACEHOLD_94 (-1765328290L)
+#define KRB5PLACEHOLD_95 (-1765328289L)
+#define KRB5PLACEHOLD_96 (-1765328288L)
+#define KRB5PLACEHOLD_97 (-1765328287L)
+#define KRB5PLACEHOLD_98 (-1765328286L)
+#define KRB5PLACEHOLD_99 (-1765328285L)
+#define KRB5PLACEHOLD_100 (-1765328284L)
+#define KRB5PLACEHOLD_101 (-1765328283L)
+#define KRB5PLACEHOLD_102 (-1765328282L)
+#define KRB5PLACEHOLD_103 (-1765328281L)
+#define KRB5PLACEHOLD_104 (-1765328280L)
+#define KRB5PLACEHOLD_105 (-1765328279L)
+#define KRB5PLACEHOLD_106 (-1765328278L)
+#define KRB5PLACEHOLD_107 (-1765328277L)
+#define KRB5PLACEHOLD_108 (-1765328276L)
+#define KRB5PLACEHOLD_109 (-1765328275L)
+#define KRB5PLACEHOLD_110 (-1765328274L)
+#define KRB5PLACEHOLD_111 (-1765328273L)
+#define KRB5PLACEHOLD_112 (-1765328272L)
+#define KRB5PLACEHOLD_113 (-1765328271L)
+#define KRB5PLACEHOLD_114 (-1765328270L)
+#define KRB5PLACEHOLD_115 (-1765328269L)
+#define KRB5PLACEHOLD_116 (-1765328268L)
+#define KRB5PLACEHOLD_117 (-1765328267L)
+#define KRB5PLACEHOLD_118 (-1765328266L)
+#define KRB5PLACEHOLD_119 (-1765328265L)
+#define KRB5PLACEHOLD_120 (-1765328264L)
+#define KRB5PLACEHOLD_121 (-1765328263L)
+#define KRB5PLACEHOLD_122 (-1765328262L)
+#define KRB5PLACEHOLD_123 (-1765328261L)
+#define KRB5PLACEHOLD_124 (-1765328260L)
+#define KRB5PLACEHOLD_125 (-1765328259L)
+#define KRB5PLACEHOLD_126 (-1765328258L)
+#define KRB5PLACEHOLD_127 (-1765328257L)
+#define KRB5_ERR_RCSID (-1765328256L)
+#define KRB5_LIBOS_BADLOCKFLAG (-1765328255L)
+#define KRB5_LIBOS_CANTREADPWD (-1765328254L)
+#define KRB5_LIBOS_BADPWDMATCH (-1765328253L)
+#define KRB5_LIBOS_PWDINTR (-1765328252L)
+#define KRB5_PARSE_ILLCHAR (-1765328251L)
+#define KRB5_PARSE_MALFORMED (-1765328250L)
+#define KRB5_CONFIG_CANTOPEN (-1765328249L)
+#define KRB5_CONFIG_BADFORMAT (-1765328248L)
+#define KRB5_CONFIG_NOTENUFSPACE (-1765328247L)
+#define KRB5_BADMSGTYPE (-1765328246L)
+#define KRB5_CC_BADNAME (-1765328245L)
+#define KRB5_CC_UNKNOWN_TYPE (-1765328244L)
+#define KRB5_CC_NOTFOUND (-1765328243L)
+#define KRB5_CC_END (-1765328242L)
+#define KRB5_NO_TKT_SUPPLIED (-1765328241L)
+#define KRB5KRB_AP_WRONG_PRINC (-1765328240L)
+#define KRB5KRB_AP_ERR_TKT_INVALID (-1765328239L)
+#define KRB5_PRINC_NOMATCH (-1765328238L)
+#define KRB5_KDCREP_MODIFIED (-1765328237L)
+#define KRB5_KDCREP_SKEW (-1765328236L)
+#define KRB5_IN_TKT_REALM_MISMATCH (-1765328235L)
+#define KRB5_PROG_ETYPE_NOSUPP (-1765328234L)
+#define KRB5_PROG_KEYTYPE_NOSUPP (-1765328233L)
+#define KRB5_WRONG_ETYPE (-1765328232L)
+#define KRB5_PROG_SUMTYPE_NOSUPP (-1765328231L)
+#define KRB5_REALM_UNKNOWN (-1765328230L)
+#define KRB5_SERVICE_UNKNOWN (-1765328229L)
+#define KRB5_KDC_UNREACH (-1765328228L)
+#define KRB5_NO_LOCALNAME (-1765328227L)
+#define KRB5_MUTUAL_FAILED (-1765328226L)
+#define KRB5_RC_TYPE_EXISTS (-1765328225L)
+#define KRB5_RC_MALLOC (-1765328224L)
+#define KRB5_RC_TYPE_NOTFOUND (-1765328223L)
+#define KRB5_RC_UNKNOWN (-1765328222L)
+#define KRB5_RC_REPLAY (-1765328221L)
+#define KRB5_RC_IO (-1765328220L)
+#define KRB5_RC_NOIO (-1765328219L)
+#define KRB5_RC_PARSE (-1765328218L)
+#define KRB5_RC_IO_EOF (-1765328217L)
+#define KRB5_RC_IO_MALLOC (-1765328216L)
+#define KRB5_RC_IO_PERM (-1765328215L)
+#define KRB5_RC_IO_IO (-1765328214L)
+#define KRB5_RC_IO_UNKNOWN (-1765328213L)
+#define KRB5_RC_IO_SPACE (-1765328212L)
+#define KRB5_TRANS_CANTOPEN (-1765328211L)
+#define KRB5_TRANS_BADFORMAT (-1765328210L)
+#define KRB5_LNAME_CANTOPEN (-1765328209L)
+#define KRB5_LNAME_NOTRANS (-1765328208L)
+#define KRB5_LNAME_BADFORMAT (-1765328207L)
+#define KRB5_CRYPTO_INTERNAL (-1765328206L)
+#define KRB5_KT_BADNAME (-1765328205L)
+#define KRB5_KT_UNKNOWN_TYPE (-1765328204L)
+#define KRB5_KT_NOTFOUND (-1765328203L)
+#define KRB5_KT_END (-1765328202L)
+#define KRB5_KT_NOWRITE (-1765328201L)
+#define KRB5_KT_IOERR (-1765328200L)
+#define KRB5_NO_TKT_IN_RLM (-1765328199L)
+#define KRB5DES_BAD_KEYPAR (-1765328198L)
+#define KRB5DES_WEAK_KEY (-1765328197L)
+#define KRB5_BAD_ENCTYPE (-1765328196L)
+#define KRB5_BAD_KEYSIZE (-1765328195L)
+#define KRB5_BAD_MSIZE (-1765328194L)
+#define KRB5_CC_TYPE_EXISTS (-1765328193L)
+#define KRB5_KT_TYPE_EXISTS (-1765328192L)
+#define KRB5_CC_IO (-1765328191L)
+#define KRB5_FCC_PERM (-1765328190L)
+#define KRB5_FCC_NOFILE (-1765328189L)
+#define KRB5_FCC_INTERNAL (-1765328188L)
+#define KRB5_CC_WRITE (-1765328187L)
+#define KRB5_CC_NOMEM (-1765328186L)
+#define KRB5_CC_FORMAT (-1765328185L)
+#define KRB5_CC_NOT_KTYPE (-1765328184L)
+#define KRB5_INVALID_FLAGS (-1765328183L)
+#define KRB5_NO_2ND_TKT (-1765328182L)
+#define KRB5_NOCREDS_SUPPLIED (-1765328181L)
+#define KRB5_SENDAUTH_BADAUTHVERS (-1765328180L)
+#define KRB5_SENDAUTH_BADAPPLVERS (-1765328179L)
+#define KRB5_SENDAUTH_BADRESPONSE (-1765328178L)
+#define KRB5_SENDAUTH_REJECTED (-1765328177L)
+#define KRB5_PREAUTH_BAD_TYPE (-1765328176L)
+#define KRB5_PREAUTH_NO_KEY (-1765328175L)
+#define KRB5_PREAUTH_FAILED (-1765328174L)
+#define KRB5_RCACHE_BADVNO (-1765328173L)
+#define KRB5_CCACHE_BADVNO (-1765328172L)
+#define KRB5_KEYTAB_BADVNO (-1765328171L)
+#define KRB5_PROG_ATYPE_NOSUPP (-1765328170L)
+#define KRB5_RC_REQUIRED (-1765328169L)
+#define KRB5_ERR_BAD_HOSTNAME (-1765328168L)
+#define KRB5_ERR_HOST_REALM_UNKNOWN (-1765328167L)
+#define KRB5_SNAME_UNSUPP_NAMETYPE (-1765328166L)
+#define KRB5KRB_AP_ERR_V4_REPLY (-1765328165L)
+#define KRB5_REALM_CANT_RESOLVE (-1765328164L)
+#define KRB5_TKT_NOT_FORWARDABLE (-1765328163L)
+#define KRB5_FWD_BAD_PRINCIPAL (-1765328162L)
+#define KRB5_GET_IN_TKT_LOOP (-1765328161L)
+#define KRB5_CONFIG_NODEFREALM (-1765328160L)
+#define KRB5_SAM_UNSUPPORTED (-1765328159L)
+#define KRB5_SAM_INVALID_ETYPE (-1765328158L)
+#define KRB5_SAM_NO_CHECKSUM (-1765328157L)
+#define KRB5_SAM_BAD_CHECKSUM (-1765328156L)
+#define KRB5_KT_NAME_TOOLONG (-1765328155L)
+#define KRB5_KT_KVNONOTFOUND (-1765328154L)
+#define KRB5_APPL_EXPIRED (-1765328153L)
+#define KRB5_LIB_EXPIRED (-1765328152L)
+#define KRB5_CHPW_PWDNULL (-1765328151L)
+#define KRB5_CHPW_FAIL (-1765328150L)
+#define KRB5_KT_FORMAT (-1765328149L)
+#define KRB5_NOPERM_ETYPE (-1765328148L)
+#define KRB5_CONFIG_ETYPE_NOSUPP (-1765328147L)
+#define KRB5_OBSOLETE_FN (-1765328146L)
+#define KRB5_EAI_FAIL (-1765328145L)
+#define KRB5_EAI_NODATA (-1765328144L)
+#define KRB5_EAI_NONAME (-1765328143L)
+#define KRB5_EAI_SERVICE (-1765328142L)
+#define KRB5_ERR_NUMERIC_REALM (-1765328141L)
+#define KRB5_ERR_BAD_S2K_PARAMS (-1765328140L)
+#define KRB5_ERR_NO_SERVICE (-1765328139L)
+#define KRB5_CC_READONLY (-1765328138L)
+#define KRB5_CC_NOSUPP (-1765328137L)
+#define ERROR_TABLE_BASE_krb5 (-1765328384L)
+
+extern const struct error_table et_krb5_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_krb5_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_krb5_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_krb5_err_tbl initialize_krb5_error_table
+#define krb5_err_base ERROR_TABLE_BASE_krb5
+#endif
+/*
+ * include/kdb5_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define KRB5_KDB_RCSID (-1780008448L)
+#define KRB5_KDB_INUSE (-1780008447L)
+#define KRB5_KDB_UK_SERROR (-1780008446L)
+#define KRB5_KDB_UK_RERROR (-1780008445L)
+#define KRB5_KDB_UNAUTH (-1780008444L)
+#define KRB5_KDB_NOENTRY (-1780008443L)
+#define KRB5_KDB_ILL_WILDCARD (-1780008442L)
+#define KRB5_KDB_DB_INUSE (-1780008441L)
+#define KRB5_KDB_DB_CHANGED (-1780008440L)
+#define KRB5_KDB_TRUNCATED_RECORD (-1780008439L)
+#define KRB5_KDB_RECURSIVELOCK (-1780008438L)
+#define KRB5_KDB_NOTLOCKED (-1780008437L)
+#define KRB5_KDB_BADLOCKMODE (-1780008436L)
+#define KRB5_KDB_DBNOTINITED (-1780008435L)
+#define KRB5_KDB_DBINITED (-1780008434L)
+#define KRB5_KDB_ILLDIRECTION (-1780008433L)
+#define KRB5_KDB_NOMASTERKEY (-1780008432L)
+#define KRB5_KDB_BADMASTERKEY (-1780008431L)
+#define KRB5_KDB_INVALIDKEYSIZE (-1780008430L)
+#define KRB5_KDB_CANTREAD_STORED (-1780008429L)
+#define KRB5_KDB_BADSTORED_MKEY (-1780008428L)
+#define KRB5_KDB_CANTLOCK_DB (-1780008427L)
+#define KRB5_KDB_DB_CORRUPT (-1780008426L)
+#define KRB5_KDB_BAD_VERSION (-1780008425L)
+#define KRB5_KDB_BAD_SALTTYPE (-1780008424L)
+#define KRB5_KDB_BAD_ENCTYPE (-1780008423L)
+#define KRB5_KDB_BAD_CREATEFLAGS (-1780008422L)
+#define KRB5_KDB_NO_PERMITTED_KEY (-1780008421L)
+#define KRB5_KDB_NO_MATCHING_KEY (-1780008420L)
+#define ERROR_TABLE_BASE_kdb5 (-1780008448L)
+
+extern const struct error_table et_kdb5_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_kdb5_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_kdb5_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_kdb5_err_tbl initialize_kdb5_error_table
+#define kdb5_err_base ERROR_TABLE_BASE_kdb5
+#endif
+/*
+ * include/kv5m_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define KV5M_NONE (-1760647424L)
+#define KV5M_PRINCIPAL (-1760647423L)
+#define KV5M_DATA (-1760647422L)
+#define KV5M_KEYBLOCK (-1760647421L)
+#define KV5M_CHECKSUM (-1760647420L)
+#define KV5M_ENCRYPT_BLOCK (-1760647419L)
+#define KV5M_ENC_DATA (-1760647418L)
+#define KV5M_CRYPTOSYSTEM_ENTRY (-1760647417L)
+#define KV5M_CS_TABLE_ENTRY (-1760647416L)
+#define KV5M_CHECKSUM_ENTRY (-1760647415L)
+#define KV5M_AUTHDATA (-1760647414L)
+#define KV5M_TRANSITED (-1760647413L)
+#define KV5M_ENC_TKT_PART (-1760647412L)
+#define KV5M_TICKET (-1760647411L)
+#define KV5M_AUTHENTICATOR (-1760647410L)
+#define KV5M_TKT_AUTHENT (-1760647409L)
+#define KV5M_CREDS (-1760647408L)
+#define KV5M_LAST_REQ_ENTRY (-1760647407L)
+#define KV5M_PA_DATA (-1760647406L)
+#define KV5M_KDC_REQ (-1760647405L)
+#define KV5M_ENC_KDC_REP_PART (-1760647404L)
+#define KV5M_KDC_REP (-1760647403L)
+#define KV5M_ERROR (-1760647402L)
+#define KV5M_AP_REQ (-1760647401L)
+#define KV5M_AP_REP (-1760647400L)
+#define KV5M_AP_REP_ENC_PART (-1760647399L)
+#define KV5M_RESPONSE (-1760647398L)
+#define KV5M_SAFE (-1760647397L)
+#define KV5M_PRIV (-1760647396L)
+#define KV5M_PRIV_ENC_PART (-1760647395L)
+#define KV5M_CRED (-1760647394L)
+#define KV5M_CRED_INFO (-1760647393L)
+#define KV5M_CRED_ENC_PART (-1760647392L)
+#define KV5M_PWD_DATA (-1760647391L)
+#define KV5M_ADDRESS (-1760647390L)
+#define KV5M_KEYTAB_ENTRY (-1760647389L)
+#define KV5M_CONTEXT (-1760647388L)
+#define KV5M_OS_CONTEXT (-1760647387L)
+#define KV5M_ALT_METHOD (-1760647386L)
+#define KV5M_ETYPE_INFO_ENTRY (-1760647385L)
+#define KV5M_DB_CONTEXT (-1760647384L)
+#define KV5M_AUTH_CONTEXT (-1760647383L)
+#define KV5M_KEYTAB (-1760647382L)
+#define KV5M_RCACHE (-1760647381L)
+#define KV5M_CCACHE (-1760647380L)
+#define KV5M_PREAUTH_OPS (-1760647379L)
+#define KV5M_SAM_CHALLENGE (-1760647378L)
+#define KV5M_SAM_CHALLENGE_2 (-1760647377L)
+#define KV5M_SAM_KEY (-1760647376L)
+#define KV5M_ENC_SAM_RESPONSE_ENC (-1760647375L)
+#define KV5M_ENC_SAM_RESPONSE_ENC_2 (-1760647374L)
+#define KV5M_SAM_RESPONSE (-1760647373L)
+#define KV5M_SAM_RESPONSE_2 (-1760647372L)
+#define KV5M_PREDICTED_SAM_RESPONSE (-1760647371L)
+#define KV5M_PASSWD_PHRASE_ELEMENT (-1760647370L)
+#define KV5M_GSS_OID (-1760647369L)
+#define KV5M_GSS_QUEUE (-1760647368L)
+#define ERROR_TABLE_BASE_kv5m (-1760647424L)
+
+extern const struct error_table et_kv5m_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_kv5m_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_kv5m_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_kv5m_err_tbl initialize_kv5m_error_table
+#define kv5m_err_base ERROR_TABLE_BASE_kv5m
+#endif
+/*
+ * include/krb524_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define KRB524_BADKEY (-1750206208L)
+#define KRB524_BADADDR (-1750206207L)
+#define KRB524_BADPRINC (-1750206206L)
+#define KRB524_BADREALM (-1750206205L)
+#define KRB524_V4ERR (-1750206204L)
+#define KRB524_ENCFULL (-1750206203L)
+#define KRB524_DECEMPTY (-1750206202L)
+#define KRB524_NOTRESP (-1750206201L)
+#define KRB524_KRB4_DISABLED (-1750206200L)
+#define ERROR_TABLE_BASE_k524 (-1750206208L)
+
+extern const struct error_table et_k524_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_k524_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_k524_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_k524_err_tbl initialize_k524_error_table
+#define k524_err_base ERROR_TABLE_BASE_k524
+#endif
+/*
+ * include/asn1_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define ASN1_BAD_TIMEFORMAT (1859794432L)
+#define ASN1_MISSING_FIELD (1859794433L)
+#define ASN1_MISPLACED_FIELD (1859794434L)
+#define ASN1_TYPE_MISMATCH (1859794435L)
+#define ASN1_OVERFLOW (1859794436L)
+#define ASN1_OVERRUN (1859794437L)
+#define ASN1_BAD_ID (1859794438L)
+#define ASN1_BAD_LENGTH (1859794439L)
+#define ASN1_BAD_FORMAT (1859794440L)
+#define ASN1_PARSE_ERROR (1859794441L)
+#define ASN1_BAD_GMTIME (1859794442L)
+#define ASN1_MISMATCH_INDEF (1859794443L)
+#define ASN1_MISSING_EOC (1859794444L)
+#define ERROR_TABLE_BASE_asn1 (1859794432L)
+
+extern const struct error_table et_asn1_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_asn1_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_asn1_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_asn1_err_tbl initialize_asn1_error_table
+#define asn1_err_base ERROR_TABLE_BASE_asn1
+#endif
--- /dev/null
+/*
+ * profile.h
+ */
+
+#ifndef _KRB5_PROFILE_H
+#define _KRB5_PROFILE_H
+
+#if defined(_WIN32)
+#include <win-mac.h>
+#endif
+
+#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
+# include <TargetConditionals.h>
+# if TARGET_RT_MAC_CFM
+# error "Use KfM 4.0 SDK headers for CFM compilation."
+# endif
+#endif
+
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#define KRB5_CALLCONV_C
+#endif
+
+typedef struct _profile_t *profile_t;
+
+/*
+ * Used by the profile iterator in prof_get.c
+ */
+#define PROFILE_ITER_LIST_SECTION 0x0001
+#define PROFILE_ITER_SECTIONS_ONLY 0x0002
+#define PROFILE_ITER_RELATIONS_ONLY 0x0004
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import on
+# endif
+#endif
+
+typedef char* profile_filespec_t; /* path as C string */
+typedef char* profile_filespec_list_t; /* list of : separated paths, C string */
+typedef const char * const_profile_filespec_t; /* path as C string */
+typedef const char * const_profile_filespec_list_t; /* list of : separated paths, C string */
+
+long KRB5_CALLCONV profile_init
+ (const_profile_filespec_t *files, profile_t *ret_profile);
+
+long KRB5_CALLCONV profile_init_path
+ (const_profile_filespec_list_t filelist, profile_t *ret_profile);
+
+long KRB5_CALLCONV profile_flush
+ (profile_t profile);
+
+void KRB5_CALLCONV profile_abandon
+ (profile_t profile);
+
+void KRB5_CALLCONV profile_release
+ (profile_t profile);
+
+long KRB5_CALLCONV profile_get_values
+ (profile_t profile, const char *const *names, char ***ret_values);
+
+void KRB5_CALLCONV profile_free_list
+ (char **list);
+
+long KRB5_CALLCONV profile_get_string
+ (profile_t profile, const char *name, const char *subname,
+ const char *subsubname, const char *def_val,
+ char **ret_string);
+long KRB5_CALLCONV profile_get_integer
+ (profile_t profile, const char *name, const char *subname,
+ const char *subsubname, int def_val,
+ int *ret_default);
+
+long KRB5_CALLCONV profile_get_boolean
+ (profile_t profile, const char *name, const char *subname,
+ const char *subsubname, int def_val,
+ int *ret_default);
+
+long KRB5_CALLCONV profile_get_relation_names
+ (profile_t profile, const char **names, char ***ret_names);
+
+long KRB5_CALLCONV profile_get_subsection_names
+ (profile_t profile, const char **names, char ***ret_names);
+
+long KRB5_CALLCONV profile_iterator_create
+ (profile_t profile, const char **names,
+ int flags, void **ret_iter);
+
+void KRB5_CALLCONV profile_iterator_free
+ (void **iter_p);
+
+long KRB5_CALLCONV profile_iterator
+ (void **iter_p, char **ret_name, char **ret_value);
+
+void KRB5_CALLCONV profile_release_string (char *str);
+
+long KRB5_CALLCONV profile_update_relation
+ (profile_t profile, const char **names,
+ const char *old_value, const char *new_value);
+
+long KRB5_CALLCONV profile_clear_relation
+ (profile_t profile, const char **names);
+
+long KRB5_CALLCONV profile_rename_section
+ (profile_t profile, const char **names,
+ const char *new_name);
+
+long KRB5_CALLCONV profile_add_relation
+ (profile_t profile, const char **names,
+ const char *new_value);
+
+#if TARGET_OS_MAC
+# if defined(__MWERKS__)
+# pragma import reset
+# endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _KRB5_PROFILE_H */
+/*
+ * util/profile/prof_err.h:
+ * This file is automatically generated; please do not edit it.
+ */
+
+#include <com_err.h>
+
+#define PROF_VERSION (-1429577728L)
+#define PROF_MAGIC_NODE (-1429577727L)
+#define PROF_NO_SECTION (-1429577726L)
+#define PROF_NO_RELATION (-1429577725L)
+#define PROF_ADD_NOT_SECTION (-1429577724L)
+#define PROF_SECTION_WITH_VALUE (-1429577723L)
+#define PROF_BAD_LINK_LIST (-1429577722L)
+#define PROF_BAD_GROUP_LVL (-1429577721L)
+#define PROF_BAD_PARENT_PTR (-1429577720L)
+#define PROF_MAGIC_ITERATOR (-1429577719L)
+#define PROF_SET_SECTION_VALUE (-1429577718L)
+#define PROF_EINVAL (-1429577717L)
+#define PROF_READ_ONLY (-1429577716L)
+#define PROF_SECTION_NOTOP (-1429577715L)
+#define PROF_SECTION_SYNTAX (-1429577714L)
+#define PROF_RELATION_SYNTAX (-1429577713L)
+#define PROF_EXTRA_CBRACE (-1429577712L)
+#define PROF_MISSING_OBRACE (-1429577711L)
+#define PROF_MAGIC_PROFILE (-1429577710L)
+#define PROF_MAGIC_SECTION (-1429577709L)
+#define PROF_TOPSECTION_ITER_NOSUPP (-1429577708L)
+#define PROF_INVALID_SECTION (-1429577707L)
+#define PROF_END_OF_SECTIONS (-1429577706L)
+#define PROF_BAD_NAMESET (-1429577705L)
+#define PROF_NO_PROFILE (-1429577704L)
+#define PROF_MAGIC_FILE (-1429577703L)
+#define PROF_FAIL_OPEN (-1429577702L)
+#define PROF_EXISTS (-1429577701L)
+#define PROF_BAD_BOOLEAN (-1429577700L)
+#define PROF_BAD_INTEGER (-1429577699L)
+#define PROF_MAGIC_FILE_DATA (-1429577698L)
+#define ERROR_TABLE_BASE_prof (-1429577728L)
+
+extern const struct error_table et_prof_error_table;
+
+#if !defined(_WIN32)
+/* for compatibility with older versions... */
+extern void initialize_prof_error_table () /*@modifies internalState@*/;
+#else
+#define initialize_prof_error_table()
+#endif
+
+#if !defined(_WIN32)
+#define init_prof_err_tbl initialize_prof_error_table
+#define prof_err_base ERROR_TABLE_BASE_prof
+#endif
--- /dev/null
+/*
+ * This file is now only used on Windows
+ */
+
+/*
+ * type functions split out of here to make things look nicer in the
+ * various include files which need these definitions, as well as in
+ * the util/ directories.
+ */
+
+#ifndef _KRB5_WIN_MAC_H
+#define _KRB5_WIN_MAC_H
+
+#ifdef _WIN32
+
+#define ID_READ_PWD_DIALOG 10000
+#define ID_READ_PWD_PROMPT 10001
+#define ID_READ_PWD_PROMPT2 10002
+#define ID_READ_PWD_PWD 10003
+
+#ifdef RES_ONLY
+
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include <windows.h>
+
+#else /* ! RES_ONLY */
+
+#define SIZEOF_INT 4
+#define SIZEOF_SHORT 2
+#define SIZEOF_LONG 4
+
+#include <windows.h>
+#include <limits.h>
+
+#define HAVE_LABS
+
+#ifndef SIZE_MAX /* in case Microsoft defines max size of size_t */
+#define SIZE_MAX UINT_MAX
+#endif
+
+#ifndef KRB5_CALLCONV
+# define KRB5_CALLCONV __stdcall
+# define KRB5_CALLCONV_C __cdecl
+
+/*
+ * Use this to mark an incorrect calling convention that has been
+ * "immortalized" because it was incorrectly exported in a previous
+ * release.
+ */
+
+# define KRB5_CALLCONV_WRONG KRB5_CALLCONV_C
+
+#endif /* !KRB5_CALLCONV */
+
+#ifndef KRB5_SYSTYPES__
+#define KRB5_SYSTYPES__
+#include <sys/types.h>
+typedef unsigned long u_long; /* Not part of sys/types.h on the pc */
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+typedef unsigned char u_char;
+#endif /* KRB5_SYSTYPES__ */
+
+#define MAXHOSTNAMELEN 512
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 256 /* Also for Windows temp files */
+#endif
+
+#define HAVE_NETINET_IN_H
+#define MSDOS_FILESYSTEM
+#define HAVE_STRING_H
+#define HAVE_SRAND
+#define HAVE_ERRNO
+#define HAVE_STRDUP
+#define NO_USERID
+#define NO_PASSWORD
+
+#define WM_KERBEROS5_CHANGED "Kerberos5 Changed"
+#ifdef KRB4
+#define WM_KERBEROS_CHANGED "Kerberos Changed"
+#endif
+
+/* Kerberos Windows initialization file */
+#define KERBEROS_INI "kerberos.ini"
+#ifdef CYGNUS
+#define KERBEROS_HLP "kerbnet.hlp"
+#else
+#define KERBEROS_HLP "krb5clnt.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 */
+#else
+#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
+#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"
+
+#define HAS_VOID_TYPE
+#define HAVE_STDARG_H
+#define HAVE_SYS_TYPES_H
+#define HAVE_STDLIB_H
+
+/* This controls which encryption routines libcrypto will provide */
+#define PROVIDE_DES_CBC_MD5
+#define PROVIDE_DES_CBC_CRC
+#define PROVIDE_DES_CBC_RAW
+#define PROVIDE_DES_CBC_CKSUM
+#define PROVIDE_CRC32
+#define PROVIDE_RSA_MD4
+#define PROVIDE_RSA_MD5
+/* #define PROVIDE_DES3_CBC_SHA */
+/* #define PROVIDE_DES3_CBC_RAW */
+/* #define PROVIDE_NIST_SHA */
+
+/* Ugly. Microsoft, in stdc mode, doesn't support the low-level i/o
+ * routines directly. Rather, they only export the _<function> version.
+ * The following defines works around this problem.
+ */
+#include <sys\types.h>
+#include <sys\stat.h>
+#include <fcntl.h>
+#include <io.h>
+#include <process.h>
+
+#ifdef NEED_SYSERROR
+/* Only needed by util/et/error_message.c but let's keep the source clean */
+#define sys_nerr _sys_nerr
+#define sys_errlist _sys_errlist
+#endif
+
+/*
+ * Functions with slightly different names on the PC
+ */
+#ifndef strcasecmp
+#define strcasecmp stricmp
+#endif
+#ifndef strncasecmp
+#define strncasecmp strnicmp
+#endif
+
+HINSTANCE get_lib_instance(void);
+
+#endif /* !RES_ONLY */
+
+#endif /* _WIN32 */
+
+#define THREEPARAMOPEN(x,y,z) open(x,y,z)
+
+#ifndef KRB5_CALLCONV
+#define KRB5_CALLCONV
+#endif
+
+#ifndef KRB5_CALLCONV_C
+#define KRB5_CALLCONV_C
+#endif
+
+#endif /* _KRB5_WIN_MAC_H */
--- /dev/null
+/*
+ * $Id$
+ *
+ * Copyright 1997 by the Regents of the University of Michigan
+ *
+ * This software is being provided to you, the LICENSEE, by the
+ * Regents of the University of Michigan (UM) under the following
+ * license. By obtaining, using and/or copying this software, you agree
+ * that you have read, understood, and will comply with these terms and
+ * conditions:
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee or royalty is hereby
+ * granted, provided that you agree to comply with the following copyright
+ * notice and statements, including the disclaimer, and that the same
+ * appear on ALL copies of the software and documentation, including
+ * modifications that you make for internal use or for distribution:
+ *
+ * Copyright 1997 by the Regents of the University of Michigan.
+ * All rights reserved.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS", AND UM MAKES NO REPRESENTATIONS
+ * OR WARRANTIES, EXPRESS OR IMPLIED. By way of example, but not
+ * limitation, UM MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY
+ * OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED
+ * SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,
+ * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+ *
+ * The name of the University of Michigan or UM may NOT be used in
+ * advertising or publicity pertaining to distribution of the software.
+ * Title to copyright in this software and any associated documentation
+ * shall at all times remain with UM, and USER agrees to preserve same.
+ *
+ * The University of Michigan
+ * c/o Steve Rothwell <sgr@umich.edu>
+ * 535 W. William Street
+ * Ann Arbor, Michigan 48013-4943
+ * U.S.A.
+ */
+
+/*
+** CacheAPI.h
+**
+** The externally visible functions and data structures
+** for the Kerberos Common Cache DLL
+** This should be the ONLY externally visible file.
+** This is ALL anyone should need to call the API.
+**
+**
+*/
+
+#ifndef Krb_CCacheAPI_h_
+#define Krb_CCacheAPI_h_
+
+#include <windows.h>
+
+//typedef int cc_int32;
+#define cc_int32 long
+#define cc_uint32 unsigned long
+
+typedef cc_int32 cc_time_t;
+
+#define CC_API_VER_1 1
+#define CC_API_VER_2 2
+
+//enum {
+// CC_API_VER_1 = 1,
+// CC_API_VER_2 = 2
+//};
+
+#define CCACHE_API __declspec(dllexport) cc_int32
+
+/*
+** The Official Error Codes
+*/
+#define CC_NOERROR 0
+#define CC_BADNAME 1
+#define CC_NOTFOUND 2
+#define CC_END 3
+#define CC_IO 4
+#define CC_WRITE 5
+#define CC_NOMEM 6
+#define CC_FORMAT 7
+#define CC_LOCKED 8
+#define CC_BAD_API_VERSION 9
+#define CC_NO_EXIST 10
+#define CC_NOT_SUPP 11
+#define CC_BAD_PARM 12
+#define CC_ERR_CACHE_ATTACH 13
+#define CC_ERR_CACHE_RELEASE 14
+#define CC_ERR_CACHE_FULL 15
+#define CC_ERR_CRED_VERSION 16
+
+\f
+/*
+** types, structs, & constants
+*/
+// Flag bits promised by Ted "RSN"
+#define CC_FLAGS_RESERVED 0xFFFFFFFF
+
+typedef cc_uint32 cc_nc_flags; // set via constants above
+
+typedef struct opaque_dll_control_block_type* apiCB;
+typedef struct opaque_ccache_pointer_type* ccache_p;
+typedef struct opaque_credential_iterator_type* ccache_cit;
+
+#if 0
+enum _cc_data_type {
+ type_ticket = 0, /* 0 for ticket, second_ticket */
+ /* Ted's draft spec says these are to be
+ "as defined in the Kerberos V5 protocol"
+ all I can find are typdefs,
+ can't find an enumerated type or #define
+ */
+ type_address, /* = <"as defined in the Kerberos V5 protocol"> */
+ type_authdata, /* = <"as defined in the Kerberos V5 protocol"> */
+ type_encryption, /* = <"as defined in the Kerberos V5 protocol"> */
+ cc_data_type_max /* for validation */
+};
+#endif
+
+typedef struct _cc_data
+{
+ cc_uint32 type; // should be one of _cc_data_type
+ cc_uint32 length;
+ unsigned char* data; // the proverbial bag-o-bits
+} cc_data;
+
+// V5 Credentials
+typedef struct _cc_creds {
+ char* client;
+ char* server;
+ cc_data keyblock;
+ cc_time_t authtime;
+ cc_time_t starttime;
+ cc_time_t endtime;
+ cc_time_t renew_till;
+ cc_uint32 is_skey;
+ cc_uint32 ticket_flags;
+ cc_data FAR ** addresses;
+ cc_data ticket;
+ cc_data second_ticket;
+ cc_data FAR ** authdata;
+} cc_creds;
+
+\f
+// begin V4 stuff
+// use an enumerated type so all callers infer the same meaning
+// these values are what krbv4win uses internally.
+#define STK_AFS 0
+#define STK_DES 1
+
+// K4 uses a MAX_KTXT_LEN of 1250 to hold a ticket
+// K95 uses 256
+// To be safe I'll use the larger number, but a factor of 5!!!
+#define MAX_V4_CRED_LEN 1250
+
+// V4 Credentials
+
+enum {
+ KRB_NAME_SZ = 40,
+ KRB_INSTANCE_SZ = 40,
+ KRB_REALM_SZ = 40
+};
+
+typedef struct cc_V4credential {
+ unsigned char kversion;
+ char principal[KRB_NAME_SZ + 1];
+ char principal_instance[KRB_INSTANCE_SZ + 1];
+ char service[KRB_NAME_SZ + 1];
+ char service_instance[KRB_INSTANCE_SZ + 1];
+ char realm[KRB_REALM_SZ + 1];
+ unsigned char session_key[8];
+ cc_int32 kvno; // k95 used BYTE skvno
+ cc_int32 str_to_key; // k4 infers dynamically, k95 stores
+ long issue_date; // k95 called this issue_time
+ cc_int32 lifetime; // k95 used LONG expiration_time
+ cc_uint32 address; // IP Address of local host
+ cc_int32 ticket_sz; // k95 used BYTE, k4 ktext uses int to hold up to 1250
+ unsigned char ticket[MAX_V4_CRED_LEN];
+ unsigned long oops; // zero to catch runaways
+} V4Cred_type;
+
+enum {
+ CC_CRED_VUNKNOWN = 0, // For validation
+ CC_CRED_V4 = 1,
+ CC_CRED_V5 = 2,
+ CC_CRED_VMAX = 3 // For validation
+};
+
+typedef union cred_ptr_union_type {
+ V4Cred_type* pV4Cred;
+ cc_creds* pV5Cred;
+} cred_ptr_union;
+
+typedef struct cred_union_type {
+ cc_int32 cred_type;
+ cred_ptr_union cred;
+} cred_union;
+
+typedef struct _infoNC {
+ char* name;
+ char* principal;
+ cc_int32 vers;
+} infoNC;
+
+\f
+/*
+** The official (externally visible) API
+*/
+
+#ifdef __cplusplus
+extern "C" /* this entire list of functions */
+{
+#endif /* __cplusplus */
+
+/*
+** Main cache routines : initialize, shutdown, get_cache_names, & get_change_time
+*/
+CCACHE_API
+cc_initialize(
+ apiCB** cc_ctx, // < DLL's primary control structure.
+ // returned here, passed everywhere else
+ cc_int32 api_version, // > ver supported by caller (use CC_API_VER_1)
+ cc_int32* api_supported, // < if ~NULL, max ver supported by DLL
+ const char** vendor // < if ~NULL, vendor name in read only C string
+ );
+
+CCACHE_API
+cc_shutdown(
+ apiCB** cc_ctx // <> DLL's primary control structure. NULL after call.
+ );
+
+CCACHE_API
+cc_get_change_time(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ cc_time_t* time // < time of last change to main cache
+ );
+
+\f
+/*
+** Named Cache (NC) routines
+** create, open, close, destroy, get_principal, get_cred_version, &
+** lock_request
+**
+** Multiple NCs are allowed within the main cache. Each has a Name
+** and kerberos version # (V4 or V5). Caller gets "ccache_ptr"s for
+** NCs.
+*/
+CCACHE_API
+cc_create(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const char* name, // > name of cache to be [destroyed if exists, then] created
+ const char* principal,
+ cc_int32 vers, // > ticket version (CC_CRED_V4 or CC_CRED_V5)
+ cc_uint32 cc_flags, // > options
+ ccache_p** ccache_ptr // < NC control structure
+ );
+
+CCACHE_API
+cc_open(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const char* name, // > name of pre-created cache
+ cc_int32 vers, // > ticket version (CC_CRED_V4 or CC_CRED_V5)
+ cc_uint32 cc_flags, // > options
+ ccache_p** ccache_ptr // < NC control structure
+ );
+
+CCACHE_API
+cc_close(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ ccache_p** ccache_ptr // <> NC control structure. NULL after call.
+ );
+
+CCACHE_API
+cc_destroy(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ ccache_p** ccache_ptr // <> NC control structure. NULL after call.
+ );
+
+/*
+** Ways to get information about the NCs
+*/
+
+CCACHE_API
+cc_seq_fetch_NCs_begin(
+ apiCB* cc_ctx,
+ ccache_cit** itNCs
+ );
+
+CCACHE_API
+cc_seq_fetch_NCs_end(
+ apiCB* cc_ctx,
+ ccache_cit** itNCs
+ );
+
+CCACHE_API
+cc_seq_fetch_NCs_next(
+ apiCB* cc_ctx,
+ ccache_p** ccache_ptr,
+ ccache_cit* itNCs
+ );
+
+CCACHE_API
+cc_seq_fetch_NCs(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ ccache_p** ccache_ptr, // < NC control structure (free via cc_close())
+ ccache_cit** itNCs // <> iterator used by DLL,
+ // set to NULL before first call
+ // returned NULL at CC_END
+ );
+
+CCACHE_API
+cc_get_NC_info(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ struct _infoNC*** ppNCi // < (NULL before call) null terminated,
+ // list of a structs (free via cc_free_infoNC())
+ );
+
+CCACHE_API
+cc_free_NC_info(
+ apiCB* cc_ctx,
+ struct _infoNC*** ppNCi // < free list of structs returned by
+ // cc_get_cache_names(). set to NULL on return
+ );
+
+/*
+** Functions that provide distinguishing characteristics of NCs.
+*/
+
+CCACHE_API
+cc_get_name(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const ccache_p* ccache_ptr, // > NC control structure
+ char** name // < name of NC associated with ccache_ptr
+ // (free via cc_free_name())
+ );
+
+CCACHE_API
+cc_set_principal(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const ccache_p* ccache_pointer, // > NC control structure
+ const cc_int32 vers,
+ const char* principal // > name of principal associated with NC
+ // Free via cc_free_principal()
+ );
+
+CCACHE_API
+cc_get_principal(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const ccache_p* ccache_pointer, // > NC control structure
+ char** principal // < name of principal associated with NC
+ // Free via cc_free_principal()
+ );
+
+CCACHE_API
+cc_get_cred_version(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const ccache_p* ccache_ptr, // > NC control structure
+ cc_int32* vers // < ticket version associated with NC
+ );
+
+#define CC_LOCK_UNLOCK 1
+#define CC_LOCK_READER 2
+#define CC_LOCK_WRITER 3
+#define CC_LOCK_NOBLOCK 16
+
+CCACHE_API
+cc_lock_request(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const ccache_p* ccache_ptr, // > NC control structure
+ const cc_int32 lock_type // > one (or combination) of above defined
+ // lock types
+ );
+
+\f
+/*
+** Credentials routines (work within an NC)
+** store, remove_cred, seq_fetch_creds
+*/
+CCACHE_API
+cc_store(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ ccache_p* ccache_ptr, // > NC control structure
+ const cred_union creds // > credentials to be copied into NC
+ );
+
+CCACHE_API
+cc_remove_cred(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ ccache_p* ccache_ptr, // > NC control structure
+ const cred_union cred // > credentials to remove from NC
+ );
+
+CCACHE_API
+cc_seq_fetch_creds(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ const ccache_p* ccache_ptr, // > NC control structure
+ cred_union** creds, // < filled in by DLL, free via cc_free_creds()
+ ccache_cit** itCreds // <> iterator used by DLL, set to NULL
+ // before first call -- Also NULL for final
+ // call if loop ends before CC_END
+ );
+
+CCACHE_API
+cc_seq_fetch_creds_begin(
+ apiCB* cc_ctx,
+ const ccache_p* ccache_ptr,
+ ccache_cit** itCreds
+ );
+
+CCACHE_API
+cc_seq_fetch_creds_end(
+ apiCB* cc_ctx,
+ ccache_cit** itCreds
+ );
+
+CCACHE_API
+cc_seq_fetch_creds_next(
+ apiCB* cc_ctx,
+ cred_union** cred,
+ ccache_cit* itCreds
+ );
+
+/*
+** methods of liberation,
+** or freeing space via the free that goes with the malloc used to get it
+** It's important to use the free carried in the DLL, not the one supplied
+** by your compiler vendor.
+**
+** freeing a NULL pointer is not treated as an error
+*/
+CCACHE_API
+cc_free_principal(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ char** principal // <> ptr to principal to be freed, returned as NULL
+ // (from cc_get_principal())
+ );
+
+CCACHE_API
+cc_free_name(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ char** name // <> ptr to name to be freed, returned as NULL
+ // (from cc_get_name())
+ );
+
+CCACHE_API
+cc_free_creds(
+ apiCB* cc_ctx, // > DLL's primary control structure
+ cred_union** pCred // <> cred (from cc_seq_fetch_creds()) to be freed
+ // Returned as NULL.
+ );
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif /* __cplusplus */
+
+#endif /* Krb_CCacheAPI_h_ */
--- /dev/null
+/*
+ * leasherr.h
+ * This file is the #include file for leasherr.et.
+ * Please do not edit it as it is automatically generated.
+ */
+
+#define LSH_ONLYONEME (40591872L)
+#define LSH_INVPRINCIPAL (40591873L)
+#define LSH_FAILEDREALM (40591874L)
+#define LSH_INVINSTANCE (40591875L)
+#define LSH_INVREALM (40591876L)
+#define LSH_EOF (40591877L)
+#define LSH_EXPIRESOON (40591878L)
+#define LSH_NOMATCH (40591879L)
+#define LSH_BADCHARS (40591880L)
+#define LSH_FATAL_ERROR (40591881L)
+#define LSH_BADWINSOCK (40591882L)
+#define LSH_BADTIMESERV (40591883L)
+#define LSH_NOSOCKET (40591884L)
+#define LSH_NOCONNECT (40591885L)
+#define LSH_TIMEFAILED (40591886L)
+#define LSH_GETTIMEOFDAY (40591887L)
+#define LSH_SETTIMEOFDAY (40591888L)
+#define LSH_RECVTIME (40591889L)
+#define LSH_RECVBYTES (40591890L)
+#define LSH_ALREADY_SETTIME (40591891L)
+extern void initialize_lsh_error_table(struct et_list **);
+#define ERROR_TABLE_BASE_lsh (40591872L)
+
+/* for compatibility with older versions... */
+#define init_lsh_err_tbl() initialize_lsh_error_table(&_et_list)
+#define lsh_err_base ERROR_TABLE_BASE_lsh
--- /dev/null
+#define LSH_TIME_HOST 1970
+#define LSH_DEFAULT_TICKET_LIFE 1971
--- /dev/null
+#ifndef __LEASHWIN__
+#define __LEASHWIN__
+
+#include <krb.h>
+
+typedef struct {
+ int dlgtype;
+#define DLGTYPE_PASSWD 0
+#define DLGTYPE_CHPASSWD 1
+ // Tells whether dialog box is in change pwd more or init ticket mode???
+ // (verify this):
+ int dlgstatemax; // What is this???
+ // The title on the Dialog box - for Renewing or Initializing:
+ LPSTR title;
+ LPSTR principal;
+} LSH_DLGINFO, FAR *LPLSH_DLGINFO;
+
+#define LEASH_USERNAME_SZ 64
+#define LEASH_REALM_SZ 192
+
+typedef struct {
+ DWORD size;
+ int dlgtype;
+#define DLGTYPE_PASSWD 0
+#define DLGTYPE_CHPASSWD 1
+ // Tells whether dialog box is in change pwd more or init ticket mode???
+ // (verify this):
+ LPSTR title;
+ LPSTR username;
+ LPSTR realm;
+ int use_defaults;
+ int forwardable;
+ int noaddresses;
+ int lifetime;
+ int renew_till;
+ int proxiable;
+ int publicip;
+ // Version 1 of this structure ended here
+ struct {
+ char username[LEASH_USERNAME_SZ];
+ char realm[LEASH_REALM_SZ];
+ } out;
+} LSH_DLGINFO_EX, FAR *LPLSH_DLGINFO_EX;
+
+#define LSH_DLGINFO_EX_V1_SZ (sizeof(DWORD) + 3 * sizeof(LPSTR) * 8 * sizeof(int))
+
+typedef struct {
+ char principal[MAX_K_NAME_SZ]; /* Principal name/instance/realm */
+ int btickets; /* Do we have tickets? */
+ long lifetime; /* Lifetime -- needs to have
+ room for 255 5-minute
+ periods * 5 * 60 */
+ long issue_date; /* The issue time */
+ long renew_till; /* The Renew time (k5 only) */
+} TICKETINFO;
+
+int FAR Leash_kinit_dlg(HWND hParent, LPLSH_DLGINFO lpdlginfo);
+int FAR Leash_kinit_dlg_ex(HWND hParent, LPLSH_DLGINFO_EX lpdlginfoex);
+int FAR Leash_changepwd_dlg(HWND hParent, LPLSH_DLGINFO lpdlginfo);
+int FAR Leash_changepwd_dlg_ex(HWND hParent, LPLSH_DLGINFO_EX lpdlginfo);
+
+long FAR Leash_checkpwd(char *principal, char *password);
+long FAR Leash_changepwd(char *principal, char *password, char *newpassword, char** result_string);
+long FAR Leash_kinit(char *principal, char *password, int lifetime);
+long FAR Leash_kinit_ex(char * principal, char * password, int lifetime,
+ int forwardable, int proxiable, int renew_life,
+ int addressless, unsigned long publicIP);
+
+long FAR Leash_klist(HWND hlist, TICKETINFO FAR *ticketinfo);
+long FAR Leash_kdestroy(void);
+long FAR Leash_get_lsh_errno( LONG FAR *err_val);
+
+long FAR Leash_renew(void);
+long FAR Leash_importable(void);
+long FAR Leash_import(void);
+
+BOOL Leash_set_help_file( char FAR *szHelpFile );
+LPSTR Leash_get_help_file(void);
+
+void Leash_reset_defaults(void);
+
+#define NO_TICKETS 0
+#define EXPD_TICKETS 2
+#define GOOD_TICKETS 1
+
+/* Leash Configuration functions - alters Current User Registry */
+DWORD Leash_get_default_lifetime();
+DWORD Leash_set_default_lifetime(DWORD minutes);
+DWORD Leash_reset_default_lifetime();
+DWORD Leash_get_default_renew_till();
+DWORD Leash_set_default_renew_till(DWORD minutes);
+DWORD Leash_reset_default_renew_till();
+DWORD Leash_get_default_renewable();
+DWORD Leash_set_default_renewable(DWORD onoff);
+DWORD Leash_reset_default_renewable();
+DWORD Leash_get_default_forwardable();
+DWORD Leash_set_default_forwardable(DWORD onoff);
+DWORD Leash_reset_default_forwardable();
+DWORD Leash_get_default_noaddresses();
+DWORD Leash_set_default_noaddresses(DWORD onoff);
+DWORD Leash_reset_default_noaddresses();
+DWORD Leash_get_default_proxiable();
+DWORD Leash_set_default_proxiable(DWORD onoff);
+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();
+DWORD Leash_get_default_life_min();
+DWORD Leash_set_default_life_min(DWORD minutes);
+DWORD Leash_reset_default_life_min();
+DWORD Leash_get_default_life_max();
+DWORD Leash_set_default_life_max(DWORD minutes);
+DWORD Leash_reset_default_life_max();
+DWORD Leash_get_default_renew_min();
+DWORD Leash_set_default_renew_min(DWORD minutes);
+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();
+
+#endif /* LEASHWIN */
--- /dev/null
+#ifndef __LOADFUNCS_AFS_H__
+#define __LOADFUNCS_AFS_H__
+
+#include "loadfuncs.h"
+
+#define AFSTOKENS_DLL "libafstokens.dll"
+#define AFSCONF_DLL "libafsconf.dll"
+
+#define CALLCONV_C
+typedef long cm_configProc_t(void *, struct sockaddr_in *, char *);
+
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_ListTokens,
+ (int, int *, struct ktc_principal *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_GetToken,
+ (struct ktc_principal *, struct ktc_token *, int, struct ktc_principal *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_SetToken,
+ (struct ktc_principal *, struct ktc_principal *, struct ktc_token *, int)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_ForgetAllTokens,
+ ()
+ );
+
+
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ cm_SearchCellFile,
+ (char *, cm_configProc_t *, void *)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ cm_GetRootCellName,
+ (char *)
+ );
+
+#endif /* __LOADFUNCS_AFS_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_AFS36_H__
+#define __LOADFUNCS_AFS36_H__
+
+#include "loadfuncs.h"
+
+#define AFSTOKENS_DLL "afsauthent.dll"
+#define AFSCONF_DLL "libafsconf.dll"
+
+#define CALLCONV_C
+typedef long cm_configProc_t(void *, struct sockaddr_in *, char *);
+
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_ListTokens,
+ (int, int *, struct ktc_principal *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_GetToken,
+ (struct ktc_principal *, struct ktc_token *, int, struct ktc_principal *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_SetToken,
+ (struct ktc_principal *, struct ktc_token *, struct ktc_principal *, int)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ ktc_ForgetAllTokens,
+ ()
+ );
+
+
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ cm_SearchCellFile,
+ (char *, char *, cm_configProc_t *, void *)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ cm_GetRootCellName,
+ (char *)
+ );
+
+#endif /* __LOADFUNCS_AFS_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_COM_ERR_H__
+#define __LOADFUNCS_COM_ERR_H__
+
+#include "loadfuncs.h"
+#include <com_err.h>
+
+#define COMERR_DLL "comerr32.dll"
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV_C,
+ com_err,
+ (const char FAR *, errcode_t, const char FAR *, ...)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ com_err_va,
+ (const char FAR *whoami, errcode_t code, const char FAR *fmt, va_list ap)
+ );
+TYPEDEF_FUNC(
+ const char FAR *,
+ KRB5_CALLCONV,
+ error_message,
+ (errcode_t)
+ );
+TYPEDEF_FUNC(
+ errcode_t,
+ KRB5_CALLCONV,
+ add_error_table,
+ (const struct error_table FAR *)
+ );
+TYPEDEF_FUNC(
+ errcode_t,
+ KRB5_CALLCONV,
+ remove_error_table,
+ (const struct error_table FAR *)
+ );
+
+#endif /* __LOADFUNCS_COM_ERR_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_KRB_H__
+#define __LOADFUNCS_KRB_H__
+
+#include "loadfuncs.h"
+#include <krb.h>
+
+#define KRB4_DLL "krbv4w32.dll"
+
+#define krb_err_text(status) pget_krb_err_txt_entry(status)
+#define CALLCONV_C
+
+TYPEDEF_FUNC(
+ char *,
+ CALLCONV_C,
+ tkt_string,
+ ()
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ gettimeofday,
+ (struct timeval *tv, struct timezone *tz)
+ );
+TYPEDEF_FUNC(
+ int,
+ PASCAL,
+ krb_sendauth,
+ (long, int, KTEXT, char *, char *, char *,
+ unsigned long, MSG_DAT *, CREDENTIALS *,
+ Key_schedule *, struct sockaddr_in *,
+ struct sockaddr_in FAR *, char *)
+ );
+TYPEDEF_FUNC(
+ int,
+ PASCAL,
+ krb_mk_req,
+ (KTEXT, char *, char *, char *, long)
+ );
+TYPEDEF_FUNC(
+ char *,
+ PASCAL,
+ krb_getrealm,
+ (char *host)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_get_tf_fullname,
+ (char FAR *, char FAR *, char FAR *, char FAR *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_get_tf_realm,
+ (char FAR *,char FAR *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ tf_init,
+ (char FAR*,int)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ LocalHostAddr,
+ ()
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ tf_get_pname,
+ (char FAR*)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ tf_get_pinst,
+ (char FAR*)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ tf_get_cred,
+ (CREDENTIALS FAR*)
+ );
+TYPEDEF_FUNC(
+ void,
+ CALLCONV_C,
+ tf_close,
+ (void)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ tf_save_cred,
+ (char FAR*,char FAR*,char FAR*,C_Block,int,int,KTEXT,long)
+ );
+TYPEDEF_FUNC(
+ BOOL,
+ CALLCONV_C,
+ k_isinst,
+ (char FAR *s)
+ );
+TYPEDEF_FUNC(
+ BOOL,
+ CALLCONV_C,
+ k_isrealm,
+ (char FAR *s)
+ );
+TYPEDEF_FUNC(
+ BOOL,
+ CALLCONV_C,
+ k_isname,
+ (char FAR *s)
+ );
+
+TYPEDEF_FUNC(
+ char **,
+ CALLCONV_C,
+ get_krb_err_txt,
+ (void)
+ );
+
+/* Warning, unique to Windows! */
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ set_krb_debug,
+ (int)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ set_krb_ap_req_debug,
+ (int)
+ );
+TYPEDEF_FUNC(
+ char *,
+ PASCAL,
+ get_krb_err_txt_entry,
+ (int i)
+ );
+TYPEDEF_FUNC(
+ char *,
+ CALLCONV_C,
+ krb_err_func,
+ (int offset, long code)
+ );
+TYPEDEF_FUNC(
+ int,
+ PASCAL,
+ k_decomp_ticket,
+ (KTEXT, unsigned char *, char *, char *, char *,
+ unsigned long *, C_Block, int *, unsigned long *,
+ char *, char *, C_Block, Key_schedule)
+ );
+TYPEDEF_FUNC(
+ int,
+ PASCAL,
+ krb_mk_req,
+ (KTEXT,char *,char *,char *,long)
+ );
+TYPEDEF_FUNC(
+ char *,
+ PASCAL,
+ krb_getrealm,
+ (char *host)
+ );
+TYPEDEF_FUNC(
+ char *,
+ PASCAL,
+ krb_realmofhost,
+ (char *host)
+ );
+TYPEDEF_FUNC(
+ char *,
+ CALLCONV_C,
+ krb_get_phost,
+ (char *host)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ kname_parse,
+ (char *, char *, char *, char *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_get_pw_in_tkt,
+ (char *, char *, char *, char *, char *, int, char *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ dest_tkt,
+ (void)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_get_lrealm,
+ (char *, int)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_check_serv,
+ (char*)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_get_cred,
+ (char *, char *, char *, CREDENTIALS *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ send_to_kdc,
+ (KTEXT, KTEXT, char *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ create_ciph,
+ (KTEXT, C_Block, char *, char *, char *, unsigned long, int,
+ KTEXT, unsigned long, C_Block *)
+ );
+TYPEDEF_FUNC(
+ char *,
+ CALLCONV_C,
+ krb_get_krbconf2,
+ (char *, size_t *)
+ );
+TYPEDEF_FUNC(
+ char *,
+ CALLCONV_C,
+ krb_get_krbrealm2,
+ (char *, size_t *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_in_tkt,
+ (char *, char *, char *)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_save_credentials,
+ (char *, char *, char *, C_Block, int, int, KTEXT, long)
+ );
+
+/* NOT IN krb.h HEADER: */
+
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ k_gethostname,
+ (char FAR*, int)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ krb_get_krbhst,
+ (char *, char *, int)
+ );
+TYPEDEF_FUNC(
+ void,
+ CALLCONV_C,
+ krb_set_tkt_string,
+ (char *)
+ );
+
+/* Evil incarnate... */
+
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ kadm_change_your_password,
+ (LPSTR principal, LPSTR old_password,
+ LPSTR new_password, HANDLE FAR * hInfo_desc)
+ );
+TYPEDEF_FUNC(
+ void,
+ CALLCONV_C,
+ initialize_krb_error_func,
+ (void* func, HANDLE *__et_list)
+ );
+TYPEDEF_FUNC(
+ void,
+ CALLCONV_C,
+ initialize_kadm_error_table,
+ (HANDLE *__et_list)
+ );
+TYPEDEF_FUNC(
+ LONG,
+ CALLCONV_C,
+ lsh_LoadKrb4LeashErrorTables,
+ (HMODULE hLeashDll, INT useCallBackFunction)
+ );
+
+#endif /* __LOADFUNCS_KRB_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_KRB5_H__
+#define __LOADFUNCS_KRB5_H__
+
+#include "loadfuncs.h"
+#include <krb5.h>
+
+#define KRB5_DLL "krb5_32.dll"
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_principal,
+ (krb5_context, krb5_principal)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_authenticator,
+ (krb5_context, krb5_authenticator * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_authenticator_contents,
+ (krb5_context, krb5_authenticator * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_addresses,
+ (krb5_context, krb5_address * * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_address,
+ (krb5_context, krb5_address * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_authdata,
+ (krb5_context, krb5_authdata * * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_enc_tkt_part,
+ (krb5_context, krb5_enc_tkt_part * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_ticket,
+ (krb5_context, krb5_ticket * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_tickets,
+ (krb5_context, krb5_ticket * * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_kdc_req,
+ (krb5_context, krb5_kdc_req * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_kdc_rep,
+ (krb5_context, krb5_kdc_rep * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_last_req,
+ (krb5_context, krb5_last_req_entry * * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_enc_kdc_rep_part,
+ (krb5_context, krb5_enc_kdc_rep_part * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_error,
+ (krb5_context, krb5_error * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_ap_req,
+ (krb5_context, krb5_ap_req * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_ap_rep,
+ (krb5_context, krb5_ap_rep * )
+ );
+
+/* Removed around the time of krb5_rc_* change... */
+#if 0
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_safe,
+ (krb5_context, krb5_safe * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_priv,
+ (krb5_context, krb5_priv * )
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_priv_enc_part,
+ (krb5_context, krb5_priv_enc_part * )
+ );
+#endif
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_cred,
+ (krb5_context, krb5_cred *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_creds,
+ (krb5_context, krb5_creds *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_cred_contents,
+ (krb5_context, krb5_creds *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_cred_enc_part,
+ (krb5_context, krb5_cred_enc_part *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_checksum,
+ (krb5_context, krb5_checksum *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_checksum_contents,
+ (krb5_context, krb5_checksum *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_keyblock,
+ (krb5_context, krb5_keyblock *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_keyblock_contents,
+ (krb5_context, krb5_keyblock *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_pa_data,
+ (krb5_context, krb5_pa_data * *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_ap_rep_enc_part,
+ (krb5_context, krb5_ap_rep_enc_part *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_tkt_authent,
+ (krb5_context, krb5_tkt_authent *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_pwd_data,
+ (krb5_context, krb5_pwd_data *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_pwd_sequences,
+ (krb5_context, passwd_phrase_element * *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_data,
+ (krb5_context, krb5_data *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_data_contents,
+ (krb5_context, krb5_data *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_unparsed_name,
+ (krb5_context, char *)
+ );
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_cksumtypes,
+ (krb5_context, krb5_cksumtype *)
+ );
+
+/* ------------------------------------------------------------------------- */
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_encrypt,
+ (krb5_context context, const krb5_keyblock *key,
+ krb5_keyusage usage, const krb5_data *ivec,
+ const krb5_data *input, krb5_enc_data *output)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_decrypt,
+ (krb5_context context, const krb5_keyblock *key,
+ krb5_keyusage usage, const krb5_data *ivec,
+ const krb5_enc_data *input, krb5_data *output)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_encrypt_length,
+ (krb5_context context, krb5_enctype enctype,
+ size_t inputlen, size_t *length)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_block_size,
+ (krb5_context context, krb5_enctype enctype,
+ size_t *blocksize)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_make_random_key,
+ (krb5_context context, krb5_enctype enctype,
+ krb5_keyblock *random_key)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_random_make_octets,
+ (krb5_context context, krb5_data *data)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_random_seed,
+ (krb5_context context, krb5_data *data)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_string_to_key,
+ (krb5_context context, krb5_enctype enctype,
+ const krb5_data *string, const krb5_data *salt,
+ krb5_keyblock *key)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_enctype_compare,
+ (krb5_context context, krb5_enctype e1, krb5_enctype e2,
+ krb5_boolean *similar)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_make_checksum,
+ (krb5_context context, krb5_cksumtype cksumtype,
+ const krb5_keyblock *key, krb5_keyusage usage,
+ const krb5_data *input, krb5_checksum *cksum)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_verify_checksum,
+ (krb5_context context,
+ const krb5_keyblock *key, krb5_keyusage usage,
+ const krb5_data *data,
+ const krb5_checksum *cksum,
+ krb5_boolean *valid)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_checksum_length,
+ (krb5_context context, krb5_cksumtype cksumtype,
+ size_t *length)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_c_keyed_checksum_types,
+ (krb5_context context, krb5_enctype enctype,
+ unsigned int *count, krb5_cksumtype **cksumtypes)
+ );
+
+/* ------------------------------------------------------------------------- */
+
+TYPEDEF_FUNC(
+ krb5_boolean,
+ KRB5_CALLCONV,
+ valid_enctype,
+ (const krb5_enctype ktype)
+ );
+
+TYPEDEF_FUNC(
+ krb5_boolean,
+ KRB5_CALLCONV,
+ valid_cksumtype,
+ (const krb5_cksumtype ctype)
+ );
+
+TYPEDEF_FUNC(
+ krb5_boolean,
+ KRB5_CALLCONV,
+ is_coll_proof_cksum,
+ (const krb5_cksumtype ctype)
+ );
+
+TYPEDEF_FUNC(
+ krb5_boolean,
+ KRB5_CALLCONV,
+ is_keyed_cksum,
+ (const krb5_cksumtype ctype)
+ );
+
+/* ------------------------------------------------------------------------- */
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_init_context,
+ (krb5_context *)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_context,
+ (krb5_context)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_decrypt_tkt_part,
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_ticket * )
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_tgt_creds,
+ (krb5_context,
+ krb5_creds ** )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_credentials,
+ (krb5_context,
+ const krb5_flags,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_creds * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_credentials_validate,
+ (krb5_context,
+ const krb5_flags,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_creds * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_credentials_renew,
+ (krb5_context,
+ const krb5_flags,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_creds * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_req,
+ (krb5_context,
+ krb5_auth_context *,
+ const krb5_flags,
+ char *,
+ char *,
+ krb5_data *,
+ krb5_ccache,
+ krb5_data * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_req_extended,
+ (krb5_context,
+ krb5_auth_context *,
+ const krb5_flags,
+ krb5_data *,
+ krb5_creds *,
+ krb5_data * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_rep,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_rep,
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_ap_rep_enc_part * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_error,
+ (krb5_context,
+ const krb5_error *,
+ krb5_data * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_error,
+ (krb5_context,
+ const krb5_data *,
+ krb5_error * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_safe,
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_priv,
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_parse_name,
+ (krb5_context,
+ const char *,
+ krb5_principal * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_unparse_name,
+ (krb5_context,
+ krb5_const_principal,
+ char * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_unparse_name_ext,
+ (krb5_context,
+ krb5_const_principal,
+ char * *,
+ int *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_set_principal_realm,
+ (krb5_context, krb5_principal, const char *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_boolean,
+ KRB5_CALLCONV,
+ krb5_principal_compare,
+ (krb5_context,
+ krb5_const_principal,
+ krb5_const_principal)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_keyblock,
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_keyblock * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_keyblock_contents,
+ (krb5_context,
+ const krb5_keyblock *,
+ krb5_keyblock *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_creds,
+ (krb5_context,
+ const krb5_creds *,
+ krb5_creds * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_data,
+ (krb5_context,
+ const krb5_data *,
+ krb5_data * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_principal,
+ (krb5_context,
+ krb5_const_principal,
+ krb5_principal *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_addr,
+ (krb5_context,
+ const krb5_address *,
+ krb5_address * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_addresses,
+ (krb5_context,
+ krb5_address * const *,
+ krb5_address * * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_ticket,
+ (krb5_context,
+ const krb5_ticket *,
+ krb5_ticket * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_authdata,
+ (krb5_context,
+ krb5_authdata * const *,
+ krb5_authdata * * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_authenticator,
+ (krb5_context,
+ const krb5_authenticator *,
+ krb5_authenticator * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_copy_checksum,
+ (krb5_context,
+ const krb5_checksum *,
+ krb5_checksum * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_server_rcache,
+ (krb5_context,
+ const krb5_data *, krb5_rcache *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV_C,
+ krb5_build_principal_ext,
+ (krb5_context, krb5_principal *, int, const char *, ...)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV_C,
+ krb5_build_principal,
+ (krb5_context, krb5_principal *, int, const char *, ...)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_425_conv_principal,
+ (krb5_context,
+ const char *name,
+ const char *instance, const char *realm,
+ krb5_principal *princ)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_524_conv_principal,
+ (krb5_context context, const krb5_principal princ,
+ char *name, char *inst, char *realm)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_chpw_req,
+ (krb5_context context, krb5_auth_context auth_context,
+ krb5_data *ap_req, char *passwd, krb5_data *packet)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_chpw_rep,
+ (krb5_context context, krb5_auth_context auth_context,
+ krb5_data *packet, int *result_code,
+ krb5_data *result_data)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_chpw_result_code_string,
+ (krb5_context context, int result_code,
+ char **result_codestr)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_register,
+ (krb5_context,
+ struct _krb5_kt_ops * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_resolve,
+ (krb5_context,
+ const char *,
+ krb5_keytab * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_default_name,
+ (krb5_context,
+ char *,
+ int )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_default,
+ (krb5_context,
+ krb5_keytab * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_free_entry,
+ (krb5_context,
+ krb5_keytab_entry * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_remove_entry,
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_add_entry,
+ (krb5_context,
+ krb5_keytab,
+ krb5_keytab_entry * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_resolve,
+ (krb5_context,
+ const char *,
+ krb5_ccache * )
+ );
+
+TYPEDEF_FUNC(
+ const char*,
+ KRB5_CALLCONV,
+ krb5_cc_default_name,
+ (krb5_context)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_set_default_name,
+ (krb5_context, const char *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_default,
+ (krb5_context,
+ krb5_ccache *)
+ );
+
+TYPEDEF_FUNC(
+ unsigned int,
+ KRB5_CALLCONV,
+ krb5_get_notification_message,
+ (void)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_copy_creds,
+ (krb5_context context,
+ krb5_ccache incc,
+ krb5_ccache outcc)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_us_timeofday,
+ (krb5_context,
+ krb5_int32 *,
+ krb5_int32 * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_timeofday,
+ (krb5_context,
+ krb5_int32 * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_os_localaddr,
+ (krb5_context,
+ krb5_address * * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_default_realm,
+ (krb5_context,
+ char * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_set_default_realm,
+ (krb5_context,
+ const char * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_sname_to_principal,
+ (krb5_context,
+ const char *,
+ const char *,
+ krb5_int32,
+ krb5_principal *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_change_password,
+ (krb5_context context, krb5_creds *creds, char *newpw,
+ int *result_code, krb5_data *result_code_string,
+ krb5_data *result_string)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_default_config_files,
+ (char ***filenames)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_config_files,
+ (char **filenames)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_in_tkt,
+ (krb5_context,
+ const krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ krb5_error_code ( * )(krb5_context,
+ const krb5_enctype,
+ krb5_data *,
+ krb5_const_pointer,
+ krb5_keyblock * *),
+ krb5_const_pointer,
+ krb5_error_code ( * )(krb5_context,
+ const krb5_keyblock *,
+ krb5_const_pointer,
+ krb5_kdc_rep * ),
+ krb5_const_pointer,
+ krb5_creds *,
+ krb5_ccache,
+ krb5_kdc_rep * * )
+ );
+
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_in_tkt_with_password,
+ (krb5_context,
+ const krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ const char *,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_kdc_rep * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_in_tkt_with_skey,
+ (krb5_context,
+ const krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ const krb5_keyblock *,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_kdc_rep * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_in_tkt_with_keytab,
+ (krb5_context,
+ const krb5_flags,
+ krb5_address * const *,
+ krb5_enctype *,
+ krb5_preauthtype *,
+ const krb5_keytab,
+ krb5_ccache,
+ krb5_creds *,
+ krb5_kdc_rep * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_req,
+ (krb5_context,
+ krb5_auth_context *,
+ const krb5_data *,
+ krb5_const_principal,
+ krb5_keytab,
+ krb5_flags *,
+ krb5_ticket * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_read_service_key,
+ (krb5_context,
+ krb5_pointer,
+ krb5_principal,
+ krb5_kvno,
+ krb5_enctype,
+ krb5_keyblock * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_safe,
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_priv,
+ (krb5_context,
+ krb5_auth_context,
+ const krb5_data *,
+ krb5_data *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_register,
+ (krb5_context,
+ krb5_cc_ops *,
+ krb5_boolean )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_sendauth,
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_pointer,
+ char *,
+ krb5_principal,
+ krb5_principal,
+ krb5_flags,
+ krb5_data *,
+ krb5_creds *,
+ krb5_ccache,
+ krb5_error * *,
+ krb5_ap_rep_enc_part * *,
+ krb5_creds * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_recvauth,
+ (krb5_context,
+ krb5_auth_context *,
+ krb5_pointer,
+ char *,
+ krb5_principal,
+ krb5_int32,
+ krb5_keytab,
+ krb5_ticket * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_ncred,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_creds * *,
+ krb5_data * *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_mk_1cred,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_creds *,
+ krb5_data * *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_rd_cred,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_data *,
+ krb5_creds * * *,
+ krb5_replay_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_fwd_tgt_creds,
+ (krb5_context,
+ krb5_auth_context,
+ char *,
+ krb5_principal,
+ krb5_principal,
+ krb5_ccache,
+ int forwardable,
+ krb5_data *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_init,
+ (krb5_context,
+ krb5_auth_context *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_free,
+ (krb5_context,
+ krb5_auth_context)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_setflags,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getflags,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32 *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_setuseruserkey,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getkey,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock **)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getlocalsubkey,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_set_req_cksumtype,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_cksumtype)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getlocalseqnumber,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32 *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getremoteseqnumber,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_int32 *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_setrcache,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_rcache)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getauthenticator,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_authenticator * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_getremotesubkey,
+ (krb5_context,
+ krb5_auth_context,
+ krb5_keyblock * *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_read_password,
+ (krb5_context,
+ const char *,
+ const char *,
+ char *,
+ int * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_host_realm,
+ (krb5_context,
+ const char *,
+ char * * * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_free_host_realm,
+ (krb5_context,
+ char * const * )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_realm_domain,
+ (krb5_context,
+ const char *,
+ char ** )
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_auth_con_genaddrs,
+ (krb5_context,
+ krb5_auth_context,
+ int, int)
+ );
+
+/* ------------------------------------------------------------------------- */
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_string_to_enctype,
+ (char *, krb5_enctype *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_string_to_salttype,
+ (char *, krb5_int32 *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_string_to_cksumtype,
+ (char *, krb5_cksumtype *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_string_to_timestamp,
+ (char *, krb5_timestamp *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_string_to_deltat,
+ (char *, krb5_deltat *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_enctype_to_string,
+ (krb5_enctype, char *, size_t)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_salttype_to_string,
+ (krb5_int32, char *, size_t)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cksumtype_to_string,
+ (krb5_cksumtype, char *, size_t)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_timestamp_to_string,
+ (krb5_timestamp, char *, size_t)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_timestamp_to_sfstring,
+ (krb5_timestamp, char *, size_t, char *)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_deltat_to_string,
+ (krb5_deltat, char *, size_t)
+ );
+
+/* ------------------------------------------------------------------------- */
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_prompter_posix,
+ (krb5_context context,
+ void *data,
+ const char *name,
+ const char *banner,
+ int num_prompts,
+ krb5_prompt prompts[])
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_init,
+ (krb5_get_init_creds_opt *opt)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_tkt_life,
+ (krb5_get_init_creds_opt *opt,
+ krb5_deltat tkt_life)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_renew_life,
+ (krb5_get_init_creds_opt *opt,
+ krb5_deltat renew_life)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_forwardable,
+ (krb5_get_init_creds_opt *opt,
+ int forwardable)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_proxiable,
+ (krb5_get_init_creds_opt *opt,
+ int proxiable)
+ );
+
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_etype_list,
+ (krb5_get_init_creds_opt *opt,
+ krb5_enctype *etype_list,
+ int etype_list_length)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_address_list,
+ (krb5_get_init_creds_opt *opt,
+ krb5_address **addresses)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_preauth_list,
+ (krb5_get_init_creds_opt *opt,
+ krb5_preauthtype *preauth_list,
+ int preauth_list_length)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_opt_set_salt,
+ (krb5_get_init_creds_opt *opt,
+ krb5_data *salt)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_password,
+ (krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ char *password,
+ krb5_prompter_fct prompter,
+ void *data,
+ krb5_deltat start_time,
+ char *in_tkt_service,
+ krb5_get_init_creds_opt *options)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_init_creds_keytab,
+ (krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ krb5_keytab arg_keytab,
+ krb5_deltat start_time,
+ char *in_tkt_service,
+ krb5_get_init_creds_opt *options)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_verify_init_creds_opt_init,
+ (krb5_verify_init_creds_opt *options)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_verify_init_creds_opt_set_ap_req_nofail,
+ (krb5_verify_init_creds_opt *options,
+ int ap_req_nofail)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_verify_init_creds,
+ (krb5_context context,
+ krb5_creds *creds,
+ krb5_principal ap_req_server,
+ krb5_keytab ap_req_keytab,
+ krb5_ccache *ccache,
+ krb5_verify_init_creds_opt *options)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_validated_creds,
+ (krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ krb5_ccache ccache,
+ char *in_tkt_service)
+ );
+
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_get_renewed_creds,
+ (krb5_context context,
+ krb5_creds *creds,
+ krb5_principal client,
+ krb5_ccache ccache,
+ char *in_tkt_service)
+ );
+
+/* ------------------------------------------------------------------------- */
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_realm_iterator_create,
+ (krb5_context context, void **iter_p)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_realm_iterator,
+ (krb5_context context, void **iter_p, char **ret_realm)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_realm_iterator_free,
+ (krb5_context context, void **iter_p)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ krb5_free_realm_string,
+ (krb5_context context, char *str)
+ );
+
+TYPEDEF_FUNC(
+ krb5_prompt_type*,
+ KRB5_CALLCONV,
+ krb5_get_prompt_types,
+ (krb5_context context)
+ );
+
+/* NOT IN krb5.h HEADER: */
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_decode_ticket,
+ (const krb5_data *code, krb5_ticket **rep)
+ );
+
+/* --- more --- */
+
+TYPEDEF_FUNC(
+ char *,
+ KRB5_CALLCONV,
+ krb5_cc_get_name,
+ (krb5_context context, krb5_ccache cache)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_gen_new,
+ (krb5_context context, krb5_ccache *cache)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_initialize,
+ (krb5_context context, krb5_ccache cache, krb5_principal principal)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_destroy,
+ (krb5_context context, krb5_ccache cache)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_close,
+ (krb5_context context, krb5_ccache cache)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_store_cred,
+ (krb5_context context, krb5_ccache cache, krb5_creds *creds)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_retrieve_cred,
+ (krb5_context context, krb5_ccache cache,
+ krb5_flags flags, krb5_creds *mcreds,
+ krb5_creds *creds)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_get_principal,
+ (krb5_context context, krb5_ccache cache, krb5_principal *principal)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_start_seq_get,
+ (krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_next_cred,
+ (krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor,
+ krb5_creds *creds)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_end_seq_get,
+ (krb5_context context, krb5_ccache cache, krb5_cc_cursor *cursor)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_remove_cred,
+ (krb5_context context, krb5_ccache cache, krb5_flags flags,
+ krb5_creds *creds)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_cc_set_flags,
+ (krb5_context context, krb5_ccache cache, krb5_flags flags)
+ );
+
+TYPEDEF_FUNC(
+ const char *,
+ KRB5_CALLCONV,
+ krb5_cc_get_type,
+ (krb5_context context, krb5_ccache cache)
+ );
+
+TYPEDEF_FUNC(
+ char *,
+ KRB5_CALLCONV,
+ krb5_kt_get_type,
+ (krb5_context, krb5_keytab keytab)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_get_name,
+ (krb5_context context, krb5_keytab keytab, char *name,
+ unsigned int namelen)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_close,
+ (krb5_context context, krb5_keytab keytab)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_get_entry,
+ (krb5_context context, krb5_keytab keytab,
+ krb5_const_principal principal, krb5_kvno vno,
+ krb5_enctype enctype, krb5_keytab_entry *entry)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_start_seq_get,
+ (krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_next_entry,
+ (krb5_context context, krb5_keytab keytab,
+ krb5_keytab_entry *entry, krb5_kt_cursor *cursor)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_kt_end_seq_get,
+ (krb5_context context, krb5_keytab keytab, krb5_kt_cursor *cursor)
+ );
+
+TYPEDEF_FUNC(
+ krb5_error_code,
+ KRB5_CALLCONV,
+ krb5_locate_kdc,
+ (krb5_context context, const krb5_data *realm,
+ struct addrlist *addrlist,
+ int get_masters, int socktype, int family)
+ );
+#endif /* __LOADFUNCS_KRB5_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_KRB524_H__
+#define __LOADFUNCS_KRB524_H__
+
+#include "loadfuncs.h"
+#include <krb5.h>
+#include <krb.h>
+
+#define KRB524_DLL "krb524.dll"
+
+TYPEDEF_FUNC(
+ int,
+ KRB5_CALLCONV_C,
+ krb524_init_ets,
+ (krb5_context context)
+ );
+TYPEDEF_FUNC(
+ int,
+ KRB5_CALLCONV_C,
+ krb524_convert_creds_kdc,
+ (krb5_context context, krb5_creds *v5creds,
+ CREDENTIALS *v4creds)
+ );
+#endif /* __LOADFUNCS_KRB524_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_LEASH_H__
+#define __LOADFUNCS_LEASH_H__
+
+#include "loadfuncs.h"
+#include <leashwin.h>
+
+#define LEASH_DLL "leashw32.dll"
+
+#define CALLCONV_C
+
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ Leash_kinit_dlg,
+ (HWND, LPLSH_DLGINFO)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ Leash_kinit_dlg_ex,
+ (HWND, LPLSH_DLGINFO_EX)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ Leash_changepwd_dlg,
+ (HWND, LPLSH_DLGINFO)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ Leash_changepwd_dlg_ex,
+ (HWND, LPLSH_DLGINFO_EX)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_checkpwd,
+ (char *, char *)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_changepwd,
+ (char *, char *, char*, char*)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_kinit,
+ (char *, char *, int)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_kinit_ex,
+ (char *, char *, int,int, int, int, int, unsigned long)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_klist,
+ (HWND, TICKETINFO*)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_kdestroy,
+ (void)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_get_lsh_errno,
+ (LONG *)
+ );
+TYPEDEF_FUNC(
+ BOOL,
+ CALLCONV_C,
+ Leash_set_help_file,
+ (char *)
+ );
+TYPEDEF_FUNC(
+ char *,
+ CALLCONV_C,
+ Leash_get_help_file,
+ (void)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_timesync,
+ (int)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_lifetime,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_lifetime,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_lifetime,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_renew_till,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_renew_till,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_renew_till,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_forwardable,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_forwardable,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_forwardable,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_noaddresses,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_noaddresses,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_noaddresses,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_proxiable,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_proxiable,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_proxiable,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_publicip,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_publicip,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ 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,
+ Leash_get_default_life_min,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_life_min,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_life_min,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_life_max,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_life_max,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_life_max,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_renew_min,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_renew_min,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_renew_min,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_renew_max,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_renew_max,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_renew_max,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_get_default_renewable,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_renewable,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ 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,
+ Leash_get_default_uppercaserealm,
+ (void)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_set_default_uppercaserealm,
+ (DWORD)
+ );
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ Leash_reset_default_uppercaserealm,
+ (void)
+ );
+TYPEDEF_FUNC(
+ BOOL,
+ CALLCONV_C,
+ Leash_import,
+ (void)
+ );
+TYPEDEF_FUNC(
+ long,
+ CALLCONV_C,
+ Leash_importable,
+ (void)
+ );
+TYPEDEF_FUNC(
+ int,
+ CALLCONV_C,
+ Leash_renew,
+ (void)
+ );
+TYPEDEF_FUNC(
+ void,
+ CALLCONV_C,
+ Leash_reset_defaults,
+ (void)
+ );
+/* They are not yet all here... */
+
+#endif /* __LOADFUNCS_LEASH_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_LSA_H__
+#define __LOADFUNCS_LSA_H__
+
+#include "loadfuncs.h"
+
+#define SECUR32_DLL "secur32.dll"
+#define ADVAPI32_DLL "advapi32.dll"
+
+TYPEDEF_FUNC(
+ NTSTATUS,
+ NTAPI,
+ LsaConnectUntrusted,
+ (PHANDLE)
+ );
+TYPEDEF_FUNC(
+ NTSTATUS,
+ NTAPI,
+ LsaLookupAuthenticationPackage,
+ (HANDLE, PLSA_STRING, PULONG)
+ );
+TYPEDEF_FUNC(
+ NTSTATUS,
+ NTAPI,
+ LsaCallAuthenticationPackage,
+ (HANDLE, ULONG, PVOID, ULONG, PVOID *, PULONG, PNTSTATUS)
+ );
+TYPEDEF_FUNC(
+ NTSTATUS,
+ NTAPI,
+ LsaFreeReturnBuffer,
+ (PVOID)
+ );
+TYPEDEF_FUNC(
+ ULONG,
+ NTAPI,
+ LsaNtStatusToWinError,
+ (NTSTATUS)
+ );
+TYPEDEF_FUNC(
+ ULONG,
+ NTAPI,
+ LsaGetLogonSessionData,
+ (PLUID, PSECURITY_LOGON_SESSION_DATA*)
+ );
+#endif /* __LOADFUNCS_LSA_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_PROFILE_H__
+#define __LOADFUNCS_PROFILE_H__
+
+#include "loadfuncs.h"
+#include <profile.h>
+
+#define PROFILE_DLL "xpprof32.dll"
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_init,
+ (const_profile_filespec_t *files, profile_t *ret_profile)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_init_path,
+ (const_profile_filespec_list_t filelist, profile_t *ret_profile)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_flush,
+ (profile_t profile)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ profile_abandon,
+ (profile_t profile)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ profile_release,
+ (profile_t profile)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_get_values,
+ (profile_t profile, const char **names, char ***ret_values)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ profile_free_list,
+ (char **list)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_get_string,
+ (profile_t profile, const char *name, const char *subname,
+ const char *subsubname, const char *def_val,
+ char **ret_string)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_get_integer,
+ (profile_t profile, const char *name, const char *subname,
+ const char *subsubname, int def_val,
+ int *ret_default)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_get_relation_names,
+ (profile_t profile, const char **names, char ***ret_names)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_get_subsection_names,
+ (profile_t profile, const char **names, char ***ret_names)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_iterator_create,
+ (profile_t profile, const char **names, int flags, void **ret_iter)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ profile_iterator_free,
+ (void **iter_p)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_iterator,
+ (void **iter_p, char **ret_name, char **ret_value)
+ );
+
+TYPEDEF_FUNC(
+ void,
+ KRB5_CALLCONV,
+ profile_release_string,
+ (char *str)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_update_relation,
+ (profile_t profile, const char **names, const char *old_value, const char *new_value)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_clear_relation,
+ (profile_t profile, const char **names)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_rename_section,
+ (profile_t profile, const char **names, const char *new_name)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ KRB5_CALLCONV,
+ profile_add_relation,
+ (profile_t profile, const char **names, const char *new_value)
+ );
+
+
+#endif /* __LOADFUNCS_PROFILE_H__ */
--- /dev/null
+#ifndef __LOADFUNCS_WSHELPER_H__
+#define __LOADFUNCS_WSHELPER_H__
+
+#include <loadfuncs.h>
+#include <wshelper.h>
+
+#define WSHELPER_DLL "wshelp32.dll"
+#define CALLCONV_C
+
+TYPEDEF_FUNC(
+ struct hostent *,
+ WINAPI,
+ rgethostbyname,
+ (char *name)
+ );
+
+TYPEDEF_FUNC(
+ struct hostent *,
+ WINAPI,
+ rgethostbyaddr,
+ (char* addr, int len, int type)
+ );
+
+TYPEDEF_FUNC(
+ struct servent,
+ WINAPI,
+ rgetservbyname,
+ (LPSTR name, LPSTR proto)
+ );
+
+TYPEDEF_FUNC(
+ LPSTR,
+ WINAPI,
+ gethinfobyname,
+ (LPSTR name)
+ );
+
+TYPEDEF_FUNC(
+ LPSTR,
+ WINAPI,
+ getmxbyname,
+ (LPSTR name)
+ );
+
+TYPEDEF_FUNC(
+ LPSTR,
+ WINAPI,
+ getrecordbyname,
+ (LPSTR name, int rectype)
+ );
+
+TYPEDEF_FUNC(
+ DWORD,
+ WINAPI,
+ rrhost,
+ (LPSTR lpHost)
+ );
+
+TYPEDEF_FUNC(
+ unsigned long,
+ WINAPI,
+ inet_aton,
+ (const char* cp, struct in_addr *addr)
+ );
+
+TYPEDEF_FUNC(
+ DWORD,
+ CALLCONV_C,
+ WhichOS,
+ (DWORD * check)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ wsh_gethostname,
+ (char* name, int size)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ wsh_getdomainname,
+ (char* name, int size)
+ );
+
+TYPEDEF_FUNC(
+ LONG,
+ CALLCONV_C,
+ WSHGetHostID,
+ ()
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ res_init,
+ ()
+ );
+
+TYPEDEF_FUNC(
+ void,
+ WINAPI,
+ res_setopts,
+ (long opts)
+ );
+
+TYPEDEF_FUNC(
+ long,
+ WINAPI,
+ res_getopts,
+ (void)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ res_mkquery,
+ (int op, const char FAR *dname,
+ int qclass, int type,
+ const char FAR *data, int datalen,
+ const struct rrec FAR *newrr,
+ char FAR *buf, int buflen)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ res_send,
+ (const char FAR *msg, int msglen,
+ char FAR *answer, int anslen)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ res_querydomain,
+ (const char FAR *name,
+ const char FAR *domain,
+ int qclass, int type,
+ u_char FAR *answer, int anslen)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ res_search,
+ (const char FAR *name,
+ int qclass, int type,
+ u_char FAR *answer, int anslen)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ dn_comp,
+ (const u_char FAR *exp_dn,
+ u_char FAR *comp_dn,
+ int length, u_char FAR * FAR *dnptrs,
+ u_char FAR * FAR *lastdnptr)
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ rdn_expand,
+ (const u_char FAR *msg,
+ const u_char FAR *eomorig,
+ const u_char FAR *comp_dn,
+ u_char FAR *exp_dn,
+ int length)
+ );
+
+TYPEDEF_FUNC(
+ LPSTR,
+ WINAPI,
+ hes_to_bind,
+ (
+ LPSTR HesiodName,
+ LPSTR HesiodNameType
+ )
+ );
+
+TYPEDEF_FUNC(
+ LPSTR *,
+ WINAPI,
+ hes_resolve,
+ (
+ LPSTR HesiodName,
+ LPSTR HesiodNameType
+ )
+ );
+
+TYPEDEF_FUNC(
+ int,
+ WINAPI,
+ hes_error,
+ (
+ void
+ )
+ );
+
+TYPEDEF_FUNC(
+ struct hes_postoffice *,
+ WINAPI,
+ hes_getmailhost,
+ (LPSTR user)
+ );
+
+TYPEDEF_FUNC(
+ struct servent *,
+ WINAPI,
+ hes_getservbyname,
+ (LPSTR name,
+ LPSTR proto)
+ );
+
+TYPEDEF_FUNC(
+ struct passwd *,
+ WINAPI,
+ hes_getpwnam,
+ (LPSTR nam)
+ );
+
+TYPEDEF_FUNC(
+ struct passwd *,
+ WINAPI,
+ hes_getpwuid,
+ (int uid)
+ );
+
+#endif /* __LOADFUNCS_WSHELPER_H__ */
--- /dev/null
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include "loadfuncs.h"
+
+//
+// UnloadFuncs:
+//
+// This function will reset all the function pointers of a function loaded
+// by LaodFuncs and will free the DLL instance provided.
+//
+
+void
+UnloadFuncs(
+ FUNC_INFO fi[],
+ HINSTANCE h
+ )
+{
+ int n;
+ if (fi)
+ for (n = 0; fi[n].func_ptr_var; n++)
+ *(fi[n].func_ptr_var) = 0;
+ if (h) FreeLibrary(h);
+}
+
+
+//
+// LoadFuncs:
+//
+// This function try to load the functions for a DLL. It returns 0 on failure
+// and non-zero on success. The parameters are descibed below.
+//
+
+int
+LoadFuncs(
+ const char* dll_name,
+ FUNC_INFO fi[],
+ HINSTANCE* ph, // [out, optional] - DLL handle
+ int* pindex, // [out, optional] - index of last func loaded (-1 if none)
+ int cleanup, // cleanup function pointers and unload on error
+ int go_on, // continue loading even if some functions cannot be loaded
+ int silent // do not pop-up a system dialog if DLL cannot be loaded
+
+ )
+{
+ HINSTANCE h;
+ int i, n, last_i;
+ int error = 0;
+ UINT em;
+
+ if (ph) *ph = 0;
+ if (pindex) *pindex = -1;
+
+ for (n = 0; fi[n].func_ptr_var; n++)
+ *(fi[n].func_ptr_var) = 0;
+
+ if (silent)
+ em = SetErrorMode(SEM_FAILCRITICALERRORS);
+ h = LoadLibrary(dll_name);
+ if (silent)
+ SetErrorMode(em);
+
+ if (!h)
+ return 0;
+
+ last_i = -1;
+ for (i = 0; (go_on || !error) && (i < n); i++)
+ {
+ void* p = (void*)GetProcAddress(h, fi[i].func_name);
+ if (!p)
+ error = 1;
+ else
+ {
+ last_i = i;
+ *(fi[i].func_ptr_var) = p;
+ }
+ }
+ if (pindex) *pindex = last_i;
+ if (error && cleanup && !go_on) {
+ for (i = 0; i < n; i++) {
+ *(fi[i].func_ptr_var) = 0;
+ }
+ FreeLibrary(h);
+ return 0;
+ }
+ if (ph) *ph = h;
+ if (error) return 0;
+ return 1;
+}
--- /dev/null
+#ifndef __LOADFUNCS_H__
+#define __LOADFUNCS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <windows.h>
+
+typedef struct _FUNC_INFO {
+ void** func_ptr_var;
+ char* func_name;
+} FUNC_INFO;
+
+#define DECL_FUNC_PTR(x) FP_##x p##x
+#define MAKE_FUNC_INFO(x) { (void**) &p##x, #x }
+#define END_FUNC_INFO { 0, 0 }
+#define TYPEDEF_FUNC(ret, call, name, args) typedef ret (call *FP_##name) args
+
+void
+UnloadFuncs(
+ FUNC_INFO fi[],
+ HINSTANCE h
+ );
+
+int
+LoadFuncs(
+ const char* dll_name,
+ FUNC_INFO fi[],
+ HINSTANCE* ph, // [out, optional] - DLL handle
+ int* pindex, // [out, optional] - index of last func loaded (-1 if none)
+ int cleanup, // cleanup function pointers and unload on error
+ int go_on, // continue loading even if some functions cannot be loaded
+ int silent // do not pop-up a system dialog if DLL cannot be loaded
+ );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LOADFUNCS_H__ */
--- /dev/null
+/*
+ * @doc
+ * @module nameser.h |
+ * Copyright (c) 1983, 1989 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.
+ *
+ * @(#)nameser.h 5.25 (Berkeley) 4/3/91
+ */
+
+#ifndef _NAMESER_H_
+#define _NAMESER_H_
+
+/*
+ * Define constants based on rfc883
+ */
+#define PACKETSZ 512 /* maximum packet size */
+#define MAXDNAME 256 /* maximum domain name */
+#define MAXCDNAME 255 /* maximum compressed domain name */
+#define MAXLABEL 63 /* maximum length of domain label */
+ /* Number of bytes of fixed size data in query structure */
+#define QFIXEDSZ 4
+ /* number of bytes of fixed size data in resource record */
+#define RRFIXEDSZ 10
+
+#if !defined(MAXHOSTNAME)
+#define MAXHOSTNAME MAXCDNAME
+#endif
+
+/*
+ * Internet nameserver port number
+ */
+#define NAMESERVER_PORT 53
+
+/*
+ * Currently defined opcodes
+ */
+#define QUERY 0x0 /* standard query */
+#define IQUERY 0x1 /* inverse query */
+#define STATUS 0x2 /* nameserver status query */
+/*#define xxx 0x3 /* 0x3 reserved */
+ /* non standard */
+#define UPDATEA 0x9 /* add resource record */
+#define UPDATED 0xa /* delete a specific resource record */
+#define UPDATEDA 0xb /* delete all nemed resource record */
+#define UPDATEM 0xc /* modify a specific resource record */
+#define UPDATEMA 0xd /* modify all named resource record */
+
+#define ZONEINIT 0xe /* initial zone transfer */
+#define ZONEREF 0xf /* incremental zone referesh */
+
+/*
+ * Currently defined response codes
+ */
+#define NOERROR 0 /* no error */
+#define FORMERR 1 /* format error */
+#define SERVFAIL 2 /* server failure */
+#define NXDOMAIN 3 /* non existent domain */
+#define NOTIMP 4 /* not implemented */
+#define REFUSED 5 /* query refused */
+ /* non standard */
+#define NOCHANGE 0xf /* update failed to change db */
+
+/*
+ * Type values for resources and queries
+ */
+#define T_A 1 /* host address */
+#define T_NS 2 /* authoritative server */
+#define T_MD 3 /* mail destination */
+#define T_MF 4 /* mail forwarder */
+#define T_CNAME 5 /* connonical name */
+#define T_SOA 6 /* start of authority zone */
+#define T_MB 7 /* mailbox domain name */
+#define T_MG 8 /* mail group member */
+#define T_MR 9 /* mail rename name */
+#define T_NULL 10 /* null resource record */
+#define T_WKS 11 /* well known service */
+#define T_PTR 12 /* domain name pointer */
+#define T_HINFO 13 /* host information */
+#define T_MINFO 14 /* mailbox information */
+#define T_MX 15 /* mail routing information */
+#define T_TXT 16 /* text strings */
+ /* non standard */
+#define T_UINFO 100 /* user (finger) information */
+#define T_UID 101 /* user ID */
+#define T_GID 102 /* group ID */
+#define T_UNSPEC 103 /* Unspecified format (binary data) */
+ /* Query type values which do not appear in resource records */
+#define T_AXFR 252 /* transfer zone of authority */
+#define T_MAILB 253 /* transfer mailbox records */
+#define T_MAILA 254 /* transfer mail agent records */
+#define T_ANY 255 /* wildcard match */
+
+/*
+ * Values for class field
+ */
+
+#define C_IN 1 /* the arpa internet */
+#define C_CHAOS 3 /* for chaos net at MIT */
+#define C_HS 4 /* for Hesiod name server at MIT */
+ /* Query class values which do not appear in resource records */
+#define C_ANY 255 /* wildcard match */
+
+/*
+ * Status return codes for T_UNSPEC conversion routines
+ */
+#define CONV_SUCCESS 0
+#define CONV_OVERFLOW -1
+#define CONV_BADFMT -2
+#define CONV_BADCKSUM -3
+#define CONV_BADBUFLEN -4
+
+#ifndef BYTE_ORDER
+#define LITTLE_ENDIAN 1234 /* least-significant byte first (vax) */
+#define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
+#define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
+
+#if defined(vax) || defined(ns32000) || defined(sun386) || defined(MIPSEL) || \
+ defined(BIT_ZERO_ON_RIGHT)
+#define BYTE_ORDER LITTLE_ENDIAN
+
+#endif
+#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
+ defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
+ defined(MIPSEB) || defined (BIT_ZERO_ON_LEFT)
+#define BYTE_ORDER BIG_ENDIAN
+#endif
+#endif /* BYTE_ORDER */
+
+#ifndef BYTE_ORDER
+ /* you must determine what the correct bit order is for your compiler */
+ #define BYTE_ORDER LITTLE_ENDIAN /* for Intel x86 series */
+#endif
+/*
+ * Structure for query header, the order of the fields is machine and
+ * compiler dependent, in our case, the bits within a byte are assignd
+ * least significant first, while the order of transmition is most
+ * significant first. This requires a somewhat confusing rearrangement.
+ */
+
+#if defined (_WINDLL) || (_WIN32)
+/* define UNIX types */
+#include <winsock.h>
+#endif
+
+typedef struct {
+ u_short id; /* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+ /* fields in third byte */
+ u_char qr:1; /* response flag */
+ u_char opcode:4; /* purpose of message */
+ u_char aa:1; /* authoritive answer */
+ u_char tc:1; /* truncated message */
+ u_char rd:1; /* recursion desired */
+ /* fields in fourth byte */
+ u_char ra:1; /* recursion available */
+ u_char pr:1; /* primary server required (non standard) */
+ u_char unused:2; /* unused bits */
+ u_char rcode:4; /* response code */
+#endif
+#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+ /* fields in third byte */
+ u_char rd:1; /* recursion desired */
+ u_char tc:1; /* truncated message */
+ u_char aa:1; /* authoritive answer */
+ u_char opcode:4; /* purpose of message */
+ u_char qr:1; /* response flag */
+ /* fields in fourth byte */
+ u_char rcode:4; /* response code */
+ u_char unused:2; /* unused bits */
+ u_char pr:1; /* primary server required (non standard) */
+ u_char ra:1; /* recursion available */
+#endif
+ /* remaining bytes */
+ u_short qdcount; /* number of question entries */
+ u_short ancount; /* number of answer entries */
+ u_short nscount; /* number of authority entries */
+ u_short arcount; /* number of resource entries */
+} HEADER;
+
+/*
+ * Defines for handling compressed domain names
+ */
+#define INDIR_MASK 0xc0
+
+/*
+ * Structure for passing resource records around.
+ */
+struct rrec {
+ short r_zone; /* zone number */
+ short r_class; /* class number */
+ short r_type; /* type number */
+ u_long r_ttl; /* time to live */
+ int r_size; /* size of data area */
+ char *r_data; /* pointer to data */
+};
+
+extern u_short _getshort();
+extern u_long _getlong();
+
+/*
+ * Inline versions of get/put short/long.
+ * Pointer is advanced; we assume that both arguments
+ * are lvalues and will already be in registers.
+ * cp MUST be u_char *.
+ */
+#define GETSHORT(s, cp) { \
+ (s) = *(cp)++ << 8; \
+ (s) |= *(cp)++; \
+}
+
+#define GETLONG(l, cp) { \
+ (l) = *(cp)++ << 8; \
+ (l) |= *(cp)++; (l) <<= 8; \
+ (l) |= *(cp)++; (l) <<= 8; \
+ (l) |= *(cp)++; \
+}
+
+
+#define PUTSHORT(s, cp) { \
+ *(cp)++ = (s) >> 8; \
+ *(cp)++ = (s); \
+}
+
+/*
+ * Warning: PUTLONG destroys its first argument.
+ */
+#define PUTLONG(l, cp) { \
+ (cp)[3] = l; \
+ (cp)[2] = (l >>= 8); \
+ (cp)[1] = (l >>= 8); \
+ (cp)[0] = l >> 8; \
+ (cp) += sizeof(u_long); \
+}
+
+#endif /* !_NAMESER_H_ */
--- /dev/null
+/* This file contains definitions for use by the Hesiod name service and
+ * applications.
+ *
+ * @doc
+ *
+ * @module hesiod.h |
+ * For copying and distribution information, see the file
+ * <gt> mit-copyright.h <lt>.
+ *
+ * Original version by Steve Dyer, IBM/Project Athena.
+ *
+ */
+
+/* Configuration information. */
+
+#ifndef _HESIOD_
+#define _HESIOD_
+
+#if defined(_WINDOWS) || defined(_WIN32)
+#include <windows.h>
+#endif
+
+#if defined(_WINDOWS) || defined(_WIN32)
+#define HESIOD_CONF "c:\\net\\tcp\\hesiod.cfg"
+#else
+#define HESIOD_CONF "/etc/hesiod.conf" /* Configuration file. */
+#endif
+
+#define DEF_RHS ".Athena.MIT.EDU" /* Defaults if HESIOD_CONF */
+#define DEF_LHS ".ns" /* file is not present. */
+
+/* @doc ERROR
+/* Error codes. */
+/*
+
+@type HES_ER_UNINIT | -1 uninitialized
+@type HES_ER_OK | 0 no error
+@type HES_ER_NOTFOUND | 1 Hesiod name not found by server
+@type HES_ER_CONFIG | 2 local problem (no config file?)
+@type HES_ER_NET | 3 network problem
+
+ */
+
+#define HES_ER_UNINIT -1 /* uninitialized */
+#define HES_ER_OK 0 /* no error */
+#define HES_ER_NOTFOUND 1 /* Hesiod name not found by server */
+#define HES_ER_CONFIG 2 /* local problem (no config file?) */
+#define HES_ER_NET 3 /* network problem */
+
+/* Declaration of routines */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(_WINDOWS) || defined(_WIN32)
+
+LPSTR WINAPI
+hes_to_bind(
+ LPSTR HesiodName,
+ LPSTR HesiodNameType
+ );
+
+LPSTR * WINAPI
+hes_resolve(
+ LPSTR HesiodName,
+ LPSTR HesiodNameType
+ );
+
+int WINAPI
+hes_error(
+ void
+ );
+
+#else
+char *hes_to_bind(const char *name, const char *type);
+char **hes_resolve(const char *name, const char *type);
+int hes_error(void);
+#endif /* WINDOWS */
+
+
+/*
+ * @doc
+ *
+ * @struct hes_postoffice | For use in getting post-office information.
+ *
+ * @field LPSTR | po_type | The post office type, e.g. POP, IMAP
+ * @field LPSTR | po_host | The post office host, e.g. PO10.MIT.EDU
+ * @field LPSTR | po_name | The account name on the post office, e.g. tom
+ *
+ */
+#if defined(_WINDOWS) || defined(_WIN32)
+struct hes_postoffice {
+ LPSTR po_type;
+ LPSTR po_host;
+ LPSTR po_name;
+};
+#else
+struct hes_postoffice {
+ char *po_type;
+ char *po_host;
+ char *po_name;
+};
+#endif
+
+/* Other routines */
+
+#if defined(_WINDOWS) || defined(_WIN32)
+struct hes_postoffice FAR * WINAPI hes_getmailhost(LPSTR user);
+struct servent FAR * WINAPI hes_getservbyname(LPSTR name,
+ LPSTR proto);
+struct passwd FAR * WINAPI hes_getpwnam(LPSTR nam);
+struct passwd FAR * WINAPI hes_getpwuid(int uid);
+#else
+struct hes_postoffice *hes_getmailhost();
+struct servent *hes_getservbyname();
+struct passwd *hes_getpwnam();
+struct passwd *hes_getpwuid();
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _HESIOD_ */
--- /dev/null
+/*
+
+@doc
+
+@module mitwhich.h |
+
+some defines so that we can figure out which MS OS and subsystem an
+application is running under. Also support for finding out which
+TCP/IP stack is being used. This is useful when you need to find out
+about the domain or the nameservers.
+
+ */
+
+#if !defined( __MIT_WHICH_H )
+#define __MIT_WHICH_H
+
+// these should become resources and loaded at run time
+#define NT_32 "Winsock 2.0"
+#define NT_16 "Windows NT 16-bit Windows Sockets"
+#define W95_32 "Microsoft Windows Sockets Version 1.1."
+#define W95_16 "Microsoft Windows Sockets Version 1.1."
+#define LWP_16 "Novell Winsock version 1.1"
+// Note that these are currently in wshelper.h and should be somewhere else
+#define MS_NT_32 1
+#define MS_NT_16 2
+#define MS_95_32 3
+#define MS_95_16 4
+#define NOVELL_LWP_16 5
+
+#define MS_OS_WIN 1
+#define MS_OS_95 2
+#define MS_OS_NT 4
+#define MS_OS_2000 12
+#define MS_OS_XP 28
+#define MS_OS_2003 60
+#define MS_OS_NT_UNKNOWN 124
+#define MS_OS_UNKNOWN 0
+
+#define STACK_UNKNOWN 0
+#define UNKNOWN_16_UNDER_32 -2
+#define UNKNOWN_16_UNDER_16 -3
+#define UNKNOWN_32_UNDER_32 -4
+#define UNKNOWN_32_UNDER_16 -5
+
+
+/*
+ @comm these are the current MIT DNS servers, the wshelper and
+ wshelp32 DLLs will do their best to find the correct DNS servers
+ for the local machine however, if all else fails these will be used
+ as a last resort. Site administrators outside of the MIT domain
+ should change these defaults to their own defaults either by
+ editing this file and recompiling or by editing the string tables
+ of the binaries. Don't use App Studio to edit the .RC files.
+<nl>
+ #define DNS1 "18.70.0.160" <nl>
+ #define DNS2 "18.71.0.151" <nl>
+ #define DNS3 "18.72.0.3" <nl>
+<nl>
+ #define DEFAULT_DOMAIN "mit.edu" <nl>
+*/
+
+#define DNS1 "18.70.0.160"
+#define DNS2 "18.71.0.151"
+#define DNS3 "18.72.0.3"
+
+#define DEFAULT_DOMAIN "mit.edu"
+
+
+#ifndef _PATH_RESCONF
+#if !defined(WINDOWS) && !defined(_WINDOWS) && !defined(_WIN32)
+#define _PATH_RESCONF "/etc/resolv.conf"
+#else
+#define _PATH_RESCONF "c:/net/tcp/resolv.cfg"
+#endif
+#endif
+
+
+/* Microsoft TCP/IP registry values that we care about */
+#define NT_TCP_PATH "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"
+#define NT_TCP_PATH_TRANS "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Transient"
+#define W95_TCP_PATH "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP"
+
+#define NT_DOMAIN_KEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Domain"
+#define NT_NS_KEY "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\NameServer"
+
+#define W95_DOMAIN_KEY "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP\\Domain"
+#define W95_NS_KEY "SYSTEM\\CurrentControlSet\\Services\\VxD\\MSTCP\\NameServer"
+
+/*
+
+ @comm Notes on different Winsock stack configuration files.<nl>
+
+ The Microsoft stacks for Windows95 and NT 3.x, 4.x use the registry
+ to store the default domain and the IP addresses of the DNS
+ servers. The wshelper and wshelp32 will use the registry information
+ when possible.<nl>
+
+ Novell's LAN WorkPlace stack and the much older Excelan products use
+ a resolv.cfg file to store this information. The resolv.cfg file
+ could be located in a number of places over the years. Our DLL will
+ try to search for it in:<nl><nl>
+
+ C:\etc\resolv.cfg<nl>
+ C:\excelan\tcp\resolv.cfg<nl>
+ C:\net\tcp\resolv.cfg<nl>
+ %NDIR%\etc\resolv.cfg<nl>
+ %NDIR%\tcp\resolv.cfg<nl><nl>
+
+ where %NDIR% is the expansion of the local environment variable
+ NDIR. So setting NDIR to be N:\COMMON\NET would mean that we would
+ also look in N:\common\net\etc\resolv.cfg and
+ N:\common\net\tcp\resolv.cfg for the domain and nameserver
+ information.<nl><nl>
+
+ Here is a sample resolv.cfg file<nl>
+
+ ; LAN WorkPlace resolver configuration file<nl>
+ domain mit.edu<nl>
+
+ nameserver 18.70.0.160<nl>
+ nameserver 18.71.0.151<nl>
+ nameserver 18.72.0.3<nl>
+ ; end of file<nl><nl>
+
+ The TRUMPET Winsock stack uses a TRUMPETWSK.INI file to store the
+ domain and nameserver configuration information. The section tag is
+ [Trumpet Winsock]. The domain information is identified by domain=
+ and the nameserver information is identified by a single name, dns=,
+ multiple nameservers may be specified on the same line and they
+ should be space delimited.<nl><nl>
+
+ trupwsk.ini<nl>
+ [Trumpet Winsock]<nl>
+ dns=18.71.0.151 18.70.0.160 18.72.0.3<nl>
+ domain=mit.edu<nl><nl>
+
+ Core Internet-Connect uses a CORE.INI file, nameservers are comma
+ delimited.<nl>
+
+ [winsock]<nl>
+ domainname=mit.edu<nl>
+ nameservers=18.71.0.151, 18.70.0.160, 18.72.0.3<nl><nl>
+
+ FTP software uses a PCTCP.INI file. This file may be located by use
+ of the environment variable PCTCP.<nl>
+
+ [pctcp general]<nl>
+ domain=mit.edu<nl>
+ [pctcp addresses]<nl>
+ domain-name-server=18.70.0.160<nl>
+ domain-name-server=18.71.0.151<nl>
+ domain-name-server=18.72.0.3<nl>
+
+*/
+
+#endif // __MIT_WHICH_H
--- /dev/null
+/*
+
+@doc
+
+@module resolv.h |
+ * Copyright (c) 1983, 1987, 1989 The Regents of the University of California.
+ * All rights reserved. <nl>
+
+ Structure definitions for resolver functions and #define statements
+
+*/
+
+/*
+ * Copyright (c) 1983, 1987, 1989 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.
+ *
+ * @(#)resolv.h 5.15 (Berkeley) 4/3/91
+ */
+
+#ifndef _RESOLV_H_
+#define _RESOLV_H_
+
+#if defined(_WINDOWS) || defined(_WIN32)
+#include <windows.h>
+#endif
+
+/*
+ * Resolver configuration file.
+ * Normally not present, but may contain the address of the
+ * inital name server(s) to query and the domain search list.
+ */
+
+#ifndef _PATH_RESCONF
+#if defined(_WINDOWS) || defined(_WIN32)
+#define _PATH_RESCONF "c:\\net\\tcp\\resolv.cfg"
+#else
+#define _PATH_RESCONF "/etc/resolv.conf"
+#endif
+#endif
+
+#ifndef MAXDNAME
+#include <arpa/nameser.h>
+#endif
+
+/*
+ * Global defines and variables for resolver stub.
+ */
+#define MAXNS 3 /* max # name servers we'll track */
+#define MAXDFLSRCH 3 /* # default domain levels to try */
+#define MAXDNSRCH 6 /* max # domains in search path */
+#define LOCALDOMAINPARTS 2 /* min levels in name that is "local" */
+
+#define RES_TIMEOUT 5 /* min. seconds between retries */
+
+// new
+#define MAXMXRECS 8
+
+struct mxent {
+ int numrecs;
+ u_short pref[MAXMXRECS];
+ char FAR * FAR * hostname;
+};
+
+
+/*
+
+ @struct state | This structure holds the state for the resolver query
+
+ */
+struct state {
+ int retrans; /* @field retransmition time interval */
+ int retry; /* @field number of times to retransmit */
+ long options; /* @field option flags - see below. */
+ int nscount; /* @field number of name servers */
+ struct sockaddr_in nsaddr_list[MAXNS]; /* @field address of name server */
+#define nsaddr nsaddr_list[0] /* @field for backward compatibility */
+ u_short id; /* @field current packet id */
+ char defdname[MAXDNAME]; /* @field default domain */
+ char *dnsrch[MAXDNSRCH+1]; /* @field components of domain to search */
+};
+
+/*
+ * Resolver options
+ */
+#define RES_INIT 0x0001 /* address initialized */
+#define RES_DEBUG 0x0002 /* print debug messages */
+#define RES_AAONLY 0x0004 /* authoritative answers only */
+#define RES_USEVC 0x0008 /* use virtual circuit */
+#define RES_PRIMARY 0x0010 /* query primary server only */
+#define RES_IGNTC 0x0020 /* ignore trucation errors */
+#define RES_RECURSE 0x0040 /* recursion desired */
+#define RES_DEFNAMES 0x0080 /* use default domain name */
+#define RES_STAYOPEN 0x0100 /* Keep TCP socket open */
+#define RES_DNSRCH 0x0200 /* search up local domain tree */
+
+#define RES_DEFAULT (RES_RECURSE | RES_DEFNAMES | RES_DNSRCH)
+
+extern struct state _res;
+
+#include <stdio.h>
+
+/* Private routines shared between libc/net, named, nslookup and others. */
+#define dn_skipname __dn_skipname
+#define fp_query __fp_query
+#define hostalias __hostalias
+#define putlong __putlong
+#define putshort __putshort
+#define p_class __p_class
+#define p_time __p_time
+#define p_type __p_type
+
+#if defined(_WINDOWS) || defined(_WIN32)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int WINAPI res_init();
+void WINAPI res_setopts(long opts);
+long WINAPI res_getopts(void);
+int WINAPI res_mkquery(int op, const char FAR *dname,
+ int qclass, int type,
+ const char FAR *data, int datalen,
+ const struct rrec FAR *newrr,
+ char FAR *buf, int buflen);
+int WINAPI res_send(const char FAR *msg, int msglen,
+ char FAR *answer, int anslen);
+int WINAPI res_querydomain(const char FAR *name,
+ const char FAR *domain,
+ int qclass, int type,
+ u_char FAR *answer, int anslen);
+int WINAPI res_search(const char FAR *name,
+ int qclass, int type,
+ u_char FAR *answer, int anslen);
+
+int WINAPI dn_comp(const u_char FAR *exp_dn,
+ u_char FAR *comp_dn,
+ int length, u_char FAR * FAR *dnptrs,
+ u_char FAR * FAR *lastdnptr);
+int WINAPI rdn_expand(const u_char FAR *msg,
+ const u_char FAR *eomorig,
+ const u_char FAR *comp_dn,
+ u_char FAR *exp_dn,
+ int length);
+/* Microsoft includes an implementation of dn_expand() in winsock */
+/* Make sure we do not use it. jaltman@columbia.edu */
+#define dn_expand(a,b,c,d,e) rdn_expand(a,b,c,d,e)
+
+#ifdef __cplusplus
+}
+#endif
+#else
+__BEGIN_DECLS
+int __dn_skipname __P((const u_char *, const u_char *));
+void __fp_query __P((char *, FILE *));
+char *__hostalias __P((const char *));
+void __putlong __P((u_long, u_char *));
+void __putshort __P((u_short, u_char *));
+char *__p_class __P((int));
+char *__p_time __P((u_long));
+char *__p_type __P((int));
+
+int dn_comp __P((const u_char *, u_char *, int, u_char **, u_char **));
+int rdn_expand __P((const u_char *, const u_char *, const u_char *,
+ u_char *, int));
+int res_init __P((void));
+int res_mkquery __P((int, const char *, int, int, const char *, int,
+ const struct rrec *, char *, int));
+int res_send __P((const char *, int, char *, int));
+__END_DECLS
+#endif /* _WINDOWS || _WIN32 */
+
+#endif /* !_RESOLV_H_ */
--- /dev/null
+/*
+ WSHelper DNS/Hesiod Library for WINSOCK
+ wshelper.h
+*/
+
+#ifndef _WSHELPER_
+#define _WSHELPER_
+
+#include <winsock.h>
+#include <mitwhich.h>
+
+#include <resolv.h>
+#include <hesiod.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct hostent FAR* WINAPI rgethostbyname(char FAR *name);
+struct hostent FAR* WINAPI rgethostbyaddr(char FAR *addr,
+ int len, int type);
+struct servent FAR* WINAPI rgetservbyname(LPSTR name,
+ LPSTR proto);
+
+LPSTR WINAPI gethinfobyname(LPSTR name);
+LPSTR WINAPI getmxbyname(LPSTR name);
+LPSTR WINAPI getrecordbyname(LPSTR name, int rectype);
+DWORD WINAPI rrhost( LPSTR lpHost );
+
+unsigned long WINAPI inet_aton(register const char *cp,
+ struct in_addr *addr);
+
+DWORD WhichOS( DWORD *check);
+
+#ifdef _WIN32
+int WINAPI wsh_gethostname(char* name, int size);
+int WINAPI wsh_getdomainname(char* name, int size);
+LONG FAR WSHGetHostID();
+#endif
+
+/* some definitions to determine which OS were using and which subsystem */
+
+#if !defined( STACK_UNKNOWN )
+#define STACK_UNKNOWN -1
+#define MS_NT_32 1
+#define MS_NT_16 2
+#define MS_95_32 3
+#define MS_95_16 4
+#define NOVELL_LWP_16 5
+#endif /* STACK_UNKNOWN */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WSHELPER_ */
+
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=3
-AFSPRODUCT_VER_PATCH=5100
+AFSPRODUCT_VER_PATCH=5299
AFSPRODUCT_VER_BUILD=0
AFSPRODUCT_VERSION=$(AFSPRODUCT_VER_MAJOR).$(AFSPRODUCT_VER_MINOR).$(AFSPRODUCT_VER_PATCH)
AFSPRODUCT_FILE_VERSION=$(AFSPRODUCT_VER_MAJOR),$(AFSPRODUCT_VER_MINOR),$(AFSPRODUCT_VER_PATCH),$(AFSPRODUCT_VER_BUILD)
-I$(DESTDIR)\include\rx \
-DWIN32_LEAN_AND_MEAN \
-DSTRICT \
- -D_WIN32_IE=0x0400 \
- -D_WIN32_WINNT=0x0400 \
- -DAFS_AFSDB_ENV \
- -DAFS_FREELANCE_CLIENT \
- -DAFS_64BIT_ENV \
+ -D_WIN32_IE=0x0500 \
+ -D_WIN32_WINNT=0x0500 \
+ -DWINVER=0x0500 \
+ -DREGISTER_POWER_NOTIFICATIONS \
+ -DAFS_AFSDB_ENV \
+ -DAFS_FREELANCE_CLIENT \
+ -DAFS_64BIT_ENV \
-DAFS_64BIT_CLIENT \
$(AFSDEV_AUXCDEFINES)
-
# Compiler switches (except include paths and preprocessor defines)
#
# Note: if conflicting options are specified, rightmost option applies.
#ifndef UKERNEL
/* This section for kernel libafs compiles only */
-/*\r
- * Copyright 2000, International Business Machines Corporation and others.\r
- * All Rights Reserved.\r
- * \r
- * This software has been released under the terms of the IBM Public\r
- * License. For details, see the LICENSE file in the top-level source\r
- * directory or online at http://www.openafs.org/dl/license10.html\r
- */ \r
- \r
-#ifndef AFS_PARAM_H\r
-#define AFS_PARAM_H\r
- \r
-#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */\r
-#define AFS_ENV 1\r
-#define AFS_SUN_ENV 1\r
-#define AFS_SUN4_ENV 1\r
- \r
-#include <afs/afs_sysnames.h>\r
- \r
-#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */\r
-#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */\r
- \r
-#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */\r
-#define AFS_SYSCALL 31\r
- \r
-/* File system entry (used if mount.h doesn't define MOUNT_AFS */ \r
-#define AFS_MOUNT_AFS "afs"\r
- \r
-/* Machine / Operating system information */ \r
-#define sys_sun4_413 1\r
-#define SYS_NAME "sun4_413"\r
-#define SYS_NAME_ID SYS_NAME_ID_sun4_411\r
-#define AFSBIG_ENDIAN 1\r
-#define AFS_HAVE_FFS 1 /* Use system's ffs. */\r
-#define AFS_HAVE_STATVFS 0\r
-#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */\r
- \r
-#define KERNEL_HAVE_UERROR 1\r
- \r
-/* Extra kernel definitions (from kdefs file) */ \r
-#ifdef KERNEL\r
-/* sun definitions here */ \r
-#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */\r
-#define afsio_iov uio_iov\r
-#define afsio_iovcnt uio_iovcnt\r
-#define afsio_offset uio_offset\r
-#define afsio_seg uio_segflg\r
-#define afsio_fmode uio_fmode\r
-#define afsio_resid uio_resid\r
-#define AFS_UIOSYS UIO_SYSSPACE\r
-#define AFS_UIOUSER UIO_USERSPACE\r
-#define AFS_CLBYTES MCLBYTES\r
-#define AFS_MINCHANGE 2\r
-#define osi_GetTime(x) uniqtime(x)\r
-#define AFS_KALLOC(n) kmem_alloc(n, KMEM_SLEEP)\r
-#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KMEM_NOSLEEP)\r
-#define AFS_KFREE kmem_free\r
-#define VATTR_NULL vattr_null\r
-#endif /* KERNEL */\r
-#define memset(A, B, S) bzero(A, S)\r
-#define memcpy(B, A, S) bcopy(A, B, S) \r
-#define memcmp(A, B, S) bcmp(A, B, S)\r
-#define memmove(B, A, S) bcopy(A, B, S)\r
-#define AFS_DIRENT \r
-#ifndef CMSERVERPREF\r
-#define CMSERVERPREF\r
-#endif /* \r */
- \r
-#endif /* AFS_PARAM_H */\r
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+#define AFS_VFSINCL_ENV 1 /* NOBODY uses this.... */
+#define AFS_ENV 1
+#define AFS_SUN_ENV 1
+#define AFS_SUN4_ENV 1
+
+#include <afs/afs_sysnames.h>
+
+#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
+#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */
+
+#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */
+#define AFS_SYSCALL 31
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS "afs"
+
+/* Machine / Operating system information */
+#define sys_sun4_413 1
+#define SYS_NAME "sun4_413"
+#define SYS_NAME_ID SYS_NAME_ID_sun4_411
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0
+#define AFS_VM_RDWR_ENV 1 /* read/write implemented via VM */
+
+#define KERNEL_HAVE_UERROR 1
+
+/* Extra kernel definitions (from kdefs file) */
+#ifdef KERNEL
+/* sun definitions here */
+#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS UIO_SYSSPACE
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define osi_GetTime(x) uniqtime(x)
+#define AFS_KALLOC(n) kmem_alloc(n, KMEM_SLEEP)
+#define AFS_KALLOC_NOSLEEP(n) kmem_alloc(n, KMEM_NOSLEEP)
+#define AFS_KFREE kmem_free
+#define VATTR_NULL vattr_null
+#endif /* KERNEL */
+#define memset(A, B, S) bzero(A, S)
+#define memcpy(B, A, S) bcopy(A, B, S)
+#define memcmp(A, B, S) bcmp(A, B, S)
+#define memmove(B, A, S) bcopy(A, B, S)
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif /* */
+
+#endif /* AFS_PARAM_H */
#else /* !defined(UKERNEL) */
/* This section for user space compiles only */
-/*\r
- * Copyright 2000, International Business Machines Corporation and others.\r
- * All Rights Reserved.\r
- * \r
- * This software has been released under the terms of the IBM Public\r
- * License. For details, see the LICENSE file in the top-level source\r
- * directory or online at http://www.openafs.org/dl/license10.html\r
- */ \r
- \r
-#ifndef AFS_PARAM_H\r
-#define AFS_PARAM_H\r
- \r
-#define UKERNEL\r
-#define AFS_ENV 1\r
-/* define AFS_USR_XXX_ENV XXX */ \r
- \r
-#include <afs/afs_sysnames.h>\r
- \r
-#define RXK_LISTENER_ENV 1\r
-#define AFS_USERSPACE_IP_ADDR 1\r
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */\r
- \r
-#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */\r
-#define AFS_SYSCALL 31\r
- \r
-/* File system entry (used if mount.h doesn't define MOUNT_AFS */ \r
-#define AFS_MOUNT_AFS 1\r
- \r
-/* Machine / Operating system information */ \r
-#define sys_sun4_413 1\r
-#define SYS_NAME "sun4_413"\r
-#define SYS_NAME_ID SYS_NAME_ID_sun4_411\r
-#define AFSBIG_ENDIAN 1\r
-#define AFS_HAVE_FFS 1 /* Use system's ffs. */\r
-#define AFS_HAVE_STATVFS 0\r
- \r
-/* Extra kernel definitions (from kdefs file) */ \r
-#ifdef KERNEL\r
-/* sun definitions here */ \r
-#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */\r
-#define afsio_iov uio_iov\r
-#define afsio_iovcnt uio_iovcnt\r
-#define afsio_offset uio_offset\r
-#define afsio_seg uio_segflg\r
-#define afsio_fmode uio_fmode\r
-#define afsio_resid uio_resid\r
-#define AFS_UIOSYS 1\r
-#define AFS_UIOUSER UIO_USERSPACE\r
-#define AFS_CLBYTES MCLBYTES\r
-#define AFS_MINCHANGE 2\r
-#define VATTR_NULL usr_vattr_null\r
-#endif /* KERNEL */\r
-#define AFS_DIRENT \r
-#ifndef CMSERVERPREF\r
-#define CMSERVERPREF\r
-#endif /* \r */
- \r
-#endif /* AFS_PARAM_H */\r
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef AFS_PARAM_H
+#define AFS_PARAM_H
+
+#define UKERNEL
+#define AFS_ENV 1
+/* define AFS_USR_XXX_ENV XXX */
+
+#include <afs/afs_sysnames.h>
+
+#define RXK_LISTENER_ENV 1
+#define AFS_USERSPACE_IP_ADDR 1
+#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+
+#define AFS_3DISPARES 1 /* Utilize the 3 available disk inode 'spares' */
+#define AFS_SYSCALL 31
+
+/* File system entry (used if mount.h doesn't define MOUNT_AFS */
+#define AFS_MOUNT_AFS 1
+
+/* Machine / Operating system information */
+#define sys_sun4_413 1
+#define SYS_NAME "sun4_413"
+#define SYS_NAME_ID SYS_NAME_ID_sun4_411
+#define AFSBIG_ENDIAN 1
+#define AFS_HAVE_FFS 1 /* Use system's ffs. */
+#define AFS_HAVE_STATVFS 0
+
+/* Extra kernel definitions (from kdefs file) */
+#ifdef KERNEL
+/* sun definitions here */
+#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
+#define afsio_iov uio_iov
+#define afsio_iovcnt uio_iovcnt
+#define afsio_offset uio_offset
+#define afsio_seg uio_segflg
+#define afsio_fmode uio_fmode
+#define afsio_resid uio_resid
+#define AFS_UIOSYS 1
+#define AFS_UIOUSER UIO_USERSPACE
+#define AFS_CLBYTES MCLBYTES
+#define AFS_MINCHANGE 2
+#define VATTR_NULL usr_vattr_null
+#endif /* KERNEL */
+#define AFS_DIRENT
+#ifndef CMSERVERPREF
+#define CMSERVERPREF
+#endif /* */
+
+#endif /* AFS_PARAM_H */
#endif /* !defined(UKERNEL) */
$(DESTDIR)\lib\afs\afseventlog.lib
$(LIBFILE): $(DLLOBJS) $(DLLLIBS) $(RXOBJS)
- $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib
+ $(DLLCONLINK) /DEF:afsauthent.def rpcrt4.lib dnsapi.lib
$(DLLPREP)
# Definitions for generating versioninfo resources
rx_enable_hot_thread @203 DATA
xdr_int64 @204
xdr_uint64 @205
+ rx_SetMaxMTU @206
#include <winbase.h>
#include "rx_clock.h"
+void clock_UpdateTime(void); /* forward reference */
+
struct clock clock_now; /* The last elapsed time ready by clock_GetTimer */
/* This is set to 1 whenever the time is read, and reset to 0 whenever
goto error;
}
- taddr.sin_addr.s_addr = 0;
+ taddr.sin_addr.s_addr = ADDR_ANY;
taddr.sin_family = AF_INET;
taddr.sin_port = (u_short) port;
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
}
UNLOCK_IF if (!pp->ifMTU) { /* not local */
pp->timeout.sec = 3;
- pp->ifMTU = RX_REMOTE_PACKET_SIZE;
+ pp->ifMTU = MIN(rx_MyMaxSendSize, RX_REMOTE_PACKET_SIZE);
}
#else /* ADAPT_MTU */
pp->rateFlag = 2; /* start timing after two full packets */
pp->timeout.sec = 2;
- pp->ifMTU = OLD_MAX_PACKET_SIZE;
+ pp->ifMTU = MIN(rx_MyMaxSendSize, OLD_MAX_PACKET_SIZE);
#endif /* ADAPT_MTU */
pp->ifMTU = rxi_AdjustIfMTU(pp->ifMTU);
pp->maxMTU = OLD_MAX_PACKET_SIZE; /* for compatibility with old guys */
rx_maxReceiveSize = OLD_MAX_PACKET_SIZE;
rxi_nSendFrags = rxi_nRecvFrags = 1;
}
+
+/* Override max MTU. If rx_SetNoJumbo is called, it must be
+ called before calling rx_SetMaxMTU since SetNoJumbo clobbers rx_maxReceiveSize */
+void rx_SetMaxMTU(int mtu)
+{
+ rx_MyMaxSendSize = rx_maxReceiveSizeUser = rx_maxReceiveSize = mtu;
+}
+
#include <smb.h>
#include <pioctl_nt.h>
+
+/* Are we using the canonical Netbios name (AFS)? */
+BOOL smb_TruncateNetbios = FALSE; /* what the registry says */
+BOOL smb_TruncateNetbiosReal = FALSE; /* what we actually grant */
+
static char AFSConfigKeyName[] =
"SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
char *drivep;
char hostName[256];
char tbuffer[100];
+ char buf[200];
char explicitNetbiosName[32];
+ DWORD isGateway = 0;
char *ctemp;
HANDLE fh;
HKEY parmKey;
long code;
if (fileNamep) {
- drivep = strchr(fileNamep, ':');
- if (drivep && (drivep - fileNamep) >= 1) {
- tbuffer[0] = *(drivep - 1);
- tbuffer[1] = ':';
- strcpy(tbuffer + 2, SMB_IOCTL_FILENAME);
- } else
- strcpy(tbuffer, SMB_IOCTL_FILENAME);
+ drivep = strchr(fileNamep, ':');
+ if (drivep && (drivep - fileNamep) >= 1) {
+ tbuffer[0] = *(drivep - 1);
+ tbuffer[1] = ':';
+ strcpy(tbuffer + 2, SMB_IOCTL_FILENAME);
+ } else
+ strcpy(tbuffer, SMB_IOCTL_FILENAME);
} else {
- /* No file name specified, use UNC name */
- /* First look for gateway host in Registry */
- code =
- RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0,
- KEY_QUERY_VALUE, &parmKey);
- if (code != ERROR_SUCCESS)
- goto nogateway;
- dummyLen = sizeof(explicitNetbiosName);
- code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
- (BYTE *) &explicitNetbiosName, &dummyLen);
- if (!code == ERROR_SUCCESS)
- {
- explicitNetbiosName[0] = 0;
- }
- dummyLen = sizeof(hostName);
- code =
- RegQueryValueEx(parmKey, "Gateway", NULL, NULL, hostName,
- &dummyLen);
- RegCloseKey(parmKey);
- if (code == ERROR_SUCCESS)
- goto havehost;
+ /* No file name specified, use UNC name */
+ code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName, 0,
+ KEY_QUERY_VALUE, &parmKey);
+ if (code != ERROR_SUCCESS)
+ goto nogateway;
+
+ dummyLen = sizeof(buf);
+ code = RegQueryValueEx(parmKey, "TruncateNetbios", NULL, NULL,
+ (BYTE *) buf, &dummyLen);
+ if (code == ERROR_SUCCESS)
+ {
+ if (!stricmp( (const char *) buf, "on"))
+ {
+ smb_TruncateNetbios = TRUE;
+ smb_TruncateNetbiosReal = TRUE;
+ }
+ }
+
+ dummyLen = sizeof(isGateway);
+ code = RegQueryValueEx(parmKey, "IsGateway", NULL, NULL,
+ (BYTE *) &isGateway, &dummyLen);
+
+ /* Is there an explicit name we should use? */
+ dummyLen = sizeof(explicitNetbiosName);
+ code = RegQueryValueEx(parmKey, "NetbiosName", NULL, NULL,
+ (BYTE *) &explicitNetbiosName, &dummyLen);
+ if (!code == ERROR_SUCCESS)
+ {
+ explicitNetbiosName[0] = 0;
+ }
+
+ /* Look for gateway host in Registry */
+ dummyLen = sizeof(hostName);
+ code = RegQueryValueEx(parmKey, "Gateway", NULL, NULL, hostName,
+ &dummyLen);
+ RegCloseKey(parmKey);
+ if (code == ERROR_SUCCESS)
+ goto havehost;
+
nogateway:
- /* No gateway name in registry; use ourself */
+ /* No gateway name in registry; use ourself */
#ifndef AFS_WIN95_ENV
- gethostname(hostName, sizeof(hostName));
+ gethostname(hostName, sizeof(hostName));
#else
- {
- int hostsize;
- /* DJGPP version of gethostname gets the NetBIOS
- * name of the machine, so that is what we are using for
- * the AFS server name instead of the DNS name. */
- hostsize = sizeof(hostName);
- GetComputerName(hostName, &hostsize);
- }
+ {
+ int hostsize;
+ /* DJGPP version of gethostname gets the NetBIOS
+ * name of the machine, so that is what we are using for
+ * the AFS server name instead of the DNS name. */
+ hostsize = sizeof(hostName);
+ GetComputerName(hostName, &hostsize);
+ }
#endif /* AFS_WIN95_ENV */
havehost:
sprintf(tbuffer, "\\\\%s\\all%s",
explicitNetbiosName, SMB_IOCTL_FILENAME);
}
+ else if (smb_TruncateNetbiosReal) {
+ sprintf(tbuffer, "\\\\AFS\\all%s", SMB_IOCTL_FILENAME);
+ }
else
{
_strupr(hostName);