[sftp-server.c]
     allow long usernames/groups in readdir
This commit is contained in:
Ben Lindstrom 2001-06-25 04:24:49 +00:00
parent af7388046d
commit 488d8805f3
2 changed files with 15 additions and 9 deletions

View File

@ -1,9 +1,9 @@
20010525 20010525
- OpenBSD CVS Sync - OpenBSD CVS Sync
- markus@cvs.openbsd.org 2001/06/21 21:08:25 - markus@cvs.openbsd.org 2001/06/21 21:08:25
[session.c] [session.c]
don't reset forced_command (we allow multiple login shells in don't reset forced_command (we allow multiple login shells in
ssh2); dwd@bell-labs.com ssh2); dwd@bell-labs.com
- mpech@cvs.openbsd.org 2001/06/22 10:17:51 - mpech@cvs.openbsd.org 2001/06/22 10:17:51
[ssh.1 sshd.8 ssh-keyscan.1] [ssh.1 sshd.8 ssh-keyscan.1]
o) .Sh AUTHOR -> .Sh AUTHORS; o) .Sh AUTHOR -> .Sh AUTHORS;
@ -29,6 +29,9 @@
[dh.c] [dh.c]
increase linebuffer to deal with larger moduli; use rewind instead of increase linebuffer to deal with larger moduli; use rewind instead of
close/open close/open
- markus@cvs.openbsd.org 2001/06/22 22:21:20
[sftp-server.c]
allow long usernames/groups in readdir
20010622 20010622
- (stevesk) handle systems without pw_expire and pw_change. - (stevesk) handle systems without pw_expire and pw_change.
@ -5713,4 +5716,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1303 2001/06/25 04:18:59 mouring Exp $ $Id: ChangeLog,v 1.1304 2001/06/25 04:24:49 mouring Exp $

View File

@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sftp-server.c,v 1.26 2001/05/12 19:53:13 markus Exp $"); RCSID("$OpenBSD: sftp-server.c,v 1.27 2001/06/22 22:21:20 markus Exp $");
#include "buffer.h" #include "buffer.h"
#include "bufaux.h" #include "bufaux.h"
@ -692,7 +692,7 @@ process_opendir(void)
char * char *
ls_file(char *name, struct stat *st) ls_file(char *name, struct stat *st)
{ {
int sz = 0; int ulen, glen, sz = 0;
struct passwd *pw; struct passwd *pw;
struct group *gr; struct group *gr;
struct tm *ltime = localtime(&st->st_mtime); struct tm *ltime = localtime(&st->st_mtime);
@ -720,8 +720,11 @@ ls_file(char *name, struct stat *st)
} }
if (sz == 0) if (sz == 0)
tbuf[0] = '\0'; tbuf[0] = '\0';
snprintf(buf, sizeof buf, "%s %3d %-8.8s %-8.8s %8llu %s %s", mode, ulen = MAX(strlen(user), 8);
st->st_nlink, user, group, (u_int64_t)st->st_size, tbuf, name); glen = MAX(strlen(group), 8);
snprintf(buf, sizeof buf, "%s %3d %-*s %-*s %8llu %s %s", mode,
st->st_nlink, ulen, user, glen, group,
(u_int64_t)st->st_size, tbuf, name);
return xstrdup(buf); return xstrdup(buf);
} }