[PATCH v2] Mount /tmp as tmpfs in test-container and run utime tests in it

DJ Delorie dj@redhat.com
Wed Mar 10 01:32:09 GMT 2021


Arjun Shankar <arjun.is@lostca.se> writes:
> -#define DSO_DIR "/tmp/tst-ldconfig"
> +#define DSO_DIR "/tst-ldconfig"
> -  if (rename (mod_src_path, "/tmp/tst-ldconfig/libldconfig-ld-mod.so"))
> +  if (rename (mod_src_path, DSO_DIR "/libldconfig-ld-mod.so"))

The net effect here is to just change the temporary directory we put the
DSO in, because we can't "rename" across filesystems.  Ok.

> -  maybe_xmkdir ("/tmp", 0755);
> +  maybe_xmkdir ("/tmp", 1777);

This change should be unneeded?  It creates a directory visible only
outside the container, which is world writable :-( Do we need this
change?  What perms does the tmpfs end up with?

(yes, I see we already use 0777 below ;)

> +  if (mount ("none", "/tmp", "tmpfs", MS_NOEXEC | MS_NOSUID | MS_NODEV, NULL) < 0)
> +    FAIL_EXIT1 ("can't mount tmpfs onto /tmp\n");

/tmp needs to be tmpfs inside the container, ok.

> -	 tst-timerfd tst-ppoll tst-futimens tst-utime tst-utimes \
> +	 tst-timerfd tst-ppoll tst-clock_adjtime tst-adjtimex tst-ntp_adjtime

> -	 tst-clock_adjtime tst-adjtimex tst-ntp_adjtime
> +
> +tests-container += tst-futimens tst-utime tst-utimes

Moves three tests, ok.

LGTM but I have no opinion on the "we should test broken kernel
interfaces" debate ;-)

Reviewed-by: DJ Delorie <dj@redhat.com>



More information about the Libc-alpha mailing list