]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: always recommend saving the output to a file
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 20 Feb 2024 17:14:53 +0000 (18:14 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 20 Feb 2024 19:35:58 +0000 (19:35 +0000)
The command will refuse to write to a TTY, so give a strong hint
that redirecting to a file is recommended. This makes the synopsis,
man page text, and --help output consistent.

Also drop the space after the redirection operator everywhere.

man/systemd-analyze.xml
src/analyze/analyze.c

index db14038bfbcf10301222c2e6396f9226d9654d96..639a7231cb21eff922333ad00a190fa38ef8c5d6 100644 (file)
       <command>systemd-analyze</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
       <arg choice="plain">srk</arg>
+      <arg choice="opt"><replaceable>&gt;FILE</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>systemd-analyze</command>
@@ -939,12 +940,17 @@ NR NAME                SHA256
     </refsect2>
 
     <refsect2>
-      <title><command>systemd-analyze srk &gt; <replaceable>FILE</replaceable></command></title>
+      <title><command>systemd-analyze srk <optional>&gt;<replaceable>FILE</replaceable></optional></command></title>
 
       <para>This command reads the Storage Root Key (SRK) from the TPM2 device, and writes it in marshalled
-      TPM2B_PUBLIC format to stdout. Example:</para>
+      TPM2B_PUBLIC format to stdout. The output is non-printable data, so it should be redirected to a file
+      or into a pipe.</para>
 
-      <programlisting>systemd-analyze srk &gt; srk.tpm2b_public</programlisting>
+      <example>
+        <title>Save the Storage Root Key to <filename>srk.tpm2b_public</filename></title>
+
+        <programlisting>systemd-analyze srk &gt;srk.tpm2b_public</programlisting>
+      </example>
     </refsect2>
 
     <refsect2>
index 49b4c3b8cc16236899dfcaa3ba425c8a9e2072c2..ea906c7bfeb57b29b69735caaf3f643241752898 100644 (file)
@@ -240,7 +240,7 @@ static int help(int argc, char *argv[], void *userdata) {
                "  fdstore SERVICE...         Show file descriptor store contents of service\n"
                "  image-policy POLICY...     Analyze image policy string\n"
                "  pcrs [PCR...]              Show TPM2 PCRs and their names\n"
-               "  srk > FILE                 Write TPM2 SRK to stdout\n"
+               "  srk [>FILE]                Write TPM2 SRK (to FILE)\n"
                "\nOptions:\n"
                "     --recursive-errors=MODE Control which units are verified\n"
                "     --offline=BOOL          Perform a security review on unit file(s)\n"