Ignore:
Timestamp:
Jul 2, 2010, 2:38:45 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Client 1.6: working dll

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/client-1.6/src/smbwrp.c

    r448 r472  
    10851085****************************************************************************/
    10861086// YD from libsmb\clilist.c
    1087 // @todo
    1088 // in the longrun we should switch to file_info struct instead of our own smbwrp_fileinfo
    1089 
     1087// @todo who frees fname, as clistr_pull_talloc allocs it
    10901088static size_t _os2_interpret_long_filename(TALLOC_CTX *ctx, struct cli_state *cli,
    10911089                                   int level,const char *p, const char *pdata_end, smbwrp_fileinfo *finfo,
     
    10951093        const char *base = p;
    10961094        size_t ret;
     1095        char *fname;
    10971096       
    10981097        data_blob_free(p_last_name_raw);
     
    11021101        }
    11031102
    1104 //      ZERO_STRUCTP(finfo);
     1103        ZERO_STRUCTP(finfo);
    11051104        debuglocal(9,"fname %s (serverzone %d, level %d)\n",finfo->fname, cli->serverzone, level);
    11061105       
     
    11391138                           between win2000 and win9x for this call
    11401139                           (tridge) */
    1141                         ret = clistr_pull_talloc(ctx, cli, &finfo->fname, p,
     1140                        ret = clistr_pull_talloc(ctx, cli, &fname, p,
    11421141                                         len+2,
    11431142                                         STR_TERMINATE);
     
    11471146                        p += ret;
    11481147                        finfo->easize = -1;
     1148                        strncpy(finfo->fname, fname, sizeof(finfo->fname) -1);
    11491149                        return PTR_DIFF(p, base);
    11501150
     
    11671167                                return pdata_end - base;
    11681168                        }
    1169                         ret = clistr_pull_talloc(ctx, cli, &finfo->fname, p,
     1169                        ret = clistr_pull_talloc(ctx, cli, &fname, p,
    11701170                                         len,
    11711171                                         STR_NOALIGN);
     
    11741174                        }
    11751175                        p += ret;
     1176                        strncpy(finfo->fname, fname, sizeof(finfo->fname) -1);
    11761177                        return PTR_DIFF(p, base) + 1;
    11771178                       
     
    12291230                                return pdata_end - base;
    12301231                        }         
    1231                         ret = clistr_pull_talloc(ctx, cli, &finfo->fname, p,
     1232                        ret = clistr_pull_talloc(ctx, cli, &fname, p,
    12321233                                    namelen, 0);
    12331234                        if (ret == (size_t)-1) {
    12341235                                return pdata_end - base;
    12351236                        }
    1236 
     1237                        strncpy(finfo->fname, fname, sizeof(finfo->fname) -1);
    12371238                        /* To be robust in the face of unicode conversion failures
    12381239                           we need to copy the raw bytes of the last name seen here.
Note: See TracChangeset for help on using the changeset viewer.