From: Tom Yu Date: Sat, 8 Dec 2001 01:58:07 +0000 (+0000) Subject: * ftpcmd.y (pathname): Handle returns from ftpglob() better so X-Git-Tag: krb5-1.3-alpha1~912 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a85ddebf1bb152f75938e8058f9bd38ba92045e;p=krb5.git * ftpcmd.y (pathname): Handle returns from ftpglob() better so that errors get sent via reply(), while causing some match failures to match to simply return $1, so the higher level can deal. Previously, some failures would cause synch problems since NULL would be returned and no reply was sent. [pullup from 1.2.3] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14059 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index c02c68047..7577d5697 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,11 @@ +2001-11-30 Tom Yu + + * ftpcmd.y (pathname): Handle returns from ftpglob() better so + that errors get sent via reply(), while causing some match + failures to match to simply return $1, so the higher level can + deal. Previously, some failures would cause synch problems since + NULL would be returned and no reply was sent. + 2001-10-11 Mitchell Berger * ftpd.M: Remove improper formatting from the .SH NAME section, as it diff --git a/src/appl/gssftp/ftpd/ftpcmd.y b/src/appl/gssftp/ftpd/ftpcmd.y index 282697e58..f7f16122a 100644 --- a/src/appl/gssftp/ftpd/ftpcmd.y +++ b/src/appl/gssftp/ftpd/ftpcmd.y @@ -811,13 +811,16 @@ pathname: pathstring char **vv; vv = ftpglob((char *) $1); - if (vv == NULL || globerr != NULL) { - reply(550, globerr); - $$ = NULL; + $$ = (vv != NULL) ? *vv : NULL; + if ($$ == NULL) { + if (globerr == NULL) + $$ = $1; + else { + reply(550, "%s", globerr); + free((char *) $1); + } } else - $$ = *vv; - - free((char *) $1); + free((char *) $1); } else $$ = $1; }