Skip to content
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

sudorule runasuser returns msg "can only concatenate tuple (not \"list\") to tuple" or "can only concatenate list (not \"tuple\") to list" #1288

Open
arnoxit opened this issue Aug 21, 2024 · 0 comments
Labels

Comments

@arnoxit
Copy link

arnoxit commented Aug 21, 2024

I am seeing an issue using ipasudorule with existing sudo rules that have runasuser set with plugins/modules/ipasudorule.py", line 567.

If the existing rule has an external runasuser I get "can only concatenate list (not "tuple") to list" and if the existing rule has an internal runasuser I get "can only concatenate tuple (not "list") to tuple". It works if I have neither or both. The issue appears to be to do with building the union list of the ipasudorunas_user and ipasudoextrunasuser values.

The issue appears to be resolved if I do something like this instead:

                    runasuser_current = []
                    runasuser_current.extend(res_find.get('ipasudorunas_user', []))
                    runasuser_current.extend(res_find.get('ipasudorunasextuser', []))
                    runasuser_add, runasuser_del = gen_add_del_lists(
                        runasuser,
                        runasuser_current
                    )

But I am not sure of a nice way to inline that and it might be better to fix it in how the values of res_find are built so they are both lists.

@t-woerner t-woerner added the bug label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants