From: <cv...@li...> - 2003-04-17 12:34:25
|
Changes in directory wzdftpd/src: ls.c updated: 1.11 -> 1.12 --- Log message: Quick and dirty fix for bug on OpenBSD 3.3: LIST command replies as follows: 512 (null) Apr 16 23:46 instead of: 512 Apr 16 23:46 home --- Diffs of the changes: Index: wzdftpd/src/ls.c diff -u wzdftpd/src/ls.c:1.11 wzdftpd/src/ls.c:1.12 --- wzdftpd/src/ls.c:1.11 Wed Apr 9 14:05:49 2003 +++ wzdftpd/src/ls.c Thu Apr 17 14:34:11 2003 @@ -222,6 +222,29 @@ if (!S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode) && !S_ISREG(st.st_mode)) continue; +#if BSD + { + char buf2[20]; + sprintf(buf2,"%13ld",s.st_size); + sprintf(line,"%c%c%c%c%c%c%c%c%c%c %3d %s %s %s %s %s\r\n", + S_ISDIR(st.st_mode) ? 'd' : S_ISLNK(st.st_mode) ? 'l' : '-', + st.st_mode & S_IRUSR ? 'r' : '-', + st.st_mode & S_IWUSR ? 'w' : '-', + st.st_mode & S_IXUSR ? 'x' : '-', + st.st_mode & S_IRGRP ? 'r' : '-', + st.st_mode & S_IWGRP ? 'w' : '-', + st.st_mode & S_IXGRP ? 'x' : '-', + st.st_mode & S_IROTH ? 'r' : '-', + st.st_mode & S_IWOTH ? 'w' : '-', + st.st_mode & S_IXOTH ? 'x' : '-', + (int)st.st_nlink, + user->username, + "ftp", + buf2, + datestr, + entr->d_name); + } +#else sprintf(line,"%c%c%c%c%c%c%c%c%c%c %3d %s %s %13ld %s %s\r\n", S_ISDIR(st.st_mode) ? 'd' : S_ISLNK(st.st_mode) ? 'l' : '-', st.st_mode & S_IRUSR ? 'r' : '-', @@ -239,6 +262,7 @@ st.st_size, datestr, entr->d_name); +#endif /* if (!callback(sock,context,line)) break;*/ if (list_call_wrapper(sock, context, line, buffer, &buffer_len, callback)) break; |