Git Product home page Git Product logo

authd's People

Contributors

3v1n0 avatar denisonbarbosa avatar dependabot[bot] avatar didrocks avatar gabrielnagy avatar jibel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

3v1n0 gabrielnagy

authd's Issues

Issue: There is one racy test

Is there an existing issue for this?

  • I have searched the existing issues and found none that matched mine

Describe the issue

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!

Steps to reproduce it

Run tests

Ubuntu users: System information and logs

No response

Non Ubuntu users: System information and logs

No response

Relevant information

No response

Double check your logs

  • I have redacted any sensitive information from the logs

Issue: Install authd libraries in subpaths

Is there an existing issue for this?

  • I have searched the existing issues and found none that matched mine

Describe the issue

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.

Steps to reproduce it

.

Ubuntu users: System information and logs

No response

Non Ubuntu users: System information and logs

No response

Relevant information

No response

Double check your logs

  • I have redacted any sensitive information from the logs

Issue: Example broker state is not reset

Is there an existing issue for this?

  • I have searched the existing issues and found none that matched mine

Describe the issue

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.

Steps to reproduce it

  1. 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

  2. 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.

Ubuntu users: System information and logs

No response

Non Ubuntu users: System information and logs

No response

Relevant information

No response

Double check your logs

  • I have redacted any sensitive information from the logs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.