version 1.40, 2003/01/10 08:48:15 |
version 1.41, 2003/01/14 10:58:00 |
|
|
mode = 0666; |
mode = 0666; |
|
|
if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && |
if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && |
(a->perm & S_IFDIR)) { |
(!S_ISREG(a->perm))) { |
error("Cannot download a directory: %s", remote_path); |
error("Cannot download non-regular file: %s", remote_path); |
return(-1); |
return(-1); |
} |
} |
|
|
|
|
if (fstat(local_fd, &sb) == -1) { |
if (fstat(local_fd, &sb) == -1) { |
error("Couldn't fstat local file \"%s\": %s", |
error("Couldn't fstat local file \"%s\": %s", |
local_path, strerror(errno)); |
local_path, strerror(errno)); |
|
close(local_fd); |
|
return(-1); |
|
} |
|
if (!S_ISREG(sb.st_mode)) { |
|
error("%s is not a regular file", local_path); |
close(local_fd); |
close(local_fd); |
return(-1); |
return(-1); |
} |
} |