mirror of
				https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
				synced 2025-11-04 05:53:26 +00:00 
			
		
		
		
	libctrl: Don't overwrite error reply if the verify function sets one
This commit is contained in:
		
				
					committed by
					
						
						Holger Hans Peter Freyther
					
				
			
			
				
	
			
			
			
						parent
						
							5763093285
						
					
				
				
					commit
					9cc771bd3d
				
			@@ -137,6 +137,8 @@ int ctrl_cmd_exec(vector vline, struct ctrl_cmd *command, vector node, void *dat
 | 
				
			|||||||
		if (cmd_el->verify) {
 | 
							if (cmd_el->verify) {
 | 
				
			||||||
			if ((ret = cmd_el->verify(command, command->value, data))) {
 | 
								if ((ret = cmd_el->verify(command, command->value, data))) {
 | 
				
			||||||
				ret = CTRL_CMD_ERROR;
 | 
									ret = CTRL_CMD_ERROR;
 | 
				
			||||||
 | 
									/* If verify() set an appropriate error message, don't change it. */
 | 
				
			||||||
 | 
									if (!command->reply)
 | 
				
			||||||
					command->reply = "Value failed verification.";
 | 
										command->reply = "Value failed verification.";
 | 
				
			||||||
				goto out;
 | 
									goto out;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user