Changeset 6 for trunk/samba-3.0.25pre1/source/ndpsmb/smbwrp.c
- Timestamp:
- Mar 25, 2007, 12:49:08 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba-3.0.25pre1/source/ndpsmb/smbwrp.c
r5 r6 35 35 initialised = 1; 36 36 37 init_globals(); 37 load_case_tables(); 38 39 init_globals( True); 38 40 39 41 load_interfaces(); … … 191 193 192 194 if (c_time) { 193 *c_time = interpret_long_date(rdata+0) - cli->serverzone;195 *c_time = convert_timespec_to_time_t(interpret_long_date(rdata+0)) - cli->serverzone; 194 196 } 195 197 if (a_time) { 196 *a_time = interpret_long_date(rdata+8) - cli->serverzone;198 *a_time = convert_timespec_to_time_t(interpret_long_date(rdata+8)) - cli->serverzone; 197 199 } 198 200 if (m_time) { 199 *m_time = interpret_long_date(rdata+16) - cli->serverzone;201 *m_time = convert_timespec_to_time_t(interpret_long_date(rdata+16)) - cli->serverzone; 200 202 } 201 203 if (w_time) { 202 *w_time = interpret_long_date(rdata+24) - cli->serverzone;204 *w_time = convert_timespec_to_time_t(interpret_long_date(rdata+24)) - cli->serverzone; 203 205 } 204 206 if (mode) { … … 262 264 263 265 if (c_time) { 264 *c_time = interpret_long_date(rdata+0) - cli->serverzone;266 *c_time = convert_timespec_to_time_t(interpret_long_date(rdata+0)) - cli->serverzone; 265 267 } 266 268 if (a_time) { 267 *a_time = interpret_long_date(rdata+8) - cli->serverzone;269 *a_time = convert_timespec_to_time_t(interpret_long_date(rdata+8)) - cli->serverzone; 268 270 } 269 271 if (m_time) { 270 *m_time = interpret_long_date(rdata+16) - cli->serverzone;272 *m_time = convert_timespec_to_time_t(interpret_long_date(rdata+16)) - cli->serverzone; 271 273 } 272 274 if (w_time) { 273 *w_time = interpret_long_date(rdata+24) - cli->serverzone;275 *w_time = convert_timespec_to_time_t(interpret_long_date(rdata+24)) - cli->serverzone; 274 276 } 275 277 if (mode) { … … 291 293 return a connection to a server 292 294 *******************************************************/ 293 int _System smbwrp_connect(smbwrp_server * srv, cli_state * c)295 int _System smbwrp_connect(smbwrp_server * srv, struct cli_state * cli) 294 296 { 295 297 char * server = srv->server_name; … … 300 302 fstring group; 301 303 struct in_addr ip; 302 intrc;303 304 zero_ip(&ip); 305 ZERO_STRUCTP(c);304 NTSTATUS rc; 305 struct cli_state * c; 306 307 zero_ip(&ip); 306 308 307 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)); … … 343 345 344 346 /* have to open a new connection */ 345 if (! cli_initialise(c))347 if (!(c=cli_initialise())) 346 348 { 347 349 return 2; … … 370 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)); 371 373 372 rc =cli_session_setup(c, srv->username,374 if (!NT_STATUS_IS_OK(cli_session_setup(c, srv->username, 373 375 srv->password, strlen(srv->password), 374 376 srv->password, strlen(srv->password), 375 workgroup); 376 if (!rc) 377 { 377 workgroup))) { 378 378 DEBUG(4,("%s/%s login failed\n", srv->username, srv->password)); 379 379 /* try an anonymous login if it failed */ 380 rc = cli_session_setup(c, "", "", 1,"", 0, workgroup); 381 if (!rc) 382 { 380 if (!NT_STATUS_IS_OK(cli_session_setup(c, "", "", 1,"", 0, workgroup))) { 383 381 DEBUG(4,("Anonymous login failed")); 384 382 cli_shutdown(c); … … 396 394 397 395 DEBUG(4,(" tconx ok. cli caps %08x\n", c->capabilities)); 396 397 // copy back cli_state 398 memcpy( cli, c, sizeof( struct cli_state)); 398 399 399 400 // srv->dev = (dev_t)(str_checksum(server) ^ str_checksum(share)); … … 441 442 time_t t; 442 443 file->mtime = time(NULL); 443 t = TimeDiff(file->mtime);444 t = get_time_zone(file->mtime); 444 445 DEBUG(4,("cli_open mtime %lu %lu\n", file->mtime, t)); 445 446 file->mtime -= t; … … 520 521 if (file->openattr || file->mtime) 521 522 { 522 DEBUG(4,("Set attr on close %s %08x %d %d\n", file->fname, file->openattr, file->mtime, file->mtime + TimeDiff(file->mtime)));523 if (!cli_setatr(cli, file->fname, file->openattr, file->mtime + TimeDiff(file->mtime)))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))); 524 if (!cli_setatr(cli, file->fname, file->openattr, file->mtime + get_time_zone(file->mtime))) 524 525 { 525 526 DEBUG(4,("Set attr on close failed %d\n", os2cli_errno(cli))); … … 635 636 } 636 637 637 DEBUG(4,("Setting on <%s> attr %04x, time %lu/%lu\n", finfo->fname, finfo->attr, finfo->mtime, finfo->mtime + TimeDiff(finfo->mtime)));638 if (!cli_setatr(cli, finfo->fname, finfo->attr, finfo->mtime + (finfo->mtime == 0 ? 0 : TimeDiff(finfo->mtime)))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))); 639 if (!cli_setatr(cli, finfo->fname, finfo->attr, finfo->mtime + (finfo->mtime == 0 ? 0 : get_time_zone(finfo->mtime))) 639 640 && !cli_setatr(cli, finfo->fname, finfo->attr, 0)) 640 641 { … … 737 738 finfo->attr &= 0x7F; 738 739 //DEBUG(2,("gotattr %08x <%s>\n", finfo->attr, finfo->fname)); 739 // finfo->ctime -= TimeDiff(finfo->ctime);740 // finfo->atime -= TimeDiff(finfo->atime);741 // finfo->mtime -= TimeDiff(finfo->mtime);740 // finfo->ctime -= get_time_zone(finfo->ctime); 741 // finfo->atime -= get_time_zone(finfo->atime); 742 // finfo->mtime -= get_time_zone(finfo->mtime); 742 743 return 0; 743 744 } … … 761 762 { 762 763 //DEBUG(2,("gotattr1 %08x <%s>\n", finfo->attr, finfo->fname)); 763 finfo->mtime -= TimeDiff(finfo->mtime);764 finfo->mtime -= get_time_zone(finfo->mtime); 764 765 finfo->atime = finfo->mtime; 765 766 finfo->ctime = finfo->mtime; … … 794 795 else 795 796 { 796 finfo->ctime -= TimeDiff(finfo->ctime);797 finfo->atime -= TimeDiff(finfo->atime);798 finfo->mtime -= TimeDiff(finfo->mtime);797 finfo->ctime -= get_time_zone(finfo->ctime); 798 finfo->atime -= get_time_zone(finfo->atime); 799 finfo->mtime -= get_time_zone(finfo->mtime); 799 800 } 800 801 } 801 802 else 802 803 { 803 // finfo->ctime -= TimeDiff(finfo->ctime);804 // finfo->atime -= TimeDiff(finfo->atime);805 // finfo->mtime -= TimeDiff(finfo->mtime);804 // finfo->ctime -= get_time_zone(finfo->ctime); 805 // finfo->atime -= get_time_zone(finfo->atime); 806 // finfo->mtime -= get_time_zone(finfo->mtime); 806 807 } 807 808 … … 814 815 add a entry to a directory listing 815 816 *******************************************************/ 816 static void smbwrp_dir_add( smbwrp_fileinfo *finfo, const char *mask, void *state)817 static void smbwrp_dir_add(const char* mnt, smbwrp_fileinfo *finfo, const char *mask, void *state) 817 818 { 818 819 if (state && finfo) … … 827 828 } 828 829 } 829 830 #if 0 830 831 static void smbwrp_dir_add_old(struct file_info *finfo, const char *mask, void *state) 831 832 { … … 839 840 st->finfo.easize = -1; 840 841 st->finfo.attr = finfo->mode; 841 st->finfo.ctime = finfo->ctime - TimeDiff(finfo->ctime);842 st->finfo.mtime = finfo->mtime - TimeDiff(finfo->mtime);843 st->finfo.atime = finfo->atime - TimeDiff(finfo->atime);842 st->finfo.ctime = finfo->ctime_ts.tv_sec - get_time_zone(finfo->ctime_ts.tv_sec); 843 st->finfo.mtime = finfo->mtime_ts.tv_sec - get_time_zone(finfo->mtime_ts.tv_sec); 844 st->finfo.atime = finfo->atime_ts.tv_sec - get_time_zone(finfo->atime_ts.tv_sec); 844 845 st->add_dir_entry(state); 845 846 } 846 847 } 847 848 } 848 849 static void smbwrp_special_add(char * name, void * state) 849 #endif 850 851 static void smbwrp_special_add(const char * name, void * state) 850 852 { 851 853 smbwrp_fileinfo finfo = {0}; … … 861 863 finfo.attr = aRONLY | aDIR; 862 864 863 smbwrp_dir_add( &finfo, NULL, state);865 smbwrp_dir_add("", &finfo, NULL, state); 864 866 } 865 867 … … 873 875 874 876 strncpy(finfo.fname, job->name, sizeof(finfo.fname) - 1); 875 finfo.mtime = job->t - TimeDiff(job->t);877 finfo.mtime = job->t - get_time_zone(job->t); 876 878 finfo.atime = finfo.mtime; 877 879 finfo.ctime = finfo.mtime; … … 879 881 finfo.size = job->size; 880 882 881 smbwrp_dir_add( &finfo, NULL, state);883 smbwrp_dir_add("", &finfo, NULL, state); 882 884 } 883 885 … … 894 896 finfo.attr = aRONLY | aDIR; 895 897 896 smbwrp_dir_add(&finfo, NULL, state); 897 } 898 898 smbwrp_dir_add("", &finfo, NULL, state); 899 } 899 900 900 901 /**************************************************************************** … … 904 905 by NT and 2 is used by OS/2 905 906 ****************************************************************************/ 906 907 static int interpret_long_filename(struct cli_state *cli, 908 int level,char *p,smbwrp_fileinfo *finfo) 907 // YD from libsmb\clilist.c 908 static size_t _os2_interpret_long_filename(struct cli_state *cli, 909 int level,char *p, smbwrp_fileinfo *finfo, 910 uint32 *p_resume_key, DATA_BLOB *p_last_name_raw, uint32 *p_last_name_raw_len) 909 911 { 910 912 extern file_info def_finfo; … … 917 919 // memcpy(finfo,&def_finfo,sizeof(*finfo)); 918 920 finfo->attr = def_finfo.mode; 919 finfo->mtime = def_finfo.mtime ;920 finfo->atime = def_finfo.atime ;921 finfo->ctime = def_finfo.ctime ;921 finfo->mtime = def_finfo.mtime_ts.tv_sec; 922 finfo->atime = def_finfo.atime_ts.tv_sec; 923 finfo->ctime = def_finfo.ctime_ts.tv_sec; 922 924 strncpy(finfo->fname, def_finfo.name, sizeof(finfo->fname) - 1); 923 925 … … 926 928 /* these dates are converted to GMT by 927 929 make_unix_date */ 928 finfo->ctime = make_unix_date2(p+4);929 finfo->atime = make_unix_date2(p+8);930 finfo->mtime = make_unix_date2(p+12);930 finfo->ctime = cli_make_unix_date2(cli, p+4); 931 finfo->atime = cli_make_unix_date2(cli, p+8); 932 finfo->mtime = cli_make_unix_date2(cli, p+12); 931 933 finfo->size = IVAL(p,16); 932 934 finfo->attr = CVAL(p,24); … … 948 950 /* these dates are converted to GMT by 949 951 make_unix_date */ 950 finfo->ctime = make_unix_date2(p+4);951 finfo->atime = make_unix_date2(p+8);952 finfo->mtime = make_unix_date2(p+12);952 finfo->ctime = cli_make_unix_date2(cli, p+4); 953 finfo->atime = cli_make_unix_date2(cli, p+8); 954 finfo->mtime = cli_make_unix_date2(cli, p+12); 953 955 finfo->size = IVAL(p,16); 954 956 finfo->attr = CVAL(p,24); … … 967 969 size_t namelen, slen; 968 970 p += 4; /* next entry offset */ 971 #if 0 972 if (p_resume_key) { 973 *p_resume_key = IVAL(p,0); 974 } 975 #endif 969 976 p += 4; /* fileindex */ 970 977 971 /* these dates appear to arrive in a 972 weird way. It seems to be localtime 973 plus the serverzone given in the 974 initial connect. This is GMT when 975 DST is not in effect and one hour 976 from GMT otherwise. Can this really 977 be right?? 978 979 I suppose this could be called 980 kludge-GMT. Is is the GMT you get 981 by using the current DST setting on 982 a different localtime. It will be 983 cheap to calculate, I suppose, as 984 no DST tables will be needed */ 985 986 finfo->ctime = interpret_long_date(p); 978 /* Offset zero is "create time", not "change time". */ 987 979 p += 8; 988 finfo->atime = interpret_long_date(p) ;980 finfo->atime = interpret_long_date(p).tv_sec; 989 981 p += 8; 990 finfo->mtime = interpret_long_date(p) ;982 finfo->mtime = interpret_long_date(p).tv_sec; 991 983 p += 8; 984 finfo->ctime = interpret_long_date(p).tv_sec; 992 985 p += 8; 993 986 finfo->size = IVAL2_TO_SMB_BIG_UINT(p,0); … … 998 991 namelen = IVAL(p,0); 999 992 p += 4; 1000 finfo->easize = IVAL(p,0);1001 993 p += 4; /* EA size */ 1002 994 slen = SVAL(p, 0); 1003 995 p += 2; 996 #if 0 997 { 998 /* stupid NT bugs. grr */ 999 int flags = 0; 1000 if (p[1] == 0 && namelen > 1) flags |= STR_UNICODE; 1001 clistr_pull(cli, finfo->short_name, p, 1002 sizeof(finfo->short_name), 1003 slen, flags); 1004 } 1005 #endif 1004 1006 p += 24; /* short name? */ 1005 1007 clistr_pull(cli, finfo->fname, p, 1006 1008 sizeof(finfo->fname), 1007 1009 namelen, 0); 1008 return SVAL(base, 0); 1010 1011 /* To be robust in the face of unicode conversion failures 1012 we need to copy the raw bytes of the last name seen here. 1013 Namelen doesn't include the terminating unicode null, so 1014 copy it here. */ 1015 #if 0 1016 if (p_last_name_raw && p_last_name_raw_len) { 1017 if (namelen + 2 > p_last_name_raw->length) { 1018 memset(p_last_name_raw->data, '\0', sizeof(p_last_name_raw->length)); 1019 *p_last_name_raw_len = 0; 1020 } else { 1021 memcpy(p_last_name_raw->data, p, namelen); 1022 SSVAL(p_last_name_raw->data, namelen, 0); 1023 *p_last_name_raw_len = namelen + 2; 1024 } 1025 } 1026 #endif 1027 return (size_t)IVAL(base, 0); 1009 1028 } 1010 1029 } 1011 1030 1012 1031 DEBUG(1,("Unknown long filename format %d\n",level)); 1013 return (SVAL(p,0));1032 return (size_t)IVAL(base,0); 1014 1033 } 1015 1034 … … 1020 1039 1021 1040 static int list_files(struct cli_state *cli, const char *Mask, uint16 attribute, 1022 void (*fn)(smbwrp_fileinfo *, const char *, void *), void *state) 1023 { 1041 void (*fn)(const char*, smbwrp_fileinfo *, const char *, void *), void *state) 1042 { 1043 #if 1 1044 int max_matches = 1366; /* Match W2k - was 512. */ 1045 #else 1024 1046 int max_matches = 512; 1047 #endif 1025 1048 int info_level; 1026 1049 char *p, *p2; … … 1034 1057 int ff_searchcount=0; 1035 1058 int ff_eos=0; 1036 int ff_lastname=0;1059 //int ff_lastname=0; 1037 1060 int ff_dir_handle=0; 1038 1061 int loop_count = 0; … … 1041 1064 uint16 setup; 1042 1065 pstring param; 1066 const char *mnt; 1067 uint32 resume_key = 0; 1068 uint32 last_name_raw_len = 0; 1069 DATA_BLOB last_name_raw = data_blob(NULL, 2*sizeof(pstring)); 1043 1070 1044 1071 /* NT uses 260, OS/2 uses 2. Both accept 1. */ … … 1047 1074 DEBUG(4,("list_files level %d. mask <%s>\n", info_level, mask)); 1048 1075 1049 pstrcpy(mask,Mask); 1050 1076 /* when getting a directory listing from a 2k dfs root share, 1077 we have to include the full path (\server\share\mask) here */ 1078 1079 if ( cli->dfsroot ) 1080 pstr_sprintf( mask, "\\%s\\%s\\%s", cli->desthost, cli->share, Mask ); 1081 else 1082 pstrcpy(mask,Mask); 1083 1051 1084 while (ff_eos == 0) { 1052 1085 loop_count++; … … 1060 1093 SSVAL(param,0,attribute); /* attribute */ 1061 1094 SSVAL(param,2,max_matches); /* max count */ 1062 SSVAL(param,4,4+2); /* resume required + close on end */ 1095 //SSVAL(param,4,4+2); /* resume required + close on end */ 1096 SSVAL(param,4,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */ 1063 1097 SSVAL(param,6,info_level); 1064 1098 SIVAL(param,8,0); … … 1070 1104 SSVAL(param,0,ff_dir_handle); 1071 1105 SSVAL(param,2,max_matches); /* max count */ 1106 //SIVAL(param,6,0); /* ff_resume_key */ 1072 1107 SSVAL(param,4,info_level); 1073 SIVAL(param,6,0); /* ff_resume_key */ 1074 SSVAL(param,10,8+4+2); /* continue + resume required + close on end */ 1108 /* For W2K servers serving out FAT filesystems we *must* set the 1109 resume key. If it's not FAT then it's returned as zero. */ 1110 SIVAL(param,6,resume_key); /* ff_resume_key */ 1111 /* NB. *DON'T* use continue here. If you do it seems that W2K and bretheren 1112 can miss filenames. Use last filename continue instead. JRA */ 1113 SSVAL(param,10,(FLAG_TRANS2_FIND_REQUIRE_RESUME|FLAG_TRANS2_FIND_CLOSE_IF_END)); /* resume required + close on end */ 1114 //SSVAL(param,10,8+4+2); /* continue + resume required + close on end */ 1075 1115 p = param+12; 1076 p += clistr_push(cli, param+12, mask, sizeof(param)-12, 1077 STR_TERMINATE); 1116 //p += clistr_push(cli, param+12, mask, sizeof(param)-12, 1117 // STR_TERMINATE); 1118 if (last_name_raw_len && (last_name_raw_len < (sizeof(param)-12))) { 1119 memcpy(p, last_name_raw.data, last_name_raw_len); 1120 p += last_name_raw_len; 1121 } else { 1122 p += clistr_push(cli, param+12, mask, sizeof(param)-12, STR_TERMINATE); 1123 } 1078 1124 } 1079 1125 … … 1103 1149 uint8 eclass; 1104 1150 uint32 ecode; 1151 1152 SAFE_FREE(rdata); 1153 SAFE_FREE(rparam); 1154 1105 1155 cli_dos_error(cli, &eclass, &ecode); 1106 1156 if (eclass != ERRSRV || ecode != ERRerror) … … 1120 1170 continue; 1121 1171 } 1172 SAFE_FREE(rdata); 1173 SAFE_FREE(rparam); 1122 1174 break; 1123 1175 } … … 1132 1184 ff_searchcount = SVAL(p,2); 1133 1185 ff_eos = SVAL(p,4); 1134 ff_lastname = SVAL(p,8);1186 //ff_lastname = SVAL(p,8); 1135 1187 } else { 1136 1188 ff_searchcount = SVAL(p,0); 1137 1189 ff_eos = SVAL(p,2); 1138 ff_lastname = SVAL(p,6); 1139 } 1140 DEBUG(4,("list_files %d %d %d %d\n", ff_searchcount, ff_eos, ff_lastname, First)); 1141 1142 if (ff_searchcount == 0) 1190 //ff_lastname = SVAL(p,6); 1191 } 1192 DEBUG(4,("list_files %d %d %d %d\n", ff_searchcount, ff_eos, "(ff_lastname)", First)); 1193 1194 if (ff_searchcount == 0) { 1195 SAFE_FREE(rdata); 1196 SAFE_FREE(rparam); 1143 1197 break; 1198 } 1144 1199 1145 1200 /* point to the data bytes */ … … 1149 1204 finfo.easize = -1; 1150 1205 /* we might need the lastname for continuations */ 1151 if (ff_lastname > 0) { 1152 switch(info_level) { 1153 case 260: 1154 clistr_pull(cli, mask, p+ff_lastname, 1155 sizeof(mask), 1156 data_len-ff_lastname, 1157 STR_TERMINATE); 1158 break; 1159 case 1: 1160 case 2: 1161 clistr_pull(cli, mask, p+ff_lastname+1, 1162 sizeof(mask), 1163 -1, 1164 STR_TERMINATE); 1165 break; 1166 } 1206 for (p2=p,i=0;i<ff_searchcount;i++) { 1207 if ((info_level == 260) && (i == ff_searchcount-1)) { 1208 /* Last entry - fixup the last offset length. */ 1209 SIVAL(p2,0,PTR_DIFF((rdata + data_len),p2)); 1210 } 1211 p2 += _os2_interpret_long_filename(cli,info_level,p2,&finfo, 1212 &resume_key,&last_name_raw,&last_name_raw_len); 1213 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)); 1217 ff_eos = 1; 1218 break; 1219 } 1220 } 1221 1222 if (ff_searchcount > 0) { 1223 pstrcpy(mask, finfo.fname); 1167 1224 } else { 1168 1225 pstrcpy(mask,""); 1169 1226 } 1170 1227 1228 /* grab the data for later use */ 1171 1229 /* and add them to the dirlist pool */ 1172 tdl = Realloc(dirlist,dirlist_len + data_len);1173 1174 if (! tdl) {1230 dirlist = (char *)SMB_REALLOC(dirlist,dirlist_len + data_len); 1231 1232 if (!dirlist) { 1175 1233 DEBUG(0,("cli_list_new: Failed to expand dirlist\n")); 1234 SAFE_FREE(rdata); 1235 SAFE_FREE(rparam); 1176 1236 break; 1177 } else { 1178 dirlist = tdl; 1179 } 1180 1181 /* put in a length for the last entry, to ensure we can chain entries 1182 into the next packet */ 1183 for (p2=p,i=0;i<(ff_searchcount-1);i++) 1184 p2 += interpret_long_filename(cli,info_level,p2,NULL); 1185 SSVAL(p2,0,data_len - PTR_DIFF(p2,p)); 1186 1187 /* grab the data for later use */ 1237 } 1238 1188 1239 memcpy(dirlist+dirlist_len,p,data_len); 1189 1240 dirlist_len += data_len; … … 1203 1254 } 1204 1255 1205 DEBUG(3,("total received %d entries\n", total_received)); 1206 for (p=dirlist,i=0;i<total_received;i++) { 1207 p += interpret_long_filename(cli,info_level,p,&finfo); 1208 fn(&finfo, Mask, state); 1209 } 1210 1211 /* free up the dirlist buffer */ 1256 mnt = cli_cm_get_mntpoint( cli ); 1257 1258 /* see if the server disconnected or the connection otherwise failed */ 1259 if (cli_is_error(cli)) { 1260 total_received = -1; 1261 } else { 1262 /* no connection problem. let user function add each entry */ 1263 for (p=dirlist,i=0;i<total_received;i++) { 1264 p += _os2_interpret_long_filename(cli, info_level, p, 1265 &finfo,NULL,NULL,NULL); 1266 fn( mnt,&finfo, Mask, state ); 1267 } 1268 } 1269 1270 /* free up the dirlist buffer and last name raw blob */ 1212 1271 SAFE_FREE(dirlist); 1272 data_blob_free(&last_name_raw); 1213 1273 return(total_received); 1214 1274 }
Note:
See TracChangeset
for help on using the changeset viewer.