Re: [PATCH v2 3/3] t: add tests for safe.directory when running with sudo
- From
Carlo Arenas <carenas@gmail.com>
- Date
- Apr 28, 2022, 20:56 UTC
- Message-ID
- <CAPUEspgcd1CYTfL=ug3WtnOrJscWbyQXeF-2SQ_24KcCTkuRkA@mail.gmail.com>
- In-Reply-To
- <000801d85b40$ac11ec80$0435c580$@nexbridge.com>
On Thu, Apr 28, 2022 at 1:43 PM <rsbecker@nexbridge.com> wrote:
> I tried to find is_root in POSIX but could not. Do you have a reference? It is not in bash 4.3.48, which is on our older system.
my bad; is_root is a helper function i provided as part of this file; the latest version which should work in your posix system AND was specifically written to hopefully not break with NON-STOP based on what you told us about it looks like (hand edited and not tested) :
is_root() {
id -u >u
id -u root >r
cmp u r
}