Ignore:
Timestamp:
Apr 7, 2008, 9:33:39 AM (17 years ago)
Author:
Yuri Dario
Message:

Fixes timezone handling for os2->xp->os2, os2->samba->os2. Partially fixes ticket:56.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/ndpsmb/smbwrp.c

    r124 r126  
    22
    33#include "smbwrp.h"
     4
     5#ifndef DEBUG_PRINTF
     6#define debug_printf( ...)
     7#endif
    48
    59static int
     
    273277
    274278        if (c_time) {
    275                 *c_time = convert_timespec_to_time_t(interpret_long_date(rdata+0)) - cli->serverzone;
     279                *c_time = convert_timespec_to_time_t(interpret_long_date(rdata+0));
    276280        }
    277281        if (a_time) {
    278                 *a_time = convert_timespec_to_time_t(interpret_long_date(rdata+8)) - cli->serverzone;
     282                *a_time = convert_timespec_to_time_t(interpret_long_date(rdata+8));
    279283        }
    280284        if (m_time) {
    281                 *m_time = convert_timespec_to_time_t(interpret_long_date(rdata+16)) - cli->serverzone;
     285                *m_time = convert_timespec_to_time_t(interpret_long_date(rdata+16));
    282286        }
    283287        if (w_time) {
    284                 *w_time = convert_timespec_to_time_t(interpret_long_date(rdata+24)) - cli->serverzone;
     288                *w_time = convert_timespec_to_time_t(interpret_long_date(rdata+24));
    285289        }
    286290        if (mode) {
     
    344348
    345349        if (c_time) {
    346                 *c_time = convert_timespec_to_time_t(interpret_long_date(rdata+0)) - cli->serverzone;
     350                *c_time = convert_timespec_to_time_t(interpret_long_date(rdata+0));
    347351        }
    348352        if (a_time) {
    349                 *a_time = convert_timespec_to_time_t(interpret_long_date(rdata+8)) - cli->serverzone;
     353                *a_time = convert_timespec_to_time_t(interpret_long_date(rdata+8));
    350354        }
    351355        if (m_time) {
    352                 *m_time = convert_timespec_to_time_t(interpret_long_date(rdata+16)) - cli->serverzone;
     356                *m_time = convert_timespec_to_time_t(interpret_long_date(rdata+16));
    353357        }
    354358        if (w_time) {
    355                 *w_time = convert_timespec_to_time_t(interpret_long_date(rdata+24)) - cli->serverzone;
     359                *w_time = convert_timespec_to_time_t(interpret_long_date(rdata+24));
    356360        }
    357361        if (mode) {
     
    609613        if (file->openattr || file->mtime)
    610614        {
    611                 debuglocal(4,"Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime + get_time_zone(file->mtime));
    612                 if (!cli_setatr(cli, file->fname, file->openattr, file->mtime + get_time_zone(file->mtime)))
     615                debuglocal(4,"Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime);
     616                if (!cli_setatr(cli, file->fname, file->openattr, file->mtime))
    613617                {
    614618                        debuglocal(4,"Set attr on close failed %d\n", os2cli_errno(cli));
     
    819823                return EINVAL;
    820824        }
     825        debug_printf( "smbwrp_getattr\n");
    821826        debuglocal(4,"getattr %d %d <%s>\n", cli->capabilities & CAP_NOPATHINFO2, cli->capabilities & CAP_NT_SMBS, finfo->fname);
    822827        if (!(cli->capabilities & CAP_NOPATHINFO2) &&
     
    868873        }
    869874
    870         if (cli_getatr(cli, finfo->fname, (unsigned short *)&finfo->attr, (size_t *)&finfo->size, (time_t *)&finfo->mtime))
     875        if (cli_getatr(cli, finfo->fname, (unsigned short *)&finfo->attr, &finfo->size, (time_t *)&finfo->mtime))
    871876        {
    872877//debuglocal(2,("gotattr1 %08x <%s>\n", finfo->attr, finfo->fname));
     
    10361041        finfo->ctime = def_finfo.ctime_ts.tv_sec;
    10371042        strncpy(finfo->fname, def_finfo.name, sizeof(finfo->fname) - 1);
    1038 
     1043        debug_printf( "fname %s (serverzone %d, level %d)\n",finfo->fname, cli->serverzone, level);
     1044       
    10391045        switch (level) {
    10401046                case 1: /* OS/2 understands this */
     
    10901096                        /* Offset zero is "create time", not "change time". */
    10911097                        p += 8;
    1092                         finfo->atime = interpret_long_date(p).tv_sec - cli->serverzone;
     1098                        finfo->atime = interpret_long_date(p).tv_sec;
    10931099                        p += 8;
    1094                         finfo->mtime = interpret_long_date(p).tv_sec - cli->serverzone;
     1100                        finfo->mtime = interpret_long_date(p).tv_sec;
    10951101                        p += 8;
    1096                         finfo->ctime = interpret_long_date(p).tv_sec - cli->serverzone;
     1102                        finfo->ctime = interpret_long_date(p).tv_sec;
    10971103                        p += 8;
    10981104                        finfo->size = IVAL2_TO_SMB_BIG_UINT(p,0);
     
    14041410        }
    14051411        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);
     1412        debug_printf( "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);
    14061413        if (*srv->workgroup == 0 && *srv->server_name == 0)
    14071414        {
Note: See TracChangeset for help on using the changeset viewer.