]> git.proxmox.com Git - swtpm.git/commitdiff
Show error message when not installing as root
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 20 Feb 2015 23:44:47 +0000 (18:44 -0500)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 20 Feb 2015 23:44:47 +0000 (18:44 -0500)
Only root can change the ownership of swtpm_setup.sh to tss:tss, so
only root can install the file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
src/swtpm_setup/Makefile.am

index 8c2f2f24f74b3ebbde51a595d4549a817de9dfed..77809d86042693d872be2a2205455e64b7fe338a 100644 (file)
@@ -12,6 +12,10 @@ swtpm_setup_SOURCES = swtpm_setup.c
 dist_bin_SCRIPTS = swtpm_setup.sh
 
 install-exec-hook:
+       @if test $$(id -u) != 0; then                                   \
+               echo "You must be root to install swtpm_setup.sh.";     \
+               exit 1;                                                 \
+       fi
        chown tss:tss $(DESTDIR)/$(bindir)/swtpm_setup.sh
        chmod 750 $(DESTDIR)/$(bindir)/swtpm_setup.sh