int cm_sysNameCount = 0;
char *cm_sysNameList[MAXNUMSYSNAMES];
+DWORD TraceOption = 0;
+
/*
* AFSD Initialization Log
*
char t[100], u[100], *p, *path;
int zilch;
int code;
+ DWORD dwLow, dwHigh;
+ HKEY parmKey;
+ DWORD dummyLen;
+ DWORD maxLogSize = 100 * 1024;
afsi_file = INVALID_HANDLE_VALUE;
if (getenv("TEMP"))
GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, t, sizeof(t));
afsi_file = CreateFile(wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
+
+ code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSConfigKeyName,
+ 0, KEY_QUERY_VALUE, &parmKey);
+ if (code == ERROR_SUCCESS) {
+ dummyLen = sizeof(maxLogSize);
+ code = RegQueryValueEx(parmKey, "MaxLogSize", NULL, NULL,
+ (BYTE *) &maxLogSize, &dummyLen);
+ RegCloseKey (parmKey);
+ }
+
+ if (maxLogSize) {
+ dwLow = GetFileSize( afsi_file, &dwHigh );
+ if ( dwHigh > 0 || dwLow >= maxLogSize ) {
+ CloseHandle(afsi_file);
+ afsi_file = CreateFile( wd, GENERIC_WRITE, FILE_SHARE_READ, NULL,
+ CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
+ }
+ }
+
SetFilePointer(afsi_file, 0, NULL, FILE_END);
GetTimeFormat(LOCALE_SYSTEM_DEFAULT, 0, NULL, NULL, u, sizeof(u));
StringCbCatA(t, sizeof(t), ": Create log file\n");
}
}
+ dummyLen = sizeof(TraceOption);
+ code = RegQueryValueEx(parmKey, "TraceOption", NULL, NULL,
+ (BYTE *) &TraceOption, &dummyLen);
+ afsi_log("Event Log Tracing = %lX", TraceOption);
+
dummyLen = sizeof(traceBufSize);
code = RegQueryValueEx(parmKey, "TraceBufferSize", NULL, NULL,
(BYTE *) &traceBufSize, &dummyLen);
}
cm_mountRootLen = sizeof(cm_mountRoot);
- code = RegQueryValueEx(parmKey, "Mountroot", NULL, NULL,
+ code = RegQueryValueEx(parmKey, "MountRoot", NULL, NULL,
cm_mountRoot, &cm_mountRootLen);
if (code == ERROR_SUCCESS) {
afsi_log("Mount root %s", cm_mountRoot);
#include "krb.h"
#include "afskfw.h"
-DWORD LogonOption,TraceOption;
+DWORD TraceOption = 0;
HANDLE hDLL;
WSADATA WSAjunk;
+#define AFS_LOGON_EVENT_NAME TEXT("AFS Logon")
void DebugEvent0(char *a)
{
HANDLE h; char *ptbuf[1];
if (!ISLOGONTRACE(TraceOption))
return;
- h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
+ h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
ptbuf[0] = a;
ReportEvent(h, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)ptbuf, NULL);
DeregisterEventSource(h);
}
-#define MAXBUF_ 131
-void DebugEvent(char *a,char *b,...)
+#define MAXBUF_ 512
+void DebugEvent(char *b,...)
{
HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
va_list marker;
if (!ISLOGONTRACE(TraceOption))
return;
- /*if(!a) */
- a = AFS_DAEMON_EVENT_NAME;
- h = RegisterEventSource(NULL, a);
+ h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
va_start(marker,b);
StringCbVPrintf(buf, MAXBUF_+1,b,marker);
buf[MAXBUF_] = '\0';
if(hkDom) { \
dwSize = sizeof(v); \
rv = RegQueryValueEx(hkDom, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
- if(rv == ERROR_SUCCESS) DebugEvent(NULL, #v " found in hkDom with type [%d]", dwType); \
+ if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkDom with type [%d]", dwType); \
} \
if(hkDoms && (rv != ERROR_SUCCESS || dwType != t)) { \
dwSize = sizeof(v); \
rv = RegQueryValueEx(hkDoms, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
- if(rv == ERROR_SUCCESS) DebugEvent(NULL, #v " found in hkDoms with type [%d]", dwType); \
+ if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkDoms with type [%d]", dwType); \
} \
if(hkNp && (rv != ERROR_SUCCESS || dwType != t)) { \
dwSize = sizeof(v); \
rv = RegQueryValueEx(hkNp, n, 0, &dwType, (LPBYTE) &(v), &dwSize); \
- if(rv == ERROR_SUCCESS) DebugEvent(NULL, #v " found in hkNp with type [%d]", dwType); \
+ if(rv == ERROR_SUCCESS) DebugEvent(#v " found in hkNp with type [%d]", dwType); \
} \
if(rv != ERROR_SUCCESS || dwType != t) { \
v = d; \
- DebugEvent(NULL, #v " being set to default"); \
+ DebugEvent(#v " being set to default"); \
} \
} while(0)
char computerName[MAX_COMPUTERNAME_LENGTH + 1];
char *effDomain;
- DebugEvent(NULL,"In GetDomainLogonOptions for user [%s] in domain [%s]", username, domain);
+ DebugEvent("In GetDomainLogonOptions for user [%s] in domain [%s]", username, domain);
/* If the domain is the same as the Netbios computer name, we use the LOCALHOST domain name*/
opt->flags = LOGON_FLAG_REMOTE;
if(domain) {
rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY, 0, KEY_READ, &hkParm );
if(rv != ERROR_SUCCESS) {
hkParm = NULL;
- DebugEvent(NULL, "GetDomainLogonOption: Can't open parms key [%d]", rv);
+ DebugEvent("GetDomainLogonOption: Can't open parms key [%d]", rv);
}
rv = RegOpenKeyEx( HKEY_LOCAL_MACHINE, REG_CLIENT_PROVIDER_KEY, 0, KEY_READ, &hkNp );
if(rv != ERROR_SUCCESS) {
hkNp = NULL;
- DebugEvent(NULL, "GetDomainLogonOptions: Can't open NP key [%d]", rv);
+ DebugEvent("GetDomainLogonOptions: Can't open NP key [%d]", rv);
}
if(hkNp) {
rv = RegOpenKeyEx( hkNp, REG_CLIENT_DOMAINS_SUBKEY, 0, KEY_READ, &hkDoms );
if( rv != ERROR_SUCCESS ) {
hkDoms = NULL;
- DebugEvent(NULL, "GetDomainLogonOptions: Can't open Domains key [%d]", rv);
+ DebugEvent("GetDomainLogonOptions: Can't open Domains key [%d]", rv);
}
}
rv = RegOpenKeyEx( hkDoms, effDomain, 0, KEY_READ, &hkDom );
if( rv != ERROR_SUCCESS ) {
hkDom = NULL;
- DebugEvent( NULL, "GetDomainLogonOptions: Can't open domain key for [%s] [%d]", effDomain, rv);
+ DebugEvent("GetDomainLogonOptions: Can't open domain key for [%s] [%d]", effDomain, rv);
/* If none of the domains match, we shouldn't use the domain key either */
RegCloseKey(hkDoms);
hkDoms = NULL;
}
} else
- DebugEvent( NULL, "Not opening domain key for [%s]", effDomain);
+ DebugEvent("Not opening domain key for [%s]", effDomain);
/* Each individual can either be specified on the domain key, the domains key or in the
net provider key. They fail over in that order. If none is found, we just use the
UnicodeStringToANSI(plsd->UserName, lsaUsername, MAX_USERNAME_LENGTH);
UnicodeStringToANSI(plsd->LogonDomain, lsaDomain, MAX_DOMAIN_LENGTH);
- DebugEvent(NULL,"PLSD username[%s] domain[%s]",lsaUsername,lsaDomain);
+ DebugEvent("PLSD username[%s] domain[%s]",lsaUsername,lsaDomain);
if(SUCCEEDED(StringCbLength(lsaUsername, MAX_USERNAME_LENGTH, &tlen)))
len = tlen;
LsaFreeReturnBuffer(plsd);
}
- DebugEvent(NULL,"Looking up logon script");
+ DebugEvent("Looking up logon script");
/* Logon script */
/* First find out where the key is */
hkTemp = NULL;
rv = RegQueryValueExW(hkDom, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
if(rv == ERROR_SUCCESS && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
hkTemp = hkDom;
- DebugEvent(NULL,"Located logon script in hkDom");
+ DebugEvent("Located logon script in hkDom");
}
else if(hkDoms)
rv = RegQueryValueExW(hkDoms, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
hkTemp = hkDoms;
- DebugEvent(NULL,"Located logon script in hkDoms");
+ DebugEvent("Located logon script in hkDoms");
}
/* Note that the LogonScript in the NP key is only used if we are doing high security. */
else if(hkNp && ISHIGHSECURITY(opt->LogonOption))
rv = RegQueryValueExW(hkNp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, NULL, &dwSize);
if(rv == ERROR_SUCCESS && !hkTemp && (dwType == REG_SZ || dwType == REG_EXPAND_SZ)) {
hkTemp = hkNp;
- DebugEvent(NULL,"Located logon script in hkNp");
+ DebugEvent("Located logon script in hkNp");
}
if(hkTemp) {
wuname = malloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP,0,opt->smbName,-1,wuname,len*sizeof(WCHAR));
- DebugEvent(NULL,"Username is set for [%S]", wuname);
+ DebugEvent("Username is set for [%S]", wuname);
/* dwSize still has the size of the required buffer in bytes. */
regscript = malloc(dwSize);
rv = RegQueryValueExW(hkTemp, REG_CLIENT_LOGON_SCRIPT_PARMW, 0, &dwType, (LPBYTE) regscript, &dwSize);
if(rv != ERROR_SUCCESS) {/* what the ..? */
- DebugEvent(NULL,"Can't look up logon script [%d]",rv);
+ DebugEvent("Can't look up logon script [%d]",rv);
goto doneLogonScript;
}
- DebugEvent(NULL,"Found logon script [%S]", regscript);
+ DebugEvent("Found logon script [%S]", regscript);
if(dwType == REG_EXPAND_SZ) {
DWORD dwReq;
regscript = regexscript;
regexscript = NULL;
if(dwReq > (dwSize / sizeof(WCHAR))) {
- DebugEvent(NULL,"Overflow while expanding environment strings.");
+ DebugEvent("Overflow while expanding environment strings.");
goto doneLogonScript;
}
}
- DebugEvent(NULL,"After expanding env strings [%S]", regscript);
+ DebugEvent("After expanding env strings [%S]", regscript);
if(wcsstr(regscript, L"%s")) {
dwSize += len * sizeof(WCHAR); /* make room for username expansion */
hr = StringCbCopyW(regexuscript, dwSize, regscript);
}
- DebugEvent(NULL,"After expanding username [%S]", regexuscript);
+ DebugEvent("After expanding username [%S]", regexuscript);
if(hr == S_OK)
opt->logonScript = regexuscript;
/* Convert from Unicode to ANSI */
/*TODO: Use SecureZeroMemory to erase passwords */
- UnicodeStringToANSI(IL->UserName, uname, 256);
- UnicodeStringToANSI(IL->Password, password, 256);
- UnicodeStringToANSI(IL->LogonDomainName, logonDomain, 256);
+ UnicodeStringToANSI(IL->UserName, uname, MAX_USERNAME_LENGTH);
+ UnicodeStringToANSI(IL->Password, password, MAX_PASSWORD_LENGTH);
+ UnicodeStringToANSI(IL->LogonDomainName, logonDomain, MAX_DOMAIN_LENGTH);
/* Make sure AD-DOMANS sent from login that is sent to us is striped */
ctemp = strchr(uname, '@');
sleepInterval = opt.sleepInterval;
*lpLogonScript = opt.logonScript;
- DebugEvent(NULL,"Got logon script: %S",opt.logonScript);
+ DebugEvent("Got logon script: %S",opt.logonScript);
afsWillAutoStart = AFSWillAutoStart();
- DebugEvent("AFS AfsLogon - NPLogonNotify","LogonOption[%x], Service AutoStart[%d]",
+ DebugEvent("LogonOption[%x], Service AutoStart[%d]",
opt.LogonOption,afsWillAutoStart);
/* Check for zero length password if integrated logon*/
if ( ISLOGONINTEGRATED(opt.LogonOption) ) {
if ( password[0] == 0 ) {
+ DebugEvent("Password is the empty string");
code = GT_PW_NULL;
reason = "zero length password is illegal";
code=0;
/* Get cell name if doing integrated logon.
We might overwrite this if we are logging into an AD realm and we find out that
the user's home dir is in some other cell. */
+ DebugEvent("About to call cm_GetRootCellName(%s)",cell);
code = cm_GetRootCellName(cell);
if (code < 0) {
+ DebugEvent("Unable to obtain Root Cell");
code = KTC_NOCELL;
reason = "unknown cell";
code=0;
- }
+ } else {
+ DebugEvent("Cell is %s",cell);
+ }
/* We get the user's home directory path, if applicable, though we can't lookup the
cell right away because the client service may not have started yet. This call
also sets the AD_REALM flag in opt.flags if applicable. */
- if(ISREMOTE(opt.flags))
+ if(ISREMOTE(opt.flags)) {
+ DebugEvent("Is Remote");
GetAdHomePath(homePath,MAX_PATH,lpLogonId,&opt);
+ }
}
/* loop until AFS is started. */
while (TRUE) {
- if(ISADREALM(opt.flags)) {
+ DebugEvent("while(TRUE) LogonOption[%x], Service AutoStart[%d]",
+ opt.LogonOption,afsWillAutoStart);
+
+ if(ISADREALM(opt.flags)) {
code = GetFileCellName(homePath,cell,256);
if(!code) {
- DebugEvent(NULL,"profile path [%s] is in cell [%s]",homePath,cell);
+ DebugEvent("profile path [%s] is in cell [%s]",homePath,cell);
}
/* Don't bail out if GetFileCellName failed.
* The home dir may not be in AFS after all.
{
if ( KFW_is_available() ) {
code = KFW_AFS_get_cred(uname, cell, password, 0, opt.smbName, &reason);
- DebugEvent(NULL,"KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]",uname,opt.smbName,cell,code);
+ DebugEvent("KFW_AFS_get_cred uname=[%s] smbname=[%s] cell=[%s] code=[%d]",uname,opt.smbName,cell,code);
}
else {
code = ka_UserAuthenticateGeneral2(KA_USERAUTH_VERSION+KA_USERAUTH_AUTHENT_LOGON,
retryInterval -= sleepInterval;
}
+ DebugEvent("while loop exited");
/* remove any kerberos 5 tickets currently held by the SYSTEM account */
if ( KFW_is_available() )
KFW_AFS_destroy_tickets_for_cell(cell);
HANDLE h;
char *ptbuf[1];
- h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
+ h = RegisterEventSource(NULL, AFS_LOGON_EVENT_NAME);
ptbuf[0] = msg;
ReportEvent(h, EVENTLOG_WARNING_TYPE, 0, 1008, NULL,
1, 0, ptbuf, NULL);
code = MapAuthError(code);
SetLastError(code);
- if (ISLOGONINTEGRATED(LogonOption) && (code!=0))
+ if (ISLOGONINTEGRATED(opt.LogonOption) && (code!=0))
{
if (*lpLogonScript)
LocalFree(*lpLogonScript);
return TRUE;
}
+#ifdef COMMENT
+typedef struct _WLX_NOTIFICATION_INFO {
+ ULONG Size;
+ ULONG Flags;
+ PWSTR UserName;
+ PWSTR Domain;
+ PWSTR WindowStation;
+ HANDLE hToken;
+ HDESK hDesktop;
+ PFNMSGECALLBACK pStatusCallback;
+} WLX_NOTIFICATION_INFO, *PWLX_NOTIFICATION_INFO;
+#endif
+
+VOID AFS_Startup_Event( PWLX_NOTIFICATION_INFO pInfo )
+{
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
+
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+ LSPsize=sizeof(TraceOption);
+ RegQueryValueEx(NPKey, REG_CLIENT_TRACE_OPTION_PARM, NULL,
+ &LSPtype, (LPBYTE)&TraceOption, &LSPsize);
+
+ RegCloseKey (NPKey);
+ DebugEvent0("AFS_Startup_Event");
+}
+
VOID AFS_Logoff_Event( PWLX_NOTIFICATION_INFO pInfo )
{
DWORD code;
TCHAR profileDir[256] = TEXT("");
DWORD len = 256;
+ PTOKEN_USER tokenUser = NULL;
+ DWORD retLen;
+ HANDLE hToken;
+
+ DebugEvent0("AFS_Logoff_Event - Starting");
- if ( GetUserProfileDirectory(pInfo->hToken, profileDir, &len) ) {
+ if (!GetTokenInformation(pInfo->hToken, TokenUser, NULL, 0, &retLen))
+ {
+ if ( GetLastError() == ERROR_INSUFFICIENT_BUFFER ) {
+ tokenUser = (PTOKEN_USER) LocalAlloc(LPTR, retLen);
+
+ if (!GetTokenInformation(pInfo->hToken, TokenUser, tokenUser, retLen, &retLen))
+ {
+ DebugEvent("GetTokenInformation failed: GLE = %lX", GetLastError());
+ }
+ }
+ }
+
+ if (QueryAdHomePathFromSid( profileDir, sizeof(profileDir), tokenUser->User.Sid))
+ GetUserProfileDirectory(pInfo->hToken, profileDir, &len);
+
+ if (strlen(profileDir)) {
+ DebugEvent("Profile Directory: %s", profileDir);
if (!IsPathInAfs(profileDir)) {
if (code = ktc_ForgetAllTokens())
- DebugEvent(NULL,"AFS AfsLogon - AFS_Logoff_Event - ForgetAllTokens failed [%lX]",code);
+ DebugEvent("AFS_Logoff_Event - ForgetAllTokens failed [%lX]",code);
else
- DebugEvent0("AFS AfsLogon - AFS_Logoff_Event - ForgetAllTokens succeeded");
+ DebugEvent0("AFS_Logoff_Event - ForgetAllTokens succeeded");
} else {
- DebugEvent0("AFS AfsLogon - AFS_Logoff_Event - Tokens left in place; profile in AFS");
+ DebugEvent0("AFS_Logoff_Event - Tokens left in place; profile in AFS");
}
+ } else {
+ DebugEvent0("AFS_Logoff_Event - Unable to load profile");
}
+
+ if ( tokenUser )
+ LocalFree(tokenUser);
}
+
NPGetCaps
NPLogonNotify
NPPasswordChangeNotify
+ AFS_Startup_Event
AFS_Logoff_Event
#endif
void DebugEvent0(char *a);
-void DebugEvent(char *a,char *b,...);
+void DebugEvent(char *b,...);
CHAR *GenRandomName(CHAR *pbuf);
void GetDomainLogonOptions( PLUID lpLogonId, char * username, char * domain, LogonOptions_t *opt );
DWORD GetFileCellName(char * path, char * cell, size_t cellLen);
DWORD GetAdHomePath(char * homePath, size_t homePathLen, PLUID lpLogonId, LogonOptions_t * opt);
+DWORD QueryAdHomePathFromSid(char * homePath, size_t homePathLen, PSID psid);
#ifdef __cplusplus
}
#define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
#endif /* DJGPP || WIN95 */
-#ifdef DEBUG
-DWORD TraceOption=1;
+static DWORD TraceOption = 0;
+
+/* This really needs to be initialized at DLL Init */
+#define TRACE_OPTION_EVENT 4
-#define TRACE_OPTION_EVENT 1
-#define ISLOGONTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
+#define ISCONFIGTRACE(v) ( ((v) & TRACE_OPTION_EVENT)==TRACE_OPTION_EVENT)
void DebugEvent0_local(char *a)
{
HANDLE h; char *ptbuf[1];
- if (!ISLOGONTRACE(TraceOption))
+ if (!ISCONFIGTRACE(TraceOption))
return;
h = RegisterEventSource(NULL, a);
ptbuf[0] = a;
{
HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
va_list marker;
- if (!ISLOGONTRACE(TraceOption))
+ if (!ISCONFIGTRACE(TraceOption))
return;
h = RegisterEventSource(NULL, a);
va_start(marker,b);
DeregisterEventSource(h);
va_end(marker);
}
-#endif /* DEBUG */
+
+#define REG_CLIENT_PARMS_KEY TEXT("SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters")
+#define REG_CLIENT_TRACE_OPTION_PARM TEXT("TraceOption")
+
+#ifdef COMMENT
+BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH: {
+ DWORD LSPtype, LSPsize;
+ HKEY NPKey;
+
+ (void) RegOpenKeyEx(HKEY_LOCAL_MACHINE, REG_CLIENT_PARMS_KEY,
+ 0, KEY_QUERY_VALUE, &NPKey);
+ LSPsize=sizeof(TraceOption);
+ RegQueryValueEx(NPKey, REG_CLIENT_TRACE_OPTION_PARM, NULL,
+ &LSPtype, (LPBYTE)&TraceOption, &LSPsize);
+
+ RegCloseKey (NPKey);
+ break;
+ }
+
+ case DLL_THREAD_ATTACH:
+ break;
+
+ case DLL_THREAD_DETACH:
+ break;
+
+ case DLL_PROCESS_DETACH:
+ break;
+
+ default:
+ return FALSE;
+ }
+
+ return TRUE; // successful DLL_PROCESS_ATTACH
+}
+#endif /* COMMENT */
static long cm_ParsePair(char *lineBufferp, char *leftp, char *rightp)
{
cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
{
char wdir[256];
- long code;
long tlen;
FILE *tfilep;
void cm_GetConfigDir(char *dir)
{
char wdir[256];
- int code;
int tlen;
#ifdef AFS_WIN95_ENV
char *afsconf_path;
getAFSServer @14
cm_InitDNS @15
cm_GetConfigDir @16
+
\ No newline at end of file
&expiry);
if(status != SEC_E_OK) {
- DebugEvent(NULL,"AcquireCredentialsHandle failed: %lX", status);
+ DebugEvent("AcquireCredentialsHandle failed: %lX", status);
goto ghp_0;
}
&expiry
);
- DebugEvent(NULL,"InitializeSecurityContext returns status[%lX](%s)",status,_get_sec_err_text(status));
+ DebugEvent("InitializeSecurityContext returns status[%lX](%s)",status,_get_sec_err_text(status));
if(!first) FreeContextBuffer(stoks.pvBuffer);
}
if(!stokc.cbBuffer && !cont) {
- DebugEvent(NULL,"Breaking out after InitializeSecurityContext");
+ DebugEvent("Breaking out after InitializeSecurityContext");
break;
}
&sattrs,
&expiry);
- DebugEvent(NULL,"AcceptSecurityContext returns status[%lX](%s)", status, _get_sec_err_text(status));
+ DebugEvent("AcceptSecurityContext returns status[%lX](%s)", status, _get_sec_err_text(status));
FreeContextBuffer(stokc.pvBuffer);
} while(cont && iters);
if(sattrs & ASC_RET_DELEGATE) {
- DebugEvent(NULL,"Received delegate context");
+ DebugEvent("Received delegate context");
*outCtx = ctxserver;
code = 0;
} else {
- DebugEvent(NULL,"Didn't receive delegate context");
+ DebugEvent("Didn't receive delegate context");
outCtx->dwLower = 0;
outCtx->dwUpper = 0;
DeleteSecurityContext(&ctxserver);
}
-ghp_2:
DeleteSecurityContext(&ctxclient);
-ghp_1:
FreeCredentialsHandle(&creds);
ghp_0:
return code;
}
-DWORD QueryAdHomePath(char * homePath, size_t homePathLen, PLUID lpLogonId) {
+DWORD QueryAdHomePathFromSid(char * homePath, size_t homePathLen, PSID psid) {
DWORD code = 1; /* default is failure */
-
- PSECURITY_LOGON_SESSION_DATA plsd;
NTSTATUS rv = 0;
- DWORD size1,size2;
- SID_NAME_USE snu;
HRESULT hr = S_OK;
LPWSTR p = NULL;
WCHAR adsPath[MAX_PATH] = L"";
homePath[0] = '\0';
- rv = LsaGetLogonSessionData(lpLogonId, &plsd);
- if(rv == 0){
- if(ConvertSidToStringSidW(plsd->Sid,&p)) {
- IADsNameTranslate *pNto;
-
- DebugEvent(NULL, "Got SID string [%S]", p);
-
- hr = CoInitialize(NULL);
- if(SUCCEEDED(hr))
- coInitialized = TRUE;
-
- hr = CoCreateInstance(CLSID_NameTranslate,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_IADsNameTranslate,
- (void**)&pNto);
-
- if(FAILED(hr)) { DebugEvent(NULL,"Can't create nametranslate object"); }
- else {
- hr = pNto->Init(ADS_NAME_INITTYPE_GC,L""); //,clientUpn/*IL->UserName.Buffer*/,IL->LogonDomainName.Buffer,IL->Password.Buffer);
- if (FAILED(hr)) {
- DebugEvent(NULL,"NameTranslate Init failed [%ld]", hr);
- }
- else {
- hr = pNto->Set(ADS_NAME_TYPE_SID_OR_SID_HISTORY_NAME, p);
- if(FAILED(hr)) { DebugEvent(NULL,"Can't set sid string"); }
- else {
- BSTR bstr;
-
- hr = pNto->Get(ADS_NAME_TYPE_1779, &bstr);
- wcscpy(adsPath, bstr);
-
- SysFreeString(bstr);
- }
- }
- pNto->Release();
- }
-
- LocalFree(p);
+ if(ConvertSidToStringSidW(psid,&p)) {
+ IADsNameTranslate *pNto;
- } else {
- DebugEvent(NULL, "Can't convert sid to string");
- }
+ DebugEvent("Got SID string [%S]", p);
- LsaFreeReturnBuffer(plsd);
- } else {
- DebugEvent(NULL, "LsaGetLogonSessionData failed");
- }
+ hr = CoInitialize(NULL);
+ if(SUCCEEDED(hr))
+ coInitialized = TRUE;
+
+ hr = CoCreateInstance( CLSID_NameTranslate,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ IID_IADsNameTranslate,
+ (void**)&pNto);
+
+ if(FAILED(hr)) { DebugEvent("Can't create nametranslate object"); }
+ else {
+ hr = pNto->Init(ADS_NAME_INITTYPE_GC,L""); //,clientUpn/*IL->UserName.Buffer*/,IL->LogonDomainName.Buffer,IL->Password.Buffer);
+ if (FAILED(hr)) {
+ DebugEvent("NameTranslate Init failed [%ld]", hr);
+ }
+ else {
+ hr = pNto->Set(ADS_NAME_TYPE_SID_OR_SID_HISTORY_NAME, p);
+ if(FAILED(hr)) { DebugEvent("Can't set sid string"); }
+ else {
+ BSTR bstr;
+
+ hr = pNto->Get(ADS_NAME_TYPE_1779, &bstr);
+ wcscpy(adsPath, bstr);
+
+ SysFreeString(bstr);
+ }
+ }
+ pNto->Release();
+ }
+
+ LocalFree(p);
+
+ } else {
+ DebugEvent("Can't convert sid to string");
+ }
if(adsPath[0]) {
WCHAR fAdsPath[MAX_PATH];
hr = StringCchPrintfW(fAdsPath, MAX_PATH, L"LDAP://%s", adsPath);
if(hr != S_OK) {
- DebugEvent(NULL, "Can't format full adspath");
+ DebugEvent("Can't format full adspath");
goto cleanup;
}
- DebugEvent(NULL, "Trying adsPath=[%S]", fAdsPath);
+ DebugEvent("Trying adsPath=[%S]", fAdsPath);
hr = ADsGetObject( fAdsPath, IID_IADsUser, (LPVOID *) &pAdsUser);
if(hr != S_OK) {
- DebugEvent(NULL, "Can't open IADs object");
+ DebugEvent("Can't open IADs object");
goto cleanup;
}
hr = pAdsUser->get_Profile(&bstHomeDir);
if(hr != S_OK) {
- DebugEvent(NULL, "Can't get profile directory");
+ DebugEvent("Can't get profile directory");
goto cleanup_homedir_section;
}
wcstombs(homePath, bstHomeDir, homePathLen);
- DebugEvent(NULL, "Got homepath [%s]", homePath);
+ DebugEvent("Got homepath [%s]", homePath);
SysFreeString(bstHomeDir);
homePath[0] = '\0';
- if(LogonSSP(lpLogonId,&ctx))
+ if(LogonSSP(lpLogonId,&ctx)) {
+ DebugEvent("Failed LogonSSP");
return 1;
- else {
+ } else {
status = ImpersonateSecurityContext(&ctx);
if(status == SEC_E_OK) {
- if(!QueryAdHomePath(homePath,homePathLen,lpLogonId)) {
- DebugEvent(NULL,"Returned home path [%s]",homePath);
- opt->flags |= LOGON_FLAG_AD_REALM;
- }
- RevertSecurityContext(&ctx);
+ PSECURITY_LOGON_SESSION_DATA plsd;
+ NTSTATUS rv;
+
+ rv = LsaGetLogonSessionData(lpLogonId, &plsd);
+ if(rv == 0) {
+ if(!QueryAdHomePathFromSid(homePath,homePathLen,plsd->Sid)) {
+ DebugEvent("Returned home path [%s]",homePath);
+ opt->flags |= LOGON_FLAG_AD_REALM;
+ }
+ LsaFreeReturnBuffer(plsd);
+ } else {
+ DebugEvent("LsaGetLogonSessionData failed [%lX]", rv);
+ }
+ RevertSecurityContext(&ctx);
} else {
- DebugEvent(NULL,"Can't impersonate context [%lX]",status);
+ DebugEvent("Can't impersonate context [%lX]",status);
code = 1;
}
-ghp_0:
- DeleteSecurityContext(&ctx);
+
+ DeleteSecurityContext(&ctx);
return code;
}
}
#include "drivemap.h"
#include <time.h>
#include <adssts.h>
+#ifdef DEBUG
#define DEBUG_VERBOSE
+#endif
#include <osilog.h>
#include <lanahelper.h>
WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Impersonate" 1
WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "DLLName" "afslogon.dll"
WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Logoff" "AFS_Logoff_Event"
+ WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" "Startup" "AFS_Startup_Event"
SetRebootFlag true
Call AFSLangFiles
SetOutPath "$INSTDIR\Common"
- SetOutPath "$INSTDIR\Common"
-!IFDEF DEBUG
-!IFDEF CL_1310
- File "${SYSTEMDIR}\msvcr71d.dll"
- File "${SYSTEMDIR}\msvcp71d.dll"
- File "${SYSTEMDIR}\mfc71d.dll"
- File "${SYSTEMDIR}\MFC71CHS.DLL"
- File "${SYSTEMDIR}\MFC71CHT.DLL"
- File "${SYSTEMDIR}\MFC71DEU.DLL"
- File "${SYSTEMDIR}\MFC71ENU.DLL"
- File "${SYSTEMDIR}\MFC71ESP.DLL"
- File "${SYSTEMDIR}\MFC71FRA.DLL"
- File "${SYSTEMDIR}\MFC71ITA.DLL"
- File "${SYSTEMDIR}\MFC71JPN.DLL"
- File "${SYSTEMDIR}\MFC71KOR.DLL"
-!ELSE
-!IFDEF CL_1300
- File "${SYSTEMDIR}\msvcr70d.dll"
- File "${SYSTEMDIR}\msvcp70d.dll"
- File "${SYSTEMDIR}\mfc70d.dll"
- File "${SYSTEMDIR}\MFC70CHS.DLL"
- File "${SYSTEMDIR}\MFC70CHT.DLL"
- File "${SYSTEMDIR}\MFC70DEU.DLL"
- File "${SYSTEMDIR}\MFC70ENU.DLL"
- File "${SYSTEMDIR}\MFC70ESP.DLL"
- File "${SYSTEMDIR}\MFC70FRA.DLL"
- File "${SYSTEMDIR}\MFC70ITA.DLL"
- File "${SYSTEMDIR}\MFC70JPN.DLL"
- File "${SYSTEMDIR}\MFC70KOR.DLL"
-!ELSE
- File "${SYSTEMDIR}\mfc42d.dll"
- File "${SYSTEMDIR}\msvcp60d.dll"
- File "${SYSTEMDIR}\msvcrtd.dll"
-!ENDIF
-!ENDIF
-!ELSE
-!IFDEF CL_1310
- File "${SYSTEMDIR}\mfc71.dll"
- File "${SYSTEMDIR}\msvcr71.dll"
- File "${SYSTEMDIR}\msvcp71.dll"
- File "${SYSTEMDIR}\MFC71CHS.DLL"
- File "${SYSTEMDIR}\MFC71CHT.DLL"
- File "${SYSTEMDIR}\MFC71DEU.DLL"
- File "${SYSTEMDIR}\MFC71ENU.DLL"
- File "${SYSTEMDIR}\MFC71ESP.DLL"
- File "${SYSTEMDIR}\MFC71FRA.DLL"
- File "${SYSTEMDIR}\MFC71ITA.DLL"
- File "${SYSTEMDIR}\MFC71JPN.DLL"
- File "${SYSTEMDIR}\MFC71KOR.DLL"
-!ELSE
-!IFDEF CL_1300
- File "${SYSTEMDIR}\mfc70.dll"
- File "${SYSTEMDIR}\msvcr70.dll"
- File "${SYSTEMDIR}\msvcp70.dll"
- File "${SYSTEMDIR}\MFC70CHS.DLL"
- File "${SYSTEMDIR}\MFC70CHT.DLL"
- File "${SYSTEMDIR}\MFC70DEU.DLL"
- File "${SYSTEMDIR}\MFC70ENU.DLL"
- File "${SYSTEMDIR}\MFC70ESP.DLL"
- File "${SYSTEMDIR}\MFC70FRA.DLL"
- File "${SYSTEMDIR}\MFC70ITA.DLL"
- File "${SYSTEMDIR}\MFC70JPN.DLL"
- File "${SYSTEMDIR}\MFC70KOR.DLL"
-!ELSE
- File "${SYSTEMDIR}\mfc42.dll"
- File "${SYSTEMDIR}\msvcp60.dll"
- File "${SYSTEMDIR}\msvcrt.dll"
-!ENDIF
-!ENDIF
-!ENDIF
;Store install folder
WriteRegStr HKCU "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "PathName" $INSTDIR
WriteRegStr HKLM "${AFS_REGKEY_ROOT}\AFS Control Center\CurrentVersion" "VersionString" ${AFS_VERSION}
File "${AFS_SERVER_BUILDDIR}\afskasadmin.dll"
File "${AFS_SERVER_BUILDDIR}\afsptsadmin.dll"
+ SetOutPath "$INSTDIR\Common"
+
!IFDEF DEBUG
!IFDEF CL_1310
- File "${SYSTEMDIR}\msvcr71d.dll"
- File "${SYSTEMDIR}\msvcr71d.pdb"
- File "${SYSTEMDIR}\msvcp71d.dll"
- File "${SYSTEMDIR}\msvcp71d.pdb"
- File "${SYSTEMDIR}\mfc71d.dll"
- File "${SYSTEMDIR}\mfc71d.pdb"
- File "${SYSTEMDIR}\MFC71CHS.DLL"
- File "${SYSTEMDIR}\MFC71CHT.DLL"
- File "${SYSTEMDIR}\MFC71DEU.DLL"
- File "${SYSTEMDIR}\MFC71ENU.DLL"
- File "${SYSTEMDIR}\MFC71ESP.DLL"
- File "${SYSTEMDIR}\MFC71FRA.DLL"
- File "${SYSTEMDIR}\MFC71ITA.DLL"
- File "${SYSTEMDIR}\MFC71JPN.DLL"
- File "${SYSTEMDIR}\MFC71KOR.DLL"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\Common\msvcr71d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\Common\msvcp71d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\Common\mfc71d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\Common\MFC71CHS.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\Common\MFC71CHT.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\Common\MFC71DEU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\Common\MFC71ENU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\Common\MFC71ESP.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\Common\MFC71FRA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\Common\MFC71ITA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\Common\MFC71JPN.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\Common\MFC71KOR.DLL" "$INSTDIR"
!ELSE
!IFDEF CL_1300
- File "${SYSTEMDIR}\msvcr70d.dll"
- File "${SYSTEMDIR}\msvcr70d.pdb"
- File "${SYSTEMDIR}\msvcp70d.dll"
- File "${SYSTEMDIR}\msvcp70d.pdb"
- File "${SYSTEMDIR}\mfc70d.dll"
- File "${SYSTEMDIR}\mfc70d.pdb"
- File "${SYSTEMDIR}\MFC70CHS.DLL"
- File "${SYSTEMDIR}\MFC70CHT.DLL"
- File "${SYSTEMDIR}\MFC70DEU.DLL"
- File "${SYSTEMDIR}\MFC70ENU.DLL"
- File "${SYSTEMDIR}\MFC70ESP.DLL"
- File "${SYSTEMDIR}\MFC70FRA.DLL"
- File "${SYSTEMDIR}\MFC70ITA.DLL"
- File "${SYSTEMDIR}\MFC70JPN.DLL"
- File "${SYSTEMDIR}\MFC70KOR.DLL"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\Common\msvcr70d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\Common\msvcp70d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\Common\mfc70d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\Common\MFC70CHS.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\Common\MFC70CHT.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\Common\MFC70DEU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\Common\MFC70ENU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\Common\MFC70ESP.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\Common\MFC70FRA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\Common\MFC70ITA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\Common\MFC70JPN.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\Common\MFC70KOR.DLL" "$INSTDIR"
!ELSE
- File "${SYSTEMDIR}\mfc42d.dll"
- File "${SYSTEMDIR}\mfc42d.pdb"
- File "${SYSTEMDIR}\msvcp60d.dll"
- File "${SYSTEMDIR}\msvcp60d.pdb"
- File "${SYSTEMDIR}\msvcrtd.dll"
- File "${SYSTEMDIR}\msvcrtd.pdb"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\Common\mfc42d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\Common\msvcp60d.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\Common\msvcrtd.dll" "$INSTDIR"
!ENDIF
!ENDIF
!ELSE
!IFDEF CL_1310
- File "${SYSTEMDIR}\mfc71.dll"
- File "${SYSTEMDIR}\msvcr71.dll"
- File "${SYSTEMDIR}\msvcp71.dll"
- File "${SYSTEMDIR}\MFC71CHS.DLL"
- File "${SYSTEMDIR}\MFC71CHT.DLL"
- File "${SYSTEMDIR}\MFC71DEU.DLL"
- File "${SYSTEMDIR}\MFC71ENU.DLL"
- File "${SYSTEMDIR}\MFC71ESP.DLL"
- File "${SYSTEMDIR}\MFC71FRA.DLL"
- File "${SYSTEMDIR}\MFC71ITA.DLL"
- File "${SYSTEMDIR}\MFC71JPN.DLL"
- File "${SYSTEMDIR}\MFC71KOR.DLL"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\Common\mfc71.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\Common\msvcr71.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\Common\msvcp71.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\Common\MFC71CHS.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\Common\MFC71CHT.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\Common\MFC71DEU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\Common\MFC71ENU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\Common\MFC71ESP.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\Common\MFC71FRA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\Common\MFC71ITA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\Common\MFC71JPN.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\Common\MFC71KOR.DLL" "$INSTDIR"
!ELSE
!IFDEF CL_1300
- File "${SYSTEMDIR}\mfc70.dll"
- File "${SYSTEMDIR}\msvcr70.dll"
- File "${SYSTEMDIR}\msvcp70.dll"
- File "${SYSTEMDIR}\MFC70CHS.DLL"
- File "${SYSTEMDIR}\MFC70CHT.DLL"
- File "${SYSTEMDIR}\MFC70DEU.DLL"
- File "${SYSTEMDIR}\MFC70ENU.DLL"
- File "${SYSTEMDIR}\MFC70ESP.DLL"
- File "${SYSTEMDIR}\MFC70FRA.DLL"
- File "${SYSTEMDIR}\MFC70ITA.DLL"
- File "${SYSTEMDIR}\MFC70JPN.DLL"
- File "${SYSTEMDIR}\MFC70KOR.DLL"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\Common\mfc70.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\Common\msvcr70.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\Common\msvcp70.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\Common\MFC70CHS.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\Common\MFC70CHT.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\Common\MFC70DEU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\Common\MFC70ENU.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\Common\MFC70ESP.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\Common\MFC70FRA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\Common\MFC70ITA.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\Common\MFC70JPN.DLL" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\Common\MFC70KOR.DLL" "$INSTDIR"
!ELSE
- File "${SYSTEMDIR}\mfc42.dll"
- File "${SYSTEMDIR}\msvcp60.dll"
- File "${SYSTEMDIR}\msvcrt.dll"
-!ENDIF
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\Common\mfc42.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\Common\msvcp60.dll" "$INSTDIR"
+ !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\Common\msvcrt.dll" "$INSTDIR"
!ENDIF
!ENDIF
+!ENDIF
StrCmp $LANGUAGE ${LANG_ENGLISH} DoEnglish
StrCmp $LANGUAGE ${LANG_GERMAN} DoGerman
<Registry Id="reg_afslogon04" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" Name="Impersonate" Value="1" Type="integer" />
<Registry Id="reg_afslogon05" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" Name="DLLName" Value="#fileafslogon_DLL" />
<Registry Id="reg_afslogon06" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" Name="Logoff" Value="AFS_Logoff_Event" />
+ <Registry Id="reg_afslogon07" Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\AfsLogon" Name="Startup" Value="AFS_Startup_Event" />
</Component>
<?ifdef DebugSyms?>
<Component Id="cmp_ClientSystemDebug" Guid="DD34DA09-D9DA-4A5A-9521-87B7738A7D53">
strcompose(tbuffer, sizeof(tbuffer), adir->name, "/",
AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
} else {
- int len = strlen(tbuffer);
+ int len;
+ strncpy(tbuffer, adir->name, sizeof(tbuffer));
+ len = strlen(tbuffer);
if ( tbuffer[len-1] != '\\' && tbuffer[len-1] != '/' ) {
strncat(tbuffer, "\\", sizeof(tbuffer));
}
strcompose(tbuffer, sizeof(tbuffer), adir->name, "/",
AFSDIR_CELLSERVDB_FILE_NTCLIENT, NULL);
} else {
- int len = strlen(tbuffer);
+ int len;
+ strncpy(tbuffer, adir->name, sizeof(tbuffer));
+ len = strlen(tbuffer);
if ( tbuffer[len-1] != '\\' && tbuffer[len-1] != '/' ) {
strncat(tbuffer, "\\", sizeof(tbuffer));
}