In this case it's what you get if you try to create a nonexistent directory (with trailing slash) using open(), as the following short C program demonstrates:
#include <unistd.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h>
int main(int argc, char **argv) { int fd = open("nonexistent/", O_WRONLY | O_CREAT); if (fd < 0) { perror("open"); return 1; } close(fd); return 0; }
scp probably ought to be a little bit more careful; calling verifydir() when the target ends in '/' would do it, I think. Still, it's minor.
In this case it's what you get if you try to create a nonexistent directory
(with trailing slash) using open(), as the following short C program demonstrates:
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
int main(int argc, char **argv) nt/", O_WRONLY | O_CREAT);
perror( "open") ;
{
int fd = open("nonexiste
if (fd < 0) {
return 1;
}
close(fd);
return 0;
}
scp probably ought to be a little bit more careful; calling verifydir() when the
target ends in '/' would do it, I think. Still, it's minor.