Commit Graph
98 Commits
Author SHA1 Message Date
dietrich 70ee27a246 replace println! with trace! 2020-11-30 15:17:24 +01:00
dietrich 1e5a95a9f6 fix warnings 2020-11-30 13:21:22 +01:00
dietrich df2f51a24e add license 2020-11-29 17:35:24 +01:00
dietrich 80a41fc1a2 updating group membership on user deletion
until now groups had members without useraccount after the account has been deleted.

fixes: #5
2020-11-27 17:32:41 +01:00
dietrich e9fbbd91ce Enum to discriminate primary and reg. memberships 2020-11-24 19:20:48 +01:00
dietrich 93e958108b better tests for groups 2020-11-19 09:34:49 +01:00
dietrich 8b42c8c3b2 add group members 2020-11-19 09:14:00 +01:00
dietrich 65542c9b69 make Group a Rc<Inner> type 2020-11-17 07:53:49 +01:00
dietrich 98b1634924 adding new title 2020-11-16 14:35:06 +01:00
dietrich e5583bb378 add summary 2020-11-16 14:21:16 +01:00
dietrich 36f5e51811 updating dependencies 2020-11-16 14:13:25 +01:00
dietrich 0a1bb3bd7e fix clippy warning 2020-11-16 13:08:37 +01:00
dietrich 10d9e3e71e right parameters 2020-11-16 13:04:16 +01:00
dietrich 3583d89697 fix indentation 2020-11-16 12:57:23 +01:00
dietrich c056016d43 add clippy info 2020-11-16 12:52:12 +01:00
dietrich 5a678bc3d5 renaming the project adduser -> umanux 2020-11-16 10:37:18 +01:00
dietrich 05cbd2d139 better 2020-11-16 09:14:40 +00:00
dietrich 425de573d5 update readme 2020-11-16 10:12:51 +01:00
dietrich e13a81f814 use +nightly (#2)
* use +nightly
2020-11-16 08:46:34 +01:00
dietrich 95ce925286 Merge pull request #1 from umanux/enaut-add-rust-workflow
Add rust workflow
2020-11-16 08:11:18 +01:00
dietrich 60e6eb6fa4 Add rust workflow 2020-11-16 08:11:00 +01:00
dietrich 3dae3c4109 modify the shadow file and test the binary 2020-11-15 17:04:31 +01:00
dietrich ed77466bd6 add default shadow entry to default users 2020-11-15 17:02:35 +01:00
dietrich 32d02dcc81 add parameters for files to create_user 2020-11-15 17:01:47 +01:00
dietrich c21ba2fa39 return from main function 2020-11-11 08:20:09 +01:00
dietrich f7fc3229ed optimize release builds for size 2020-11-11 06:58:17 +01:00
dietrich 101dcbb649 first binary test not complete 2020-11-11 06:57:46 +01:00
dietrich de17ff12be first version of create_user 2020-11-10 13:45:21 +01:00
dietrich ed06c58913 remove debug and commented code 2020-11-09 20:25:42 +01:00
dietrich 8fcd32eca2 Fix missing lints - Docs need to be improved still 2020-11-09 13:58:13 +01:00
dietrich 467c8ee007 linting changes 2020-11-09 09:56:24 +01:00
dietrich 647881f022 Adding a first integrationtest for delete_user 2020-11-08 10:41:20 +01:00
dietrich 732893b5d4 first integration test try 2020-11-05 09:01:51 +01:00
dietrich 4062f7a6bb delete the home directory 2020-11-03 13:09:16 +01:00
dietrich f3a18641e0 make delete_user take a struct use derive_builder 2020-11-02 07:55:33 +01:00
dietrich 31fbfbe628 remove from groups 2020-10-31 16:40:26 +01:00
dietrich b72f292891 improve functionlength 2020-10-31 15:55:15 +01:00
dietrich d9fe8b8160 improve error handling 2020-10-31 11:15:29 +01:00
dietrich 6389bb988d actually remove the shadow line and fix a final newline 2020-10-30 19:45:41 +01:00
dietrich bacbfae4d1 delete the shadow entry along with the passwd one 2020-10-30 19:09:56 +01:00
dietrich 4207e1dc0f split Hashes into sepparate module 2020-10-30 16:37:57 +01:00
dietrich 8dd2c53aa9 sepparate Files struct 2020-10-30 16:26:31 +01:00
dietrich 8337c737d9 make userlib module a directory 2020-10-30 16:13:05 +01:00
dietrich 1af8a7cd65 Add better error handling 2020-10-30 08:39:59 +01:00
dietrich bf6908346e first draft of working user deletion
TODO:
  * remove user group
  * remove shadow entry
2020-10-28 09:39:42 +01:00
dietrich b8c1e3989a use env_logger 2020-10-26 14:33:05 +01:00
dietrich 927e7ba4a7 unify locking of a single file to locking of all files 2020-10-26 08:13:24 +01:00
dietrich b8c544a846 first draft of file locking 2020-10-25 11:08:56 +01:00
dietrich 338b4949e4 add must uses 2020-10-24 13:50:33 +02:00
dietrich 91f0453be6 do not use deprecated description 2020-10-24 13:50:20 +02:00
dietrich 56a6679ccb create draft binary for create_users 2020-10-23 19:50:06 +02:00
dietrich 67af4a39cd add getters to User 2020-10-23 19:49:47 +02:00
dietrich 83255390e3 make the structs clonable, add pos and source to the fields 2020-10-23 19:49:21 +02:00
dietrich d81bac5146 add get nth line function 2020-10-23 19:46:20 +02:00
dietrich 932fb2827d comment broken newuser 2020-10-23 19:45:51 +02:00
dietrich f33ba8e767 persistent ordering of the passwd file 2020-10-23 15:21:30 +02:00
dietrich 98d4c72f7f properly do read_all 2020-10-23 15:18:57 +02:00
dietrich 134b97cfec first try implementing userdbwrite 2020-10-23 12:33:34 +02:00
dietrich 70fcd823da adjust and implement more of the api 2020-10-22 12:40:30 +02:00
dietrich f2000c7650 remove erronous warning 2020-10-19 13:04:03 +02:00
dietrich d09f861ab0 add validation for usernames and groupnames 2020-10-19 12:14:00 +02:00
dietrich 7ec3bc3f0c first draft of username and groupname validation 2020-10-18 20:35:53 +02:00
dietrich 403f948c67 implement UserDbRead 2020-10-18 15:22:17 +02:00
dietrich 60bbe1ef1b add some documentation 2020-10-18 08:50:19 +02:00
dietrich abdb704ba0 remove duplicated code 2020-10-18 08:38:23 +02:00
dietrich ffafa7e473 Make the conten of shadow part of the user struct 2020-10-17 20:38:28 +02:00
dietrich 9482e85821 add rough api draft 2020-10-16 13:19:32 +02:00
dietrich 01a76b16a1 explicit types 2020-10-16 08:29:17 +02:00
dietrich f14d4b34ee fix some warnings 2020-10-09 12:11:23 +02:00
dietrich b6eb9972d2 restructuring
Fix (remove) lifetimes and restructure the code

Co-authored-by: Dietrich <dietrich@teilgedanken.de>
Reviewed-on: http://git.teilgedanken.de/Rust/useradd/pulls/2
2020-10-07 15:11:10 +00:00
dietrich 180934b789 Make shadow an entry of the passwd struct 2020-10-03 21:07:47 +02:00
dietrich 4af05c1134 initial parsing and testing for a shadow line 2020-10-03 15:18:45 +02:00
dietrich 4db597c058 initial parsing of shadow file 2020-10-02 18:13:15 +02:00
dietrich c6af13f3af Add is system user 2020-10-02 12:40:03 +02:00
dietrich 9b4956c78a Restructure the passwd file 2020-10-02 11:55:56 +02:00
dietrich 24db3e2579 Add warning on unconventional usernames 2020-10-02 09:50:02 +02:00
dietrich d4d3c0f0cf Merge pull request 'make the username part of the invalid message.' (#1) from local into master
Reviewed-on: http://git.teilgedanken.de/Rust/useradd/pulls/1
2020-10-02 07:46:59 +00:00
dietrich a95fa96d08 Adding a testcase for the ubuntu special user 2020-10-02 09:45:08 +02:00
dietrich b030045355 make the username part of the invalid message. 2020-10-02 09:45:08 +02:00
dietrich 063fb41708 restructure 2020-10-01 09:38:13 +02:00
dietrich 1ab0adbc06 user validation and tests 2020-09-30 20:58:24 +02:00
dietrich 5000fba6e7 doc update for enum Gecos 2020-09-30 18:23:44 +02:00
dietrich 676a5218e6 rename shell_dir -> shell_path 2020-09-30 18:02:02 +02:00
dietrich 2094bb7549 fix switched values 2020-09-30 17:35:39 +02:00
dietrich ee04fa30af Fix failing tests because ubuntu has no comment field 2020-09-30 11:09:43 +02:00
dietrich 0761afa6a0 ignore non ascii characters in tests 2020-09-30 08:40:19 +02:00
dietrich b72449eb88 partially fix clippy warnings regarding umlauts 2020-09-29 20:10:01 +02:00
dietrich 020a95920e Make the other field variable length, it can now be many fields or be missing entirely 2020-09-29 14:19:40 +02:00
dietrich a25092c7a0 Add getters for the attributes 2020-09-29 12:26:49 +02:00
dietrich 5d83f1264f Add custom errors 2020-09-29 12:26:43 +02:00
dietrich 3232f2b1da add test case if gecos has no other field. 2020-09-23 10:57:04 +02:00
dietrich 4e80b7128a fix tests ubuntu 2020-09-23 10:52:36 +02:00
dietrich 670f4d2a96 comments 2020-09-23 09:37:32 +02:00
dietrich 8c1a0a52f6 make the parser use the TryFrom trait. 2020-09-22 20:09:53 +02:00
dietrich c9cba38f2f remove pw_prefix 2020-09-22 13:08:15 +02:00
dietrich a68f0800cc more tests 2020-09-22 12:51:28 +02:00
dietrich 1bd6031e5a Adding tests 2020-09-21 14:37:21 +02:00
dietrich cd19cb7115 Parsing the passwd file 2020-09-21 09:05:38 +02:00