Skip to content

Tests: Usermod rename user, change password, lock password#1622

Open
aborah-sudo wants to merge 3 commits intoshadow-maint:masterfrom
aborah-sudo:usermode
Open

Tests: Usermod rename user, change password, lock password#1622
aborah-sudo wants to merge 3 commits intoshadow-maint:masterfrom
aborah-sudo:usermode

Conversation

@aborah-sudo
Copy link
Copy Markdown
Contributor

No description provided.

@aborah-sudo aborah-sudo changed the title Usermode Tests: Usermod rename user, change password, lock password Apr 30, 2026
Comment thread tests/system/tests/test_usermod.py Outdated
Comment thread tests/system/tests/test_usermod.py Outdated
Comment thread tests/system/tests/test_usermod.py Outdated
Comment thread tests/system/tests/test_usermod.py Outdated
Comment thread tests/system/tests/test_usermod.py Outdated
@aborah-sudo aborah-sudo force-pushed the usermode branch 7 times, most recently from 1df807b to 83bcf72 Compare April 30, 2026 10:54
@aborah-sudo aborah-sudo requested a review from ikerexxe April 30, 2026 11:03
Comment thread tests/system/tests/test_usermod.py Outdated
Comment thread tests/system/tests/test_usermod.py Outdated
Comment thread tests/system/tests/test_usermod.py
@aborah-sudo aborah-sudo force-pushed the usermode branch 6 times, most recently from d06e12d to 0611ed0 Compare May 4, 2026 09:05
Copy link
Copy Markdown
Collaborator

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you've chosen passlib over my suggestion to use hashlib. Can you help me understand the technical reasoning behind this choice? I want to make sure I understand the requirements correctly.

In addition, several commit messages mention usermode, but that's a different binary that isn't provided by shadow. Do you mind updating the commit messages to usermod?

Comment thread tests/system/tests/test_usermod.py Outdated
@aborah-sudo aborah-sudo force-pushed the usermode branch 2 times, most recently from ffd9848 to 02ace2b Compare May 6, 2026 01:39
This is the transformation to Python of the test located in
`tests/usertools/01/10_usermod_rename_user_in_group.test`
which checks that `usermod` can rename user who is member of a group
@aborah-sudo aborah-sudo force-pushed the usermode branch 2 times, most recently from 7f9d5a6 to e761230 Compare May 6, 2026 01:44
@aborah-sudo aborah-sudo requested a review from ikerexxe May 6, 2026 01:44
@ikerexxe
Copy link
Copy Markdown
Collaborator

ikerexxe commented May 7, 2026

I see we went back to the crypt module. To clarify, we cannot use crypt because it is removed in Python 3.13, and our code will break in the next update.

I also want to avoid passlib to keep our project lightweight without external dependencies.

Please implement this using hashlib. It is built into Python, secure, and future-proof. Does that make sense?

This is the transformation to Python of the test located in
`tests/usertools/01/11_usermod_change_password.test`
which checks that `usermod` can change user password
@aborah-sudo aborah-sudo force-pushed the usermode branch 2 times, most recently from 64b1e36 to 6d48bb4 Compare May 7, 2026 07:43
This is the transformation to Python of the test located in
`tests/usertools/01/11_usermod_lock_password.test`
which checks that `usermod` can lock user password
@aborah-sudo
Copy link
Copy Markdown
Contributor Author

I see we went back to the crypt module. To clarify, we cannot use crypt because it is removed in Python 3.13, and our code will break in the next update.

I also want to avoid passlib to keep our project lightweight without external dependencies.

Please implement this using hashlib. It is built into Python, secure, and future-proof. Does that make sense?

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants