Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JFrog CLI fails, if there is a directory /tmp/jfrog, which is not owned by the current user #2630

Open
adityaramesh7 opened this issue Jul 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@adityaramesh7
Copy link

Describe the bug

The JFrog CLI fails to execute if a directory named /tmp/jfrog is not owned by the current user. When User A, who has full access to the directory, runs the jf bce command, it executes successfully. However, when User B, who only has read and execute permissions, attempts to run the same command, a "permission denied" error occurs.

Current behavior

su - user1
Last login: Tue Jul 30 12:53:12 UTC 2024 on pts/0
[user1@adityar-centos9 ~]$ cd /tmp/jfrog/
[user1@adityar-centos9 jfrog]$ export JFROG_CLI_LOG_LEVEL="DEBUG"
[user1@adityar-centos9 jfrog]$ jf rt bce a b
06:55:33 [Debug] JFrog CLI version: 2.61.2
06:55:33 [Debug] OS/Arch: linux/amd64
06:55:33 [Debug] Trace ID for JFrog Platform logs: b8e78780db418691
06:55:33 [🔵Info] Collecting environment variables...
06:55:33 [Debug] Reading build general details from: /tmp/jfrog/builds/0d95fb310c002d398282654740a3ee422ddf14b11a8d0bb8df04af14199b33a1/partials
06:55:33 [Debug] No servers were configured.
06:55:33 [Debug] Creating temp build file at: /tmp/jfrog/builds/0d95fb310c002d398282654740a3ee422ddf14b11a8d0bb8df04af14199b33a1/partials
06:55:33 [🔵Info] Collected environment variables for a/b.
su - user2
Last login: Tue Jul 30 12:53:35 UTC 2024 on pts/0
[user2@adityar-centos9 ~]$ cd /tmp/jfrog/
[user2@adityar-centos9 jfrog]$ export JFROG_CLI_LOG_LEVEL="DEBUG"
[user2@adityar-centos9 jfrog]$ jf rt bce e x
06:57:04 [Debug] JFrog CLI version: 2.61.2
06:57:04 [Debug] OS/Arch: linux/amd64
06:57:04 [Debug] Trace ID for JFrog Platform logs: df3b05cf60c21c83
06:57:04 [🔵Info] Collecting environment variables...
06:57:04 [Debug] No servers were configured.
06:57:04 [🔵Info] Trace ID for JFrog Platform logs: df3b05cf60c21c83
06:57:04 [🚨Error] mkdir /tmp/jfrog/builds/1095ef206c3342b07180cb508f4c82dbd8283acc96134d3f5f0b31a24c2f3559: permission denied

Reproduction steps

On Linux Host (tested on Centos 9)
mkdir /tmp/jfrog
adduser user1
adduser user2
chown user1 /tmp/jfrog

$ ls -lartd /tmp/jfrog/
drwxr-xr-x. 3 user1 root 20 Jul 18 14:07 /tmp/jfrog/

user A: $ su - user1
$ cd /tmp/jfrog
$ jf rt bce a b
14:07:53 [:large_blue_circle:Info] Collecting environment variables...
14:07:53 [:large_blue_circle:Info] Collected environment variables for a/b.

user B: $ su - user2
$ jf rt bce e x
14:08:24 [:large_blue_circle:Info] Collecting environment variables...
14:08:24 [:rotating_light:Error] mkdir /tmp/jfrog/builds/1095ef206c3342b07180cb508f4c82dbd8283acc96134d3f5f0b31a24c2f3559: permission denied

Expected behavior

Executing the command jf rt bce e x does not inherently require write privileges in the current directory because the primary function of this command is to collect environment variables related to a build and send them to JFrog Artifactory.

JFrog CLI version

2.61.2

Operating system type and version

Linux - Centos9

JFrog Artifactory version

No response

JFrog Xray version

No response

@adityaramesh7 adityaramesh7 added the bug Something isn't working label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant