Sebastiaan van Stijn
e6f41e22a7
client: Client.doRequest: fix closing filehandle and reversed errors
...
commit 1a5dafb31e improved the error messages
produced by adding a check if the client is using as an elevated user. For
this, it attempts to open `\\.\PHYSICALDRIVE0`.
However, it looks like closing the file landed in the wrong branch of the
condition, so the file-handle would not be closed when the os.Open succeeded.
Looking further into this check, it appears the conditions were reversed;
if the check _fails_, it means the user is not running with elevated
permissions, but the check would use elevatedErr == nil.
Fix both by changing the condition to `elevatedErr != nil`.
While at it, also changing the string to use a string-literal, to reduce
the amount of escaping needed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl >
2024-06-03 10:52:15 +02:00
..
2023-08-01 16:19:36 +02:00
2021-02-16 10:07:44 -05:00
2023-09-20 15:23:27 +02:00
2023-08-26 12:37:41 +02:00
2023-08-26 12:37:41 +02:00
2023-08-26 12:37:41 +02:00
2023-08-26 12:37:41 +02:00
2023-08-26 12:37:41 +02:00
2023-08-26 12:37:41 +02:00
2023-03-31 16:15:01 -04:00
2023-09-07 18:38:19 +00:00
2024-02-23 15:17:10 +01:00
2023-05-19 20:38:51 +02:00
2023-01-01 13:35:16 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-10-12 11:29:23 +02:00
2023-10-12 11:29:23 +02:00
2023-10-12 11:29:23 +02:00
2023-06-29 00:25:21 +02:00
2022-04-19 08:28:20 +02:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-03 21:25:07 +02:00
2023-05-03 21:23:42 +02:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2022-04-19 17:40:33 +02:00
2023-10-12 11:29:24 +02:00
2023-10-12 11:29:24 +02:00
2023-10-12 11:30:12 +02:00
2023-10-12 11:30:12 +02:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-10-12 11:29:23 +02:00
2023-10-12 11:29:23 +02:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-10-12 11:29:23 +02:00
2023-10-12 11:29:23 +02:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-10-12 11:29:24 +02:00
2023-10-12 11:29:24 +02:00
2023-05-10 22:13:38 +02:00
2023-07-17 12:24:28 +02:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2019-03-18 15:26:21 +01:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2021-02-16 10:07:44 -05:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2021-07-27 12:17:45 +02:00
2023-05-10 22:13:38 +02:00
2024-01-19 12:49:53 +01:00
2022-03-07 12:35:55 +01:00
2024-02-23 15:17:10 +01:00
2023-08-29 00:38:08 +02:00
2022-09-28 01:58:52 +02:00
2021-08-27 14:56:57 +08:00
2023-12-18 13:16:37 -08:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2024-01-24 00:10:33 +01:00
2024-01-24 00:10:33 +01:00
2023-05-10 22:13:38 +02:00
2019-03-18 15:26:21 +01:00
2024-01-24 00:10:33 +01:00
2024-01-24 00:10:33 +01:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2023-07-11 13:14:28 +02:00
2023-10-12 11:29:20 +02:00
2023-09-20 15:23:27 +02:00
2024-03-22 13:06:43 +01:00
2024-03-22 13:06:43 +01:00
2024-03-22 13:06:43 +01:00
2024-03-22 13:06:43 +01:00
2024-01-24 00:10:33 +01:00
2024-01-24 00:10:33 +01:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2024-03-22 13:06:43 +01:00
2024-03-22 13:06:43 +01:00
2023-08-30 21:43:02 +02:00
2023-09-05 12:09:26 +02:00
2023-07-07 13:01:36 +02:00
2023-07-07 13:01:36 +02:00
2023-08-26 12:37:41 +02:00
2018-02-05 16:51:57 -05:00
2024-05-31 17:41:31 +02:00
2022-07-29 23:05:15 +02:00
2024-05-29 19:22:37 +02:00
2024-05-29 19:22:37 +02:00
2024-05-29 19:22:34 +02:00
2024-05-29 19:22:34 +02:00
2024-05-29 19:22:37 +02:00
2024-05-29 19:22:37 +02:00
2024-05-29 19:22:37 +02:00
2024-06-03 10:52:15 +02:00
2024-05-31 17:41:31 +02:00
2024-05-31 17:41:31 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2023-06-29 00:25:21 +02:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2022-05-13 02:40:14 +02:00
2023-06-09 09:59:29 +02:00
2023-09-07 18:38:19 +00:00
2024-02-23 14:25:52 +01:00
2024-02-23 14:31:55 +01:00
2019-03-18 15:26:21 +01:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2024-03-22 13:06:43 +01:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2023-07-11 13:14:28 +02:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-09-20 15:23:27 +02:00
2023-11-14 12:27:35 +01:00
2023-10-12 11:29:24 +02:00
2024-06-03 10:52:15 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2019-10-14 10:43:00 -05:00
2023-10-12 11:30:12 +02:00
2023-10-12 11:30:12 +02:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2019-03-18 15:26:21 +01:00
2023-05-10 22:13:38 +02:00
2019-03-18 15:26:21 +01:00
2023-05-10 22:13:38 +02:00
2019-03-18 15:26:21 +01:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2018-04-23 13:52:44 -07:00
2023-05-10 22:13:38 +02:00
2022-05-13 02:40:14 +02:00
2023-05-10 22:13:38 +02:00
2022-03-20 19:04:52 +01:00
2023-05-10 22:13:38 +02:00
2019-03-18 15:26:21 +01:00
2023-10-12 11:30:12 +02:00
2018-02-05 16:51:57 -05:00
2019-03-18 15:26:21 +01:00
2023-05-10 22:13:38 +02:00
2022-04-28 22:39:14 +02:00
2023-05-10 22:13:38 +02:00
2022-04-21 19:50:59 +02:00
2023-05-10 22:13:38 +02:00
2022-08-03 23:30:28 +02:00
2023-09-20 15:23:27 +02:00
2024-02-23 15:17:10 +01:00
2024-02-23 15:17:10 +01:00
2023-05-10 22:13:38 +02:00
2023-09-20 15:23:27 +02:00