Changeset 460 for branches/samba-3.3.x/source
- Timestamp:
- Jun 9, 2010, 4:46:02 PM (15 years ago)
- Location:
- branches/samba-3.3.x/source
- Files:
-
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/Makefile.in
r372 r460 332 332 lib/interface.o lib/md4.o \ 333 333 lib/pidfile.o \ 334 lib/signal.o lib/system.o lib/os2 ea.o lib/os2path.o lib/sendfile.o lib/recvfile.o lib/time.o \334 lib/signal.o lib/system.o lib/os2helper.o lib/sendfile.o lib/recvfile.o lib/time.o \ 335 335 lib/ufc.o lib/genrand.o lib/username.o \ 336 336 lib/util_pw.o lib/access.o lib/smbrun.o \ -
branches/samba-3.3.x/source/build.cmd
r433 r460 16 16 say " BRAND - create a branded build" 17 17 say " MAKE - just compile changed files" 18 say " CLUT - build command line utilities only (N/A)"19 say " WPI - create WPI archive (N/A)"20 say " ZIP - create ZIP archive 21 say " ALL - do just everything (N/A)"18 say " CLUT - build command line utilities only" 19 say " WPI - create WPI archive" 20 say " ZIP - create ZIP archive" 21 say " ALL - do just everything" 22 22 say 23 23 exit 255 … … 32 32 33 33 /* defaults */ 34 make = " CLEAN"34 make = "" 35 35 libc = "064x" 36 36 brand = "No" 37 37 conf = "" 38 verstring = 'x.x.x-3.x.x.xxx-eCS-'date('S') /* for packaging if branding is disabled */ 38 39 39 40 /* Read profile */ … … 42 43 opt_line = translate(linein(options)) 43 44 interpret opt_line 45 call charout , opt_line' ' 44 46 end 47 say 45 48 ok = stream(options,'c','close') 46 49 … … 103 106 if brand = "YES" then do 104 107 svninfo = ".\svninfo" 105 address cmd 'svn info | grep "^Revision:" | sed -e "s/Revision: *//">'svninfo108 address cmd 'svn status -q -u | grep "^Status against revision:" | sed -e "s/Status against revision: *//">'svninfo 106 109 revision = strip(translate(linein(svninfo))) 107 110 ok = stream(svninfo,'c','close') … … 109 112 end 110 113 111 say build_parms 112 'make 2>&1 | tee build.log' 114 if make <> "" then do 115 say build_parms 116 address cmd 'make 2>&1 | tee build.log' 117 end 113 118 114 119 if pos("ZIP", cmdline) > 0 then do 120 say 'Creating "samba-'translate(verstring,'-',' ')'.zip"' 121 ok = SysFileDelete('samba-'translate(verstring,'-',' ')'.zip') 115 122 'cd .\bin' 116 123 'md .\samba' 117 124 'cd .\samba' 118 'move ..\*.exe '119 'move ..\*.dll '125 'move ..\*.exe >NUL' 126 'move ..\*.dll >NUL' 120 127 'cd ..' 121 'zip -rpmo9 samba-NEW.zip .\samba\*.exe .\samba\*.dll' 128 'zip -rpo9 samba-'translate(verstring,'-',' ')'.zip .\samba\*.exe .\samba\*.dll' 129 'cd .\samba' 130 'move * .. >NUL' 131 'cd ..' 122 132 'rd .\samba' 123 133 say 'Created ZIP package' … … 127 137 exit 0 128 138 129 brand: procedure 139 brand: procedure expose verstring 130 140 parse arg revision 131 141 132 142 /* eComStation Version file */ 133 143 VerFile = "VERSION.ECS" 134 135 /* is the file available */136 ok = stream(VerFile, 'c', 'QUERY EXISTS')137 if ok = "" then do138 say 'Please create a VERSION.ECS based on VERSION.EC_'139 exit 0140 end141 144 142 145 /* Samba Version file */ … … 149 152 I = I + 1 150 153 eCSVer.I = linein(VerFile) 154 if left(eCSVer.I,28) = "SAMBA_VERSION_VENDOR_SUFFIX=" then do 155 parse var eCSver.I . '='vendor_suffix 156 vendor_suffix = strip(vendor_suffix,,'"') 157 parse var vendor_suffix vendor suffix 158 end 151 159 end 152 160 ok = stream(VerFile, 'c', 'close') … … 159 167 do until lines(VERSION) = 0 160 168 verline = linein(VERSION) 169 if left(Verline,20) = "SAMBA_VERSION_MAJOR=" then do 170 parse var verline . '='Major 171 end 172 if left(Verline,20) = "SAMBA_VERSION_MINOR=" then do 173 parse var verline . '='Minor 174 end 175 if left(Verline,22) = "SAMBA_VERSION_RELEASE=" then do 176 parse var verline . '='release 177 end 178 161 179 do I = 1 to eCSVer.0 162 180 parse var eCSVer.I tag'='strvalue … … 171 189 ok = stream(Version,'c','close') 172 190 ok = stream(NewVersion,'c','close') 173 address cmd "ksh ./script/mkversion.sh "NewVersion 191 address cmd "ksh ./script/mkversion.sh "NewVersion" >NUL" 174 192 ok = SysFileDelete(NewVersion) 175 return 193 verstring = suffix'-'Major'.'minor'.'release'.'revision'-'vendor'-'date('S') 194 say "Samba "verstring 195 return -
branches/samba-3.3.x/source/lib/os2helper.c
r430 r460 10 10 #define INCL_DOSMODULEMGR 11 11 #define INCL_DOSERRORS 12 //_SMB_H 12 13 13 #include <os2.h> 14 14 #include <stdio.h> … … 16 16 #include <errno.h> 17 17 #include <types.h> 18 18 #include <string.h> 19 19 //YD for tmalloc 20 20 #include <malloc.h> … … 32 32 // Samba DEBUG() needs the following includes and defines 33 33 #define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) 34 #define CMD_KI_RDCNT (0x63)35 34 #include <stdbool.h> 36 35 #include "local.h" … … 99 98 } 100 99 101 /* Functions below are based on APR random code */ 102 /* Licensed to the Apache Software Foundation (ASF) under one or more 103 * contributor license agreements. See the NOTICE file distributed with 104 * this work for additional information regarding copyright ownership. 105 * The ASF licenses this file to You under the Apache License, Version 2.0 106 * (the "License"); you may not use this file except in compliance with 107 * the License. You may obtain a copy of the License at 108 * 109 * http://www.apache.org/licenses/LICENSE-2.0 110 * 111 * Unless required by applicable law or agreed to in writing, software 112 * distributed under the License is distributed on an "AS IS" BASIS, 113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 114 * See the License for the specific language governing permissions and 115 * limitations under the License. 116 */ 100 // we search the path of the .exe and return it 101 int os2_GetExePath(char *buff) 102 { 103 APIRET rc = NO_ERROR; 104 PPIB ppib = NULL; 105 char sExePath [_MAX_PATH]; 106 char sDrive [_MAX_PATH], sDir [_MAX_DIR]; 107 108 // we search for the infoblock to get the module name 109 rc = DosGetInfoBlocks(NULL, &ppib); 110 if (rc != NO_ERROR) 111 { 112 return -1; 113 } 114 115 // with the module name we get the path (including the exe name) 116 rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExePath), sExePath); 117 if (rc != NO_ERROR) 118 { 119 return -1; 120 } 121 122 // we split to the different values 123 _splitpath(sExePath, sDrive, sDir, NULL, NULL); 124 // strcat(sDrive, sDir); 125 strncat(sDrive, sDir, strlen(sDir) -1); 126 strcpy(buff, sDrive); 127 128 return 0; 129 } 130 131 /* os2 specific random functions. this functions used to be based on APR random code. 132 but we discovered some nasty problems with it on fast hardware (especially on quadcore) and 133 decided to rewrite it with libc random() */ 117 134 118 135 void os2_randget(char * buffer, int length) … … 126 143 } 127 144 128 /* A bunch of system information like memory & process stats. 129 * Not highly random but every bit helps.... 130 */ 131 static UCHAR randbyte_sysinfo() 132 { 133 UCHAR byte = 0; 134 UCHAR SysVars[100]; 135 int b; 136 137 DosQuerySysInfo(1, QSV_FOREGROUND_PROCESS, SysVars, sizeof(SysVars)); 138 139 for (b = 0; b < 100; b++) { 140 byte ^= SysVars[b]; 141 } 145 UCHAR randbyte() 146 { 147 int c; 148 UCHAR byte; 149 ULONG ulrandom; 150 ulrandom = random(); 151 for (c = 0; c < sizeof(ulrandom); c++) { 152 byte ^= ((UCHAR *)&ulrandom)[c]; 153 } 142 154 143 155 return byte; 144 }145 146 147 148 /* Similar in concept to randbyte_hrtimer() but accesses the CPU's internal149 * counters which run at the CPU's MHz speed. We get separate150 * idle / busy / interrupt cycle counts which should provide very good151 * randomness due to interference of hardware events.152 * This only works on newer CPUs (at least PPro or K6) and newer OS/2 versions153 * which is why it's run-time linked.154 */155 156 static HMODULE hDoscalls = 0;157 #define CMD_KI_RDCNT (0x63)158 159 typedef struct _CPUUTIL {160 ULONG ulTimeLow; /* Low 32 bits of time stamp */161 ULONG ulTimeHigh; /* High 32 bits of time stamp */162 ULONG ulIdleLow; /* Low 32 bits of idle time */163 ULONG ulIdleHigh; /* High 32 bits of idle time */164 ULONG ulBusyLow; /* Low 32 bits of busy time */165 ULONG ulBusyHigh; /* High 32 bits of busy time */166 ULONG ulIntrLow; /* Low 32 bits of interrupt time */167 ULONG ulIntrHigh; /* High 32 bits of interrupt time */168 } CPUUTIL;169 170 APIRET APIENTRY(*pfnDosPerfSysCall) (ULONG ulCommand, ULONG ulParm1, ULONG ulParm2, ULONG ulParm3) = NULL;171 APIRET APIENTRY(*pfnDosQuerySysState) (ULONG func, ULONG arg1, ULONG pid, ULONG _res_, PVOID buf, ULONG bufsz) = NULL;172 173 static UCHAR randbyte_perf()174 {175 UCHAR byte = 0;176 CPUUTIL util;177 int c;178 179 if (hDoscalls == 0) {180 char failed_module[20];181 ULONG rc;182 183 rc = DosLoadModule(failed_module, sizeof(failed_module), "DOSCALLS",184 &hDoscalls);185 186 if (rc == 0) {187 rc = DosQueryProcAddr(hDoscalls, 976, NULL, (PFN *)&pfnDosPerfSysCall);188 189 if (rc) {190 pfnDosPerfSysCall = NULL;191 }192 }193 }194 195 if (pfnDosPerfSysCall) {196 if ((*pfnDosPerfSysCall) (CMD_KI_RDCNT, (ULONG)&util, 0, 0) == 0) {197 for (c = 0; c < sizeof(util); c++) {198 byte ^= ((UCHAR *)&util)[c];199 }200 }201 else {202 pfnDosPerfSysCall = NULL;203 }204 }205 206 return byte;207 }208 209 210 211 UCHAR randbyte()212 {213 return randbyte_sysinfo() ^ randbyte_perf();214 156 } 215 157
Note:
See TracChangeset
for help on using the changeset viewer.