Skip to contentSkip to conversation

secilc/docs: fix use of TMPDIR

PATCH Applied Topi Miettinen 3 participants 4 messages May 15, 2020 – Jun 1, 2020 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 secilc/docs: fix use of TMPDIR

Environment variable TMPDIR may be already set for the user building and this could be equal to $XDG_RUNTIME_DIR or /tmp which are existing directories. Then when running 'make clean', there are unintended side effects:

rm -rf /run/user/1000
rm: cannot remove '/run/user/1000/dconf/user': Permission denied
rm: cannot remove '/run/user/1000/systemd': Permission denied
rm: cannot remove '/run/user/1000/gnupg': Permission denied
rm: cannot remove '/run/user/1000/dbus-1': Is a directory
rm: cannot remove '/run/user/1000/inaccessible': Permission denied make[1]: *** [Makefile:68: clean] Error 1

Fix by always setting the variable.

---
 secilc/docs/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
secilc/docs/Makefile +5 -5
index 6b07ce7f..197ccef2 100644
@@ -1,8 +1,8 @@
-CWD ?= $(shell pwd)
-HTMLDIR ?= $(CWD)/html
-PDFDIR ?= $(CWD)/pdf
-TMPDIR ?= $(CWD)/tmp
-TESTDIR ?= $(CWD)/../test
+CWD = $(shell pwd)
+HTMLDIR = $(CWD)/html
+PDFDIR = $(CWD)/pdf
+TMPDIR = $(CWD)/tmp
+TESTDIR = $(CWD)/../test
 
 # All the markdown files that make up the guide:
 FILE_LIST ?= cil_introduction.md \
Signature · 1 line
2.26.2
Acked-by on v3 1/1
#1 lore raw
Quoted 13 lines · Topi Miettinen

Environment variable TMPDIR may be already set for the user building and this could be equal to $XDG_RUNTIME_DIR or /tmp which are existing directories. Then when running 'make clean', there are unintended side effects:

rm -rf /run/user/1000
rm: cannot remove '/run/user/1000/dconf/user': Permission denied
rm: cannot remove '/run/user/1000/systemd': Permission denied
rm: cannot remove '/run/user/1000/gnupg': Permission denied
rm: cannot remove '/run/user/1000/dbus-1': Is a directory
rm: cannot remove '/run/user/1000/inaccessible': Permission denied make[1]: *** [Makefile:68: clean] Error 1

Quoted 4 lines

Fix by always setting the variable.

Thanks!

Quoted 25 lines
---
 secilc/docs/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
secilc/docs/Makefile +5 -5
index 6b07ce7f..197ccef2 100644
@@ -1,8 +1,8 @@
-CWD ?= $(shell pwd)
-HTMLDIR ?= $(CWD)/html
-PDFDIR ?= $(CWD)/pdf
-TMPDIR ?= $(CWD)/tmp
-TESTDIR ?= $(CWD)/../test
+CWD = $(shell pwd)
+HTMLDIR = $(CWD)/html
+PDFDIR = $(CWD)/pdf
+TMPDIR = $(CWD)/tmp
+TESTDIR = $(CWD)/../test
 
 # All the markdown files that make up the guide:
 FILE_LIST ?= cil_introduction.md \
Signature · 1 line
2.26.2
Signature · 2 lines
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments
maintainer
#2 lore raw
Quoted 15 lines · Petr Lautrbach
Quoted 13 lines · Topi Miettinen

Environment variable TMPDIR may be already set for the user building and this could be equal to $XDG_RUNTIME_DIR or /tmp which are existing directories. Then when running 'make clean', there are unintended side effects:

rm -rf /run/user/1000
rm: cannot remove '/run/user/1000/dconf/user': Permission denied
rm: cannot remove '/run/user/1000/systemd': Permission denied
rm: cannot remove '/run/user/1000/gnupg': Permission denied
rm: cannot remove '/run/user/1000/dbus-1': Is a directory
rm: cannot remove '/run/user/1000/inaccessible': Permission denied make[1]: *** [Makefile:68: clean] Error 1

Quoted 6 lines
Quoted 4 lines

Fix by always setting the variable.

Should I merge this or do you have it?

#3 lore raw
Quoted 16 lines · Stephen Smalley
Quoted 15 lines · Petr Lautrbach
Quoted 13 lines · Topi Miettinen

Environment variable TMPDIR may be already set for the user building and this could be equal to $XDG_RUNTIME_DIR or /tmp which are existing directories. Then when running 'make clean', there are unintended side effects:

rm -rf /run/user/1000
rm: cannot remove '/run/user/1000/dconf/user': Permission denied
rm: cannot remove '/run/user/1000/systemd': Permission denied
rm: cannot remove '/run/user/1000/gnupg': Permission denied
rm: cannot remove '/run/user/1000/dbus-1': Is a directory
rm: cannot remove '/run/user/1000/inaccessible': Permission denied make[1]: *** [Makefile:68: clean] Error 1

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

Fix by always setting the variable.

Should I merge this or do you have it?

Applied.

Sorry for the delay.