Changeset 24


Ignore:
Timestamp:
Mar 26, 2007, 2:46:41 PM (14 years ago)
Author:
Yuri Dario
Message:

More debugging informations on request.

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
    13#define NDPL_LARGEFILES
    24#define INCL_LONGLONG
  • trunk/samba/source/ndpsmb/smbwrp.c

    r8 r24  
    307307        zero_ip(&ip);
    308308
    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);
    310310
    311311        if (!*server) {
     
    363363        }
    364364
    365         DEBUG(4,(" session request ok\n"));
     365        debuglocal(4," session request ok\n");
    366366
    367367        if (!cli_negprot(c)) {
     
    370370        }
    371371
    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);
    373373
    374374        if (!NT_STATUS_IS_OK(cli_session_setup(c, srv->username,
     
    376376                               srv->password, strlen(srv->password),
    377377                               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);
    379379                /* try an anonymous login if it failed */
    380380                if (!NT_STATUS_IS_OK(cli_session_setup(c, "", "", 1,"", 0, workgroup))) {
    381                         DEBUG(4,("Anonymous login failed"));
     381                        debuglocal(4,"Anonymous login failed");
    382382                        cli_shutdown(c);
    383383                        return 6;
     
    385385        }
    386386
    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));
    388388
    389389        if (!cli_send_tconX(c, share, "?????",
     
    393393        }
    394394
    395         DEBUG(4,(" tconx ok. cli caps %08x\n", c->capabilities));
     395        debuglocal(4," tconx ok. cli caps %08x\n", c->capabilities);
    396396
    397397        // copy back cli_state
     
    432432        }
    433433
    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);
    435435        file->fd = cli_open(cli, file->fname, file->openmode, file->denymode);
    436436        if (file->fd == -1)
     
    443443                file->mtime = time(NULL);
    444444                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);
    446446                file->mtime -= t;
    447447        }
     
    489489       
    490490        *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));
    492492        ret = cli_write(cli, file->fd, 0, buf, file->offset, count);
    493493        if (ret == -1)
     
    521521        if (file->openattr || file->mtime)
    522522        {
    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));
    524524                if (!cli_setatr(cli, file->fname, file->openattr, file->mtime + get_time_zone(file->mtime)))
    525525                {
    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));
    527527                        //rc = os2cli_errno(cli);
    528528                }       
     
    579579        }
    580580
    581         DEBUG(4,("cli_setnewfileszie(%s) %lld\n", file->fname, newsize));
     581        debuglocal(4,"cli_setnewfileszie(%s) %lld\n", file->fname, newsize);
    582582        if (!cli_setfilenewsize(cli, file->fd, newsize))
    583583        {
     
    595595                file->openmode &= ~(O_CREAT | O_EXCL);
    596596                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);
    598598                file->fd = cli_open(cli, file->fname, file->openmode, file->denymode);
    599599                if (file->fd == -1)
     
    615615        }
    616616
    617         DEBUG(1,("Rename <%s> -> <%s>\n", oldname, newname));
     617        debuglocal(1,"Rename <%s> -> <%s>\n", oldname, newname);
    618618        //cli_unlink(cli, newname);
    619619//      if (!cli_rename(cli, oldname, newname) && !cli_ntrename(cli, oldname, newname))
     
    636636        }
    637637
    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)));
     638debuglocal(4,"Setting on <%s> attr %04x, time %lu/%lu\n", finfo->fname, finfo->attr, finfo->mtime, finfo->mtime + get_time_zone(finfo->mtime));
    639639        if (!cli_setatr(cli, finfo->fname, finfo->attr, finfo->mtime + (finfo->mtime == 0 ? 0 : get_time_zone(finfo->mtime)))
    640640                && !cli_setatr(cli, finfo->fname, finfo->attr, 0))
     
    686686        }
    687687
    688         DEBUG(4,("lseek %d %lld %lld\n", whence, offset, file->offset));
     688        debuglocal(4,"lseek %d %lld %lld\n", whence, offset, file->offset);
    689689
    690690        switch (whence) {
     
    731731                return EINVAL;
    732732        }
    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);
    734734        if (!(cli->capabilities & CAP_NOPATHINFO2) &&
    735735                cli_qpathinfo3(cli, finfo->fname, (time_t *)&finfo->ctime, (time_t *)&finfo->atime, (time_t *)&finfo->mtime, NULL,
     
    737737        {
    738738                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));
    740740//              finfo->ctime -= get_time_zone(finfo->ctime);
    741741//              finfo->atime -= get_time_zone(finfo->atime);
     
    743743                return 0;
    744744        }
    745 //DEBUG(2,("getattr rc1 %d\n", os2cli_errno(cli)));
     745//debuglocal(2,("getattr rc1 %d\n", os2cli_errno(cli)));
    746746
    747747        /* if this is NT then don't bother with the getatr */
     
    761761        if (cli_getatr(cli, finfo->fname, (unsigned short *)&finfo->attr, (size_t *)&finfo->size, (time_t *)&finfo->mtime))
    762762        {
    763 //DEBUG(2,("gotattr1 %08x <%s>\n", finfo->attr, finfo->fname));
     763//debuglocal(2,("gotattr1 %08x <%s>\n", finfo->attr, finfo->fname));
    764764                finfo->mtime -= get_time_zone(finfo->mtime);
    765765                finfo->atime = finfo->mtime;
     
    822822                if (st->add_dir_entry)
    823823                {
    824 DEBUG(8,("adding <%s> %d %d\n", finfo->fname, sizeof(st->finfo), st->datalen));
     824debuglocal(8,"adding <%s> %d %d\n", finfo->fname, sizeof(st->finfo), st->datalen);
    825825                        memcpy(&st->finfo, finfo, sizeof(st->finfo));
    826826                        st->add_dir_entry(state);
     
    10291029        }
    10301030       
    1031         DEBUG(1,("Unknown long filename format %d\n",level));
     1031        debuglocal(1,"Unknown long filename format %d\n",level);
    10321032        return (size_t)IVAL(base,0);
    10331033}
     
    10721072        info_level = (cli->capabilities&CAP_NT_SMBS)?260:2;
    10731073
    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);
    10751075
    10761076        /* when getting a directory listing from a 2k dfs root share,
     
    10851085                loop_count++;
    10861086                if (loop_count > 200) {
    1087                         DEBUG(0,("Error: Looping in FIND_NEXT??\n"));
     1087                        debuglocal(0,"Error: Looping in FIND_NEXT??\n");
    10881088                        break;
    10891089                }
     
    11671167                                // we have tried query ea size, but now will try without ea size
    11681168                                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);
    11701170                                continue;
    11711171                        }
     
    11901190                        //ff_lastname = SVAL(p,6);
    11911191                }
    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);
    11931193
    11941194                if (ff_searchcount == 0) {
     
    12131213
    12141214                        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);
    12171217                                ff_eos = 1;
    12181218                                break;
     
    12311231
    12321232                if (!dirlist) {
    1233                         DEBUG(0,("cli_list_new: Failed to expand dirlist\n"));
     1233                        debuglocal(0,"cli_list_new: Failed to expand dirlist\n");
    12341234                        SAFE_FREE(rdata);
    12351235                        SAFE_FREE(rparam);
     
    12451245                SAFE_FREE(rparam);
    12461246
    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);
    12491249
    12501250                if (ff_searchcount > 0)
     
    12841284                return EINVAL;
    12851285        }
    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);
    12871287        if (*srv->workgroup == 0 && *srv->server_name == 0)
    12881288        {
     
    14681468                if (!cli_get_ea_list_fnum(cli, file->fd, mem_ctx, &num_eas, &ea_list))
    14691469                {
    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));
    14711471                        talloc_destroy(mem_ctx);
    14721472                        return os2cli_errno(cli);
     
    14771477                if (!cli_get_ea_list_path(cli, fname, mem_ctx, &num_eas, &ea_list))
    14781478                {
    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));
    14801480                        talloc_destroy(mem_ctx);
    14811481                        return os2cli_errno(cli);
     
    14831483        }
    14841484
    1485         DEBUG(4,("num_eas = %d\n", num_eas));
     1485        debuglocal(4,"num_eas = %d\n", num_eas);
    14861486
    14871487        // we will count that os/2 max EA size for file is 64kb
     
    14901490        {
    14911491                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);
    14931493                if (namelen > 0xFF || ea_list[i].value.length > 0xFFFF)
    14941494                {
    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);
    14961496                        continue;
    14971497                }
     
    15101510        }
    15111511        pfealist->cbList = gotsize;
    1512         DEBUG(4,("ret size = %d\n", gotsize));
     1512        debuglocal(4,"ret size = %d\n", gotsize);
    15131513
    15141514        talloc_destroy(mem_ctx);
     
    15261526        }
    15271527
    1528         DEBUG(4,("EALIst for <%s>\n", fname));
     1528        debuglocal(4,"EALIst for <%s>\n", fname);
    15291529        return unilistea(cli, fname, NULL, buffer, size);
    15301530}
     
    15401540        }
    15411541
    1542         DEBUG(4,("FEALIst for <%s>/%d\n", file->fname, file->fd));
     1542        debuglocal(4,"FEALIst for <%s>/%d\n", file->fname, file->fd);
    15431543        return unilistea(cli, NULL, file, buffer, size);
    15441544}
     
    15581558        if (!cli_dskattr(cli, &bsize, &total, &avail))
    15591559        {
    1560                 DEBUG(4,("Error in dskattr: %s\n",cli_errstr(cli)));
     1560                debuglocal(4,"Error in dskattr: %s\n",cli_errstr(cli));
    15611561                return os2cli_errno(cli);
    15621562        }
    15631563
    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);
    15661566
    15671567        // YD currently Samba return it in MB!
Note: See TracChangeset for help on using the changeset viewer.