Changeset 693
- Timestamp:
- Mar 11, 2012, 6:19:02 PM (13 years ago)
- Location:
- branches/samba-3.0/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/build.cmd
r459 r693 1 1 /* Samba build script for eCS (OS/2) */ 2 3 /* version history */ 4 /* version 0.1.0 from 09.04.2010 Herwig (first edition) */ 5 /* version 0.2.2 from 08.09.2009 Herwig (a lot enhancements) */ 6 /* version 0.3.0 from 17.08.2010 Silvan (redone a lot) */ 7 /* version 0.3.1 from 20.08.2010 Silvan (added version.ecs check) */ 8 /* version 0.3.2 from 08.07.2011 Silvan (pythonhome may be not set) */ 9 /* version 0.3.3 from 05.11.2011 Herwig (add support for libc064) */ 10 /* version 0.3.4 from 23.11.2011 Herwig (simplify libc switching) */ 11 /* version 0.3.5 from 23.11.2011 Herwig (brand befor configure, if version.h is missing) */ 12 13 /* load the sysfuncs if not already loaded */ 14 if (RxFuncQuery('SysLoadFuncs') = 1) then 15 do 16 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'; 17 call SysLoadFuncs; 18 end 19 20 /* init the version string (don't forget to change) */ 21 version = "0.3.5" 22 version_date = "23.11.2011" 2 23 3 24 '@echo off' 4 25 parse upper arg cmdline 5 26 27 say "Samba for eCS (OS/2) build script v" || version || " from " || version_date 28 6 29 /* No parameter or HELP -> display usage */ 7 30 if pos("HELP", cmdline) > 0 | cmdline = "" then do 8 say "Samba for eCS (OS/2) build script"9 31 say 10 32 say "Valid commands are:" 11 33 say " HELP - this page" 12 say " 063 - link against libc063.dll"13 say " 064x - link against libc064x.dll"14 34 say " CONF - run configure" 15 35 say " CLEAN - clean up and recompile everything" … … 20 40 say " ZIP - create ZIP archive" 21 41 say " ALL - do just everything" 42 say "Deprecated options:" 43 say " 064 - link against libc064.dll (default)" 44 say " 064x - link against libc064x.dll" 45 say " 063 - link against libc063.dll" 22 46 say 23 47 exit 255 … … 30 54 31 55 options = 'build.options' 56 cacheFile = 'build.cache' 32 57 33 58 /* defaults */ 34 59 make = "" 35 libc = "064x"36 60 brand = "No" 37 61 conf = "" … … 52 76 build_parms = "" 53 77 78 /* delete the following 7 lines to remove libc switching capability */ 79 select 80 when pos("064X", cmdline) > 0 then libc = "064X" 81 when pos("063", cmdline) > 0 then libc = "063" 82 otherwise libc = "064" 83 end 84 address cmd "call "libc".cmd" 85 54 86 if pos("MAKE", cmdline) > 0 then do 55 87 make = "MAKE" … … 61 93 build_parms = build_parms||' 'make 62 94 end 63 if pos("064X", cmdline) > 0 then do 64 libc = "064X" 65 build_parms = build_parms||' 'libc 66 end 67 if pos("063", cmdline) > 0 then do 68 libc = "063" 69 build_parms = build_parms||' 'libc 70 end 95 71 96 if pos("BRAND", cmdline) > 0 then do 72 97 Brand = "YES" … … 78 103 end 79 104 105 ok = SysFileTree(".\include\version.h",versionh.,'FO') 106 107 if versionh.0 = 0 & conf = "YES" then do 108 svninfo = ".\svninfo" 109 address cmd 'svn status -q -u | grep "^Status against revision:" | sed -e "s/Status against revision: *//">'svninfo 110 revision = strip(translate(linein(svninfo))) 111 ok = stream(svninfo,'c','close') 112 call brand revision 113 end 114 80 115 /* start working */ 81 if libc = "063" then do82 address cmd "call 063.cmd"83 end84 else do85 address cmd "call 064x.cmd"86 end87 88 116 if conf = "YES" then do 89 90 91 92 93 94 address cmd 'SET LIBS=-lsocket -lsyslog' 117 address cmd 'SETLOCAL' 118 /* address cmd 'SET CFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4' 119 address cmd 'SET CXXFLAGS=-g -Zomf -O1 -march=pentium -mtune=pentium4' 120 address cmd 'SET LDFLAGS=-s -Zsym -Zmap -Zbin-files -Zomf -Zexe -Zargs-wild -Zargs-resp' 121 address cmd 'SET AR=emxomfar' 122 address cmd 'SET LIBS=-lsocket -lsyslog' */ 95 123 /* disabled options: 96 124 --enable-developer --enable-socket-wrapper 97 125 */ 98 address cmd 'ksh ./configure --enable-pie=no --prefix=/samba --enable-static --disable-shared --disable-cups --disable-ldap --with-acl-support 2>&1 | tee configure.log' 99 address cmd 'ENDLOCAL' 126 127 /* we need to delete the cache file and redo it afterwards */ 128 ok = SysFileDelete(cacheFile); 129 130 /* is cups env set */ 131 sEnvVar = EnvGet('CUPS'); 132 if sEnvVar <> '' then do 133 call lineout cacheFile, "ac_cv_path_CUPS_CONFIG='" || sEnvVar || "'"; 134 end 135 136 /* is python env set */ 137 sEnvVar = EnvGet('PYTHONHOME'); 138 if sEnvVar <> '' then do 139 sPythonVersion = PythonVersion(sEnvVar); 140 if sPythonVersion <> '-1' then do 141 call lineout cacheFile, "ac_cv_path_PYTHON_CONFIG='" || sEnvVar || "/config/" || sPythonVersion || "'"; 142 call lineout cacheFile, "ac_cv_path_PYTHON='" || sEnvVar || "'"; 143 end 144 end 145 146 ok = stream(cacheFile, 'c', 'close'); 147 148 /* run configure */ 149 address cmd 'ksh ./configure --enable-pie=no --prefix=/samba --disable-shared --with-acl-support --cache-file=build.cache 2>&1 | tee configure.log' 150 address cmd 'ENDLOCAL' 100 151 end 101 152 … … 103 154 address cmd "make clean" 104 155 end 105 156 106 157 if brand = "YES" then do 107 158 svninfo = ".\svninfo" … … 115 166 say build_parms 116 167 address cmd 'make 2>&1 | tee build.log' 117 end 168 end 118 169 119 170 if pos("ZIP", cmdline) > 0 then do … … 143 194 VerFile = "VERSION.ECS" 144 195 196 /* is the file available */ 197 ok = stream(VerFile, 'c', 'QUERY EXISTS') 198 if ok = "" then do 199 say "Please create a " || VerFile || " based on VERSION.EC_" 200 exit 0 201 end 202 145 203 /* Samba Version file */ 146 204 Version = "VERSION" … … 153 211 eCSVer.I = linein(VerFile) 154 212 if left(eCSVer.I,28) = "SAMBA_VERSION_VENDOR_SUFFIX=" then do 155 156 157 213 parse var eCSver.I . '='vendor_suffix 214 vendor_suffix = strip(vendor_suffix,,'"') 215 parse var vendor_suffix vendor suffix 158 216 end 159 217 end … … 193 251 verstring = suffix'-'Major'.'minor'.'release'.'revision'-'vendor'-'date('S') 194 252 say "Samba "verstring 195 return 253 return 254 255 256 /** 257 * Gets the value of sEnvVar. 258 */ 259 EnvGet: procedure 260 parse arg sEnvVar 261 if ((translate(sEnvVar) = 'BEGINLIBPATH') | (translate(sEnvVar) = 'ENDLIBPATH')) then 262 return SysQueryExtLibPath(substr(sEnvVar, 1, 1)); 263 return value(sEnvVar,, 'OS2ENVIRONMENT'); 264 265 /** 266 * try to find the pythonversion 267 */ 268 PythonVersion: procedure 269 parse arg pdir 270 271 ok = SysFileTree(pdir||"\python*.dll",pydll.,"FO") 272 rc = -1 273 if pydll.0 = 1 then do 274 dllpur = filespec("N",pydll.1) 275 parse var dllpur 'python' ver '.dll' 276 if datatype(ver) <> "NUM" then do 277 say "no valid python dll found!" 278 end 279 else do 280 major = left(ver,1) 281 minor = substr(ver,2,) 282 verstring = "python"||major||"."||minor 283 rc = verstring 284 end 285 end 286 else do 287 say "no dll found!" 288 end 289 return rc -
branches/samba-3.0/source/smbd/process.c
r468 r693 1026 1026 int msg_type = CVAL(inbuf,0); 1027 1027 uint16_t mid = SVAL(inbuf, smb_mid); 1028 uint8_t wct = CVAL(inbuf, smb_wct); 1028 1029 1029 1030 chain_size = 0; … … 1033 1034 if (msg_type != 0) 1034 1035 return(reply_special(inbuf,outbuf)); 1036 1037 /* Ensure we have at least wct words and 2 bytes of bcc. */ 1038 if (smb_size + wct*2 > size) { 1039 DEBUG(0,("init_smb_request: invalid wct number %u (size %u)\n", 1040 (unsigned int)wct, 1041 (unsigned int)size)); 1042 exit_server_cleanly("Invalid SMB request"); 1043 } 1044 /* Ensure bcc is correct. */ 1045 if (((uint8 *)smb_buf(inbuf)) + smb_buflen(inbuf) > inbuf + size) { 1046 DEBUG(0,("init_smb_request: invalid bcc number %u " 1047 "(wct = %u, size %u)\n", 1048 (unsigned int)smb_buflen(inbuf), 1049 (unsigned int)wct, 1050 (unsigned int)size)); 1051 exit_server_cleanly("Invalid SMB request"); 1052 } 1035 1053 1036 1054 construct_reply_common(inbuf, outbuf); … … 1162 1180 static int orig_size; 1163 1181 int smb_com1, smb_com2 = CVAL(inbuf,smb_vwv0); 1164 unsigned smb_off2 = SVAL(inbuf,smb_vwv1);1182 static unsigned smb_off2; 1165 1183 char *inbuf2, *outbuf2; 1166 1184 int outsize2; … … 1181 1199 orig_outbuf = outbuf; 1182 1200 orig_size = size; 1183 } 1201 smb_off2 = 0; 1202 } 1203 1204 if (SVAL(inbuf,smb_vwv1) <= smb_off2) { 1205 DEBUG(1, ("AndX offset not increasing\n")); 1206 SCVAL(outbuf, smb_vwv0, 0xFF); 1207 return outsize; 1208 } 1209 smb_off2 = SVAL(inbuf, smb_vwv1); 1184 1210 1185 1211 /* Validate smb_off2 */
Note:
See TracChangeset
for help on using the changeset viewer.