[krbdev.mit.edu #1218] [Daniel Schepler <schepler@math.berkeley.edu>] Bug#165655: krb5: FTBFS with new bison

Ezra Peisach via RT rt-comment at krbdev.mit.edu
Wed Oct 23 10:16:02 EDT 2002


The following patch should solve the problem.  Essentialy the '=' is not
required by yacc specifications. (no wheer else in the tree do we
require it). I will be checking in this change shortly.

Index: ftpcmd.y
===================================================================
RCS file: /cvs/krbdev/krb5/src/appl/gssftp/ftpd/ftpcmd.y,v
retrieving revision 1.24
diff -c -r1.24 ftpcmd.y
*** ftpcmd.y	2002/03/07 00:21:38	1.24
--- ftpcmd.y	2002/10/23 14:13:07
***************
*** 202,208 ****
  
  cmd_list:	/* empty */
  	|	cmd_list cmd
! 		= {
  			fromname = (char *) 0;
  			restart_point = (off_t) 0;
  		}
--- 202,208 ----
  
  cmd_list:	/* empty */
  	|	cmd_list cmd
! 		{
  			fromname = (char *) 0;
  			restart_point = (off_t) 0;
  		}
***************
*** 210,226 ****
  	;
  
  cmd:		USER SP username CRLF
! 		= {
  			user((char *) $3);
  			free((char *) $3);
  		}
  	|	PASS SP password CRLF
! 		= {
  			pass((char *) $3);
  			free((char *) $3);
  		}
  	|	PORT SP host_port CRLF
! 		= {
  			/*
  			 * Don't allow a port < 1024 if we're not
  			 * connecting back to the original source address
--- 210,226 ----
  	;
  
  cmd:		USER SP username CRLF
! 		{
  			user((char *) $3);
  			free((char *) $3);
  		}
  	|	PASS SP password CRLF
! 		{
  			pass((char *) $3);
  			free((char *) $3);
  		}
  	|	PORT SP host_port CRLF
! 		{
  			/*
  			 * Don't allow a port < 1024 if we're not
  			 * connecting back to the original source address
***************
*** 239,257 ****
  			}
  		}
  	|	PASV check_login CRLF
! 		= {
  			if ($2)
  				passive();
  		}
  	|	PROT SP prot_code CRLF
! 		= {
  		    if (maxbuf)
  			setdlevel ($3);
  		    else
  			reply(503, "Must first set PBSZ");
  		}
  	|	CCC CRLF
! 		= {
  			if (!allow_ccc) {
  			    reply(534, "CCC not supported");
  			}
--- 239,257 ----
  			}
  		}
  	|	PASV check_login CRLF
! 		{
  			if ($2)
  				passive();
  		}
  	|	PROT SP prot_code CRLF
! 		{
  		    if (maxbuf)
  			setdlevel ($3);
  		    else
  			reply(503, "Must first set PBSZ");
  		}
  	|	CCC CRLF
! 		{
  			if (!allow_ccc) {
  			    reply(534, "CCC not supported");
  			}
***************
*** 265,271 ****
  			}
  		}
  	|	PBSZ SP STRING CRLF
! 		= {
  			/* Others may want to do something more fancy here */
  			if (!auth_type)
  			    reply(503, "Must first perform authentication");
--- 265,271 ----
  			}
  		}
  	|	PBSZ SP STRING CRLF
! 		{
  			/* Others may want to do something more fancy here */
  			if (!auth_type)
  			    reply(503, "Must first perform authentication");
***************
*** 290,296 ****
  			}
  		}
  	|	TYPE SP type_code CRLF
! 		= {
  			switch (cmd_type) {
  
  			case TYPE_A:
--- 290,296 ----
  			}
  		}
  	|	TYPE SP type_code CRLF
! 		{
  			switch (cmd_type) {
  
  			case TYPE_A:
***************
*** 325,331 ****
  			}
  		}
  	|	STRU SP struct_code CRLF
! 		= {
  			switch ($3) {
  
  			case STRU_F:
--- 325,331 ----
  			}
  		}
  	|	STRU SP struct_code CRLF
! 		{
  			switch ($3) {
  
  			case STRU_F:
***************
*** 337,343 ****
  			}
  		}
  	|	MODE SP mode_code CRLF
! 		= {
  			switch ($3) {
  
  			case MODE_S:
--- 337,343 ----
  			}
  		}
  	|	MODE SP mode_code CRLF
! 		{
  			switch ($3) {
  
  			case MODE_S:
***************
*** 349,426 ****
  			}
  		}
  	|	ALLO SP NUMBER CRLF
! 		= {
  			reply(202, "ALLO command ignored.");
  		}
  	|	ALLO SP NUMBER SP 'R' SP NUMBER CRLF
! 		= {
  			reply(202, "ALLO command ignored.");
  		}
  	|	RETR check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				retrieve((char *) 0, (char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	STOR check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				store_file((char *) $4, "w", 0);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	APPE check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				store_file((char *) $4, "a", 0);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	NLST check_login CRLF
! 		= {
  			if ($2)
  				send_file_list(".");
  		}
  	|	NLST check_login SP STRING CRLF
! 		= {
  			if ($2 && $4 != NULL) 
  				send_file_list((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	LIST check_login CRLF
! 		= {
  			if ($2)
  				retrieve("/bin/ls -lgA", "");
  		}
  	|	LIST check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				retrieve("/bin/ls -lgA %s", (char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	STAT check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				statfilecmd((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	STAT CRLF
! 		= {
  			statcmd();
  		}
  	|	DELE check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				delete_file((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	RNTO SP pathname CRLF
! 		= {
  			if (fromname) {
  				renamecmd(fromname, (char *) $3);
  				free(fromname);
--- 349,426 ----
  			}
  		}
  	|	ALLO SP NUMBER CRLF
! 		{
  			reply(202, "ALLO command ignored.");
  		}
  	|	ALLO SP NUMBER SP 'R' SP NUMBER CRLF
! 		{
  			reply(202, "ALLO command ignored.");
  		}
  	|	RETR check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				retrieve((char *) 0, (char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	STOR check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				store_file((char *) $4, "w", 0);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	APPE check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				store_file((char *) $4, "a", 0);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	NLST check_login CRLF
! 		{
  			if ($2)
  				send_file_list(".");
  		}
  	|	NLST check_login SP STRING CRLF
! 		{
  			if ($2 && $4 != NULL) 
  				send_file_list((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	LIST check_login CRLF
! 		{
  			if ($2)
  				retrieve("/bin/ls -lgA", "");
  		}
  	|	LIST check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				retrieve("/bin/ls -lgA %s", (char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	STAT check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				statfilecmd((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	STAT CRLF
! 		{
  			statcmd();
  		}
  	|	DELE check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				delete_file((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	RNTO SP pathname CRLF
! 		{
  			if (fromname) {
  				renamecmd(fromname, (char *) $3);
  				free(fromname);
***************
*** 431,457 ****
  			free((char *) $3);
  		}
  	|	ABOR CRLF
! 		= {
  			reply(225, "ABOR command successful.");
  		}
  	|	CWD check_login CRLF
! 		= {
  			if ($2)
  				cwd(pw->pw_dir);
  		}
  	|	CWD check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				cwd((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	HELP CRLF
! 		= {
  			help(cmdtab, (char *) 0);
  		}
  	|	HELP SP STRING CRLF
! 		= {
  			register char *cp = (char *)$3;
  
  			if (strncasecmp(cp, "SITE", 4) == 0) {
--- 431,457 ----
  			free((char *) $3);
  		}
  	|	ABOR CRLF
! 		{
  			reply(225, "ABOR command successful.");
  		}
  	|	CWD check_login CRLF
! 		{
  			if ($2)
  				cwd(pw->pw_dir);
  		}
  	|	CWD check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				cwd((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	HELP CRLF
! 		{
  			help(cmdtab, (char *) 0);
  		}
  	|	HELP SP STRING CRLF
! 		{
  			register char *cp = (char *)$3;
  
  			if (strncasecmp(cp, "SITE", 4) == 0) {
***************
*** 466,508 ****
  				help(cmdtab, (char *) $3);
  		}
  	|	NOOP CRLF
! 		= {
  			reply(200, "NOOP command successful.");
  		}
  	|	MKD nonguest SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				makedir((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	RMD nonguest SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				removedir((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	PWD check_login CRLF
! 		= {
  			if ($2)
  				pwd();
  		}
  	|	CDUP check_login CRLF
! 		= {
  			if ($2)
  				cwd("..");
  		}
  	|	SITE SP HELP CRLF
! 		= {
  			help(sitetab, (char *) 0);
  		}
  	|	SITE SP HELP SP STRING CRLF
! 		= {
  			help(sitetab, (char *) $5);
  		}
  	|	SITE SP UMASK check_login CRLF
! 		= {
  			int oldmask;
  
  			if ($4) {
--- 466,508 ----
  				help(cmdtab, (char *) $3);
  		}
  	|	NOOP CRLF
! 		{
  			reply(200, "NOOP command successful.");
  		}
  	|	MKD nonguest SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				makedir((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	RMD nonguest SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				removedir((char *) $4);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	PWD check_login CRLF
! 		{
  			if ($2)
  				pwd();
  		}
  	|	CDUP check_login CRLF
! 		{
  			if ($2)
  				cwd("..");
  		}
  	|	SITE SP HELP CRLF
! 		{
  			help(sitetab, (char *) 0);
  		}
  	|	SITE SP HELP SP STRING CRLF
! 		{
  			help(sitetab, (char *) $5);
  		}
  	|	SITE SP UMASK check_login CRLF
! 		{
  			int oldmask;
  
  			if ($4) {
***************
*** 512,518 ****
  			}
  		}
  	|	SITE SP UMASK nonguest SP octal_number CRLF
! 		= {
  			int oldmask;
  
  			if ($4) {
--- 512,518 ----
  			}
  		}
  	|	SITE SP UMASK nonguest SP octal_number CRLF
! 		{
  			int oldmask;
  
  			if ($4) {
***************
*** 527,533 ****
  			}
  		}
  	|	SITE SP CHMOD nonguest SP octal_number SP pathname CRLF
! 		= {
  			if ($4 && ($8 != NULL)) {
  				if ($6 > 0777)
  					reply(501,
--- 527,533 ----
  			}
  		}
  	|	SITE SP CHMOD nonguest SP octal_number SP pathname CRLF
! 		{
  			if ($4 && ($8 != NULL)) {
  				if ($6 > 0777)
  					reply(501,
***************
*** 541,553 ****
  				free((char *) $8);
  		}
  	|	SITE SP IDLE CRLF
! 		= {
  			reply(200,
  			    "Current IDLE time limit is %d seconds; max %d",
  				timeout, maxtimeout);
  		}
  	|	SITE SP IDLE SP NUMBER CRLF
! 		= {
  			if ($5 < 30 || $5 > maxtimeout) {
  				reply(501,
  			"Maximum IDLE time must be between 30 and %d seconds",
--- 541,553 ----
  				free((char *) $8);
  		}
  	|	SITE SP IDLE CRLF
! 		{
  			reply(200,
  			    "Current IDLE time limit is %d seconds; max %d",
  				timeout, maxtimeout);
  		}
  	|	SITE SP IDLE SP NUMBER CRLF
! 		{
  			if ($5 < 30 || $5 > maxtimeout) {
  				reply(501,
  			"Maximum IDLE time must be between 30 and %d seconds",
***************
*** 561,574 ****
  			}
  		}
  	|	STOU check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				store_file((char *) $4, "w", 1);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	SYST CRLF
! 		= {
  #ifdef unix
  #ifdef __svr4__
  #undef BSD
--- 561,574 ----
  			}
  		}
  	|	STOU check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				store_file((char *) $4, "w", 1);
  			if ($4 != NULL)
  				free((char *) $4);
  		}
  	|	SYST CRLF
! 		{
  #ifdef unix
  #ifdef __svr4__
  #undef BSD
***************
*** 592,598 ****
  		 * using with RESTART (we just count bytes).
  		 */
  	|	SIZE check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL)
  				sizecmd((char *) $4);
  			if ($4 != NULL)
--- 592,598 ----
  		 * using with RESTART (we just count bytes).
  		 */
  	|	SIZE check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL)
  				sizecmd((char *) $4);
  			if ($4 != NULL)
***************
*** 609,615 ****
  		 * not necessarily 3 digits)
  		 */
  	|	MDTM check_login SP pathname CRLF
! 		= {
  			if ($2 && $4 != NULL) {
  				struct stat stbuf;
  				if (stat($4, &stbuf) < 0)
--- 609,615 ----
  		 * not necessarily 3 digits)
  		 */
  	|	MDTM check_login SP pathname CRLF
! 		{
  			if ($2 && $4 != NULL) {
  				struct stat stbuf;
  				if (stat($4, &stbuf) < 0)
***************
*** 632,657 ****
  				free((char *) $4);
  		}
  	|	AUTH SP STRING CRLF
! 		= {
  			auth((char *) $3);
  		}
  	|	ADAT SP STRING CRLF
! 		= {
  			auth_data((char *) $3);
  			free((char *) $3);
  		}
  	|	QUIT CRLF
! 		= {
  			reply(221, "Goodbye.");
  			dologout(0);
  		}
  	|	error CRLF
! 		= {
  			yyerrok;
  		}
  	;
  rcmd:		RNFR check_login SP pathname CRLF
! 		= {
  			restart_point = (off_t) 0;
  			if ($2 && $4) {
  				fromname = renamefrom((char *) $4);
--- 632,657 ----
  				free((char *) $4);
  		}
  	|	AUTH SP STRING CRLF
! 		{
  			auth((char *) $3);
  		}
  	|	ADAT SP STRING CRLF
! 		{
  			auth_data((char *) $3);
  			free((char *) $3);
  		}
  	|	QUIT CRLF
! 		{
  			reply(221, "Goodbye.");
  			dologout(0);
  		}
  	|	error CRLF
! 		{
  			yyerrok;
  		}
  	;
  rcmd:		RNFR check_login SP pathname CRLF
! 		{
  			restart_point = (off_t) 0;
  			if ($2 && $4) {
  				fromname = renamefrom((char *) $4);
***************
*** 661,667 ****
  			}
  		}
  	|	REST SP byte_size CRLF
! 		= {
  			fromname = (char *) 0;
  			restart_point = $3;
  			reply(350, "Restarting at %ld. %s", 
--- 661,667 ----
  			}
  		}
  	|	REST SP byte_size CRLF
! 		{
  			fromname = (char *) 0;
  			restart_point = $3;
  			reply(350, "Restarting at %ld. %s", 
***************
*** 674,680 ****
  	;
  
  password:	/* empty */
! 		= {
  			*(char **)&($$) = (char *)calloc(1, sizeof(char));
  		}
  	|	STRING
--- 674,680 ----
  	;
  
  password:	/* empty */
! 		{
  			*(char **)&($$) = (char *)calloc(1, sizeof(char));
  		}
  	|	STRING
***************
*** 685,691 ****
  
  host_port:	NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA 
  		NUMBER COMMA NUMBER
! 		= {
  			register char *a, *p;
  
  			a = (char *)&host_port.sin_addr;
--- 685,691 ----
  
  host_port:	NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA 
  		NUMBER COMMA NUMBER
! 		{
  			register char *a, *p;
  
  			a = (char *)&host_port.sin_addr;
***************
*** 697,805 ****
  	;
  
  form_code:	'N'
! 	= {
  		$$ = FORM_N;
  	}
  	|	'T'
! 	= {
  		$$ = FORM_T;
  	}
  	|	'C'
! 	= {
  		$$ = FORM_C;
  	}
  	;
  
  prot_code:	'C'
! 	= {
  		$$ = PROT_C;
  	}
  	|	'S'
! 	= {
  		$$ = PROT_S;
  	}
  	|	'P'
! 	= {
  		$$ = PROT_P;
  	}
  	|	'E'
! 	= {
  		$$ = PROT_E;
  	}
  	;
  
  type_code:	'A'
! 	= {
  		cmd_type = TYPE_A;
  		cmd_form = FORM_N;
  	}
  	|	'A' SP form_code
! 	= {
  		cmd_type = TYPE_A;
  		cmd_form = $3;
  	}
  	|	'E'
! 	= {
  		cmd_type = TYPE_E;
  		cmd_form = FORM_N;
  	}
  	|	'E' SP form_code
! 	= {
  		cmd_type = TYPE_E;
  		cmd_form = $3;
  	}
  	|	'I'
! 	= {
  		cmd_type = TYPE_I;
  	}
  	|	'L'
! 	= {
  		cmd_type = TYPE_L;
  		cmd_bytesz = NBBY;
  	}
  	|	'L' SP byte_size
! 	= {
  		cmd_type = TYPE_L;
  		cmd_bytesz = $3;
  	}
  	/* this is for a bug in the BBN ftp */
  	|	'L' byte_size
! 	= {
  		cmd_type = TYPE_L;
  		cmd_bytesz = $2;
  	}
  	;
  
  struct_code:	'F'
! 	= {
  		$$ = STRU_F;
  	}
  	|	'R'
! 	= {
  		$$ = STRU_R;
  	}
  	|	'P'
! 	= {
  		$$ = STRU_P;
  	}
  	;
  
  mode_code:	'S'
! 	= {
  		$$ = MODE_S;
  	}
  	|	'B'
! 	= {
  		$$ = MODE_B;
  	}
  	|	'C'
! 	= {
  		$$ = MODE_C;
  	}
  	;
  
  pathname:	pathstring
! 	= {
  		/*
  		 * Problem: this production is used for all pathname
  		 * processing, but only gives a 550 error reply.
--- 697,805 ----
  	;
  
  form_code:	'N'
! 	{
  		$$ = FORM_N;
  	}
  	|	'T'
! 	{
  		$$ = FORM_T;
  	}
  	|	'C'
! 	{
  		$$ = FORM_C;
  	}
  	;
  
  prot_code:	'C'
! 	{
  		$$ = PROT_C;
  	}
  	|	'S'
! 	{
  		$$ = PROT_S;
  	}
  	|	'P'
! 	{
  		$$ = PROT_P;
  	}
  	|	'E'
! 	{
  		$$ = PROT_E;
  	}
  	;
  
  type_code:	'A'
! 	{
  		cmd_type = TYPE_A;
  		cmd_form = FORM_N;
  	}
  	|	'A' SP form_code
! 	{
  		cmd_type = TYPE_A;
  		cmd_form = $3;
  	}
  	|	'E'
! 	{
  		cmd_type = TYPE_E;
  		cmd_form = FORM_N;
  	}
  	|	'E' SP form_code
! 	{
  		cmd_type = TYPE_E;
  		cmd_form = $3;
  	}
  	|	'I'
! 	{
  		cmd_type = TYPE_I;
  	}
  	|	'L'
! 	{
  		cmd_type = TYPE_L;
  		cmd_bytesz = NBBY;
  	}
  	|	'L' SP byte_size
! 	{
  		cmd_type = TYPE_L;
  		cmd_bytesz = $3;
  	}
  	/* this is for a bug in the BBN ftp */
  	|	'L' byte_size
! 	{
  		cmd_type = TYPE_L;
  		cmd_bytesz = $2;
  	}
  	;
  
  struct_code:	'F'
! 	{
  		$$ = STRU_F;
  	}
  	|	'R'
! 	{
  		$$ = STRU_R;
  	}
  	|	'P'
! 	{
  		$$ = STRU_P;
  	}
  	;
  
  mode_code:	'S'
! 	{
  		$$ = MODE_S;
  	}
  	|	'B'
! 	{
  		$$ = MODE_B;
  	}
  	|	'C'
! 	{
  		$$ = MODE_C;
  	}
  	;
  
  pathname:	pathstring
! 	{
  		/*
  		 * Problem: this production is used for all pathname
  		 * processing, but only gives a 550 error reply.
***************
*** 828,834 ****
  	;
  
  octal_number:	NUMBER
! 	= {
  		register int ret, dec, multby, digit;
  
  		/*
--- 828,834 ----
  	;
  
  octal_number:	NUMBER
! 	{
  		register int ret, dec, multby, digit;
  
  		/*
***************
*** 853,859 ****
  	;
  
  check_login:	/* empty */
! 	= {
  		if (logged_in)
  			$$ = 1;
  		else {
--- 853,859 ----
  	;
  
  check_login:	/* empty */
! 	{
  		if (logged_in)
  			$$ = 1;
  		else {
***************
*** 864,870 ****
  	;
  
  nonguest: check_login
! 	= {
  		if (guest) {
  			reply(550, "Operation prohibited for anonymous users.");
  			$$ = 0;
--- 864,870 ----
  	;
  
  nonguest: check_login
! 	{
  		if (guest) {
  			reply(550, "Operation prohibited for anonymous users.");
  			$$ = 0;



More information about the krb5-bugs mailing list