]> andersk Git - gssapi-openssh.git/blobdiff - openssh/sftp-glob.c
The man2html from jbasney on pkilab2 works whereas the standard one doesn't.
[gssapi-openssh.git] / openssh / sftp-glob.c
index 1234074c45ccc0d3f076cb0f5452517a2eef8d63..a432bdfc2f986d6bc60aa678d9ebe3814404f1bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001,2002 Damien Miller.  All rights reserved.
+ * Copyright (c) 2001 Damien Miller.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-glob.c,v 1.10 2002/02/13 00:59:23 djm Exp $");
+RCSID("$OpenBSD: sftp-glob.c,v 1.8 2001/07/14 15:10:17 stevesk Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -41,17 +41,18 @@ struct SFTP_OPENDIR {
 };
 
 static struct {
-       struct sftp_conn *conn;
+       int fd_in;
+       int fd_out;
 } cur;
 
 static void *
 fudge_opendir(const char *path)
 {
        struct SFTP_OPENDIR *r;
-
+       
        r = xmalloc(sizeof(*r));
-
-       if (do_readdir(cur.conn, (char*)path, &r->dir))
+       
+       if (do_readdir(cur.fd_in, cur.fd_out, (char*)path, &r->dir))
                return(NULL);
 
        r->offset = 0;
@@ -109,7 +110,7 @@ static void
 attrib_to_stat(Attrib *a, struct stat *st)
 {
        memset(st, 0, sizeof(*st));
-
+       
        if (a->flags & SSH2_FILEXFER_ATTR_SIZE)
                st->st_size = a->size;
        if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) {
@@ -128,12 +129,12 @@ static int
 fudge_lstat(const char *path, struct stat *st)
 {
        Attrib *a;
-
-       if (!(a = do_lstat(cur.conn, (char*)path, 0)))
+       
+       if (!(a = do_lstat(cur.fd_in, cur.fd_out, (char*)path, 0)))
                return(-1);
-
+       
        attrib_to_stat(a, st);
-
+       
        return(0);
 }
 
@@ -141,17 +142,17 @@ static int
 fudge_stat(const char *path, struct stat *st)
 {
        Attrib *a;
-
-       if (!(a = do_stat(cur.conn, (char*)path, 0)))
+       
+       if (!(a = do_stat(cur.fd_in, cur.fd_out, (char*)path, 0)))
                return(-1);
-
+       
        attrib_to_stat(a, st);
-
+       
        return(0);
 }
 
 int
-remote_glob(struct sftp_conn *conn, const char *pattern, int flags,
+remote_glob(int fd_in, int fd_out, const char *pattern, int flags,
     int (*errfunc)(const char *, int), glob_t *pglob)
 {
        pglob->gl_opendir = fudge_opendir;
@@ -159,9 +160,11 @@ remote_glob(struct sftp_conn *conn, const char *pattern, int flags,
        pglob->gl_closedir = (void (*)(void *))fudge_closedir;
        pglob->gl_lstat = fudge_lstat;
        pglob->gl_stat = fudge_stat;
-
+       
        memset(&cur, 0, sizeof(cur));
-       cur.conn = conn;
+       cur.fd_in = fd_in;
+       cur.fd_out = fd_out;
 
-       return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc, pglob));
+       return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc,
+           pglob));
 }
This page took 0.038668 seconds and 4 git commands to generate.