tpm2-software / tpm2-totp

Attest the trustworthiness of a device against a human using time-based one-time passwords
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
159 stars 35 forks source link

udev error in bootlog when using dracut + plymouth #65

Closed simonfxr closed 4 years ago

simonfxr commented 4 years ago

I just tested this package in a fresh Fedora 31 VM (KVM and swtpm). In the bootlog (journalctl -b) I found this line:

Dec 22 11:11:19 localhost.localdomain systemd-udevd[407]: /etc/udev/rules.d/80-tpm2-totp.rules:1 Invalid value "/sbin/initqueue --settled --onetime /bin/show-tpm2-totp & show_tpm2_totp_pid=$!" for RUN (char 79: invalid substitution type),ignoring, but please fix it.

The strange thing is, it works! I see the correct totp code on the screen. I built tmpm2-totp from git, following the README.

diabonas commented 4 years ago

Thank you for the report! I don't see this warning on my own system, but from reading the udev rules files syntax, I guess it means that $ should be escaped as $$. I have posted a candidate fix as #66. Could you please test this pull request to see whether the TOTP is shown without the warning in the log? Also please run ps ax | grep totp immediately after the system is booted up to see whether show-tpm2-totp is killed correctly: if not, you would see a line similar to

534 ?        S      0:00 /bin/sh /bin/show-tpm2-totp

in the output.

simonfxr commented 4 years ago

@diabonas Thank you for the quick fix, now everything seems to work properly! The udev error is gone and the ps output shows nothing related to totp.

diabonas commented 4 years ago

Awesome, thanks for testing! I have merged the fix and will include it in the upcoming 0.2.1 release as well.