-
Notifications
You must be signed in to change notification settings - Fork 60
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
Tune owner for umockdev dir/files #221
Comments
Can you please tell me the privilege/component structure of how you use umockdev? Are you using the CLI ( For the CLI you could just run it via This information does not really belong into the recorded |
Also, what do you mean by "accessed"? Many devices are read-only for unpriv users by default, some are world writable. Does your non-root consumer need to write to them? One option would be to record the permissions and owner into the |
We use the CLI ( I have one question regarding the operation of this tool. When we run @madhuriupadhye can you confirm that you are doing the umockdev recording as root user? |
@ikerexxe BTW, for this problem the user that |
We are using su, so I don't think |
No no, this isn't about su vs. runuser. I'm interested in a structural overview which components are in your test setup, i.e. how umockdev{-record,run} or the umockdev API hangs together with the things you want to test, and which privileges each process has, etc. |
Yes, we did and doing recording as a root user. |
@madhuriupadhye As I said, the recording side is much less interesting. I still need to understand how your root/non-root test processes and umockdev-run (or whatever else) hang together, and where the privilege boundaries are. There are several ways how permissions could be addressed/changed, but I need to understand your setup. |
I can only speak from the development side, and how the functionality works. I'll let Madhuri provide you the exact details about the testing environment. All the communication from SSSD happens in a binary called Note: if you are using Fedora 39+ you can install this binary by installing the Do you miss any details? |
|
I'm still missing pretty much all of the details in this and this comment. I can guess that you run So the most obvious thing to do would be to run |
Would it work other way round: run |
Sure, a root process has no trouble accessing files owned by any user. (Unless it drops CAP_DAC_OVERRIDE) |
@ikerexxe @alexey-tikhonov Just to avoid misunderstandings: This isn't actionable for me right now, I'm still waiting for your input/details. |
Meanwhile we realized that real tokens are (also) not accessible by non privileged users. For this reason following udev rule was added to sssd-passkey package: But looks like it doesn't work for mocked devices... |
It does drop all capabilities. This is how 'umockdev-run' is executed: 'run_su' script has 'chmod -R a+rwx $UMOCKDEV_DIR': But this doesn't help for some reason... |
Ah, of course, it doesn't help because this is a source dir, that is being replayed, not a device file. I wonder if it would work to just chown o+rw /dev/hidraw* in the test env... |
@martinpitt, how will |
@martinpitt, is it possible to make following udev rule work with 'umockdev-run':
? |
I tried both 'runuser' and 'setpriv' without luck so far. |
@alexey-tikhonov sorry for the late answer, this slipped through the cracks 😢 umockdev doesn't run udev rules at all, so I'm afraid no. You'll have to call |
-- by the moment 'umockdev-run' starts execution of 'program', is mocked device file already available? In our case 'program' is a script. I added
|
We'd like to be able to use umockdev as unprivileged users, but currently the directory and files that need to be accessed by umockdev are hardcoded as root.
Provide a way to tune the owner of the umockdev directory and files to another (unprivileged) user.
The text was updated successfully, but these errors were encountered: