17
17
18
18
#include "includes.h"
19
19
20
- /*
21
- * We support only client side kerberos on Windows.
22
- */
23
-
24
- #ifdef WIN32_FIXME
25
- #undef GSSAPI
26
- #undef KRB5
27
-
28
- #define true 1
29
- #define false 0
30
-
31
- #endif
32
-
33
20
#include <sys/param.h> /* MIN */
34
21
#include <sys/types.h>
35
22
#include <sys/stat.h>
@@ -232,9 +219,7 @@ errno_to_portable(int unixerrno)
232
219
case ENOENT :
233
220
case ENOTDIR :
234
221
case EBADF :
235
- #ifndef WIN32_FIXME
236
222
case ELOOP :
237
- #endif
238
223
ret = SSH2_FX_NO_SUCH_FILE ;
239
224
break ;
240
225
case EPERM :
@@ -726,12 +711,8 @@ process_open(u_int32_t id)
726
711
char * name ;
727
712
int r , handle , fd , flags , mode , status = SSH2_FX_FAILURE ;
728
713
729
- // #ifdef WIN32_FIXME
730
- // name = buffer_get_string_local8_from_utf8(&iqueue, NULL);
731
- //#else
732
714
if ((r = sshbuf_get_cstring (iqueue , & name , NULL )) != 0 )
733
715
fatal ("%s: buffer error: %s" , __func__ , ssh_err (r ));
734
- //#endif /* WIN32_FIXME */
735
716
736
717
if ((r = sshbuf_get_u32 (iqueue , & pflags )) != 0 || /* portable flags */
737
718
(r = decode_attrib (iqueue , & a )) != 0 )
@@ -740,14 +721,14 @@ process_open(u_int32_t id)
740
721
debug3 ("request %u: open flags %d" , id , pflags );
741
722
flags = flags_from_portable (pflags );
742
723
mode = (a .flags & SSH2_FILEXFER_ATTR_PERMISSIONS ) ? a .perm : 0666 ;
743
- #ifdef WIN32_FIXME
724
+ #ifdef WIN32_FIXME
744
725
char resolvedname [MAXPATHLEN ];
745
726
if (realpathWin32i (name , resolvedname ))
746
727
{
747
728
free (name );
748
729
name = strdup (resolvedname );
749
730
}
750
- #endif
731
+ #endif
751
732
752
733
logit ("open \"%s\" flags %s mode 0%o" ,
753
734
name , string_from_portable (pflags ), mode );
@@ -882,27 +863,26 @@ process_do_stat(u_int32_t id, int do_lstat)
882
863
char * name ;
883
864
int r , status = SSH2_FX_FAILURE ;
884
865
885
- #ifdef WIN32_FIXME
886
- char resolvedname [MAXPATHLEN ];
887
- #endif
866
+ #ifdef WIN32_FIXME
867
+ char resolvedname [MAXPATHLEN ];
868
+ #endif
888
869
889
870
890
- #ifdef WIN32_FIXME
871
+ #ifdef WIN32_FIXME
891
872
892
- if ((r = sshbuf_get_cstring (iqueue , & name , NULL )) != 0 )
873
+ if ((r = sshbuf_get_cstring (iqueue , & name , NULL )) != 0 )
893
874
fatal ("%s: buffer error: %s" , __func__ , ssh_err (r ));
894
875
895
- if (realpathWin32i (name , resolvedname ))
896
- {
897
- free (name );
898
- name = strdup (resolvedname );
899
- }
876
+ if (realpathWin32i (name , resolvedname )) {
877
+ free (name );
878
+ name = strdup (resolvedname );
879
+ }
900
880
901
- debug3 ("request %u: %sstat" , id , do_lstat ? "l" : "" );
902
- verbose ("%sstat name \"%s\"" , do_lstat ? "l" : "" , name );
903
- r = stat (name , & st );
881
+ debug3 ("request %u: %sstat" , id , do_lstat ? "l" : "" );
882
+ verbose ("%sstat name \"%s\"" , do_lstat ? "l" : "" , name );
883
+ r = stat (name , & st );
904
884
905
- #else
885
+ #else
906
886
907
887
908
888
@@ -1957,21 +1937,6 @@ sftp_server_usage(void)
1957
1937
exit (1 );
1958
1938
}
1959
1939
1960
- #ifdef WIN32_FIXME
1961
- DWORD select_in_handle ( HANDLE in_handle )
1962
- {
1963
- //DWORD rc = WaitForSingleObject (in_handle, 0);
1964
- //if (rc == WAIT_OBJECT_0)
1965
- // return 1;
1966
- //else
1967
- // return 0;
1968
-
1969
- DWORD bytesavail = 0 ;
1970
- PeekNamedPipe (in_handle , NULL ,0 , NULL , & bytesavail , NULL );
1971
- return bytesavail ;
1972
- }
1973
- #endif
1974
-
1975
1940
int
1976
1941
sftp_server_main (int argc , char * * argv , struct passwd * user_pw )
1977
1942
{
@@ -2113,14 +2078,10 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw)
2113
2078
fatal ("%s: sshbuf_new failed" , __func__ );
2114
2079
if ((oqueue = sshbuf_new ()) == NULL )
2115
2080
fatal ("%s: sshbuf_new failed" , __func__ );
2116
- #if (0 )//def WIN32_FIXME
2117
- //rset = (fd_set *)xmalloc(sizeof(fd_set));
2118
- //wset = (fd_set *)xmalloc(sizeof(fd_set));
2119
- #else
2081
+
2120
2082
set_size = howmany (max + 1 , NFDBITS ) * sizeof (fd_mask );
2121
2083
rset = xmalloc (set_size );
2122
2084
wset = xmalloc (set_size );
2123
- #endif
2124
2085
2125
2086
2126
2087
if (homedir != NULL ) {
0 commit comments