mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-25 14:54:45 +02:00
- dtucker@cvs.openbsd.org 2010/01/14 23:41:49
[sftp-common.c] use user_from{uid,gid} to lookup up ids since it keeps a small cache. ok djm
This commit is contained in:
parent
94881d8dbb
commit
a788de2066
@ -11,6 +11,10 @@
|
|||||||
when using ChrootDirectory, make sure we test for the existence of the
|
when using ChrootDirectory, make sure we test for the existence of the
|
||||||
user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu;
|
user's shell inside the chroot; bz #1679, patch from alex AT rtfs.hu;
|
||||||
ok dtucker
|
ok dtucker
|
||||||
|
- dtucker@cvs.openbsd.org 2010/01/14 23:41:49
|
||||||
|
[sftp-common.c]
|
||||||
|
use user_from{uid,gid} to lookup up ids since it keeps a small cache.
|
||||||
|
ok djm
|
||||||
|
|
||||||
20100114
|
20100114
|
||||||
- (djm) [platform.h] Add missing prototype for
|
- (djm) [platform.h] Add missing prototype for
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $OpenBSD: sftp-common.c,v 1.21 2010/01/13 01:40:16 djm Exp $ */
|
/* $OpenBSD: sftp-common.c,v 1.22 2010/01/14 23:41:49 dtucker Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2001 Markus Friedl. All rights reserved.
|
||||||
* Copyright (c) 2001 Damien Miller. All rights reserved.
|
* Copyright (c) 2001 Damien Miller. All rights reserved.
|
||||||
@ -198,14 +198,14 @@ ls_file(const char *name, const struct stat *st, int remote, int si_units)
|
|||||||
char sbuf[FMT_SCALED_STRSIZE];
|
char sbuf[FMT_SCALED_STRSIZE];
|
||||||
|
|
||||||
strmode(st->st_mode, mode);
|
strmode(st->st_mode, mode);
|
||||||
if (!remote && (pw = getpwuid(st->st_uid)) != NULL) {
|
if (!remote) {
|
||||||
user = pw->pw_name;
|
user = user_from_uid(st->st_uid, 0);
|
||||||
} else {
|
} else {
|
||||||
snprintf(ubuf, sizeof ubuf, "%u", (u_int)st->st_uid);
|
snprintf(ubuf, sizeof ubuf, "%u", (u_int)st->st_uid);
|
||||||
user = ubuf;
|
user = ubuf;
|
||||||
}
|
}
|
||||||
if (!remote && (gr = getgrgid(st->st_gid)) != NULL) {
|
if (!remote) {
|
||||||
group = gr->gr_name;
|
group = group_from_gid(st->st_gid, 0);
|
||||||
} else {
|
} else {
|
||||||
snprintf(gbuf, sizeof gbuf, "%u", (u_int)st->st_gid);
|
snprintf(gbuf, sizeof gbuf, "%u", (u_int)st->st_gid);
|
||||||
group = gbuf;
|
group = gbuf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user