diff options
author | jp161948 <none@none> | 2007-09-19 05:03:12 -0700 |
---|---|---|
committer | jp161948 <none@none> | 2007-09-19 05:03:12 -0700 |
commit | 90685d2c52744c6540828f16cdd2db815d467e37 (patch) | |
tree | d0b643cf07d9886649691973b48b865d32a93f19 /usr/src/cmd/ssh/libssh/common/sftp-common.c | |
parent | 1fceb383a3f0b59711832b9dc4e8329d7f216604 (diff) | |
download | illumos-joyent-90685d2c52744c6540828f16cdd2db815d467e37.tar.gz |
PSARC/2007/033 sftp resync with OpenSSH
6481668 sftp(1)/sftp-server(1m) needs a resync with OpenSSH
--HG--
rename : usr/src/cmd/ssh/include/sftp-glob.h => deleted_files/usr/src/cmd/ssh/include/sftp-glob.h
rename : usr/src/cmd/ssh/include/sftp-int.h => deleted_files/usr/src/cmd/ssh/include/sftp-int.h
rename : usr/src/cmd/ssh/sftp/sftp-int.c => deleted_files/usr/src/cmd/ssh/sftp/sftp-int.c
Diffstat (limited to 'usr/src/cmd/ssh/libssh/common/sftp-common.c')
-rw-r--r-- | usr/src/cmd/ssh/libssh/common/sftp-common.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/usr/src/cmd/ssh/libssh/common/sftp-common.c b/usr/src/cmd/ssh/libssh/common/sftp-common.c index 7cbe72c44c..ead9e2406f 100644 --- a/usr/src/cmd/ssh/libssh/common/sftp-common.c +++ b/usr/src/cmd/ssh/libssh/common/sftp-common.c @@ -23,15 +23,27 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "includes.h" -RCSID("$OpenBSD: sftp-common.c,v 1.7 2002/09/11 22:41:50 djm Exp $"); +/* $OpenBSD: sftp-common.c,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */ #pragma ident "%Z%%M% %I% %E% SMI" +#include "includes.h" + +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/param.h> + +#include <grp.h> +#include <pwd.h> +#include <stdio.h> +#include <string.h> +#include <time.h> +#include <stdarg.h> + +#include "xmalloc.h" #include "buffer.h" #include "bufaux.h" #include "log.h" -#include "xmalloc.h" #include "sftp.h" #include "sftp-common.h" @@ -51,7 +63,7 @@ attrib_clear(Attrib *a) /* Convert from struct stat to filexfer attribs */ void -stat_to_attrib(struct stat *st, Attrib *a) +stat_to_attrib(const struct stat *st, Attrib *a) { attrib_clear(a); a->flags = 0; @@ -69,7 +81,7 @@ stat_to_attrib(struct stat *st, Attrib *a) /* Convert from filexfer attribs to struct stat */ void -attrib_to_stat(Attrib *a, struct stat *st) +attrib_to_stat(const Attrib *a, struct stat *st) { memset(st, 0, sizeof(*st)); @@ -126,7 +138,7 @@ decode_attrib(Buffer *b) /* Encode attributes to buffer */ void -encode_attrib(Buffer *b, Attrib *a) +encode_attrib(Buffer *b, const Attrib *a) { buffer_put_int(b, a->flags); if (a->flags & SSH2_FILEXFER_ATTR_SIZE) @@ -149,25 +161,25 @@ fx2txt(int status) { switch (status) { case SSH2_FX_OK: - return("No error"); + return(gettext("No error")); case SSH2_FX_EOF: - return("End of file"); + return(gettext("End of file")); case SSH2_FX_NO_SUCH_FILE: - return("No such file or directory"); + return(gettext("No such file or directory")); case SSH2_FX_PERMISSION_DENIED: - return("Permission denied"); + return(gettext("Permission denied")); case SSH2_FX_FAILURE: - return("Failure"); + return(gettext("Failure")); case SSH2_FX_BAD_MESSAGE: - return("Bad message"); + return(gettext("Bad message")); case SSH2_FX_NO_CONNECTION: - return("No connection"); + return(gettext("No connection")); case SSH2_FX_CONNECTION_LOST: - return("Connection lost"); + return(gettext("Connection lost")); case SSH2_FX_OP_UNSUPPORTED: - return("Operation unsupported"); + return(gettext("Operation unsupported")); default: - return("Unknown status"); + return(gettext("Unknown status")); } /* NOTREACHED */ } @@ -176,7 +188,7 @@ fx2txt(int status) * drwxr-xr-x 5 markus markus 1024 Jan 13 18:39 .ssh */ char * -ls_file(char *name, struct stat *st, int remote) +ls_file(const char *name, const struct stat *st, int remote) { int ulen, glen, sz = 0; struct passwd *pw; @@ -208,8 +220,8 @@ ls_file(char *name, struct stat *st, int remote) tbuf[0] = '\0'; ulen = MAX(strlen(user), 8); 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); + snprintf(buf, sizeof buf, "%s %3u %-*s %-*s %8llu %s %s", mode, + (u_int)st->st_nlink, ulen, user, glen, group, + (unsigned long long)st->st_size, tbuf, name); return xstrdup(buf); } |