]> andersk Git - openssh.git/blobdiff - sftp-common.c
- deraadt@cvs.openbsd.org 2002/07/06 01:00:49
[openssh.git] / sftp-common.c
index 3310eabab57778792d0a43cc6c012dc7f5a88146..6bed0ab8a06d1f26c6af458df4e9a3b9885e3a7f 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-common.c,v 1.2 2001/02/06 23:50:10 markus Exp $");
+RCSID("$OpenBSD: sftp-common.c,v 1.6 2002/06/23 09:30:14 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)
 {
@@ -47,6 +47,7 @@ attrib_clear(Attrib *a)
        a->mtime = 0;
 }
 
+/* Convert from struct stat to filexfer attribs */
 void
 stat_to_attrib(struct stat *st, Attrib *a)
 {
@@ -64,10 +65,12 @@ stat_to_attrib(struct stat *st, Attrib *a)
        a->mtime = st->st_mtime;
 }
 
+/* Decode attributes in buffer */
 Attrib *
 decode_attrib(Buffer *b)
 {
        static Attrib a;
+
        attrib_clear(&a);
        a.flags = buffer_get_int(b);
        if (a.flags & SSH2_FILEXFER_ATTR_SIZE)
@@ -86,6 +89,7 @@ decode_attrib(Buffer *b)
        if (a.flags & SSH2_FILEXFER_ATTR_EXTENDED) {
                char *type, *data;
                int i, count;
+
                count = buffer_get_int(b);
                for (i = 0; i < count; i++) {
                        type = buffer_get_string(b, NULL);
@@ -98,6 +102,7 @@ decode_attrib(Buffer *b)
        return &a;
 }
 
+/* Encode attributes to buffer */
 void
 encode_attrib(Buffer *b, Attrib *a)
 {
@@ -116,6 +121,7 @@ encode_attrib(Buffer *b, Attrib *a)
        }
 }
 
+/* Convert from SSH2_FX_ status to text error message */
 const char *
 fx2txt(int status)
 {
@@ -140,7 +146,6 @@ fx2txt(int status)
                return("Operation unsupported");
        default:
                return("Unknown status");
-       };
+       }
        /* NOTREACHED */
 }
-
This page took 0.040217 seconds and 4 git commands to generate.