Problem pointed out by Gene Stark: mput command breaks on namei changes.
authorGeoff Rehmet <csgr@alpha.ru.ac.za>
Tue, 31 May 1994 18:51:06 +0000 (18:51 +0000)
committerGeoff Rehmet <csgr@alpha.ru.ac.za>
Tue, 31 May 1994 18:51:06 +0000 (18:51 +0000)
- on opendir call, if the directory to be opened is "" call opendir
  with "." instead.  This would not have any adverse effects if the
  namei changes were backed out.

usr.bin/ftp/glob.c

index e09648f..c5ebb5a 100644 (file)
@@ -216,7 +216,8 @@ matchdir(pattern)
        register struct dirent *dp;
        DIR *dirp;
 
        register struct dirent *dp;
        DIR *dirp;
 
-       dirp = opendir(gpath);
+       /* Note: "" is not equivalent to "." for opendir(2) now! */
+       dirp = opendir((strlen(gpath))?gpath:".");
        if (dirp == NULL) {
                if (globbed)
                        return;
        if (dirp == NULL) {
                if (globbed)
                        return;