-
Notifications
You must be signed in to change notification settings - Fork 63
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
Adding new user - no user directory created #4255
Comments
I believe the script is called when the user logs in? |
Nope and why? This needs only be done once and not every time a user log in. |
If you use LDAP, the user must first have been written into LDAP so that the operating system knows him. Otherwise |
Sorry, I have a different opinion to this issue: on creating a new user an user home directory should be created independent if you use LDAP or not. If you use LDAP than adding this user to LDAP should be done between creating database entry and creating user home directory. If on every login the user home directory is checked if existing or not than this is for me a big waste of time and resources. Last sentence: even without using LDAP and logging in as this user the user home directory is currently not created! |
Well, but in the script |
Perhaps we then need two different scripts, one that runs when the user is created and one that runs when the user is written to LDAP. I agree that this doesn't have to be the case every time you log in. And we have to keep the script that runs at login because there is probably some facility out there that is misusing it for something else. |
You can do this with one script if you call the script after the user is added to the database (which is needed in any way) and optional written into the LDAP. I don't know: should the default provided scripts for running out of box without any modification for database only usage, LDAP usage or both? If they should support both then you need more logic into the scripts as a database only usage did need other chown calls than a LDAP usage. You can even add a new parameter to the scripts which is informing the scripts if the use is a database only or ldap user. You can even miss this new parameter if you use a Linux / unix call to get the information (maybe through a
Which script? Currently there is no script and even in 2.x there is no such kind of script called at log in of a user. Why you want to add such kind of script which is not needed or tell me the use case where such kind of script is needed. |
You can then still have the two scripts variables point to the same script physical. I think it's basically stupid that the default-provided script doesn't work in any environment, but you always have to adapt it, for example with For this I wrote #3328, that is a directory structure that is there and then everything is in it that you need first of all. That would be my idea, but like so often my ideas, nobody cares. |
Because the scripts are to simple to work in any environment. They are basically from 1.x and never get touched because any user in the past modified it in any way to his local environment. If you really want to make them to work out of the box in any environment then you must put a lot more logic into them but this make them harder to maintain as there is not one environment out there. So I would suggest to include the basic idea of the script usage (which parameters it gets) and what the script should do (f.e. creating a directory and maybe assign right user rights to this created directory) but not with explicit commands which maybe not work everywhere.
Your suggestion is not bad but not related to this issue as your suggestion is for the structure of the repository and not for the used script files and where they should be stored nor their content. |
I would suggest removing the scripts and implementing the basic functionality in the application. In addition, scripts can optionally be called at various points if you want additional functionality. Otherwise, whoever completely deviates, should implement their own filesystem management module. |
No way. If this scripts would get removed I lost the control about the application!
Where should this scripts called? You need additional functionality for calling them in the right places like now. F.e. call of the script for linking into the user home directory must be done in this place and not after the application has done something which did not work in a specific environment. Or like creating the meta data directories: for most of the users they could "life" with a flat directory system but if you have a lot of directories with even more data (1 TB per process f.e.) then you may have a little bit other directory structure in the background and do some things only to look like a flat directory structure.
As long as the file management module (like other modules too) is in this repository you must maintain a fork of the whole project instead only one module. Even then the core application did calling not in any case the file management module for creating directories and / or files and doing it with direct Java calls instead of delegating this to the file management module. |
Maybe that's a fundamental problem: Should you have control over the program, or should the program (as long as you don't change it) have control over its data? There are good arguments for both sides.
I meant these three scripts as replacements for the one
Yes, that's it. As long as you don't touch the rest of it, it should come to the same thing.
These cases need to be identified and I consider them to be bugs that need to be fixed! |
Why did you need this? What did you want to archive with a script call at log in? |
Assume that the user password is not stored in the database in a decipherable manner, but only as a hash. “Write user in LDAP” function is then not available at anytime. It requires the password in clear text. The function can only be carried out after entering the password, and that is when logging in. However, the user is being registered in LDAP, is a prerequisite for the Linux operating system to recognize the username for the chown command. The user is made known to the operating system from LDAP through PAM-LDAP. So it depends, and it can only be done in that order. |
Maybe I have a to simple idea how this should work if a new user get stored:
If in 1), 2) or 3) an error happened did not go further into this creation workflow and report the user in the ui the error message. |
Yes, the idea is too simple. The goal is precisely not to save the user's password in the database, but only an irreversible hash. But this is the topic of #4576 now. Sorry, I got confused between the issues yesterday. Back to your initial question/bug report: The script_createDirUserHome is currently not called when creating the user, but when the LDAP user is created (if LDAP is used, the reason is In our current set-up, it seems to be working. Can you please check in which the four cases it doesn’t work for you that the script is not executed? Notes:
|
On adding a new user no user home directory is created in this creation process. In
kitodo_config.properties
defined scriptscript_createDirUserHome
is not called once.The text was updated successfully, but these errors were encountered: