void dirlist_one_file(char *name, FILE *client, char verbose) { struct stat statbuf; struct hidegroup *tmp = hidegroups; char *filename_index; /* place where filename starts in path */ if (!stat(name, (struct stat *) &statbuf)) { if (tmp) do { if (statbuf.st_gid == tmp->data) return; } while ((tmp = tmp->next)); } /* find start of filename after path */ filename_index = strrchr(name, '/'); if (filename_index) filename_index++; /* goto first character after '/' */ else filename_index = name; if (verbose) bftpd_stat(name, client); else fprintf(client, "%s\r\n", filename_index); }
void dirlist_one_file(char *name, FILE *client, char verbose) { struct stat statbuf; struct hidegroup *tmp = hidegroups; char *filename_index; /* place where filename starts in path */ char szBuffer[512] = ""; if (!stat(name, (struct stat *) &statbuf)) { if (tmp) do { if (statbuf.st_gid == tmp->data) return; } while ((tmp = tmp->next)); } /* find start of filename after path */ filename_index = strrchr(name, '/'); if (filename_index) filename_index++; /* goto first character after '/' */ else filename_index = name; if (verbose) { bftpd_stat(name, client); } else { #if 0 fprintf(client, "%s\r\n", filename_index); #endif snprintf( szBuffer,sizeof(szBuffer), "%s\r\n", filename_index ); /*Added by yehuisheng00183935@20110702 添加ftpds功能*/ #ifdef SUPPORT_ATP_FTPDS if ( pstssldataobj != NULL ) { SSL_write(pstssldataobj,(const unsigned char*)szBuffer, strlen(szBuffer) ); } else { fprintf(client, "%s", szBuffer); } #else fprintf(client, "%s", szBuffer); #endif /*Added by yehuisheng00183935@20110702 添加ftpds功能*/ } }
void dirlist_one_file(char *name, FILE *client, char verbose) { struct stat statbuf; struct hidegroup *tmp = hidegroups; if (!stat(name, (struct stat *) &statbuf)) { if (tmp) do { if (statbuf.st_gid == tmp->data) return; } while ((tmp = tmp->next)); } if (verbose) bftpd_stat(name, client); else fprintf(client, "%s\r\n", name); }