*/
#include "includes.h"
-RCSID("$OpenBSD: sftp-common.c,v 1.1 2001/02/04 11:11:54 djm Exp $");
+RCSID("$OpenBSD: sftp-common.c,v 1.5 2001/12/02 02:08:32 deraadt Exp $");
#include "buffer.h"
#include "bufaux.h"
-#include "getput.h"
#include "log.h"
#include "xmalloc.h"
#include "sftp.h"
#include "sftp-common.h"
+/* Clear contents of attributes structure */
void
attrib_clear(Attrib *a)
{
a->mtime = 0;
}
+/* Convert from struct stat to filexfer attribs */
void
stat_to_attrib(struct stat *st, Attrib *a)
{
a->mtime = st->st_mtime;
}
+/* Decode attributes in buffer */
Attrib *
decode_attrib(Buffer *b)
{
return &a;
}
+/* Encode attributes to buffer */
void
encode_attrib(Buffer *b, Attrib *a)
{
}
}
+/* Convert from SSH2_FX_ status to text error message */
const char *
fx2txt(int status)
{
switch (status) {
case SSH2_FX_OK:
- return("No Error");
+ return("No error");
case SSH2_FX_EOF:
- return("End of File");
+ return("End of file");
case SSH2_FX_NO_SUCH_FILE:
- return("No Such File");
+ return("No such file or directory");
case SSH2_FX_PERMISSION_DENIED:
- return("Permission Denied");
+ return("Permission denied");
case SSH2_FX_FAILURE:
return("Failure");
case SSH2_FX_BAD_MESSAGE:
return("Operation unsupported");
default:
return("Unknown status");
- };
+ }
/* NOTREACHED */
}
-