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

#31: Support multiple devices per user #177

Merged
merged 57 commits into from
Jul 20, 2024

Conversation

mcdope
Copy link
Owner

@mcdope mcdope commented Aug 27, 2022

Feel free to test, basic functionality is now fully working.

It's only tested in a dedicated test VM so far though.

Closes #31

@mcdope mcdope added the enhancement New feature or request label Aug 27, 2022
@mcdope mcdope self-assigned this Aug 27, 2022
@mcdope mcdope marked this pull request as ready for review August 27, 2022 14:32
@mcdope mcdope changed the base branch from prepare-083 to master August 27, 2022 14:32
src/conf.c Fixed Show fixed Hide fixed
src/conf.c Fixed Show fixed Hide fixed
src/conf.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/conf.c Fixed Show fixed Hide fixed
)
{
char *xpath = NULL;
size_t xpath_len;
int retval;

xpath_len = strlen(CONF_DEVICE_XPATH) + strlen(opts->device.name) + strlen(property) + 1;
xpath_len = strlen(CONF_DEVICE_XPATH) + strlen(deviceId) + strlen(property) + 1;

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
)
{
char *xpath = NULL;
size_t xpath_len;
int retval;

xpath_len = strlen(CONF_DEVICE_XPATH) + strlen(opts->device.name) + strlen(property) + 1;
xpath_len = strlen(CONF_DEVICE_XPATH) + strlen(deviceId) + strlen(property) + 1;

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
)
{
char *xpath = NULL;
size_t xpath_len;
int retval;

xpath_len = strlen(CONF_DEVICE_XPATH) + strlen(opts->device.name) + strlen(property) + 1;
xpath_len = strlen(CONF_DEVICE_XPATH) + strlen(deviceId) + strlen(property) + 1;

Check notice

Code scanning / devskim

If a string is missing a null terminator, strlen will read past the end of the buffer Note

Problematic C function detected (strlen)
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Fixed Show fixed Hide fixed
src/device.c Outdated

g_object_unref(drive);
if (retval) {
strcpy(opts->device.name, opts->device_list[currentDevice].name);

Check failure

Code scanning / devskim

strcpy is frequently dangerous, as it will cause a buffer overflow if the source is larger than the destination. Error

Banned C function detected (strcpy)
src/conf.c Dismissed Show dismissed Hide dismissed
src/conf.c Dismissed Show dismissed Hide dismissed
src/conf.c Dismissed Show dismissed Hide dismissed
src/device.c Outdated
strcpy(opts->device.vendor, opts->device_list[currentDevice].vendor);
strcpy(opts->device.model, opts->device_list[currentDevice].model);
strcpy(opts->device.serial, opts->device_list[currentDevice].serial);
strcpy(opts->device.volume_uuid, opts->device_list[currentDevice].volume_uuid);

Check failure

Code scanning / devskim

strcpy is frequently dangerous, as it will cause a buffer overflow if the source is larger than the destination. Error

Banned C function detected (strcpy)
src/device.c Outdated
strcpy(opts->device.name, opts->device_list[currentDevice].name);
strcpy(opts->device.vendor, opts->device_list[currentDevice].vendor);
strcpy(opts->device.model, opts->device_list[currentDevice].model);
strcpy(opts->device.serial, opts->device_list[currentDevice].serial);

Check failure

Code scanning / devskim

strcpy is frequently dangerous, as it will cause a buffer overflow if the source is larger than the destination. Error

Banned C function detected (strcpy)
src/device.c Outdated
if (retval) {
strcpy(opts->device.name, opts->device_list[currentDevice].name);
strcpy(opts->device.vendor, opts->device_list[currentDevice].vendor);
strcpy(opts->device.model, opts->device_list[currentDevice].model);

Check failure

Code scanning / devskim

strcpy is frequently dangerous, as it will cause a buffer overflow if the source is larger than the destination. Error

Banned C function detected (strcpy)
src/device.c Outdated
g_object_unref(drive);
if (retval) {
strcpy(opts->device.name, opts->device_list[currentDevice].name);
strcpy(opts->device.vendor, opts->device_list[currentDevice].vendor);

Check failure

Code scanning / devskim

strcpy is frequently dangerous, as it will cause a buffer overflow if the source is larger than the destination. Error

Banned C function detected (strcpy)
@mcdope
Copy link
Owner Author

mcdope commented Jan 9, 2024

Note to people interested in this, and my future self: this is verified to work with two usb sticks.

Agent still doesnt support it / broken though

edit: nop, actually - its broken

@mcdope
Copy link
Owner Author

mcdope commented Jan 10, 2024

Note to people interested in this, and my future self: this is verified to work with two usb sticks.

Agent still doesnt support it / broken though

edit: nop, actually - its broken

lmao, actually it's not - my ntfs stick just didnt liked to get unplugged without unmounting.

src/conf.c Dismissed Show dismissed Hide dismissed
src/conf.c Dismissed Show dismissed Hide dismissed
src/conf.c Dismissed Show dismissed Hide dismissed
src/device.c Dismissed Show dismissed Hide dismissed
src/device.c Dismissed Show dismissed Hide dismissed
src/device.c Dismissed Show dismissed Hide dismissed
src/device.c Dismissed Show dismissed Hide dismissed
src/device.c Dismissed Show dismissed Hide dismissed
src/xpath.c Dismissed Show dismissed Hide dismissed
@mcdope
Copy link
Owner Author

mcdope commented Jul 16, 2024

Todo: make amount of devices dynamic instead of hardcoded assumptions

@mcdope mcdope merged commit 898cfcf into master Jul 20, 2024
9 checks passed
@mcdope mcdope deleted the issue-31-experimental-multidevice-support branch July 20, 2024 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for multiple devices per user
1 participant