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

Environment file does not respect all.adminpath #2106

Closed
amadio opened this issue Oct 13, 2023 · 2 comments
Closed

Environment file does not respect all.adminpath #2106

amadio opened this issue Oct 13, 2023 · 2 comments
Assignees
Milestone

Comments

@amadio
Copy link
Member

amadio commented Oct 13, 2023

In https://xrootd.slac.stanford.edu/doc/dev561/xrd_config.htm#_Toc135684283, the docs say that the environment file should be opened inside all.adminpath. However, in code, /tmp is hard-coded:

xrootd/src/Xrd/XrdConfig.cc

Lines 1057 to 1061 in e7cf81f

//
if (pidfn && (Slash = rindex(pidfn, '/')))
{strncpy(manBuff, pidfn, Slash-pidfn); pidP = manBuff+(Slash-pidfn);}
else {strcpy(manBuff, "/tmp"); pidP = manBuff+4;}

I made a change for "fixing" this, in case it should indeed respect all.adminpath. I found this out because I saw test failures after running the newly added tests as different users on my machine. They both wanto create /tmp/xrootd.anon.env, but in the second attempt, it already exists and is owned by someone else, which makes xrootd fail to initialize.

Proposed solution:

--- a/src/Xrd/XrdConfig.cc
+++ b/src/Xrd/XrdConfig.cc
@@ -1058,7 +1058,7 @@ void XrdConfig::Manifest(const char *pidfn)
 //
    if (pidfn && (Slash = rindex(pidfn, '/')))
       {strncpy(manBuff, pidfn, Slash-pidfn); pidP = manBuff+(Slash-pidfn);}
-      else {strcpy(manBuff, "/tmp");         pidP = manBuff+4;}
+      else {strcpy(manBuff, ProtInfo.AdmPath); pidP = manBuff+strlen(ProtInfo.AdmPath);}
 

Tested and it works to make the env file appear inside all.adminpath instead of /tmp.

@amadio amadio added this to the 5.6.3 milestone Oct 13, 2023
@abh3
Copy link
Member

abh3 commented Oct 16, 2023 via email

@amadio
Copy link
Member Author

amadio commented Oct 17, 2023

@abh3, ok, great. I will merge this into 5.6.3 then. Cheers,

amadio added a commit to amadio/xrootd that referenced this issue Oct 20, 2023
amadio added a commit to amadio/xrootd that referenced this issue Oct 20, 2023
amadio added a commit to amadio/xrootd that referenced this issue Oct 20, 2023
amadio added a commit to amadio/xrootd that referenced this issue Oct 26, 2023
amadio added a commit to amadio/xrootd that referenced this issue Oct 26, 2023
@amadio amadio closed this as completed in ccc8ab7 Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants