-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement uart permission check in a more distro independent way #20
base: OpenFIRE-dev
Are you sure you want to change the base?
Conversation
…rease compatability between qt versions 5 and 6
Looks functionally good, just have a couple of concerns if you could check those out. 🙂 |
Sure! But I can't seem to find any comments? |
Actually not, its also not marked as being reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just got back from a short break, and I forgot to actually send these as requested changes, apologies!
@@ -121,6 +128,23 @@ void guiWindow::PortsSearch() | |||
if(!usbName.length()) { | |||
PopupWindow("No OpenFIRE devices detected!", "Is the microcontroller board currently running OpenFIRE and is currently plugged in? Make sure it's connected and recognized by the PC.\n\nThis app will now close.", "ERROR", 4); | |||
exit(1); | |||
}else{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird to have an unresolved if branch that isn't inside the Unix conditional block? This should be bumped down to be part of if(getuid())
(and the closing brace should be outside of it too). Also consistent spacing.
}else{ | ||
#if !defined(Q_OS_MAC) && !defined(Q_OS_WIN) | ||
if(getuid()) { | ||
auto deviceName = usbName.first(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: does this actually work if we do not have any compatible devices plugged in? I was under the assumption that users outside of dialout
don't get any devices (and we've already pruned out any system ttySX
virt terminals at this point).
It would be ideal to inform the user first that they should have an ideal working user environment - which is how the original implem worked, then move to available device checks. Perhaps move this block to above/below checking the length of our available devices list?
This moves the permission check to after the devices have been discovered. It then checks the real needed group for the first device and checks if user running the process is in the group.