ubuntu / authd Goto Github PK
View Code? Open in Web Editor NEWAuthentication daemon for external Brokers
License: GNU Lesser General Public License v3.0
Authentication daemon for external Brokers
License: GNU Lesser General Public License v3.0
Running all the tests with:
go test ./...
, I got once:
--- FAIL: TestNew (0.00s)
--- FAIL: TestNew/Clean_up_on_interval (2.01s)
db_test.go:132:
Error Trace: /home/didrocks/work/authd/internal/cache/db_test.go:132
Error: Not equal:
expected: "GroupByID:\n \"33333\": '{\"Name\":\"group3\",\"GID\":33333}'\n \"99999\": '{\"Name\":\"commongroup\",\"GID\":99999}'\nGroupByName:\n commongroup: '{\"Name\":\"commongroup\",\"GID\":99999}'\n group3: '{\"Name\":\"group3\",\"GID\":33333}'\nGroupToUsers:\n \"33333\": '{\"GID\":33333,\"UIDs\":[3333]}'\n \"99999\": '{\"GID\":99999,\"UIDs\":[3333]}'\nUserByID:\n \"3333\": '{\"Name\":\"user3\",\"UID\":3333,\"GID\":33333,\"Gecos\":\"User3\",\"Dir\":\"/home/user3\",\"Shell\":\"/bin/zsh\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"ABCDETIME\"}'\nUserByName:\n user3: '{\"Name\":\"user3\",\"UID\":3333,\"GID\":33333,\"Gecos\":\"User3\",\"Dir\":\"/home/user3\",\"Shell\":\"/bin/zsh\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"ABCDETIME\"}'\nUserToGroups:\n \"3333\": '{\"UID\":3333,\"GIDs\":[33333,99999]}'\n"
actual : "GroupByID:\n \"11111\": '{\"Name\":\"group1\",\"GID\":11111}'\n \"22222\": '{\"Name\":\"group2\",\"GID\":22222}'\n \"33333\": '{\"Name\":\"group3\",\"GID\":33333}'\n \"99999\": '{\"Name\":\"commongroup\",\"GID\":99999}'\nGroupByName:\n commongroup: '{\"Name\":\"commongroup\",\"GID\":99999}'\n group1: '{\"Name\":\"group1\",\"GID\":11111}'\n group2: '{\"Name\":\"group2\",\"GID\":22222}'\n group3: '{\"Name\":\"group3\",\"GID\":33333}'\nGroupToUsers:\n \"11111\": '{\"GID\":11111,\"UIDs\":[1111]}'\n \"22222\": '{\"GID\":22222,\"UIDs\":[2222]}'\n \"33333\": '{\"GID\":33333,\"UIDs\":[3333]}'\n \"99999\": '{\"GID\":99999,\"UIDs\":[2222,3333]}'\nUserByID:\n \"1111\": '{\"Name\":\"user1\",\"UID\":1111,\"GID\":11111,\"Gecos\":\"User1 gecos\\nOn multiple lines\",\"Dir\":\"/home/user1\",\"Shell\":\"/bin/bash\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"AAAAATIME\"}'\n \"2222\": '{\"Name\":\"user2\",\"UID\":2222,\"GID\":22222,\"Gecos\":\"User2\",\"Dir\":\"/home/user2\",\"Shell\":\"/bin/dash\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"BBBBBTIME\"}'\n \"3333\": '{\"Name\":\"user3\",\"UID\":3333,\"GID\":33333,\"Gecos\":\"User3\",\"Dir\":\"/home/user3\",\"Shell\":\"/bin/zsh\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"ABCDETIME\"}'\nUserByName:\n user1: '{\"Name\":\"user1\",\"UID\":1111,\"GID\":11111,\"Gecos\":\"User1 gecos\\nOn multiple lines\",\"Dir\":\"/home/user1\",\"Shell\":\"/bin/bash\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"AAAAATIME\"}'\n user2: '{\"Name\":\"user2\",\"UID\":2222,\"GID\":22222,\"Gecos\":\"User2\",\"Dir\":\"/home/user2\",\"Shell\":\"/bin/dash\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"BBBBBTIME\"}'\n user3: '{\"Name\":\"user3\",\"UID\":3333,\"GID\":33333,\"Gecos\":\"User3\",\"Dir\":\"/home/user3\",\"Shell\":\"/bin/zsh\",\"LastPwdChange\":-1,\"MaxPwdAge\":-1,\"PwdWarnPeriod\":-1,\"PwdInactivity\":-1,\"MinPwdAge\":-1,\"ExpirationDate\":-1,\"LastLogin\":\"ABCDETIME\"}'\nUserToGroups:\n \"1111\": '{\"UID\":1111,\"GIDs\":[11111]}'\n \"2222\": '{\"UID\":2222,\"GIDs\":[22222,99999]}'\n \"3333\": '{\"UID\":3333,\"GIDs\":[33333,99999]}'\n"
Diff:
--- Expected
+++ Actual
@@ -1,2 +1,4 @@
GroupByID:
+ "11111": '{"Name":"group1","GID":11111}'
+ "22222": '{"Name":"group2","GID":22222}'
"33333": '{"Name":"group3","GID":33333}'
@@ -5,11 +7,21 @@
commongroup: '{"Name":"commongroup","GID":99999}'
+ group1: '{"Name":"group1","GID":11111}'
+ group2: '{"Name":"group2","GID":22222}'
group3: '{"Name":"group3","GID":33333}'
GroupToUsers:
+ "11111": '{"GID":11111,"UIDs":[1111]}'
+ "22222": '{"GID":22222,"UIDs":[2222]}'
"33333": '{"GID":33333,"UIDs":[3333]}'
- "99999": '{"GID":99999,"UIDs":[3333]}'
+ "99999": '{"GID":99999,"UIDs":[2222,3333]}'
UserByID:
+ "1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
+ "2222": '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
"3333": '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
UserByName:
+ user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"User1 gecos\nOn multiple lines","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"AAAAATIME"}'
+ user2: '{"Name":"user2","UID":2222,"GID":22222,"Gecos":"User2","Dir":"/home/user2","Shell":"/bin/dash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"BBBBBTIME"}'
user3: '{"Name":"user3","UID":3333,"GID":33333,"Gecos":"User3","Dir":"/home/user3","Shell":"/bin/zsh","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}'
UserToGroups:
+ "1111": '{"UID":1111,"GIDs":[11111]}'
+ "2222": '{"UID":2222,"GIDs":[22222,99999]}'
"3333": '{"UID":3333,"GIDs":[33333,99999]}'
Test: TestNew/Clean_up_on_interval
Messages: Did not get expected database content
FAIL
FAIL github.com/ubuntu/authd/internal/cache 2.199s
Probably rare, but worth checking what could be racy!
Run tests
No response
No response
No response
We have authd libraries installed in ./usr/lib/x86_64-linux-gnu/libnss_authd.so.2
while these should instead be into an authd subpath, so ideally something like ./usr/lib/x86_64-linux-gnu/authd/libnss_so.2
.
In fact we don't expect these libraries to be something consumed by others.
.
No response
No response
No response
When reusing the same user like (user-needs-reset, user-can-reset or user-mfa), some state is kept on the broker side and lead to invalid flow.
user-needs-reset or user-can-reset:
a. Start the PAM binary, press escape, change user to one of the above
b. Log in once with password
c. Then, change your password on the newpasswd screen
d. Restart a PAM session (do not restart authd), reselect the same user
-> you are directly directed to the newpasswd screen
user-mfa:
Similarly, reusing the same user without restart authd can lead to different flows, some not proposing the "Give me your password screen", but directly topt and then via email link (requested twice).
Those 2 issues are probably related.
I suggest once fix to have a long live authd daemon, and try multiple scenarios, stopping as soon as something don’t feel right in the logic flow.
No response
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.