]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-windows-build-cleanup-20021204
authorJames Peterson <james@abrakus.com>
Wed, 4 Dec 2002 14:20:44 +0000 (14:20 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 4 Dec 2002 14:20:44 +0000 (14:20 +0000)
makefile changes.
initialize variables to NULL before use
clean up CellServDB parsing
make sure files do not get timestamp of -1 (1969)
update product version

14 files changed:
src/WINNT/afsapplib/NTMakefile
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/smb3.c
src/WINNT/client_config/NTMakefile
src/WINNT/client_creds/NTMakefile
src/WINNT/client_creds/shortcut.cpp
src/WINNT/eventlog/lang/NTMakefile
src/WINNT/install/InstallShield5/NTMakefile
src/config/NTMakefile.i386_nt40
src/config/NTMakefile.i386_win95
src/config/util_cr.c
src/libafsrpc/NTMakefile
src/rxkad/NTMakefile

index c19d740659447b2dbb04b6bc87cdad273f940ea6..44ef0a61f8cdccdcf08592df58d061e2381b52e3 100644 (file)
@@ -5,10 +5,6 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-# make compiler warnings fatal
-
-AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX
-
 # indicate that the functions in this library should be exported
 
 AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -DEXPORT_AFSAPPLIB -DEXPORTED=_declspec(dllexport)
index f09e9fcc6b46e9f8c8192243721d7867e6a6cf25..2501ff85ac4b54721d6a92e6e9680782ce7172f6 100644 (file)
@@ -241,8 +241,14 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
                                return -4;
                        }
                         valuep++;      /* skip the "#" */
-
-                        valuep += strspn(valuep, "     "); /* skip SP & TAB */
+                        valuep += strspn(valuep, " \t"); /* skip SP & TAB */
+                        /* strip spaces and tabs in the end. They should not be there according to CellServDB format
+                        so do this just in case                        */
+                        while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') valuep[strlen(valuep) - 1] = '\0';
+
+                        /* strip spaces and tabs in the end. They should not be there according to CellServDB format
+                        so do this just in case                        */
+                        while (valuep[strlen(valuep) - 1] == ' ' || valuep[strlen(valuep) - 1] == '\t') valuep[strlen(valuep) - 1] = '\0';
 #endif /* !DJGPP */
                        if (inRightCell) {
 #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
index 0f7406032f534673c12673e460b5407efcba3f3f..3b326022e3c4942775cc74755394ece94fd4ae55 100644 (file)
@@ -63,9 +63,9 @@ long cm_GetServerList(struct cm_fid *fidp, struct cm_user *userp,
        struct cm_req *reqp, cm_serverRef_t **serverspp)
 {
        long code;
-        cm_volume_t *volp;
-        cm_serverRef_t *serversp;
-        cm_cell_t *cellp;
+        cm_volume_t *volp = NULL;
+        cm_serverRef_t *serversp = NULL;
+        cm_cell_t *cellp = NULL;
 
         if (!fidp) {
                *serverspp = NULL;
index ef4e7e2b8fff83bb8393de4eb004dcca6131cabc..0fa49bc845fcc67c6683c0bb05dfd908ff4161ca 100644 (file)
@@ -1448,7 +1448,10 @@ long smb_ReceiveTran2SetFileInfo(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet
                /* prepare for setattr call */
                attr.mask = 0;
                lastMod = *((FILETIME *)(p->datap + 16));
-               if (LargeIntegerNotEqualToZero(*((LARGE_INTEGER *)&lastMod))) {
+               /* 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) {
                        attr.mask |= CM_ATTRMASK_CLIENTMODTIME;
                        smb_UnixTimeFromLargeSearchTime(&attr.clientModTime,
                                                        &lastMod);
@@ -4064,7 +4067,7 @@ long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
                         
                         osi_Log3(afsd_logp, "Cancelling change notification for fid %d wtree %d file %s", 
                                 fid, watchtree,
-                                osi_LogSaveString(afsd_logp, fidp->NTopen_wholepathp));
+                                                               osi_LogSaveString(afsd_logp, (fidp)?fidp->NTopen_wholepathp:""));
 
                        scp = fidp->scp;
                        lock_ObtainMutex(&scp->mx);
index fc20442dd7340ea67e8c5390e3e5e3c4bb3bab92..0d1d176101aeae23537f179f7b119fb06dbddb8d 100644 (file)
@@ -5,10 +5,6 @@
 # License.  For details, see the LICENSE file in the top-level source
 # directory or online at http://www.openafs.org/dl/license10.html
 
-# make compiler warnings fatal
-
-AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -WX
-
 # include the AFSD source tree on our inclusion path
 
 AFSDEV_AUXCDEFINES = $(AFSDEV_AUXCDEFINES) -I ..\afsd
index cd4d6a2d5b8d76a4a109a80f87423a4e86caefb1..85f9736b2a08e67d9efffcbdd8d8d9a7404cb5f1 100644 (file)
@@ -100,7 +100,7 @@ COPYSOURCES = \
 ############################################################################
 
 $(EXEFILE) : $(EXEOBJS) $(EXELIBS)
-       $(EXEGUILINK) $(VCLIBS)
+       $(EXEMFCLINK) $(VCLIBS)
        $(EXEPREP) 
 
 install : $(COPYSOURCES) $(COPYHEADERS) $(EXEFILE) lang
index ee66dd9a6c943aaec1ab012626ee6bd13a051e9d..b6c4adef7422d60d4182d948f9fdec1c6cb0db92 100644 (file)
@@ -16,6 +16,7 @@ extern "C" {
 #include <initguid.h>
 #include <windows.h>
 #include <windowsx.h>
+#undef INITGUID
 #include <shlobj.h>
 #include <shellapi.h>
 #include "shortcut.h"
index 7c8894c3ff3bf66c14ac32a88c7d237489263418..6b176a86be07ab9844defc60a3c398bb09e613cc 100644 (file)
@@ -40,7 +40,7 @@ EVENTRESFILE = $(LANGNAME)\event.res
 DLLOBJS = $(DLLRESFILE)
 
 $(DLLFILE): $(DLLOBJS)
-       $(DLLCONLINK)
+       $(DLLRESLINK)
        $(DLLPREP)
 
 ############################################################################
index 5577a96b49f6b3cccd3322bd4d2dbb69340d7bb0..91a960b7da1cdcbe553b7d9984f59f939e6f1c5f 100644 (file)
@@ -62,8 +62,7 @@ build:
        $(DEL) /q $(DESTDIR)\Wininstall\PackageWeb\*.*
        $(ISWEB)\Pftwwiz.exe $(AFSROOT)\src\winnt\install\InstallShield5\PackageWeb.pfw -s -a 
 !ENDIF
-       xcopy /s/e/y "Media\OpenAFS\Disk Images\disk1\*.*" $(DESTDIR)\WinInstall
+       $(DESTDIR)\bin\util_cr.exe # xp w2 # xcopy /s/e/y /s/e Media\OpenAFS\DiskIm~1\disk1\*.* $(DESTDIR)\WinInstall   
        copy AFS_component_version_number.txt $(DESTDIR)\WinInstall\Version.txt
        $(DEL) /q "Media\OpenAFS\Disk Images\disk1\*.*"
-
 install: prep build
index 43f278963e925c1c294538ef298c474ec9a586d9..fe7b908c2c155325fef0696e9661fd070169f5ca 100644 (file)
@@ -37,8 +37,8 @@ APPVER = 4.0
 !ENDIF
 
 #define used in WinNT/2000 installation and program version display
-AFSPRODUCT_VERSION=1.2.2 b
-CELLNAME_DEFAULT=Your Cell Name
+AFSPRODUCT_VERSION=1.2.8 a
+CELLNAME_DEFAULT=openafs.org
 CELLSERVDB_INSTALL=CellServDB.GrandCentral
 CELLSERVDB_WEB=http://grand.central.org/dl/cellservdb/CellServDB
 #NMAKE_DEFINES=-DDEBUG_VERBOSE
@@ -63,40 +63,26 @@ AFSDEV_BUILDTYPE = NONE
 
 # Limit default include and library directories to those specified for build.
 
-!IFNDEF AFSDEV_INCLUDE
-!ERROR Must define AFSDEV_INCLUDE to be the default include directories.
-!ENDIF
+#!IFNDEF AFSDEV_INCLUDE
+#!ERROR Must define AFSDEV_INCLUDE to be the default include directories.
+#!ENDIF
 
-!IF ((!DEFINED(INCLUDE)) && ([set INCLUDE=$(AFSDEV_INCLUDE)] != 0))
+#!IF ((!DEFINED(INCLUDE)) && ([set INCLUDE=$(AFSDEV_INCLUDE)] != 0))
 #    If env. var. INCLUDE not defined then macro assignment won't set it.
-!ERROR Failed setting environment variable INCLUDE.
-!ENDIF
-INCLUDE = $(AFSDEV_INCLUDE)
+#!ERROR Failed setting environment variable INCLUDE.
+#!ENDIF
+#INCLUDE = $(AFSDEV_INCLUDE)
 
 
-!IFNDEF AFSDEV_LIB
-!ERROR Must define AFSDEV_LIB to be the default library directories.
-!ENDIF
+#!IFNDEF AFSDEV_LIB
+#!ERROR Must define AFSDEV_LIB to be the default library directories.
+#!ENDIF
 
-!IF ((!DEFINED(LIB)) && ([set LIB=$(AFSDEV_LIB)] != 0))
+#!IF ((!DEFINED(LIB)) && ([set LIB=$(AFSDEV_LIB)] != 0))
 #    If env. var. LIB not defined then macro assignment won't set it.
-!ERROR Failed setting environment variable LIB.
-!ENDIF
-LIB = $(AFSDEV_LIB)
-
-
-# Put default build binary directories at front of path.
-
-!IFNDEF AFSDEV_BIN
-!ERROR Must define AFSDEV_BIN to be the default build binary directories.
-!ENDIF
-
-!IF ((!DEFINED(PATH)) && ([set PATH=$(AFSDEV_BIN)] != 0))
-#    If env. var. PATH not defined then macro assignment won't set it.
-!ERROR Failed setting environment variable PATH.
-!ENDIF
-PATH = $(AFSDEV_BIN);$(PATH)
-
+#!ERROR Failed setting environment variable LIB.
+#!ENDIF
+#LIB = $(AFSDEV_LIB)
 
 # Undefine WIN32.MAK NODEBUG macro.
 # Always generate full debug info, unless profiling or tuning (see below).
@@ -183,14 +169,16 @@ afscflags =\
 
 !IF ("$(AFSDEV_BUILDTYPE)" == "FREE")
 #    Apply full optimization; generate full debug info in obj.
-afscflags = $(afscflags) /Ox /Z7
-ldebug = $(ldebug) -debugtype:both
+afscflags = $(afscflags) /Ox /Zi
+ldebug = $(ldebug)
 cdebug = $(cdebug:-Od=)  # avoid annoying override warning (D4025)
+cvarsdll = $(cvarsdll:-MDd=-MD)
 
 !ELSEIF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
 #    Disable optimization; generate full debug info in obj.
-afscflags = $(afscflags) /Od /Z7
+afscflags = $(afscflags) /Od /Zi
 ldebug = $(ldebug) -debugtype:both
+cdebug = $(cdebug:-Z7=-Zi)  # avoid annoying override warning (D4025)
 !ENDIF
 
 # Set compiler warning level
@@ -215,14 +203,14 @@ afscflags = $(afscflags) /W$(AFSDEV_WARNLEVEL)
 # /FIXED:NO   generates a relocation section in the executable
 
 afslflags =\
-       /FIXED:NO
+       /FIXED:NO /VERBOSE:LIB
 
 
 
 # For checked builds, define DEBUG (but not the MS control flag _DEBUG).
 
 !IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
-afscdefs = $(afscdefs) -DDEBUG
+#afscdefs = $(afscdefs) -DDEBUG
 !ENDIF
 
 # Utilize the debug version of the MSVC runtime, if requested.
@@ -279,6 +267,11 @@ EXEMFCLINK = $(link) /OUT:$@ $(ldebug) $(mfclflags) $(afslflags) $(mfclibsdll) $
 DLLCONLINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(conlibsdll) $**
 
 # DLL link macro for GUI applications
+!IF ("$(AFSDEV_BUILDTYPE)" == "CHECKED")
+DLLGUILINK = $(link) /OUT:$@ /NODEFAULTLIB:LIBC $(ldebug) $(dlllflags) $(afslflags) $(guilibsdll)  $**
+!ELSE
+DLLGUILINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(guilibsdll) $**
+!ENDIF
 DLLGUILINK = $(link) /OUT:$@ $(ldebug) $(dlllflags) $(afslflags) $(guilibsdll) $**
 
 # DLL link macro for MFC applications
index 13799adf9db9e792f07bf09e4786f70ebdaef8a6..7d2c950d6a69f3038be47e417ce7a460563a5917 100644 (file)
@@ -11,7 +11,6 @@
 #     AFSDEV_BUILDTYPE = [ CHECKED | FREE ]
 #     AFSDEV_INCLUDE = <default include directories>
 #     AFSDEV_LIB = <default library directories>
-#     AFSDEV_BIN = <default build binary directories>
 #
 # Optional definitions:
 #     AFSDEV_DESTDIR = <top-level install directory>  (default is $(AFSROOT)\DEST)
@@ -94,20 +93,6 @@ INCLUDE = $(AFSDEV_INCLUDE)
 !ENDIF
 LIB = $(AFSDEV_LIB)
 
-
-# Put default build binary directories at front of path.
-
-!IFNDEF AFSDEV_BIN
-!ERROR Must define AFSDEV_BIN to be the default build binary directories.
-!ENDIF
-
-!IF ((!DEFINED(PATH)) && ([set PATH=$(AFSDEV_BIN)] != 0))
-#    If env. var. PATH not defined then macro assignment won't set it.
-!ERROR Failed setting environment variable PATH.
-!ENDIF
-PATH = $(AFSDEV_BIN);$(PATH)
-
-
 # Undefine WIN32.MAK NODEBUG macro.
 # Always generate full debug info, unless profiling or tuning (see below).
 
index 15e54e0c85d1a5f96e5508e66f1459501575cb20..73adc3d2c33afb59d73055fba1a357a873a13549 100644 (file)
@@ -16,6 +16,7 @@
 #include "windows.h"
 #include "malloc.h"
 #include "time.h"
+#include "stdlib.h"
 
 void usuage()
 {
@@ -29,10 +30,106 @@ void usuage()
        OR util_cr * \"-[register key value]\" ; aremove register key value\n\
        OR util_cr @ file.ini \"[SectionKey]variable=value\" ; update ini-ipr-pwf file\n\
        OR util_cr @ file.ini \"[SectionKey]variable=value*DatE*\" ; update ini-ipr-pwf file, insert date\n\
-       OR util_cr ~  ;force error\n");
+       OR util_cr ~  ;force error\n\
+       OR util_cr # [nt xp 98 9x w2] ;test for OS, return 0 if match else 1\n\
+       OR util_cr # [nt xp 98 9x w2] #[command] [true options] [false optiosn] [paramters] \n\t test for OS; execute command with options\n");
        exit(0xc000);
 }
 
+int CheckVersion(int argc,char *argv[])
+{
+       OSVERSIONINFO VersionInfo;
+       int i;
+       memset(&VersionInfo,0,sizeof(VersionInfo));
+       VersionInfo.dwOSVersionInfoSize =sizeof(OSVERSIONINFO);
+       if (!GetVersionEx(&VersionInfo))
+       {
+               return 0XC000;
+       }
+       for (i=1;i<argc;i++)
+       {
+               if (stricmp(argv[i],"nt")==0)
+               {
+                       if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) 
+                               && (VersionInfo.dwMajorVersion==4)
+                               && (VersionInfo.dwMinorVersion==0))
+                               return 0;
+               }
+               if (stricmp(argv[i],"xp")==0)
+               {
+                       if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) 
+                               && (VersionInfo.dwMajorVersion==5)
+                               && (VersionInfo.dwMinorVersion==1))
+                               return 0;
+               }
+               if (stricmp(argv[i],"w2")==0)
+               {
+                       if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT) 
+                               && (VersionInfo.dwMajorVersion==5)
+                               && (VersionInfo.dwMinorVersion==0))
+                               return 0;
+               }
+               if (stricmp(argv[i],"98")==0)
+               {
+                       if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) && (VersionInfo.dwMinorVersion==10))
+                               return 0;
+               }
+               if (stricmp(argv[i],"95")==0)
+               {
+                       if ((VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS) && (VersionInfo.dwMinorVersion==0))
+
+                               return 0;
+               }
+               if (stricmp(argv[i],"9x")==0)
+               {
+                       if (VersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS)
+                               return 0;
+               }
+               if (stricmp(argv[i],"#")==0)
+                       return 1;
+       }
+       return 1;
+}
+
+int DoCheckVersion(int argc,char *argv[])
+{
+       //arg 1 nth versions
+       //arg nth #
+       //arg n+1 command
+       //arg n+2 option true
+       //arg n+3 option false
+       //arg n+4 ... command arguments
+       int x,i;
+       int ret;
+       char command[1024];
+       for (x=1;((x<argc) && (strcmp(argv[x],"#")!=0));x++);
+       if (strcmp(argv[x],"#")!=0)
+               return 0xc000;
+       ret=CheckVersion(argc-x,&argv[x]);
+       if (x+6>=argc)
+               return (!ret)?0:1;
+       for (++x;((x<argc) && (strcmp(argv[x],"#")!=0));x++);
+       if (strcmp(argv[x],"#")!=0)
+               return 0xc000;
+       i=0;
+       GetSystemDirectory(command,sizeof(command));
+       sprintf(command,"%s\\cmd.exe",command);
+       argv[i++]=command;
+       argv[i++]="/c";
+       argv[i++]=argv[x+1];
+       if (!ret) 
+               argv[i++]=argv[x+2];
+       else 
+               argv[i++]=argv[x+3];
+       for (x+=4;x<argc;x++) 
+               argv[i++]=argv[x];
+       argv[i]=NULL;
+/*     for (i=0;argv[i];i++)
+               command=argv[i];
+*/
+       ret=_spawnv(_P_WAIT,argv[0],argv);
+       return 0;
+}
 
 void Addkey (const char *hkey,const char *subkey,const char *stag,const char *sval)
 {
@@ -107,6 +204,10 @@ int main(int argc, char* argv[])
 
        if (argc<3)
                usuage();
+       if (strcmp(argv[1],"#")==0)
+       {
+               return DoCheckVersion(argc,argv);
+       }
        if (strcmp(argv[1],"}")==0)
        {
                char v1[4],v2[4],v3[4],v4[4];
index f8131dd31d3a41e0db3939562de0c9ebe5d5a2d4..eb84cf54012d550303f0fffe5b030967c425586d 100644 (file)
@@ -262,7 +262,8 @@ DLLLIBS =\
        $(DESTDIR)\lib\afspthread.lib \
 !ENDIF
        $(DESTDIR)\lib\afs\afsutil.lib \
-       $(DESTDIR)\lib\afs\afsreg.lib
+       $(DESTDIR)\lib\afs\afsreg.lib  \
+       $(DESTDIR)\lib\afsrxkad.lib
 
 $(DESTDIR)\lib\afsrpc.dll: $(DLLOBJS) $(DLLLIBS)
        $(DLLCONLINK) /DEF:afsrpc.def
index fc71d72ebd79d4f49de27f6fac96c6cd8f47fd6d..8a5f8d443e46dbc02e4a7394b033b21bc2072d70 100644 (file)
@@ -23,6 +23,8 @@ LIBOBJS =\
        rxkad_errs.obj \
        AFS_component_version_number.obj \
        fcrypt.obj \
+       crc.obj \
+       ticket5.obj \
        crypt_conn.obj 
 
 # afsrxkad.lib