Re: [PATCH v2] t4129: don't fail if setgid is set in the test directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matheus Tavares <matheus.bernardino@xxxxxx> writes:

> +# Get the modebits from a file or directory, ignoring the setgid bit (g+s).
> +# This bit is inherited by subdirectories at their creation. So we remove it
> +# from the returning string to prevent callers from having to worry about the
> +# state of the bit in the test directory.
> +#

We probably do not use "chmod g+s" manually on regular files, so I
may be being overly "correct", but shouldn't these be done only for
directories?

>  test_modebits () {
> -	ls -ld "$1" | sed -e 's|^\(..........\).*|\1|'
> +	ls -ld "$1" | sed -e 's|^\(..........\).*|\1|' \
> +			  -e 's|^\(......\)S|\1-|' -e 's|^\(......\)s|\1x|'

That is, 

			  -e 's|^\(d.....\)S|\1-|' -e 's|^\(d.....\)s|\1x|'

instead of applying the rule to any filetype.

Will queue as-is, as the distinction probably would not matter in
practice.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux