3535import org .cesecore .util .EjbRemoteHelper ;
3636import org .ejbca .core .ejb .ra .raadmin .EndEntityProfileSessionRemote ;
3737import org .ejbca .core .model .authorization .AccessRulesConstants ;
38+ import org .ejbca .ui .cli .ca .CertificateImporter .Result ;
3839import org .ejbca .ui .cli .infrastructure .command .CommandResult ;
3940import org .ejbca .ui .cli .infrastructure .parameter .Parameter ;
4041import org .ejbca .ui .cli .infrastructure .parameter .ParameterContainer ;
@@ -254,6 +255,7 @@ public CommandResult execute(final ParameterContainer parameters) {
254255 final String [] sa = file .getName ().split ("!" );
255256 if (sa .length <3 ) {
256257 log .error ("ERROR: The revocation details are not found in filename '" +file .getName ()+"'. Ignoring this file." );
258+ results .add ( Result .GENERAL_IMPORT_ERROR );
257259 continue ;
258260 } else {
259261 // Process the REASON from 2nd last string in array
@@ -264,6 +266,7 @@ public CommandResult execute(final ParameterContainer parameters) {
264266 revocationReason = RevocationReasons .getFromDatabaseValue (iRevCode );
265267 if (revocationReason == null ) {
266268 log .error ("ERROR: '" + iRevCode + "' is not a valid revocation reason code. Ignoring this file '" +file .getName ()+"'." );
269+ results .add ( Result .GENERAL_IMPORT_ERROR );
267270 continue ;
268271 }
269272
@@ -281,7 +284,8 @@ public CommandResult execute(final ParameterContainer parameters) {
281284 revocationReason = RevocationReasons .getFromCliValue (sRevCode .toUpperCase ());
282285 if (revocationReason == null ) {
283286 log .error ("ERROR: '" + sRevCode + "' is not a valid revocation reason. Ignoring this file '" +file .getName ()+"'." );
284- continue ;
287+ results .add ( Result .GENERAL_IMPORT_ERROR );
288+ continue ;
285289 }
286290 }
287291
@@ -291,6 +295,7 @@ public CommandResult execute(final ParameterContainer parameters) {
291295 revocationTime = new SimpleDateFormat (DATE_FORMAT_WINSAFE ).parse ( sRevTime );
292296 } catch (ParseException e ) {
293297 log .error ("ERROR: '" + sRevTime + "' was not a valid revocation time. Use this time format '" +DATE_FORMAT_WINSAFE +"'. Ignoring this file '" +file .getName ()+"'." );
298+ results .add ( Result .GENERAL_IMPORT_ERROR );
294299 continue ;
295300 }
296301 }
0 commit comments