tpm2-setup: use symbolic exit code
76 is the bsd exit code EX_PROTOCOL, which is kinda fitting here. Let#s hence use the symbolic exit code here.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <getopt.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sysexits.h>
|
||||
|
||||
#include "sd-messages.h"
|
||||
|
||||
@@ -291,8 +292,8 @@ static int setup_srk(void) {
|
||||
log_struct_errno(LOG_INFO, r,
|
||||
LOG_MESSAGE("Insufficient permissions to access TPM, not generating SRK."),
|
||||
LOG_MESSAGE_ID(SD_MESSAGE_SRK_ENROLLMENT_NEEDS_AUTHORIZATION_STR));
|
||||
return 76; /* Special return value which means "Insufficient permissions to access TPM,
|
||||
* cannot generate SRK". This isn't really an error when called at boot. */;
|
||||
return EX_PROTOCOL; /* Special return value which means "Insufficient permissions to access TPM,
|
||||
* cannot generate SRK". This isn't really an error when called at boot. */;
|
||||
}
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -22,5 +22,5 @@ Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart={{LIBEXECDIR}}/systemd-tpm2-setup --early=yes --graceful
|
||||
|
||||
# The tool returns 76 if the TPM cannot be accessed due to an authorization failure and we can't generate an SRK.
|
||||
SuccessExitStatus=76
|
||||
# The tool returns EX_PROTOCOL if the TPM cannot be accessed due to an authorization failure and we can't generate an SRK.
|
||||
SuccessExitStatus=PROTOCOL
|
||||
|
||||
@@ -23,5 +23,5 @@ Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart={{LIBEXECDIR}}/systemd-tpm2-setup --graceful
|
||||
|
||||
# The tool returns 76 if the TPM cannot be accessed due to an authorization failure and we can't generate an SRK.
|
||||
SuccessExitStatus=76
|
||||
# The tool returns EX_PROTOCOL if the TPM cannot be accessed due to an authorization failure and we can't generate an SRK.
|
||||
SuccessExitStatus=PROTOCOL
|
||||
|
||||
Reference in New Issue
Block a user