holgerBerger / hpc-workspace

Automatically exported from code.google.com/p/hpc-workspace
GNU General Public License v3.0
18 stars 13 forks source link

Workspace allocation with existing prefix changes parent directory #32

Closed casio888 closed 3 years ago

casio888 commented 4 years ago

When a prefix for the workspaces is set, the allocation changes the owner and grouup to the user's values to create a new directory. However, it does not change these back, so after allocating a workspace, a user owns the whole ws directory.

The uid in our code are hardcoded. It would be cleaner to catch them before changing them, holding them in variables and applying them from the variable.

Our fix is this part of code inserted into line 338 of src/ws.cpp:

if(prefix.length()>0) {  // in case we have a prefix, we change owner of that one back
    chown(wsdir_nopostfix.c_str(), 11, 4);
}
holgerBerger commented 4 years ago

hmmmmm. why change the prefix dir in the first place? I wonder why this is done...

Am Do., 12. Dez. 2019 um 09:41 Uhr schrieb casio888 < notifications@github.com>:

When a prefix for the workspaces is set, the allocation changes the owner and grouup to the user's values to create a new directory. However, it does not change these back, so after allocating a workspace, a user owns the whole ws directory.

The uid in our code are hardcoded. It would be cleaner to catch them before changing them, holding them in variables and applying them from the variable.

Our fix is this part of code inserted into line 338 of src/ws.cpp:

if(prefix.length()>0) { // in case we have a prefix, we change owner of that one back chown(wsdir_nopostfix.c_str(), 11, 4); }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/holgerBerger/hpc-workspace/issues/32?email_source=notifications&email_token=ADEY2AUNW5F7DHXJF73F7HDQYH2JPA5CNFSM4JZ24HP2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H77NEYQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEY2AUFZU3YY2OYVG6GGL3QYH2JPANCNFSM4JZ24HPQ .

holgerBerger commented 4 years ago

I can not reproduce that problem actually, can you provide some output showing what exactly happens?

Am Do., 12. Dez. 2019 um 09:41 Uhr schrieb casio888 < notifications@github.com>:

When a prefix for the workspaces is set, the allocation changes the owner and grouup to the user's values to create a new directory. However, it does not change these back, so after allocating a workspace, a user owns the whole ws directory.

The uid in our code are hardcoded. It would be cleaner to catch them before changing them, holding them in variables and applying them from the variable.

Our fix is this part of code inserted into line 338 of src/ws.cpp:

if(prefix.length()>0) { // in case we have a prefix, we change owner of that one back chown(wsdir_nopostfix.c_str(), 11, 4); }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/holgerBerger/hpc-workspace/issues/32?email_source=notifications&email_token=ADEY2AUNW5F7DHXJF73F7HDQYH2JPA5CNFSM4JZ24HP2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H77NEYQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEY2AUFZU3YY2OYVG6GGL3QYH2JPANCNFSM4JZ24HPQ .

holgerBerger commented 3 years ago

I think this was fixed meanwhile.