Changeset 24
- Timestamp:
- Mar 26, 2007, 4:46:41 PM (18 years ago)
- Location:
- trunk/samba/source/ndpsmb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/ndpsmb/ndpsmb.c
r7 r24 1 //YD enable following line to get logging to disk 2 //#define DEBUG 1 3 #define NDPL_LARGEFILES 2 4 #define INCL_LONGLONG -
trunk/samba/source/ndpsmb/smbwrp.c
r8 r24 307 307 zero_ip(&ip); 308 308 309 DEBUG(1,("Connecting to \\\\%s:%s@%s:%s\\%s. Master %s:%d\n", srv->username, srv->password, workgroup, server, share, srv->master, srv->ifmastergroup));309 debuglocal(1,"Connecting to \\\\%s:%s@%s:%s\\%s. Master %s:%d\n", srv->username, srv->password, workgroup, server, share, srv->master, srv->ifmastergroup); 310 310 311 311 if (!*server) { … … 363 363 } 364 364 365 DEBUG(4,(" session request ok\n"));365 debuglocal(4," session request ok\n"); 366 366 367 367 if (!cli_negprot(c)) { … … 370 370 } 371 371 372 DEBUG(4,(" session setuping for <%s>/<%s> %d in <%s> %08x %08x %08x\n", srv->username, srv->password, strlen(srv->password), workgroup, c->protocol, c->sec_mode, c->capabilities));372 debuglocal(4," session setuping for <%s>/<%s> %d in <%s> %08x %08x %08x\n", srv->username, srv->password, strlen(srv->password), workgroup, c->protocol, c->sec_mode, c->capabilities); 373 373 374 374 if (!NT_STATUS_IS_OK(cli_session_setup(c, srv->username, … … 376 376 srv->password, strlen(srv->password), 377 377 workgroup))) { 378 DEBUG(4,("%s/%s login failed\n", srv->username, srv->password));378 debuglocal(4,"%s/%s login failed\n", srv->username, srv->password); 379 379 /* try an anonymous login if it failed */ 380 380 if (!NT_STATUS_IS_OK(cli_session_setup(c, "", "", 1,"", 0, workgroup))) { 381 DEBUG(4,("Anonymous login failed"));381 debuglocal(4,"Anonymous login failed"); 382 382 cli_shutdown(c); 383 383 return 6; … … 385 385 } 386 386 387 DEBUG(4,(" session setup ok. Sending tconx <%s> <%s> %d\n", share, srv->password, strlen(srv->password)));387 debuglocal(4," session setup ok. Sending tconx <%s> <%s> %d\n", share, srv->password, strlen(srv->password)); 388 388 389 389 if (!cli_send_tconX(c, share, "?????", … … 393 393 } 394 394 395 DEBUG(4,(" tconx ok. cli caps %08x\n", c->capabilities));395 debuglocal(4," tconx ok. cli caps %08x\n", c->capabilities); 396 396 397 397 // copy back cli_state … … 432 432 } 433 433 434 DEBUG(4,("cli_open(%s) attr %08x mode %02x denymode %02x\n", file->fname, file->openattr, file->openmode, file->denymode));434 debuglocal(4,"cli_open(%s) attr %08x mode %02x denymode %02x\n", file->fname, file->openattr, file->openmode, file->denymode); 435 435 file->fd = cli_open(cli, file->fname, file->openmode, file->denymode); 436 436 if (file->fd == -1) … … 443 443 file->mtime = time(NULL); 444 444 t = get_time_zone(file->mtime); 445 DEBUG(4,("cli_open mtime %lu %lu\n", file->mtime, t));445 debuglocal(4,"cli_open mtime %lu %lu\n", file->mtime, t); 446 446 file->mtime -= t; 447 447 } … … 489 489 490 490 *result = 0; 491 // DEBUG(1,("Write %x %d %lld %d", cli, file->fd, file->offset, count));491 //debuglocal(1,("Write %x %d %lld %d", cli, file->fd, file->offset, count)); 492 492 ret = cli_write(cli, file->fd, 0, buf, file->offset, count); 493 493 if (ret == -1) … … 521 521 if (file->openattr || file->mtime) 522 522 { 523 DEBUG(4,("Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime + get_time_zone(file->mtime)));523 debuglocal(4,"Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime + get_time_zone(file->mtime)); 524 524 if (!cli_setatr(cli, file->fname, file->openattr, file->mtime + get_time_zone(file->mtime))) 525 525 { 526 DEBUG(4,("Set attr on close failed %d\n", os2cli_errno(cli)));526 debuglocal(4,"Set attr on close failed %d\n", os2cli_errno(cli)); 527 527 //rc = os2cli_errno(cli); 528 528 } … … 579 579 } 580 580 581 DEBUG(4,("cli_setnewfileszie(%s) %lld\n", file->fname, newsize));581 debuglocal(4,"cli_setnewfileszie(%s) %lld\n", file->fname, newsize); 582 582 if (!cli_setfilenewsize(cli, file->fd, newsize)) 583 583 { … … 595 595 file->openmode &= ~(O_CREAT | O_EXCL); 596 596 file->openmode |= O_TRUNC; 597 DEBUG(4,("cli_setnewfileszie : cli_open(%s) attr %08x mode %02x denymode %02x\n", file->fname, file->openattr, file->openmode, file->denymode));597 debuglocal(4,"cli_setnewfileszie : cli_open(%s) attr %08x mode %02x denymode %02x\n", file->fname, file->openattr, file->openmode, file->denymode); 598 598 file->fd = cli_open(cli, file->fname, file->openmode, file->denymode); 599 599 if (file->fd == -1) … … 615 615 } 616 616 617 DEBUG(1,("Rename <%s> -> <%s>\n", oldname, newname));617 debuglocal(1,"Rename <%s> -> <%s>\n", oldname, newname); 618 618 //cli_unlink(cli, newname); 619 619 // if (!cli_rename(cli, oldname, newname) && !cli_ntrename(cli, oldname, newname)) … … 636 636 } 637 637 638 DEBUG(4,("Setting on <%s> attr %04x, time %lu/%lu\n", finfo->fname, finfo->attr, finfo->mtime, finfo->mtime + get_time_zone(finfo->mtime)));638 debuglocal(4,"Setting on <%s> attr %04x, time %lu/%lu\n", finfo->fname, finfo->attr, finfo->mtime, finfo->mtime + get_time_zone(finfo->mtime)); 639 639 if (!cli_setatr(cli, finfo->fname, finfo->attr, finfo->mtime + (finfo->mtime == 0 ? 0 : get_time_zone(finfo->mtime))) 640 640 && !cli_setatr(cli, finfo->fname, finfo->attr, 0)) … … 686 686 } 687 687 688 DEBUG(4,("lseek %d %lld %lld\n", whence, offset, file->offset));688 debuglocal(4,"lseek %d %lld %lld\n", whence, offset, file->offset); 689 689 690 690 switch (whence) { … … 731 731 return EINVAL; 732 732 } 733 DEBUG(4,("getattr %d %d <%s>\n", cli->capabilities & CAP_NOPATHINFO2, cli->capabilities & CAP_NT_SMBS, finfo->fname));733 debuglocal(4,"getattr %d %d <%s>\n", cli->capabilities & CAP_NOPATHINFO2, cli->capabilities & CAP_NT_SMBS, finfo->fname); 734 734 if (!(cli->capabilities & CAP_NOPATHINFO2) && 735 735 cli_qpathinfo3(cli, finfo->fname, (time_t *)&finfo->ctime, (time_t *)&finfo->atime, (time_t *)&finfo->mtime, NULL, … … 737 737 { 738 738 finfo->attr &= 0x7F; 739 // DEBUG(2,("gotattr %08x <%s>\n", finfo->attr, finfo->fname));739 //debuglocal(2,("gotattr %08x <%s>\n", finfo->attr, finfo->fname)); 740 740 // finfo->ctime -= get_time_zone(finfo->ctime); 741 741 // finfo->atime -= get_time_zone(finfo->atime); … … 743 743 return 0; 744 744 } 745 // DEBUG(2,("getattr rc1 %d\n", os2cli_errno(cli)));745 //debuglocal(2,("getattr rc1 %d\n", os2cli_errno(cli))); 746 746 747 747 /* if this is NT then don't bother with the getatr */ … … 761 761 if (cli_getatr(cli, finfo->fname, (unsigned short *)&finfo->attr, (size_t *)&finfo->size, (time_t *)&finfo->mtime)) 762 762 { 763 // DEBUG(2,("gotattr1 %08x <%s>\n", finfo->attr, finfo->fname));763 //debuglocal(2,("gotattr1 %08x <%s>\n", finfo->attr, finfo->fname)); 764 764 finfo->mtime -= get_time_zone(finfo->mtime); 765 765 finfo->atime = finfo->mtime; … … 822 822 if (st->add_dir_entry) 823 823 { 824 DEBUG(8,("adding <%s> %d %d\n", finfo->fname, sizeof(st->finfo), st->datalen));824 debuglocal(8,"adding <%s> %d %d\n", finfo->fname, sizeof(st->finfo), st->datalen); 825 825 memcpy(&st->finfo, finfo, sizeof(st->finfo)); 826 826 st->add_dir_entry(state); … … 1029 1029 } 1030 1030 1031 DEBUG(1,("Unknown long filename format %d\n",level));1031 debuglocal(1,"Unknown long filename format %d\n",level); 1032 1032 return (size_t)IVAL(base,0); 1033 1033 } … … 1072 1072 info_level = (cli->capabilities&CAP_NT_SMBS)?260:2; 1073 1073 1074 DEBUG(4,("list_files level %d. mask <%s>\n", info_level, mask));1074 debuglocal(4,"list_files level %d. mask <%s>\n", info_level, mask); 1075 1075 1076 1076 /* when getting a directory listing from a 2k dfs root share, … … 1085 1085 loop_count++; 1086 1086 if (loop_count > 200) { 1087 DEBUG(0,("Error: Looping in FIND_NEXT??\n"));1087 debuglocal(0,"Error: Looping in FIND_NEXT??\n"); 1088 1088 break; 1089 1089 } … … 1167 1167 // we have tried query ea size, but now will try without ea size 1168 1168 info_level = 1; 1169 DEBUG(4,("list_files fallback to level %d\n", info_level));1169 debuglocal(4,"list_files fallback to level %d\n", info_level); 1170 1170 continue; 1171 1171 } … … 1190 1190 //ff_lastname = SVAL(p,6); 1191 1191 } 1192 DEBUG(4,("list_files %d %d %d %d\n", ff_searchcount, ff_eos, "(ff_lastname)", First));1192 debuglocal(4,"list_files %d %d %d %d\n", ff_searchcount, ff_eos, "(ff_lastname)", First); 1193 1193 1194 1194 if (ff_searchcount == 0) { … … 1213 1213 1214 1214 if (!First && *mask && strcsequal(finfo.fname, mask)) { 1215 DEBUG(0,("Error: Looping in FIND_NEXT as name %s has already been seen?\n",1216 finfo.fname) );1215 debuglocal(0,"Error: Looping in FIND_NEXT as name %s has already been seen?\n", 1216 finfo.fname); 1217 1217 ff_eos = 1; 1218 1218 break; … … 1231 1231 1232 1232 if (!dirlist) { 1233 DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));1233 debuglocal(0,"cli_list_new: Failed to expand dirlist\n"); 1234 1234 SAFE_FREE(rdata); 1235 1235 SAFE_FREE(rparam); … … 1245 1245 SAFE_FREE(rparam); 1246 1246 1247 DEBUG(3,("received %d entries (eos=%d)\n",1248 ff_searchcount,ff_eos) );1247 debuglocal(3,"received %d entries (eos=%d)\n", 1248 ff_searchcount,ff_eos); 1249 1249 1250 1250 if (ff_searchcount > 0) … … 1284 1284 return EINVAL; 1285 1285 } 1286 DEBUG(1,("Filelist <%s> on master <%s> wgrp <%s> server <%s> share <%s> clidev <%s>\n", state->mask, srv->master, srv->workgroup, srv->server_name, srv->share_name, cli->dev));1286 debuglocal(1,"Filelist <%s> on master <%s> wgrp <%s> server <%s> share <%s> clidev <%s>\n", state->mask, srv->master, srv->workgroup, srv->server_name, srv->share_name, cli->dev); 1287 1287 if (*srv->workgroup == 0 && *srv->server_name == 0) 1288 1288 { … … 1468 1468 if (!cli_get_ea_list_fnum(cli, file->fd, mem_ctx, &num_eas, &ea_list)) 1469 1469 { 1470 DEBUG(4,("ea_get_fnum list failed - %s\n", cli_errstr(cli)));1470 debuglocal(4,"ea_get_fnum list failed - %s\n", cli_errstr(cli)); 1471 1471 talloc_destroy(mem_ctx); 1472 1472 return os2cli_errno(cli); … … 1477 1477 if (!cli_get_ea_list_path(cli, fname, mem_ctx, &num_eas, &ea_list)) 1478 1478 { 1479 DEBUG(4,("ea_get_file list failed - %s\n", cli_errstr(cli)));1479 debuglocal(4,"ea_get_file list failed - %s\n", cli_errstr(cli)); 1480 1480 talloc_destroy(mem_ctx); 1481 1481 return os2cli_errno(cli); … … 1483 1483 } 1484 1484 1485 DEBUG(4,("num_eas = %d\n", num_eas));1485 debuglocal(4,"num_eas = %d\n", num_eas); 1486 1486 1487 1487 // we will count that os/2 max EA size for file is 64kb … … 1490 1490 { 1491 1491 int namelen = strlen(ea_list[i].name); 1492 DEBUG(4, ("%d Got EA <%s> with namelen %d, size %d. Gross %d. Buf %d\n", i, ea_list[i].name, namelen, ea_list[i].value.length, gotsize, size));1492 debuglocal(4, "%d Got EA <%s> with namelen %d, size %d. Gross %d. Buf %d\n", i, ea_list[i].name, namelen, ea_list[i].value.length, gotsize, size); 1493 1493 if (namelen > 0xFF || ea_list[i].value.length > 0xFFFF) 1494 1494 { 1495 DEBUG(4, ("Skip EA <%s> with namelen %d, size %d\n", ea_list[i].name, namelen, ea_list[i].value.length));1495 debuglocal(4, "Skip EA <%s> with namelen %d, size %d\n", ea_list[i].name, namelen, ea_list[i].value.length); 1496 1496 continue; 1497 1497 } … … 1510 1510 } 1511 1511 pfealist->cbList = gotsize; 1512 DEBUG(4,("ret size = %d\n", gotsize));1512 debuglocal(4,"ret size = %d\n", gotsize); 1513 1513 1514 1514 talloc_destroy(mem_ctx); … … 1526 1526 } 1527 1527 1528 DEBUG(4,("EALIst for <%s>\n", fname));1528 debuglocal(4,"EALIst for <%s>\n", fname); 1529 1529 return unilistea(cli, fname, NULL, buffer, size); 1530 1530 } … … 1540 1540 } 1541 1541 1542 DEBUG(4,("FEALIst for <%s>/%d\n", file->fname, file->fd));1542 debuglocal(4,"FEALIst for <%s>/%d\n", file->fname, file->fd); 1543 1543 return unilistea(cli, NULL, file, buffer, size); 1544 1544 } … … 1558 1558 if (!cli_dskattr(cli, &bsize, &total, &avail)) 1559 1559 { 1560 DEBUG(4,("Error in dskattr: %s\n",cli_errstr(cli)));1560 debuglocal(4,"Error in dskattr: %s\n",cli_errstr(cli)); 1561 1561 return os2cli_errno(cli); 1562 1562 } 1563 1563 1564 DEBUG(4,("\n\t\t%d blocks of size %d. %d blocks available\n",1565 total, bsize, avail) );1564 debuglocal(4,"\n\t\t%d blocks of size %d. %d blocks available\n", 1565 total, bsize, avail); 1566 1566 1567 1567 // YD currently Samba return it in MB!
Note:
See TracChangeset
for help on using the changeset viewer.