-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
Signed-off-by: McDope <[email protected]>
…ame if they have no revision set (thx cheapo manufacturers)
…n first found connected drive as 'primary' drive that will be used further down
…al-multidevice-support
…e-support' into issue-31-experimental-multidevice-support
…al-multidevice-support
) | ||
{ | ||
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
) | ||
{ | ||
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
) | ||
{ | ||
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
…al-multidevice-support
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
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
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
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
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
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. |
…al-multidevice-support
…al-multidevice-support
Todo: make amount of devices dynamic instead of hardcoded assumptions |
Feel free to test, basic functionality is now fully working.
It's only tested in a dedicated test VM so far though.
Closes #31