diff mbox series

[v3] secilc/docs: fix use of TMPDIR

Message ID 20200515114111.11428-1-toiwoton@gmail.com (mailing list archive)
State Accepted
Headers show
Series [v3] secilc/docs: fix use of TMPDIR | expand

Commit Message

Topi Miettinen May 15, 2020, 11:41 a.m. UTC
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.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Suggested-by: Petr Lautrbach <plautrba@redhat.com>
---
 secilc/docs/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Petr Lautrbach May 15, 2020, 1:35 p.m. UTC | #1
On Fri, May 15, 2020 at 02:41:11PM +0300, Topi Miettinen wrote:
> 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.
> 
> Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
> Suggested-by: Petr Lautrbach <plautrba@redhat.com>

Acked-by: Petr Lautrbach <plautrba@redhat.com>

Thanks!

> ---
>  secilc/docs/Makefile | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/secilc/docs/Makefile b/secilc/docs/Makefile
> index 6b07ce7f..197ccef2 100644
> --- a/secilc/docs/Makefile
> +++ b/secilc/docs/Makefile
> @@ -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 \
> -- 
> 2.26.2
>
Stephen Smalley May 29, 2020, 1:03 p.m. UTC | #2
On Fri, May 15, 2020 at 9:36 AM Petr Lautrbach <plautrba@redhat.com> wrote:
>
> On Fri, May 15, 2020 at 02:41:11PM +0300, Topi Miettinen wrote:
> > 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.
> >
> > Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
> > Suggested-by: Petr Lautrbach <plautrba@redhat.com>
>
> Acked-by: Petr Lautrbach <plautrba@redhat.com>

Should I merge this or do you have it?
Petr Lautrbach June 1, 2020, 8:43 a.m. UTC | #3
On Fri, May 29, 2020 at 09:03:44AM -0400, Stephen Smalley wrote:
> On Fri, May 15, 2020 at 9:36 AM Petr Lautrbach <plautrba@redhat.com> wrote:
> >
> > On Fri, May 15, 2020 at 02:41:11PM +0300, Topi Miettinen wrote:
> > > 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.
> > >
> > > Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
> > > Suggested-by: Petr Lautrbach <plautrba@redhat.com>
> >
> > Acked-by: Petr Lautrbach <plautrba@redhat.com>
> 
> Should I merge this or do you have it?
> 

Applied.

Sorry for the delay.
diff mbox series

Patch

diff --git a/secilc/docs/Makefile b/secilc/docs/Makefile
index 6b07ce7f..197ccef2 100644
--- a/secilc/docs/Makefile
+++ b/secilc/docs/Makefile
@@ -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 \