Allow larger numbers for file descriptor names

This commit is contained in:
Paul Schaub 2022-11-14 13:54:08 +01:00
parent 1a381becfa
commit 00ab68b504
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -42,7 +42,7 @@ public abstract class AbstractSopCmd implements Runnable {
public static final Date BEGINNING_OF_TIME = new Date(0);
public static final Date END_OF_TIME = new Date(8640000000000000L);
public static final Pattern PATTERN_FD = Pattern.compile("^\\d{1,3}$");
public static final Pattern PATTERN_FD = Pattern.compile("^\\d{1,20}$");
protected final ResourceBundle messages;
protected EnvironmentVariableResolver envResolver = System::getenv;
@ -219,7 +219,7 @@ public abstract class AbstractSopCmd implements Runnable {
}
String fdNumber = fdString.substring(PRFX_FD.length());
if (!PATTERN_FD.matcher(fdNumber).matches()) {
throw new IllegalArgumentException("File descriptor must be a 1-3 digit, positive number.");
throw new IllegalArgumentException("File descriptor must be a positive number.");
}
File descriptor = new File(fdDir, fdNumber);
return descriptor;