Changeset 454
- Timestamp:
- Jun 4, 2010, 3:11:43 PM (15 years ago)
- Location:
- trunk/server/source3
- Files:
-
- 8 added
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/Makefile.in
r429 r454 391 391 $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \ 392 392 lib/interface.o lib/pidfile.o \ 393 lib/system.o lib/ sendfile.o lib/recvfile.o lib/time.o \393 lib/system.o lib/os2ea.o lib/os2path.o lib/sendfile.o lib/recvfile.o lib/time.o \ 394 394 lib/username.o \ 395 395 ../libds/common/flag_mapping.o \ … … 1785 1785 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(ZLIB_LIBS) 1786 1786 1787 bin/ldbedit : $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)1787 bin/ldbedit@EXEEXT@: $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) 1788 1788 @echo Linking $@ 1789 1789 @$(CC) -o $@ $(LDBEDIT_OBJ) $(DYNEXP) $(LDFLAGS) \ … … 1791 1791 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) 1792 1792 1793 bin/ldbsearch : $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)1793 bin/ldbsearch@EXEEXT@: $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) 1794 1794 @echo Linking $@ 1795 1795 @$(CC) -o $@ $(LDBSEARCH_OBJ) $(DYNEXP) $(LDFLAGS) \ … … 1797 1797 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) 1798 1798 1799 bin/ldbadd : $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)1799 bin/ldbadd@EXEEXT@: $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) 1800 1800 @echo Linking $@ 1801 1801 @$(CC) -o $@ $(LDBADD_OBJ) $(DYNEXP) $(LDFLAGS) \ … … 1803 1803 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) 1804 1804 1805 bin/ldbmodify : $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)1805 bin/ldbmodify@EXEEXT@: $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) 1806 1806 @echo Linking $@ 1807 1807 @$(CC) -o $@ $(LDBMODIFY_OBJ) $(DYNEXP) $(LDFLAGS) \ … … 1809 1809 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) 1810 1810 1811 bin/ldbdel : $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)1811 bin/ldbdel@EXEEXT@: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) 1812 1812 @echo Linking $@ 1813 1813 @$(CC) -o $@ $(LDBDEL_OBJ) $(DYNEXP) $(LDFLAGS) \ … … 1815 1815 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) 1816 1816 1817 bin/ldbrename : $(BINARY_PREREQS) $(LDBRENAME_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)1817 bin/ldbrename@EXEEXT@: $(BINARY_PREREQS) $(LDBRENAME_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT) 1818 1818 @echo Linking $@ 1819 1819 @$(CC) $(FLAGS) -o $@ $(LDBRENAME_OBJ) $(DYNEXP) $(LDFLAGS) \ … … 1821 1821 $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) 1822 1822 1823 bin/versiontest : $(BINARY_PREREQS) lib/version_test.o $(VERSION_OBJ)1823 bin/versiontest@EXEEXT@: $(BINARY_PREREQS) lib/version_test.o $(VERSION_OBJ) 1824 1824 @echo Linking $@ 1825 1825 @$(CC) $(FLAGS) -o $@ $(VERSION_OBJ) lib/version_test.o -
trunk/server/source3/dynconfig.c
r414 r454 41 41 **/ 42 42 43 #ifndef __OS2__ 43 44 #define DEFINE_DYN_CONFIG_PARAM(name) \ 44 45 static char *dyn_##name; \ … … 65 66 return (dyn_##name == NULL);\ 66 67 } 68 #else 69 #define DEFINE_DYN_CONFIG_PARAM(name) \ 70 static char *dyn_##name; \ 71 \ 72 const char *set_dyn_##name(const char *newpath) \ 73 {\ 74 if (dyn_##name) {\ 75 SAFE_FREE(dyn_##name);\ 76 }\ 77 dyn_##name = SMB_STRDUP(newpath);\ 78 return dyn_##name;\ 79 }\ 80 \ 81 bool is_default_dyn_##name(void) \ 82 {\ 83 return (dyn_##name == NULL);\ 84 } 85 #endif 67 86 68 87 DEFINE_DYN_CONFIG_PARAM(SBINDIR) … … 83 102 DEFINE_DYN_CONFIG_PARAM(SMB_PASSWD_FILE) 84 103 DEFINE_DYN_CONFIG_PARAM(PRIVATE_DIR) 104 105 #ifdef __OS2__ 106 107 /* Directory the binary was called from, same as getbindir() */ 108 const char *get_dyn_SBINDIR(void) 109 { 110 static char buffer[1024] = ""; 111 if (!*buffer) 112 { 113 char exedir[1024] = ""; 114 if (os2_GetExePath(exedir) != 0) 115 { 116 snprintf(buffer, 260, "%s", SBINDIR); 117 } else { 118 snprintf(buffer, 260, "%s", exedir); 119 } 120 } 121 122 if (dyn_SBINDIR == NULL) { 123 return buffer; 124 } 125 return dyn_SBINDIR; 126 } 127 128 /* Directory the binary was called from, same as getsbindir() */ 129 const char *get_dyn_BINDIR(void) 130 { 131 static char buffer[1024] = ""; 132 if (!*buffer) 133 { 134 char exedir[1024] = ""; 135 if (os2_GetExePath(exedir) != 0) 136 { 137 snprintf(buffer, 260, "%s", BINDIR); 138 } else { 139 snprintf(buffer, 260, "%s", exedir); 140 } 141 } 142 143 if (dyn_BINDIR == NULL) { 144 return buffer; 145 } 146 return dyn_BINDIR; 147 } 148 149 /* Directory holding the SWAT files */ 150 const char *get_dyn_SWATDIR(void) 151 { 152 static char buffer[1024] = ""; 153 if (!*buffer) 154 { 155 char exedir[1024] = ""; 156 if (os2_GetExePath(exedir) != 0) 157 { 158 snprintf(buffer, 260, "%s", SWATDIR); 159 } else { 160 snprintf(buffer, 260, "%s/%s", exedir,"swat"); 161 } 162 } 163 164 if (dyn_SWATDIR == NULL) { 165 return buffer; 166 } 167 return dyn_SWATDIR; 168 } 169 170 /* Location of smb.conf file. */ 171 const char *get_dyn_CONFIGFILE(void) 172 { 173 static char buffer[1024] = ""; 174 if (!*buffer) 175 { 176 snprintf(buffer, 260, "%s/samba/smb.conf", getenv("ETC")); 177 } 178 /* Set UNIXROOT to x:\MPTN if UNIXROOT is undefined */ 179 if (getenv("UNIXROOT") == NULL) { 180 static char unixroot[1024] = ""; 181 strncpy(unixroot,getenv("ETC"),strlen(getenv("ETC"))-4); 182 setenv("UNIXROOT",unixroot,0); 183 } 184 /* Make sure TMPIR points to a proper value */ 185 static char tmpdir[1024] = ""; 186 if (getenv("TMPDIR") == NULL && getenv("TEMP") != NULL) { 187 strncpy(tmpdir,getenv("TEMP"),strlen(getenv("TEMP"))); 188 setenv("TMPDIR",tmpdir,0); 189 } 190 if (getenv("TMPDIR") == NULL) { 191 strncpy(tmpdir,getenv("ETC"),2); 192 stpcpy(tmpdir,"/OS2/SYSTEM"); 193 setenv("TMPDIR",tmpdir,0); 194 } 195 196 if (dyn_CONFIGFILE == NULL) { 197 return buffer; 198 } 199 return dyn_CONFIGFILE; 200 } 201 202 /** Log file directory. **/ 203 const char *get_dyn_LOGFILEBASE(void) 204 { 205 static char buffer[1024] = ""; 206 if (!*buffer) 207 { 208 snprintf(buffer, 260, "%s/samba/log", getenv("ETC")); 209 } 210 if (dyn_LOGFILEBASE == NULL) { 211 return buffer; 212 } 213 return dyn_LOGFILEBASE; 214 } 215 216 /** Statically configured LanMan hosts. **/ 217 const char *get_dyn_LMHOSTSFILE(void) 218 { 219 static char buffer[1024] = ""; 220 if (!*buffer) 221 { 222 snprintf(buffer, 260, "%s/samba/lmhosts", getenv("ETC")); 223 } 224 if (dyn_LMHOSTSFILE == NULL) { 225 return buffer; 226 } 227 return dyn_LMHOSTSFILE; 228 } 229 230 /* Directory holding the codepages */ 231 const char *get_dyn_CODEPAGEDIR(void) 232 { 233 static char buffer[1024] = ""; 234 if (!*buffer) 235 { 236 char exedir[1024] = ""; 237 if (os2_GetExePath(exedir) != 0) 238 { 239 snprintf(buffer, 260, "%s", CODEPAGEDIR); 240 } else { 241 snprintf(buffer, 260, "%s/%s", exedir, "codepages"); 242 } 243 } 244 245 if (dyn_CODEPAGEDIR == NULL) { 246 return buffer; 247 } 248 return dyn_CODEPAGEDIR; 249 } 250 251 /* Directory holding the libs */ 252 const char *get_dyn_LIBDIR(void) 253 { 254 static char buffer[1024] = ""; 255 if (!*buffer) 256 { 257 char exedir[1024] = ""; 258 if (os2_GetExePath(exedir) != 0) 259 { 260 snprintf(buffer, 260, "%s", LIBDIR); 261 } else { 262 snprintf(buffer, 260, "%s/%s", exedir, "lib"); 263 } 264 } 265 266 if (dyn_LIBDIR == NULL) { 267 return buffer; 268 } 269 return dyn_LIBDIR; 270 } 271 272 /* Directory holding the modules */ 273 const char *get_dyn_MODULESDIR(void) 274 { 275 static char buffer[1024] = ""; 276 if (!*buffer) 277 { 278 char exedir[1024] = ""; 279 if (os2_GetExePath(exedir) != 0) 280 { 281 snprintf(buffer, 260, "%s", MODULESDIR); 282 } else { 283 snprintf(buffer, 260, "%s/%s", exedir, "modules"); 284 } 285 } 286 287 if (dyn_MODULESDIR == NULL) { 288 return buffer; 289 } 290 return dyn_MODULESDIR; 291 } 292 293 /* Directory holding lock files */ 294 const char *get_dyn_LOCKDIR(void) 295 { 296 static char buffer[1024] = ""; 297 if (!*buffer) 298 { 299 snprintf(buffer, 260, "%s/samba/lock", getenv("ETC")); 300 } 301 if (dyn_LOCKDIR == NULL) { 302 return buffer; 303 } 304 return dyn_LOCKDIR; 305 } 306 307 /* Directory holding the pid files */ 308 const char *get_dyn_PIDDIR(void) 309 { 310 static char buffer[1024] = ""; 311 if (!*buffer) 312 { 313 snprintf(buffer, 260, "%s/samba/pid", getenv("ETC")); 314 } 315 if (dyn_PIDDIR == NULL) { 316 return buffer; 317 } 318 return dyn_PIDDIR; 319 } 320 321 /* Location of smbpasswd */ 322 const char *get_dyn_SMB_PASSWD_FILE(void) 323 { 324 static char buffer[1024] = ""; 325 if (!*buffer) 326 { 327 snprintf(buffer, 260, "%s/samba/private/smbpasswd", getenv("ETC")); 328 } 329 if (dyn_SMB_PASSWD_FILE == NULL) { 330 return buffer; 331 } 332 return dyn_SMB_PASSWD_FILE; 333 } 334 335 /* Directory holding the private files */ 336 const char *get_dyn_PRIVATE_DIR(void) 337 { 338 static char buffer[1024] = ""; 339 if (!*buffer) 340 { 341 snprintf(buffer, 260, "%s/samba/private", getenv("ETC")); 342 } 343 if (dyn_PRIVATE_DIR == NULL) { 344 return buffer; 345 } 346 return dyn_PRIVATE_DIR; 347 } 348 349 /* @todo define NCALRPCDIR and SHLIBDIR eventually different */ 350 351 /* Directory holding the shared libs (same as libdir) */ 352 const char *get_dyn_SHLIBEXT(void) 353 { 354 static char buffer[1024] = ""; 355 if (!*buffer) 356 { 357 char exedir[1024] = ""; 358 if (os2_GetExePath(exedir) != 0) 359 { 360 snprintf(buffer, 260, "%s", LIBDIR); 361 } else { 362 snprintf(buffer, 260, "%s/%s", exedir, "lib"); 363 } 364 } 365 366 if (dyn_SHLIBEXT == NULL) { 367 return buffer; 368 } 369 return dyn_SHLIBEXT; 370 } 371 372 /* Directory holding the NCALRPCDIR (whatever that is) */ 373 const char *get_dyn_NCALRPCDIR(void) 374 { 375 static char buffer[1024] = ""; 376 if (!*buffer) 377 { 378 char exedir[1024] = ""; 379 if (os2_GetExePath(exedir) != 0) 380 { 381 snprintf(buffer, 260, "%s", NCALRPCDIR); 382 } else { 383 snprintf(buffer, 260, "%s/%s", exedir, "lib"); 384 } 385 } 386 387 if (dyn_NCALRPCDIR == NULL) { 388 return buffer; 389 } 390 return dyn_NCALRPCDIR; 391 } 392 393 #endif /* __OS2__ */ 394 395 /* In non-FHS mode, these should be configurable using 'lock dir ='; 396 but in FHS mode, they are their own directory. Implement as wrapper 397 functions so that everything can still be kept in dynconfig.c. 398 */ 399 400 const char *get_dyn_STATEDIR(void) 401 { 402 #ifdef FHS_COMPATIBLE 403 return STATEDIR; 404 #else 405 return lp_lockdir(); 406 #endif 407 } 408 409 const char *get_dyn_CACHEDIR(void) 410 { 411 #ifdef FHS_COMPATIBLE 412 return CACHEDIR; 413 #else 414 return lp_lockdir(); 415 #endif 416 } -
trunk/server/source3/groupdb/mapping_ldb.c
r414 r454 81 81 /* force the permissions on the ldb to 0600 - this will fix 82 82 existing databases as well as new ones */ 83 #ifndef __OS2__ 83 84 if (chmod(db_path, 0600) != 0) { 84 85 goto failed; 85 86 } 87 #endif 86 88 87 89 if (!existed) { -
trunk/server/source3/include/version.h
r429 r454 4 4 #define SAMBA_VERSION_RELEASE 2 5 5 #define SAMBA_VERSION_OFFICIAL_STRING "3.5.2" 6 #define SAMBA_VERSION_VENDOR_SUFFIX "eCS 1.2.0" 7 #define SAMBA_VERSION_VENDOR_PATCH 426 8 #define SAMBA_VERSION_VENDOR_PATCH_STRING "426" 6 9 #ifdef SAMBA_VERSION_VENDOR_FUNCTION 7 10 # define SAMBA_VERSION_STRING SAMBA_VERSION_VENDOR_FUNCTION -
trunk/server/source3/lib/charcnv.c
r414 r454 1804 1804 */ 1805 1805 1806 /* @todo eventually port old code, but probably not necessary */ 1806 1807 codepoint_t next_codepoint(const char *str, size_t *size) 1807 1808 { -
trunk/server/source3/lib/fault.c
r414 r454 54 54 if (cont_fn) { 55 55 cont_fn(NULL); 56 #ifndef __OS2__ /* don't use the built in signal capture stuff - prefer native handling of errors */ 56 57 #ifdef SIGSEGV 57 58 CatchSignal(SIGSEGV,SIGNAL_CAST SIG_DFL); … … 62 63 #ifdef SIGABRT 63 64 CatchSignal(SIGABRT,SIGNAL_CAST SIG_DFL); 65 #endif 64 66 #endif 65 67 return; /* this should cause a core dump */ … … 83 85 cont_fn = fn; 84 86 87 #ifndef __OS2__ /* don't use the built in signal capture stuff - prefer native handling of errors */ 85 88 #ifdef SIGSEGV 86 89 CatchSignal(SIGSEGV,SIGNAL_CAST sig_fault); … … 91 94 #ifdef SIGABRT 92 95 CatchSignal(SIGABRT,SIGNAL_CAST sig_fault); 96 #endif 93 97 #endif 94 98 } -
trunk/server/source3/lib/iconv.c
r414 r454 128 128 } 129 129 130 #ifdef __OS2__ 131 // i could have done a static variable w/o this function. but i feel it's nicer this way. 132 // the purpose of this function is to save the to_name to get the korean and japanese code set working 133 char * save_toname(char *toname, bool what) 134 { 135 static char *to_name=NULL; 136 137 if ( what == 0 ) 138 to_name = SMB_STRDUP(toname); 139 140 return to_name; 141 } 142 #endif 143 130 144 #ifdef HAVE_NATIVE_ICONV 131 145 /* if there was an error then reset the internal state, … … 136 150 char **outbuf, size_t *outbytesleft) 137 151 { 152 #ifdef __OS2__ 153 uint16 *outbuf_uc = ( uint16 * )*outbuf; 154 char *to_name = save_toname(NULL, 1); 155 #endif 156 138 157 size_t ret = iconv((iconv_t)cd, 139 158 (void *)inbuf, inbytesleft, … … 144 163 errno = saved_errno; 145 164 } 165 #ifdef __OS2__ 166 /* Workaround for path separator on OS/2 */ 167 else 168 { 169 if( (strstr(to_name, "949") != NULL) || /* Korean CP */ 170 (strstr(to_name, "932") != NULL) || /* Japanese CP */ 171 (strstr(to_name, "942") != NULL) || /* Japanese CP */ 172 (strstr(to_name, "943") != NULL) ) /* Japanese CP */ 173 { 174 while(( char * )outbuf_uc < *outbuf ) 175 { 176 if( *outbuf_uc == 0x20a9 || /* Korean WON */ 177 *outbuf_uc == 0x00a5 ) /* Japanese YEN */ 178 *outbuf_uc = '\\'; 179 180 outbuf_uc++; 181 } 182 } 183 } 184 #endif 185 146 186 return ret; 147 187 } … … 161 201 char *bufp = cvtbuf; 162 202 size_t bufsize; 203 #ifdef __OS2__ 204 save_toname(cd->to_name, 0); 205 #endif 163 206 164 207 /* in many cases we can go direct */ -
trunk/server/source3/lib/ldb/common/ldb.c
r414 r454 117 117 ldb_connect_fn fn; 118 118 119 #ifndef __OS2__ // on OS2 we have a semicolon at the second character if w/o backend called 119 120 if (strchr(url, ':') != NULL) { 121 #else 122 if (url[1] != ':' && strchr(url, ':') != NULL) { 123 #endif 120 124 backend = talloc_strndup(ldb, url, strchr(url, ':')-url); 121 125 } else { -
trunk/server/source3/lib/ldb/ldb_tdb/ldb_tdb.c
r414 r454 1012 1012 1013 1013 /* parse the url */ 1014 #ifndef __OS2__ // on OS2 we have a semicolon at the second character if w/o backend called 1014 1015 if (strchr(url, ':')) { 1016 #else 1017 if (url[1] != ':' && strchr(url, ':') != NULL) { 1018 #endif 1015 1019 if (strncmp(url, "tdb://", 6) != 0) { 1016 1020 ldb_debug(ldb, LDB_DEBUG_ERROR, "Invalid tdb URL '%s'", url); -
trunk/server/source3/lib/pidfile.c
r414 r454 68 68 } 69 69 70 #ifndef __OS2__ // if we lock the file, we won't be able to read it later on OS/2 70 71 if (fcntl_lock(fd,SMB_F_SETLK,0,1,F_RDLCK)) { 71 72 /* we could get the lock - it can't be a Samba process */ 72 73 goto noproc; 73 74 } 75 #endif 74 76 75 77 SAFE_FREE(pidFile); … … 95 97 /* Add a suffix to the program name if this is a process with a 96 98 * none default configuration file name. */ 99 100 /* On OS/2, CONFIGFILE will always be different to dyn_CONFIGFILE 101 as dyn_CONFIGFILE dynamically looks up the system ETC directory */ 102 #ifndef __OS2__ 103 97 104 if (strcmp( CONFIGFILE, get_dyn_CONFIGFILE()) == 0) { 98 105 name = SMB_STRDUP(program_name); … … 111 118 } 112 119 } 120 #else 121 name = SMB_STRDUP(program_name); 122 #endif 113 123 114 124 if (asprintf(&pidFile_name, "%s/%s.pid", lp_piddir(), name) == -1) { … … 144 154 exit(1); 145 155 } 156 146 157 /* Leave pid file open & locked for the duration... */ 147 158 SAFE_FREE(name); 159 #ifdef __OS2__ // If we leave the file open & locked on OS/2 - we can't read it, so close the fd 160 close(fd); 161 #endif 148 162 } 149 163 -
trunk/server/source3/lib/readline.c
r414 r454 102 102 return ret; 103 103 } 104 #ifdef __OS2__ 105 #include <conio.h> 106 { 107 char * cp = line; 108 char c; 109 int flag = 1; 110 while (flag && cp < line + sizeof(line) - 1) 111 { 112 c = getch(); 113 switch (c) 114 { 115 case 8: 116 { 117 if (cp > line) 118 { 119 cp--; 120 putchar(8); 121 putchar(32); 122 putchar(8); 123 } 124 } break; 125 case 0: break; 126 case 10: // generally should not be 127 case 13: 128 { 129 flag = 0; 130 } break; 131 case 27: 132 { 133 for (; cp > line; cp--) 134 { 135 putchar(8); 136 putchar(32); 137 putchar(8); 138 } 139 } break; 140 default: 141 { 142 *cp++ = c; 143 putchar(c); 144 } 145 } 146 } 147 *cp = 0; 148 printf("\n"); 149 return line; 150 } 151 #endif /* __OS2__ */ 152 104 153 if (callback) { 105 154 callback(); -
trunk/server/source3/lib/select.c
r414 r454 63 63 64 64 if (initialised != sys_getpid()) { 65 #ifndef __OS2__ 65 66 if (pipe(select_pipe) == -1) 67 #else 68 if (socketpair(AF_UNIX, SOCK_STREAM,0, select_pipe) == -1) 69 #endif 66 70 { 67 71 DEBUG(0, ("sys_select: pipe failed (%s)\n", -
trunk/server/source3/lib/smbrun.c
r414 r454 83 83 } 84 84 85 #ifdef __OS2__ 86 char buf[8192]; 87 int n, w; 88 const char *newcmd = sanitize ? escape_shell_string(cmd) : cmd; 89 if (!newcmd) { 90 close(*outfd); 91 *outfd = -1; 92 return(82); 93 } 94 // execute script and capture stdout 95 FILE* pipe = popen( newcmd, "rb"); 96 if (pipe) { 97 // get stdout from pipe 98 while( !feof( pipe)) { 99 n = fread( buf, 1, 8192, pipe); 100 // write to file if required 101 if (n>0 && outfd!=NULL) 102 w = write( *outfd, buf, n); 103 } 104 // close and return status 105 pclose( pipe); 106 return 0; 107 } 108 // error, close files 109 close(*outfd); 110 *outfd = -1; 111 return 83; 112 #else 85 113 /* in this method we will exec /bin/sh with the correct 86 114 arguments, after first setting stdout to point at the file */ … … 202 230 exit(83); 203 231 return 1; 232 #endif 204 233 } 205 234 -
trunk/server/source3/lib/system.c
r429 r454 641 641 #if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_FTRUNCATE64) 642 642 return ftruncate64(fd, offset); 643 #elif defined(__OS2__) 644 return os2_ftruncate(fd, offset); 643 645 #else 644 646 return ftruncate(fd, offset); … … 1571 1573 } 1572 1574 return ret; 1575 #elif defined(__OS2__) 1576 return unigetxattr(path, 0, name, value, size); 1573 1577 #else 1574 1578 errno = ENOSYS; … … 1622 1626 } 1623 1627 return ret; 1628 #elif defined(__OS2__) 1629 return unigetxattr(path, 0, name, value, size); 1624 1630 #else 1625 1631 errno = ENOSYS; … … 1675 1681 } 1676 1682 return ret; 1683 #elif defined(__OS2__) 1684 return unigetxattr(0, filedes, name, value, size); 1677 1685 #else 1678 1686 errno = ENOSYS; … … 1867 1875 } 1868 1876 return ret; 1877 #elif defined(__OS2__) 1878 return unilistxattr(path, 0, list, size); 1869 1879 #else 1870 1880 errno = ENOSYS; … … 1896 1906 } 1897 1907 return ret; 1908 #elif defined(__OS2__) 1909 return unilistxattr(path, 0, list, size); 1898 1910 #else 1899 1911 errno = ENOSYS; … … 1927 1939 } 1928 1940 return ret; 1941 #elif defined(__OS2__) 1942 return unilistxattr(0, filedes, list, size); 1929 1943 #else 1930 1944 errno = ENOSYS; … … 1966 1980 } 1967 1981 return ret; 1982 #elif defined(__OS2__) 1983 return uniremovexattr (path, 0, name); 1968 1984 #else 1969 1985 errno = ENOSYS; … … 2003 2019 } 2004 2020 return ret; 2021 #elif defined(__OS2__) 2022 return uniremovexattr (path, 0, name); 2005 2023 #else 2006 2024 errno = ENOSYS; … … 2042 2060 } 2043 2061 return ret; 2062 #elif defined(__OS2__) 2063 return uniremovexattr (0, filedes, name); 2044 2064 #else 2045 2065 errno = ENOSYS; … … 2107 2127 } 2108 2128 return ret; 2129 #elif defined(__OS2__) 2130 return unisetxattr (path, 0, name, value, size, flags); 2109 2131 #else 2110 2132 errno = ENOSYS; … … 2171 2193 } 2172 2194 return ret; 2195 #elif defined(__OS2__) 2196 return unisetxattr (path, 0, name, value, size, flags); 2173 2197 #else 2174 2198 errno = ENOSYS; … … 2236 2260 } 2237 2261 return ret; 2262 #elif defined(__OS2__) 2263 return unisetxattr (0, filedes, name, value, size, flags); 2238 2264 #else 2239 2265 errno = ENOSYS; -
trunk/server/source3/lib/system_smbd.c
r414 r454 41 41 int *grpcnt) 42 42 { 43 #ifndef __OS2__groups 43 44 gid_t *gids_saved; 44 45 int ret, ngrp_saved, num_gids; … … 112 113 free(gids_saved); 113 114 return ret; 115 #else 116 *grpcnt = 0; 117 return 0; 118 #endif 114 119 } 115 120 #endif -
trunk/server/source3/lib/util.c
r414 r454 2027 2027 int set_maxfiles(int requested_max) 2028 2028 { 2029 #if (defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) )2029 #if (defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) && !defined(__OS2__)) 2030 2030 struct rlimit rlp; 2031 2031 int saved_current_limit; -
trunk/server/source3/lib/util_sec.c
r414 r454 93 93 static void assert_uid(uid_t ruid, uid_t euid) 94 94 { 95 #ifndef __OS2__ 95 96 if ((euid != (uid_t)-1 && geteuid() != euid) || 96 97 (ruid != (uid_t)-1 && getuid() != ruid)) { … … 103 104 } 104 105 } 106 #endif 105 107 } 106 108 … … 110 112 static void assert_gid(gid_t rgid, gid_t egid) 111 113 { 114 #ifndef __OS2__ 112 115 if ((egid != (gid_t)-1 && getegid() != egid) || 113 116 (rgid != (gid_t)-1 && getgid() != rgid)) { … … 121 124 } 122 125 } 126 #endif 123 127 } 124 128 -
trunk/server/source3/lib/util_sock.c
r414 r454 1679 1679 /* Create the socket directory or reuse the existing one */ 1680 1680 1681 #ifndef __OS2__ 1681 1682 if (lstat(socket_dir, &st) == -1) { 1682 1683 if (errno == ENOENT) { … … 1707 1708 } 1708 1709 } 1710 #endif 1709 1711 1710 1712 /* Create the socket file */ … … 1718 1720 } 1719 1721 1722 #ifdef __OS2__ 1723 if (asprintf(&path, "\\socket\\samba\\%s\\%s", socket_dir, socket_name) == -1) { 1724 #else 1720 1725 if (asprintf(&path, "%s/%s", socket_dir, socket_name) == -1) { 1726 #endif 1721 1727 goto out_close; 1722 1728 } -
trunk/server/source3/lib/util_str.c
r414 r454 2264 2264 *******************************************************************/ 2265 2265 2266 #ifdef __OS2__ 2267 #define INCLUDE_LIST "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_/ \t.,:" 2268 #else 2266 2269 #define INCLUDE_LIST "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_/ \t.," 2270 #endif 2267 2271 #define INSIDE_DQUOTE_LIST "$`\n\"\\" 2268 2272 -
trunk/server/source3/libaddns/dns.h
r414 r454 41 41 #include <fcntl.h> 42 42 #include <time.h> 43 #ifndef __OS2__ 43 44 #include <string.h> 45 #endif 44 46 #include <errno.h> 45 47 #include <netdb.h> -
trunk/server/source3/libaddns/dnserr.h
r414 r454 36 36 /* Setup the DNS_ERROR typedef. Technique takes from nt_status.h */ 37 37 38 #if defined(HAVE_IMMEDIATE_STRUCTURES) 38 #if defined(HAVE_IMMEDIATE_STRUCTURES) && !defined(__OS2__) 39 39 typedef struct {uint32 v;} DNS_ERROR; 40 40 #define ERROR_DNS(x) ((DNS_ERROR) { x }) -
trunk/server/source3/libsmb/clientgen.c
r429 r454 567 567 bool mandatory_signing = false; 568 568 569 #ifndef __OS2__ 569 570 /* Check the effective uid - make sure we are not setuid */ 570 571 if (is_setuid_root()) { … … 572 573 return NULL; 573 574 } 575 #endif 574 576 575 577 cli = TALLOC_ZERO_P(NULL, struct cli_state); -
trunk/server/source3/libsmb/clifile.c
r414 r454 4360 4360 &setup, 1, 0, /* setup, length, max */ 4361 4361 param, param_len, 10, /* param, length, max */ 4362 #ifdef __OS2__ 4363 NULL, data_len, CLI_BUFFER_SIZE /* data, length, max */ 4364 #else 4362 4365 NULL, data_len, cli->max_xmit /* data, length, max */ 4366 #endif 4363 4367 )) { 4364 4368 return False; … … 4502 4506 memset(param, 0, 6); 4503 4507 SSVAL(param,0,fnum); 4508 #ifndef __OS2__ 4504 4509 SSVAL(param,2,SMB_INFO_SET_EA); 4510 #else 4511 SSVAL(param,2,SMB_INFO_QUERY_ALL_EAS); 4512 #endif 4505 4513 4506 4514 return cli_get_ea_list(cli, setup, param, 6, ctx, pnum_eas, pea_list); -
trunk/server/source3/locking/posix.c
r414 r454 252 252 ret = SMB_VFS_GETLOCK(fsp, poffset, pcount, ptype, &pid); 253 253 254 #ifndef __OS2__ /* file locks currently fail with OS/2's libc */ 254 255 if (!ret && ((errno == EFBIG) || (errno == ENOLCK) || (errno == EINVAL))) { 255 256 … … 277 278 } 278 279 } 280 #endif 279 281 280 282 DEBUG(8,("posix_fcntl_getlock: Lock query call %s\n", ret ? "successful" : "failed")); -
trunk/server/source3/nmbd/asyncdns.c
r414 r454 141 141 CatchChild(); 142 142 143 #ifdef __OS2__ // cant use pipes here, because select() from innotek lib does work only for sockets. 144 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd1) < 0) 145 { 146 DEBUG(0,("can't create asyncdns socketpair1 %d\n", errno)); 147 return; 148 } 149 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fd2) < 0) 150 { 151 DEBUG(0,("can't create asyncdns socketpair2 %d\n", errno)); 152 close(fd1[0]); 153 close(fd1[1]); 154 return; 155 } 156 DEBUG(9,("!!!!!!PIPES %d %d %d %d\n", fd1[0], fd1[1], fd2[0], fd2[1])); 157 #else 143 158 if (pipe(fd1) || pipe(fd2)) { 144 159 DEBUG(0,("can't create asyncdns pipes\n")); 145 160 return; 146 161 } 162 #endif 147 163 148 164 child_pid = sys_fork(); -
trunk/server/source3/nmbd/nmbd.c
r414 r454 30 30 extern bool global_in_nmbd; 31 31 32 #ifdef __OS2__ 33 extern int global_Sem32Add; 34 #endif 35 32 36 extern bool override_logfile; 33 37 … … 384 388 reload_nmbd_services( True ); 385 389 } 390 391 #ifdef __OS2__ 392 /* restore the logfile to log.nmbd if !override_logfile */ 393 if (!override_logfile) { 394 char *lfile = NULL; 395 if (asprintf(&lfile, "%s/log.nmbd", get_dyn_LOGFILEBASE()) < 0) { 396 exit(1); 397 } 398 lp_set_logfile(lfile); 399 SAFE_FREE(lfile); 400 } 401 #endif 386 402 387 403 return(ret); … … 776 792 TALLOC_CTX *frame = talloc_stackframe(); /* Setup tos. */ 777 793 794 #ifdef __OS2__ 795 global_Sem32Add = 1; 796 #endif 797 778 798 load_case_tables(); 779 799 -
trunk/server/source3/nmbd/nmbd_serverlistdb.c
r414 r454 331 331 return; 332 332 } 333 #ifndef __OS2__ 333 334 fnamenew = talloc_asprintf(ctx, "%s.", 335 #else 336 fnamenew = talloc_asprintf(ctx, "%s.tmp", 337 #endif 334 338 fname); 335 339 if (!fnamenew) { … … 418 422 419 423 x_fclose(fp); 424 #ifdef __OS2__ 425 close(fp); 426 #endif 420 427 unlink(fname); 421 428 chmod(fnamenew,0644); -
trunk/server/source3/nmbd/nmbd_winsserver.c
r414 r454 2389 2389 2390 2390 x_fclose(fp); 2391 #ifdef __OS2__ 2392 close(fp); 2393 #endif 2391 2394 chmod(fnamenew,0644); 2392 2395 unlink(fname); -
trunk/server/source3/param/loadparm.c
r414 r454 4665 4665 case PRINT_AIX: 4666 4666 case PRINT_LPRNT: 4667 #ifndef __OS2__ 4667 4668 case PRINT_LPROS2: 4669 #endif 4668 4670 string_set(&pService->szLpqcommand, "lpq -P'%p'"); 4669 4671 string_set(&pService->szLprmcommand, "lprm -P'%p' %j"); 4670 4672 string_set(&pService->szPrintcommand, "lpr -r -P'%p' %s"); 4671 4673 break; 4674 #ifdef __OS2__ 4675 case PRINT_LPROS2: 4676 string_set(&pService->szLpqcommand, "lpq.exe -s %i -p %p"); 4677 string_set(&pService->szLprmcommand, "lprm.exe -s %i -p %p %j"); 4678 string_set(&pService->szPrintcommand, "lpr.exe -b -s %i -p %p %s & cmd.exe /c del %s"); 4679 break; 4680 #endif 4672 4681 4673 4682 case PRINT_LPRNG: … … 4938 4947 string_set(&Globals.szGuestaccount, GUEST_ACCOUNT); 4939 4948 4949 #ifdef __OS2__ 4950 /* search the system codepage and set OS2CodePageStr */ 4951 unsigned long _System DosQueryCp (unsigned long ulLength, unsigned long *pCodePageList, unsigned long *pDataLength); 4952 char *OS2CodePageStr=NULL; 4953 unsigned long OS2CodePage[3]; 4954 unsigned long OS2CodePageLen; 4955 if ( DosQueryCp( sizeof(OS2CodePage), OS2CodePage, &OS2CodePageLen ) ) 4956 asprintf(&OS2CodePageStr, "SYSTEM"); 4957 else 4958 asprintf(&OS2CodePageStr, "IBM-%u", OS2CodePage[0]); 4959 #endif 4960 #ifndef __OS2__ 4940 4961 /* using UTF8 by default allows us to support all chars */ 4941 4962 string_set(&Globals.unix_charset, DEFAULT_UNIX_CHARSET); 4963 #else 4964 /* On OS/2, using UTF8 causes problems with display of foreign 4965 characters - default to system codepage */ 4966 string_set(&Globals.unix_charset, OS2CodePageStr); 4967 #endif 4942 4968 4943 4969 #if defined(HAVE_NL_LANGINFO) && defined(CODESET) 4944 4970 /* If the system supports nl_langinfo(), try to grab the value 4945 4971 from the user's locale */ 4972 #ifndef __OS2__ 4946 4973 string_set(&Globals.display_charset, "LOCALE"); 4974 #else 4975 /* On OS/2, using UTF8 causes problems with display of foreign 4976 characters - default to system codepage */ 4977 string_set(&Globals.display_charset, OS2CodePageStr); 4978 #endif 4979 4947 4980 #else 4948 4981 string_set(&Globals.display_charset, DEFAULT_DISPLAY_CHARSET); 4949 4982 #endif 4950 4983 4984 #ifndef __OS2__ 4951 4985 /* Use codepage 850 as a default for the dos character set */ 4952 4986 string_set(&Globals.dos_charset, DEFAULT_DOS_CHARSET); 4987 #else 4988 /* On OS/2, using UTF8 causes problems with display of foreign 4989 characters - default to system codepage */ 4990 string_set(&Globals.dos_charset, OS2CodePageStr); 4991 #endif 4953 4992 4954 4993 /* -
trunk/server/source3/passdb/pdb_smbpasswd.c
r414 r454 277 277 */ 278 278 279 #ifndef __OS2__ 279 280 if (sys_stat(pfile, &sbuf1, false) != 0) { 280 281 DEBUG(0, ("startsmbfilepwent_internal: unable to stat file %s. \ … … 294 295 295 296 if( sbuf1.st_ex_ino == sbuf2.st_ex_ino) { 297 #else 296 298 /* No race. */ 299 { 300 #endif 297 301 break; 298 302 } … … 315 319 setvbuf(fp, (char *)NULL, _IOFBF, 1024); 316 320 321 #ifndef __OS2__ 317 322 /* Make sure it is only rw by the owner */ 318 323 #ifdef HAVE_FCHMOD … … 327 332 return NULL; 328 333 } 334 #endif 329 335 330 336 /* We have a lock on the file. */ … … 1168 1174 * Do an atomic rename - then release the locks. 1169 1175 */ 1176 #ifdef __OS2__ 1177 endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); 1178 endsmbfilepwent(fp_write,&pfile2_lockdepth); 1179 #endif 1170 1180 1171 1181 if(rename(pfile2,pfile) != 0) { … … 1173 1183 } 1174 1184 1185 #ifndef __OS2__ 1175 1186 endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); 1176 1187 endsmbfilepwent(fp_write,&pfile2_lockdepth); 1188 #endif 1177 1189 return True; 1178 1190 } -
trunk/server/source3/printing/printing.c
r414 r454 1431 1431 DEBUG(3,("start_background_queue: Starting background LPQ thread\n")); 1432 1432 1433 #ifndef __OS2__ 1433 1434 if (pipe(pause_pipe) == -1) { 1435 #else // on OS2 we have no select() on pipes, so we use socketpair() instead 1436 if (socketpair(AF_UNIX, SOCK_STREAM,0, pause_pipe) < 0) { 1437 #endif 1434 1438 DEBUG(5,("start_background_queue: cannot create pipe. %s\n", strerror(errno) )); 1435 1439 exit(1); -
trunk/server/source3/rpc_server/srv_srvsvc_nt.c
r414 r454 179 179 180 180 if ( strcmp( fname, "." ) == 0 ) { 181 #ifndef __OS2__ 181 182 fullpath = talloc_asprintf(fenum->ctx, "C:%s", sharepath ); 183 #else 184 fullpath = talloc_asprintf(fenum->ctx, "%s%s", 185 (strchr( sharepath,':')) ? "" : "C:", sharepath ); 186 #endif 182 187 } else { 188 #ifndef __OS2__ 183 189 fullpath = talloc_asprintf(fenum->ctx, "C:%s/%s", 184 190 sharepath, fname ); 191 #else 192 fullpath = talloc_asprintf(fenum->ctx, "%s%s/%s", 193 (strchr( sharepath,':')) ? "" : "C:", sharepath, fname ); 194 #endif 185 195 } 186 196 if (!fullpath) { … … 294 304 "", remark); 295 305 } 306 #ifdef __OS2__ 307 if (strchr( lp_pathname(snum), ':')) 308 path = talloc_asprintf(p->mem_ctx,"%s", lp_pathname(snum)); 309 else 310 #endif 311 296 312 path = talloc_asprintf(p->mem_ctx, 297 313 "C:%s", lp_pathname(snum)); … … 386 402 "", remark); 387 403 } 404 #ifdef __OS2__ 405 if (strchr( lp_pathname(snum), ':')) 406 path = talloc_asprintf(ctx, "%s", lp_pathname(snum)); 407 else 408 #endif 388 409 path = talloc_asprintf(ctx, "C:%s", lp_pathname(snum)); 389 410 if (path) { … … 1489 1510 } 1490 1511 1512 #ifdef __OS2__ 1513 /* Only absolute paths allowed. */ 1514 if (strlen(ptr) < 2 || ptr[1] != ':') 1515 return NULL; 1516 #else 1491 1517 /* NT is braindead - it wants a C: prefix to a pathname ! So strip it. */ 1492 1518 if (strlen(ptr) > 2 && ptr[1] == ':' && ptr[0] != '/') … … 1496 1522 if (*ptr != '/') 1497 1523 return NULL; 1524 #endif 1498 1525 1499 1526 return ptr; … … 2338 2365 ***********************************************************************************/ 2339 2366 2367 #ifndef __OS2__ 2340 2368 static const char *server_disks[] = {"C:"}; 2369 #else // YD we can use a better implementation (real time scan or above idea) 2370 static const char *server_disks[] = {"C:","D:","E:","F:","G:","H:","I:","J:","K:","L:","M:","N:","O:", 2371 "P:","Q:","R:","S:","T:","U:","V:","W:","X:","Y:","Z:"}; 2372 #endif 2341 2373 2342 2374 static uint32 get_server_disk_count(void) -
trunk/server/source3/smbd/dosmode.c
r414 r454 180 180 if (ro_opts == MAP_READONLY_YES) { 181 181 /* Original Samba method - map inverse of user "w" bit. */ 182 #ifndef __OS2__ 182 183 if ((smb_fname->st.st_ex_mode & S_IWUSR) == 0) { 184 #else 185 if (os2_isattribute(smb_fname->base_name, aRONLY) == 0) { 186 #endif 183 187 result |= aRONLY; 184 188 } … … 190 194 } /* Else never set the readonly bit. */ 191 195 196 #ifndef __OS2__ 192 197 if (MAP_ARCHIVE(conn) && ((smb_fname->st.st_ex_mode & S_IXUSR) != 0)) 198 #else 199 if (os2_isattribute(smb_fname->base_name, aARCH) == 0) 200 #endif 193 201 result |= aARCH; 194 202 203 #ifndef __OS2__ 195 204 if (MAP_SYSTEM(conn) && ((smb_fname->st.st_ex_mode & S_IXGRP) != 0)) 205 #else 206 if (os2_isattribute(smb_fname->base_name, aSYSTEM) == 0) 207 #endif 196 208 result |= aSYSTEM; 197 209 210 #ifndef __OS2__ 198 211 if (MAP_HIDDEN(conn) && ((smb_fname->st.st_ex_mode & S_IXOTH) != 0)) 212 #else 213 if (os2_isattribute(smb_fname->base_name, aHIDDEN) == 0) 214 #endif 199 215 result |= aHIDDEN; 200 216 … … 249 265 #else 250 266 ) { 267 #endif 268 269 #ifdef __OS2__ //on os2 no error in case of ./.. and errno 2 270 if ((strncmp(smb_fname->base_name, "./..", 4) !=0) || (errno !=2)) 251 271 #endif 252 272 DEBUG(1,("get_ea_dos_attributes: Cannot get attribute " -
trunk/server/source3/smbd/password.c
r414 r454 219 219 return -1; 220 220 } 221 222 #ifdef __OS2__ 223 /* On OS/2 we use drive letters which have a colon. This is also the field 224 separator in master.passwd, so we use a $ instead of a colon for the drive 225 separator, ie e$/user instead of e:/user. This code simply exchanges any $ 226 for a : in the user's homedir */ 227 if (pwd->pw_dir[1] == '$') 228 pwd->pw_dir[1] = ':'; 229 #endif 221 230 222 231 DEBUG(3, ("Adding homes service for user '%s' using home directory: " -
trunk/server/source3/smbd/reply.c
r429 r454 5652 5652 bool dst_exists, old_is_stream, new_is_stream; 5653 5653 5654 /* borrowed from 3.3 source patch by Apple */ 5655 #ifdef __OS2__ 5656 bool check_dest_exist = False; 5657 #else 5658 bool check_dest_exist = True; 5659 #endif 5660 5654 5661 status = check_name(conn, smb_fname_dst_in->base_name); 5655 5662 if (!NT_STATUS_IS_OK(status)) { … … 5789 5796 dst_exists = SMB_VFS_STAT(conn, smb_fname_dst) == 0; 5790 5797 5791 if( !replace_if_exists && dst_exists) {5798 if(check_dest_exist && !replace_if_exists && dst_exists) { 5792 5799 DEBUG(3, ("rename_internals_fsp: dest exists doing rename " 5793 5800 "%s -> %s\n", smb_fname_str_dbg(fsp->fsp_name), -
trunk/server/source3/smbd/server.c
r429 r454 1117 1117 reopen_logs(); 1118 1118 1119 #ifdef __OS2__ 1120 unsigned long _System DosSetPriority (unsigned long ulScope, unsigned long ulClass, long lDelta, unsigned long ulID); 1121 int rc; 1122 rc = DosSetPriority( 1123 0, /* Scope: only one process */ 1124 4, /* set to PRTYC_FOREGROUNDSERVER */ 1125 0, /* set delta - was 0 */ 1126 0); /* Assume current process */ 1127 DEBUG(0,( "Server priority set to PRTYC_FOREGROUNDSERVER\n")); 1128 #endif 1129 1119 1130 DEBUG(0,("smbd version %s started.\n", samba_version_string())); 1120 1131 DEBUGADD(0,("%s\n", COPYRIGHT_STARTUP_MESSAGE)); -
trunk/server/source3/smbd/service.c
r429 r454 68 68 d = destname; 69 69 70 #ifndef __OS2__ 70 71 *d++ = '/'; /* Always start with root. */ 71 72 … … 159 160 *(d-1) = '\0'; 160 161 } 162 #else 163 /* Assume OS/2 users are smart enough to put a correct path in smb.conf, and simply copy the string */ 164 safe_strcpy(destname, connectpath, strlen(connectpath)); 165 #endif 161 166 162 167 DEBUG(10,("set_conn_connectpath: service %s, connectpath = %s\n", -
trunk/server/source3/smbd/sesssetup.c
r429 r454 75 75 result = 0; 76 76 77 #ifndef __OS2__ 77 78 tmp = message_push_string(outbuf, "Unix", STR_TERMINATE); 79 #else 80 tmp = message_push_string(outbuf, "eCS (OS/2)", STR_TERMINATE); 81 #endif 78 82 79 83 if (tmp == -1) return -1; -
trunk/server/source3/smbd/trans2.c
r414 r454 128 128 129 129 pea->flags = 0; 130 #ifndef __OS2__ 130 131 if (strnequal(ea_name, "user.", 5)) { 131 132 pea->name = talloc_strdup(mem_ctx, &ea_name[5]); 132 133 } else { 134 #else 135 { 136 #endif 133 137 pea->name = talloc_strdup(mem_ctx, ea_name); 134 138 } … … 287 291 fstring dos_ea_name; 288 292 293 #ifndef __OS2__ 289 294 if (strnequal(names[i], "system.", 7) 290 295 || samba_private_attr_name(names[i])) 296 #else 297 if (samba_private_attr_name(names[i])) 298 #endif 291 299 continue; 292 300 … … 492 500 fstring unix_ea_name; 493 501 502 #ifdef __OS2__ 503 /* All EA's must start with user - except on OS/2 */ 504 fstrcpy(unix_ea_name, ea_list->ea.name); 505 #else 494 506 fstrcpy(unix_ea_name, "user."); /* All EA's must start with user. */ 495 507 fstrcat(unix_ea_name, ea_list->ea.name); 508 #endif 496 509 497 510 canonicalize_ea_name(conn, fsp, fname, unix_ea_name); … … 5454 5467 } 5455 5468 5469 #ifdef __OS2__ 5470 /* YD ticket#60, the file is opened, we cannot write to it, 5471 * so we can return immediately (see above for more comments). 5472 */ 5473 else { 5474 #endif 5475 5456 5476 DEBUG(10,("smb_set_file_time: setting utimes to modified values.\n")); 5457 5477 … … 5463 5483 return map_nt_error_from_unix(errno); 5464 5484 } 5485 #ifdef __OS2__ 5486 } 5487 #endif 5465 5488 5466 5489 notify_fname(conn, NOTIFY_ACTION_MODIFIED, action, -
trunk/server/source3/smbd/vfs.c
r414 r454 716 716 return(0); 717 717 718 #ifdef __OS2__ 719 if ((*path == '/' || *path == '\\' || (*path && path[1] == ':')) && strcsequal(LastDir,path)) 720 #else 718 721 if (*path == '/' && strcsequal(LastDir,path)) 722 #endif 719 723 return(0); 720 724 … … 938 942 resolved_name)); 939 943 944 #ifdef __OS2__ 945 if (*resolved_name != '/' && *resolved_name != '\\' && (strlen(resolved_name) <= 1 || resolved_name[1] != ':')) { 946 #else 940 947 if (*resolved_name != '/') { 948 #endif 941 949 DEBUG(0,("check_reduced_name: realpath doesn't return " 942 950 "absolute paths !\n")); -
trunk/server/source3/torture/torture.c
r429 r454 5026 5026 printf("num_eas = %d\n", (int)num_eas); 5027 5027 5028 #ifdef __OS2__ // add libc UNIX emulation EAs 5029 if (num_eas != 27) { 5030 #else 5028 5031 if (num_eas != 20) { 5032 #endif 5029 5033 printf("Should be 20 EA's stored... failing.\n"); 5030 5034 correct = False; … … 5040 5044 printf("Now deleting all EA's - case indepenent....\n"); 5041 5045 5042 #if 15046 #if 0 // YD see bug#3212, smb_info_set_ea(), this is a NOP now! 5043 5047 cli_set_ea_path(cli, fname, "", "", 0); 5044 5048 #else -
trunk/server/source3/utils/net_usershare.c
r414 r454 946 946 947 947 /* Attempt to replace any existing share by this name. */ 948 #ifdef __OS2__ 949 close(tmpfd); 950 #endif 948 951 if (rename(full_path_tmp, full_path) != 0) { 949 952 unlink(full_path_tmp); … … 957 960 } 958 961 962 #ifndef __OS2__ 959 963 close(tmpfd); 964 #endif 960 965 961 966 if (c->opt_long_list_entries) { -
trunk/server/source3/utils/net_util.c
r414 r454 100 100 int flags = 0; 101 101 102 #ifdef __OS2__ 103 if (!c->opt_user_name || c->opt_user_name == NULL) { 104 d_printf("The username was not set.\n"); 105 return NT_STATUS_LOGON_FAILURE; 106 } 107 #endif 108 102 109 c->opt_password = net_prompt_pass(c, c->opt_user_name); 103 110 -
trunk/server/source3/web/cgi.c
r414 r454 315 315 } 316 316 317 #ifndef __OS2__ 317 318 pwd = getpwnam_alloc(talloc_autofree_context(), user); 318 319 if (!pwd) { … … 329 330 } 330 331 TALLOC_FREE(pwd); 332 #endif 331 333 } 332 334 -
trunk/server/source3/web/startstop.c
r414 r454 19 19 20 20 #include "includes.h" 21 22 #ifdef __OS2__ 23 /* fork() in klibc on OS/2 ends all children when parent 24 is closed, therefore we use spawn() */ 25 #include "process.h" 26 #define SWAT_HELPER(WHAT, WHO) \ 27 asprintf(&binfile, "%s/swathelp.cmd", getcwd(NULL, _MAX_PATH)); \ 28 int rc; \ 29 rc=spawnl(P_NOWAIT, binfile, binfile, #WHAT, #WHO, NULL); 30 #endif 31 21 32 #include "web/swat_proto.h" 22 33 #include "dynconfig.h" … … 32 43 } 33 44 45 #ifdef __OS2__ 46 /* fork() in klibc on OS/2 ends all children when parent 47 is closed, therefore we use spawn() */ 48 SWAT_HELPER(start, smbd) 49 #else 34 50 if (fork()) { 35 51 return; … … 41 57 } 42 58 exit(0); 59 #endif 43 60 } 44 61 … … 52 69 } 53 70 71 #ifdef __OS2__ 72 /* fork() in klibc on OS/2 ends all children when parent 73 is closed, therefore we use spawn() */ 74 SWAT_HELPER(start, nmbd) 75 #else 54 76 if (fork()) { 55 77 return; … … 61 83 } 62 84 exit(0); 85 #endif 63 86 } 64 87 … … 72 95 } 73 96 97 #ifdef __OS2__ 98 /* fork() in klibc on OS/2 ends all children when parent 99 is closed, therefore we use spawn() */ 100 SWAT_HELPER(start, winbindd) 101 #else 74 102 if (fork()) { 75 103 return; … … 81 109 } 82 110 exit(0); 111 #endif 83 112 } 84 113 … … 91 120 if (geteuid() != 0) return; 92 121 122 #ifdef __OS2__ /* we do it a bit nicer */ 123 if (smbd_running()) { 124 char *binfile = NULL; 125 SWAT_HELPER(stop, smbd) 126 } 127 #else 93 128 if (pid <= 0) return; 94 129 95 130 kill(pid, SIGTERM); 131 #endif 96 132 } 97 133 … … 103 139 if (geteuid() != 0) return; 104 140 141 #ifdef __OS2__ /* we do it a bit nicer */ 142 if (nmbd_running()) { 143 char *binfile = NULL; 144 SWAT_HELPER(stop, nmbd) 145 } 146 #else 105 147 if (pid <= 0) return; 106 148 107 149 kill(pid, SIGTERM); 150 #endif 108 151 } 109 152 #ifdef WITH_WINBIND … … 115 158 if (geteuid() != 0) return; 116 159 160 #ifdef __OS2__ /* we do it a bit nicer */ 161 if (winbindd_running()) { 162 char *binfile = NULL; 163 SWAT_HELPER(stop, winbindd) 164 } 165 #else 117 166 if (pid <= 0) return; 118 167 119 168 kill(pid, SIGTERM); 169 #endif 120 170 } 121 171 #endif -
trunk/server/source3/web/swat.c
r414 r454 1437 1437 load_printers(); 1438 1438 1439 #ifndef __OS2__ 1439 1440 cgi_setup(get_dyn_SWATDIR(), !demo_mode); 1441 #else 1442 1443 #if 0 1444 debug_set_logfile("swat.log"); // this produces a logfile in the dir where swat.exe is located. 1445 #endif 1446 1447 fstring path; 1448 fstrcpy(path, getcwd(NULL, _MAX_PATH)); 1449 fstrcat(path, "/swat"); 1450 cgi_setup(path, !demo_mode); 1451 #endif 1440 1452 1441 1453 print_header();
Note:
See TracChangeset
for help on using the changeset viewer.