kyuubi/bin
Cheng Pan 1e38f97480
[KYUUBI #6588] Get effective USER if env var is unavailable
# 🔍 Description

In some cases, env var USER is unavailable, for example, docker container, we should evaluate it via `id -nu`

ref: https://github.com/apache/hadoop/blob/rel/release-3.4.0/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh#L893-L896

## Types of changes 🔖

- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

```
$ docker run -t -i ubuntu:latest
root1dbeaefd6cd4:/# echo $USER

root1dbeaefd6cd4:/# id -nu
root
root1dbeaefd6cd4:/# exit
```

---

# Checklist 📝

- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes #6588 from pan3793/USER.

Closes #6588

a79786347 [Cheng Pan] Get effective USER if env var is unavailable

Authored-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit b90063942a)
Signed-off-by: Cheng Pan <chengpan@apache.org>
2024-08-07 17:45:06 +08:00
..
beeline [KYUUBI #5987] Enhance KYUUBI_HOME detection in shell script to handle softlink cases 2024-01-17 18:00:17 +08:00
docker-image-tool.sh [KYUUBI #6175] [MINOR] Refactor copy path about SPARK_HOME in docker 2024-03-13 11:16:57 +08:00
kyuubi [KYUUBI #6588] Get effective USER if env var is unavailable 2024-08-07 17:45:06 +08:00
kyuubi-admin [KYUUBI #5987] Enhance KYUUBI_HOME detection in shell script to handle softlink cases 2024-01-17 18:00:17 +08:00
kyuubi-ctl [KYUUBI #5987] Enhance KYUUBI_HOME detection in shell script to handle softlink cases 2024-01-17 18:00:17 +08:00
kyuubi-logo [KYUUBI #4078] [FOLLOWUP] fix shellcheck violations in scripts of /bin folder 2023-03-07 10:32:27 +08:00
kyuubi-zk-cli [KYUUBI #5987] Enhance KYUUBI_HOME detection in shell script to handle softlink cases 2024-01-17 18:00:17 +08:00
load-kyuubi-env.sh [KYUUBI #5987] Always export KYUUBI_HOME in load-kyuubi-env.sh 2024-01-22 21:32:33 +08:00
stop-application.sh [KYUUBI #4078] [FOLLOWUP] fix shellcheck violations in scripts of /bin folder 2023-03-07 10:32:27 +08:00