Changeset 472 for branches/client-1.6/src/smbwrp.c
- Timestamp:
- Jul 2, 2010, 2:38:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/client-1.6/src/smbwrp.c
r448 r472 1085 1085 ****************************************************************************/ 1086 1086 // 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 1090 1088 static size_t _os2_interpret_long_filename(TALLOC_CTX *ctx, struct cli_state *cli, 1091 1089 int level,const char *p, const char *pdata_end, smbwrp_fileinfo *finfo, … … 1095 1093 const char *base = p; 1096 1094 size_t ret; 1095 char *fname; 1097 1096 1098 1097 data_blob_free(p_last_name_raw); … … 1102 1101 } 1103 1102 1104 //ZERO_STRUCTP(finfo);1103 ZERO_STRUCTP(finfo); 1105 1104 debuglocal(9,"fname %s (serverzone %d, level %d)\n",finfo->fname, cli->serverzone, level); 1106 1105 … … 1139 1138 between win2000 and win9x for this call 1140 1139 (tridge) */ 1141 ret = clistr_pull_talloc(ctx, cli, &f info->fname, p,1140 ret = clistr_pull_talloc(ctx, cli, &fname, p, 1142 1141 len+2, 1143 1142 STR_TERMINATE); … … 1147 1146 p += ret; 1148 1147 finfo->easize = -1; 1148 strncpy(finfo->fname, fname, sizeof(finfo->fname) -1); 1149 1149 return PTR_DIFF(p, base); 1150 1150 … … 1167 1167 return pdata_end - base; 1168 1168 } 1169 ret = clistr_pull_talloc(ctx, cli, &f info->fname, p,1169 ret = clistr_pull_talloc(ctx, cli, &fname, p, 1170 1170 len, 1171 1171 STR_NOALIGN); … … 1174 1174 } 1175 1175 p += ret; 1176 strncpy(finfo->fname, fname, sizeof(finfo->fname) -1); 1176 1177 return PTR_DIFF(p, base) + 1; 1177 1178 … … 1229 1230 return pdata_end - base; 1230 1231 } 1231 ret = clistr_pull_talloc(ctx, cli, &f info->fname, p,1232 ret = clistr_pull_talloc(ctx, cli, &fname, p, 1232 1233 namelen, 0); 1233 1234 if (ret == (size_t)-1) { 1234 1235 return pdata_end - base; 1235 1236 } 1236 1237 strncpy(finfo->fname, fname, sizeof(finfo->fname) -1); 1237 1238 /* To be robust in the face of unicode conversion failures 1238 1239 we need to copy the raw bytes of the last name seen here.
Note:
See TracChangeset
for help on using the changeset viewer.