fix REST.
authorJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Thu, 7 Apr 1994 02:05:04 +0000 (18:05 -0800)
committerJan-Simon Pendry <pendry@ucbvax.Berkeley.EDU>
Thu, 7 Apr 1994 02:05:04 +0000 (18:05 -0800)
fix globbing - need NOCHECK flag

SCCS-vsn: libexec/ftpd/ftpcmd.y 8.3

usr/src/libexec/ftpd/ftpcmd.y

index 437e7c6..d92a354 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ftpcmd.y    8.2 (Berkeley) %G%
+ *     @(#)ftpcmd.y    8.3 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 %{
 
 #ifndef lint
 %{
 
 #ifndef lint
-static char sccsid[] = "@(#)ftpcmd.y   8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)ftpcmd.y   8.3 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -621,10 +621,12 @@ pathname
                         */
                        if (logged_in && $1 && *$1 == '~') {
                                glob_t gl;
                         */
                        if (logged_in && $1 && *$1 == '~') {
                                glob_t gl;
-                               int flags = GLOB_BRACE|GLOB_QUOTE|GLOB_TILDE;
+                               int flags =
+                                GLOB_BRACE|GLOB_NOCHECK|GLOB_QUOTE|GLOB_TILDE;
 
                                memset(&gl, 0, sizeof(gl));
 
                                memset(&gl, 0, sizeof(gl));
-                               if (glob($1, flags, NULL, &gl)) {
+                               if (glob($1, flags, NULL, &gl) ||
+                                   gl.gl_pathc == 0) {
                                        reply(550, "not found");
                                        $$ = NULL;
                                } else {
                                        reply(550, "not found");
                                        $$ = NULL;
                                } else {