--------------------- PatchSet 8653 Date: 2006/09/17 08:47:16 Author: serassio Branch: nt Tag: (none) Log: Fix many gcc warnings Members: helpers/basic_auth/mswin_sspi/valid.c:1.1.2.2->1.1.2.3 helpers/external_acl/mswin_lm_group/win32_check_group.c:1.1.2.3->1.1.2.4 helpers/ntlm_auth/mswin_sspi/libntlmssp.c:1.1.2.2->1.1.2.3 Index: squid/helpers/basic_auth/mswin_sspi/valid.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/basic_auth/mswin_sspi/valid.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/helpers/basic_auth/mswin_sspi/valid.c 27 May 2006 10:12:42 -0000 1.1.2.2 +++ squid/helpers/basic_auth/mswin_sspi/valid.c 17 Sep 2006 08:47:16 -0000 1.1.2.3 @@ -49,11 +49,11 @@ Valid_Group(char *UserName, char *Group) { int result = FALSE; - WCHAR wszUserName[256]; // Unicode user name + WCHAR wszUserName[256]; /* Unicode user name */ - WCHAR wszGroup[256]; // Unicode Group + WCHAR wszGroup[256]; /* Unicode Group */ - LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; + LPLOCALGROUP_USERS_INFO_0 pBuf; LPLOCALGROUP_USERS_INFO_0 pTmpBuf; DWORD dwLevel = 0; DWORD dwFlags = LG_INCLUDE_INDIRECT; @@ -63,6 +63,7 @@ NET_API_STATUS nStatus; DWORD i; DWORD dwTotalCount = 0; + LPBYTE pBufTmp = NULL; /* Convert ANSI User Name and Group to Unicode */ @@ -84,7 +85,11 @@ wszUserName, dwLevel, dwFlags, - (LPBYTE *) & pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); + &pBufTmp, + dwPrefMaxLen, + &dwEntriesRead, + &dwTotalEntries); + pBuf = (LPLOCALGROUP_USERS_INFO_0)pBufTmp; /* * If the call succeeds, */ @@ -126,7 +131,7 @@ int result = NTV_SERVER_ERROR; size_t i; char NTDomain[256]; - char *domain_qualify; + char *domain_qualify = NULL; char DomainUser[256]; char User[256]; Index: squid/helpers/external_acl/mswin_lm_group/win32_check_group.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/mswin_lm_group/win32_check_group.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- squid/helpers/external_acl/mswin_lm_group/win32_check_group.c 5 Jul 2006 16:08:44 -0000 1.1.2.3 +++ squid/helpers/external_acl/mswin_lm_group/win32_check_group.c 17 Sep 2006 08:47:17 -0000 1.1.2.4 @@ -135,10 +135,11 @@ LSA_HANDLE PolicyHandle; LSA_OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS status; - PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo; + PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo = NULL; PWKSTA_INFO_100 pwkiWorkstationInfo; DWORD netret; char *DomainName = NULL; + LPBYTE pwkiWorkstationInfoTmp; /* * Always initialize the object attributes to all zeroes. @@ -152,7 +153,8 @@ * The wki100_computername field contains a pointer to a UNICODE * string containing the local computer name. */ - netret = NetWkstaGetInfo(NULL, 100, (LPBYTE *) & pwkiWorkstationInfo); + netret = NetWkstaGetInfo(NULL, 100, &pwkiWorkstationInfoTmp); + pwkiWorkstationInfo = (PWKSTA_INFO_100) pwkiWorkstationInfoTmp; if (netret == NERR_Success) { /* * We have the workstation name in: @@ -174,6 +176,7 @@ if (status) { debug("OpenPolicy Error: %ld\n", status); } else { + PVOID ppdiDomainInfoTmp; /* * You have a handle to the policy object. Now, get the @@ -181,7 +184,8 @@ */ status = LsaQueryInformationPolicy(PolicyHandle, PolicyPrimaryDomainInformation, - (PVOID *) & ppdiDomainInfo); + &ppdiDomainInfoTmp); + ppdiDomainInfo = (PPOLICY_PRIMARY_DOMAIN_INFO)ppdiDomainInfoTmp; if (status) { debug("LsaQueryInformationPolicy Error: %ld\n", status); } else { @@ -242,7 +246,7 @@ char *Domain_Separator; WCHAR wszUserName[UNLEN + 1]; // Unicode user name - LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; + LPLOCALGROUP_USERS_INFO_0 pBuf; LPLOCALGROUP_USERS_INFO_0 pTmpBuf; DWORD dwLevel = 0; DWORD dwFlags = LG_INCLUDE_INDIRECT; @@ -252,6 +256,7 @@ NET_API_STATUS nStatus; DWORD i; DWORD dwTotalCount = 0; + LPBYTE pBufTmp = NULL; if ((Domain_Separator = strchr(UserName, '/')) != NULL) *Domain_Separator = '\\'; @@ -271,15 +276,15 @@ * function should also return the names of the local * groups in which the user is indirectly a member. */ - nStatus = NetUserGetLocalGroups( - NULL, + nStatus = NetUserGetLocalGroups(NULL, wszUserName, dwLevel, dwFlags, - (LPBYTE *) & pBuf, + &pBufTmp, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); + pBuf = (LPLOCALGROUP_USERS_INFO_0)pBufTmp; /* * If the call succeeds, */ @@ -322,7 +327,7 @@ WCHAR wszUserDomain[DNLEN + 1]; // Unicode User Domain char NTDomain[DNLEN + UNLEN + 2]; - char *domain_qualify; + char *domain_qualify = NULL; char User[UNLEN + 1]; size_t j; Index: squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c 27 May 2006 10:12:42 -0000 1.1.2.2 +++ squid/helpers/ntlm_auth/mswin_sspi/libntlmssp.c 17 Sep 2006 08:47:17 -0000 1.1.2.3 @@ -33,7 +33,7 @@ WCHAR wszGroup[GNLEN + 1]; // Unicode Group - LPLOCALGROUP_USERS_INFO_0 pBuf = NULL; + LPLOCALGROUP_USERS_INFO_0 pBuf; LPLOCALGROUP_USERS_INFO_0 pTmpBuf; DWORD dwLevel = 0; DWORD dwFlags = LG_INCLUDE_INDIRECT; @@ -43,6 +43,7 @@ NET_API_STATUS nStatus; DWORD i; DWORD dwTotalCount = 0; + LPBYTE pBufTmp = NULL; /* Convert ANSI User Name and Group to Unicode */ @@ -64,7 +65,11 @@ wszUserName, dwLevel, dwFlags, - (LPBYTE *) & pBuf, dwPrefMaxLen, &dwEntriesRead, &dwTotalEntries); + &pBufTmp, + dwPrefMaxLen, + &dwEntriesRead, + &dwTotalEntries); + pBuf = (LPLOCALGROUP_USERS_INFO_0)pBufTmp; /* * If the call succeeds, */ @@ -123,10 +128,11 @@ LSA_HANDLE PolicyHandle; LSA_OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS status; - PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo; + PPOLICY_PRIMARY_DOMAIN_INFO ppdiDomainInfo = NULL; PWKSTA_INFO_100 pwkiWorkstationInfo; DWORD netret; char *DomainName = NULL; + LPBYTE pwkiWorkstationInfoTmp; /* * Always initialize the object attributes to all zeroes. @@ -140,7 +146,8 @@ * The wki100_computername field contains a pointer to a UNICODE * string containing the local computer name. */ - netret = NetWkstaGetInfo(NULL, 100, (LPBYTE *) & pwkiWorkstationInfo); + netret = NetWkstaGetInfo(NULL, 100, &pwkiWorkstationInfoTmp); + pwkiWorkstationInfo = (PWKSTA_INFO_100) pwkiWorkstationInfoTmp; if (netret == NERR_Success) { /* * We have the workstation name in: @@ -162,6 +169,7 @@ if (status) { debug("OpenPolicy Error: %ld\n", status); } else { + PVOID ppdiDomainInfoTmp; /* * You have a handle to the policy object. Now, get the @@ -169,7 +177,8 @@ */ status = LsaQueryInformationPolicy(PolicyHandle, PolicyPrimaryDomainInformation, - (void **) &ppdiDomainInfo); + &ppdiDomainInfoTmp); + ppdiDomainInfo = (PPOLICY_PRIMARY_DOMAIN_INFO)ppdiDomainInfoTmp; if (status) { debug("LsaQueryInformationPolicy Error: %ld\n", status); } else {