Skip to content
Snippets Groups Projects
Commit d97413e8 authored by Jerome Forissier's avatar Jerome Forissier Committed by Jérôme Forissier
Browse files

buildroot: run tee-supplicant as non-root


Create user and group tee/tee and set the proper permissions on /dev/tee*
and /data/tee so that tee-supplicant and the client applications may be
run as a non-root user.

Signed-off-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
parent 0a9644da
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,14 @@
case "$1" in
start)
if [ -e /usr/sbin/tee-supplicant -a -e /dev/teepriv0 ]; then
# tee-supplicant and the client applications need not run as
# root provided that the TEE devices and the data store have
# proper permissions
printf "Setting permissions on /dev/tee*... "
chown root:tee /dev/tee* && chmod 0660 /dev/tee*
[ $? = 0 ] && echo "OK" || echo "FAIL"
printf "Starting tee-supplicant... "
/usr/sbin/tee-supplicant -d
su tee -c '/usr/sbin/tee-supplicant -d'
[ $? = 0 ] && echo "OK" || echo "FAIL"
else
echo "tee-supplicant or TEE device not found"
......
......@@ -17,4 +17,13 @@ define OPTEE_CLIENT_INSTALL_INIT_SYSV
$(OPTEE_CLIENT_INSTALL_SUPPLICANT_SCRIPT)
endef
define OPTEE_CLIENT_USERS
tee -1 tee -1 * - /bin/sh - TEE user
endef
define OPTEE_CLIENT_PERMISSIONS
/data d 755 root root - - - - -
/data/tee d 770 tee tee - - - - -
endef
$(eval $(cmake-package))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment