ccdeck 3.50.0 → 3.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/THIRD_PARTY_NOTICES.md +28 -0
- package/dist/web/assets/BrowserWatchModal-CRqdEVdh.js +1 -0
- package/dist/web/assets/IntegrationModal-BDzEIGSM.js +7 -0
- package/dist/web/assets/RadioPanel-BJlsCpnN.js +1 -0
- package/dist/web/assets/TrafficRadar-BGxw-hlO.js +8 -0
- package/dist/web/assets/UsageHistoryModal-C_WBpNIp.js +1 -0
- package/dist/web/assets/app-B53fC4gE.js +358 -0
- package/dist/web/assets/app-Co1HNGP8.css +1 -0
- package/dist/web/assets/{index-DSIUCKoe.js → index-D9nJhUJR.js} +1 -1
- package/dist/web/index.html +3 -3
- package/node_modules/bare-addon-resolve/LICENSE +201 -0
- package/node_modules/bare-addon-resolve/README.md +226 -0
- package/node_modules/bare-addon-resolve/index.d.ts +100 -0
- package/node_modules/bare-addon-resolve/index.js +531 -0
- package/node_modules/bare-addon-resolve/lib/errors.d.ts +16 -0
- package/node_modules/bare-addon-resolve/lib/errors.js +21 -0
- package/node_modules/bare-addon-resolve/package.json +57 -0
- package/node_modules/bare-module-resolve/LICENSE +201 -0
- package/node_modules/bare-module-resolve/README.md +322 -0
- package/node_modules/bare-module-resolve/index.d.ts +171 -0
- package/node_modules/bare-module-resolve/index.js +899 -0
- package/node_modules/bare-module-resolve/lib/errors.d.ts +31 -0
- package/node_modules/bare-module-resolve/lib/errors.js +37 -0
- package/node_modules/bare-module-resolve/package.json +56 -0
- package/node_modules/bare-semver/LICENSE +201 -0
- package/node_modules/bare-semver/README.md +147 -0
- package/node_modules/bare-semver/index.d.ts +61 -0
- package/node_modules/bare-semver/index.js +13 -0
- package/node_modules/bare-semver/lib/comparator.js +37 -0
- package/node_modules/bare-semver/lib/constants.js +7 -0
- package/node_modules/bare-semver/lib/errors.js +22 -0
- package/node_modules/bare-semver/lib/range.js +256 -0
- package/node_modules/bare-semver/lib/version.js +240 -0
- package/node_modules/bare-semver/package.json +43 -0
- package/node_modules/fs-native-extensions/CMakeLists.txt +118 -0
- package/node_modules/fs-native-extensions/LICENSE +201 -0
- package/node_modules/fs-native-extensions/README.md +160 -0
- package/node_modules/fs-native-extensions/binding.c +1825 -0
- package/node_modules/fs-native-extensions/binding.js +3 -0
- package/node_modules/fs-native-extensions/include/fs-ext.h +193 -0
- package/node_modules/fs-native-extensions/index.js +356 -0
- package/node_modules/fs-native-extensions/package.json +72 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/ios-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/ios-arm64-simulator/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/ios-x64-simulator/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.bare +0 -0
- package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.node +0 -0
- package/node_modules/fs-native-extensions/src/apple.c +197 -0
- package/node_modules/fs-native-extensions/src/linux.c +146 -0
- package/node_modules/fs-native-extensions/src/platform.h +51 -0
- package/node_modules/fs-native-extensions/src/posix.c +33 -0
- package/node_modules/fs-native-extensions/src/shared.c +397 -0
- package/node_modules/fs-native-extensions/src/win32/nt.h +226 -0
- package/node_modules/fs-native-extensions/src/win32.c +531 -0
- package/node_modules/require-addon/LICENSE +201 -0
- package/node_modules/require-addon/README.md +19 -0
- package/node_modules/require-addon/lib/bare.js +1 -0
- package/node_modules/require-addon/lib/default.js +7 -0
- package/node_modules/require-addon/lib/node.js +79 -0
- package/node_modules/require-addon/package.json +64 -0
- package/node_modules/which-runtime/LICENSE +201 -0
- package/node_modules/which-runtime/README.md +29 -0
- package/node_modules/which-runtime/index.js +36 -0
- package/node_modules/which-runtime/package.json +32 -0
- package/package.json +9 -2
- package/release-notes.json +33 -0
- package/src/server/integrations/jira-comment.mjs +37 -0
- package/src/server/integrations/jira-move.mjs +37 -11
- package/src/server/integrations/jira-transition.mjs +43 -0
- package/src/server/integrations/jira-write-guard.mjs +218 -0
- package/src/server/integrations/jira.mjs +16 -0
- package/src/server/integrations/routes.mjs +70 -7
- package/src/server/static-cache.mjs +34 -16
- package/src/server/traffic-radar-wire.mjs +6 -0
- package/dist/web/assets/BrowserWatchModal-CSckhvRP.js +0 -1
- package/dist/web/assets/IntegrationModal-CT8_QnAx.js +0 -7
- package/dist/web/assets/RadioPanel-D3JLkVYu.js +0 -1
- package/dist/web/assets/TrafficRadar-Cuk5tXfL.js +0 -8
- package/dist/web/assets/UsageHistoryModal-DiEH73iz.js +0 -1
- package/dist/web/assets/app-BRaZrImF.js +0 -321
- package/dist/web/assets/app-DfGYllmZ.css +0 -1
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
#include <assert.h>
|
|
2
|
+
#include <stdint.h>
|
|
3
|
+
#include <stdlib.h>
|
|
4
|
+
#include <string.h>
|
|
5
|
+
#include <uv.h>
|
|
6
|
+
|
|
7
|
+
#include "../include/fs-ext.h"
|
|
8
|
+
|
|
9
|
+
#include "platform.h"
|
|
10
|
+
|
|
11
|
+
int
|
|
12
|
+
fs_ext_try_lock(uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_type_t type) {
|
|
13
|
+
int err = fs_ext__try_lock(fd, offset, length, type);
|
|
14
|
+
|
|
15
|
+
if (err == UV_EACCES || err == UV_EAGAIN || err == UV_EBUSY) {
|
|
16
|
+
err = UV_EAGAIN;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return err;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static void
|
|
23
|
+
fs_ext__lock_close(uv_handle_t *handle) {
|
|
24
|
+
fs_ext_lock_t *r = (fs_ext_lock_t *) handle->data;
|
|
25
|
+
|
|
26
|
+
if (r->cb) r->cb(r, r->result);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static void
|
|
30
|
+
fs_ext__lock_after_work(uv_async_t *signal) {
|
|
31
|
+
int err;
|
|
32
|
+
|
|
33
|
+
fs_ext_lock_t *r = (fs_ext_lock_t *) signal->data;
|
|
34
|
+
|
|
35
|
+
err = uv_thread_join(&r->thread);
|
|
36
|
+
assert(err == 0);
|
|
37
|
+
|
|
38
|
+
uv_close((uv_handle_t *) signal, fs_ext__lock_close);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static void
|
|
42
|
+
fs_ext__lock_work(void *data) {
|
|
43
|
+
int err;
|
|
44
|
+
|
|
45
|
+
fs_ext_lock_t *r = (fs_ext_lock_t *) data;
|
|
46
|
+
|
|
47
|
+
r->result = fs_ext__wait_for_lock(r->fd, r->offset, r->length, r->type);
|
|
48
|
+
|
|
49
|
+
err = uv_async_send(&r->signal);
|
|
50
|
+
assert(err == 0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
int
|
|
54
|
+
fs_ext_wait_for_lock(uv_loop_t *loop, fs_ext_lock_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_type_t type, fs_ext_lock_cb cb) {
|
|
55
|
+
int err;
|
|
56
|
+
|
|
57
|
+
req->fd = fd;
|
|
58
|
+
req->offset = offset;
|
|
59
|
+
req->length = length;
|
|
60
|
+
req->type = type;
|
|
61
|
+
req->cb = cb;
|
|
62
|
+
req->signal.data = (void *) req;
|
|
63
|
+
|
|
64
|
+
err = uv_async_init(loop, &req->signal, fs_ext__lock_after_work);
|
|
65
|
+
assert(err == 0);
|
|
66
|
+
|
|
67
|
+
err = uv_thread_create(&req->thread, fs_ext__lock_work, (void *) req);
|
|
68
|
+
assert(err == 0);
|
|
69
|
+
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
int
|
|
74
|
+
fs_ext_try_downgrade_lock(uv_os_fd_t fd, uint64_t offset, size_t length) {
|
|
75
|
+
int err = fs_ext__try_downgrade_lock(fd, offset, length);
|
|
76
|
+
|
|
77
|
+
if (err == UV_EACCES || err == UV_EAGAIN || err == UV_EBUSY) {
|
|
78
|
+
err = UV_EAGAIN;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return err;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
static void
|
|
85
|
+
fs_ext__downgrade_lock_work(void *data) {
|
|
86
|
+
int err;
|
|
87
|
+
|
|
88
|
+
fs_ext_lock_t *r = (fs_ext_lock_t *) data;
|
|
89
|
+
|
|
90
|
+
r->result = fs_ext__wait_for_downgrade_lock(r->fd, r->offset, r->length);
|
|
91
|
+
|
|
92
|
+
err = uv_async_send(&r->signal);
|
|
93
|
+
assert(err == 0);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
int
|
|
97
|
+
fs_ext_wait_for_downgrade_lock(uv_loop_t *loop, fs_ext_lock_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_cb cb) {
|
|
98
|
+
int err;
|
|
99
|
+
|
|
100
|
+
req->fd = fd;
|
|
101
|
+
req->offset = offset;
|
|
102
|
+
req->length = length;
|
|
103
|
+
req->type = FS_EXT_RDLOCK;
|
|
104
|
+
req->cb = cb;
|
|
105
|
+
req->signal.data = (void *) req;
|
|
106
|
+
|
|
107
|
+
err = uv_async_init(loop, &req->signal, fs_ext__lock_after_work);
|
|
108
|
+
assert(err == 0);
|
|
109
|
+
|
|
110
|
+
err = uv_thread_create(&req->thread, fs_ext__downgrade_lock_work, (void *) req);
|
|
111
|
+
assert(err == 0);
|
|
112
|
+
|
|
113
|
+
return 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
static void
|
|
117
|
+
fs_ext__upgrade_lock_work(void *data) {
|
|
118
|
+
int err;
|
|
119
|
+
|
|
120
|
+
fs_ext_lock_t *r = (fs_ext_lock_t *) data;
|
|
121
|
+
|
|
122
|
+
r->result = fs_ext__wait_for_upgrade_lock(r->fd, r->offset, r->length);
|
|
123
|
+
|
|
124
|
+
err = uv_async_send(&r->signal);
|
|
125
|
+
assert(err == 0);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
int
|
|
129
|
+
fs_ext_try_upgrade_lock(uv_os_fd_t fd, uint64_t offset, size_t length) {
|
|
130
|
+
int err = fs_ext__try_upgrade_lock(fd, offset, length);
|
|
131
|
+
|
|
132
|
+
if (err == UV_EACCES || err == UV_EAGAIN || err == UV_EBUSY) {
|
|
133
|
+
err = UV_EAGAIN;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return err;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
int
|
|
140
|
+
fs_ext_wait_for_upgrade_lock(uv_loop_t *loop, fs_ext_lock_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_cb cb) {
|
|
141
|
+
int err;
|
|
142
|
+
|
|
143
|
+
req->fd = fd;
|
|
144
|
+
req->offset = offset;
|
|
145
|
+
req->length = length;
|
|
146
|
+
req->type = FS_EXT_WRLOCK;
|
|
147
|
+
req->cb = cb;
|
|
148
|
+
req->signal.data = (void *) req;
|
|
149
|
+
|
|
150
|
+
err = uv_async_init(loop, &req->signal, fs_ext__lock_after_work);
|
|
151
|
+
assert(err == 0);
|
|
152
|
+
|
|
153
|
+
err = uv_thread_create(&req->thread, fs_ext__upgrade_lock_work, (void *) req);
|
|
154
|
+
assert(err == 0);
|
|
155
|
+
|
|
156
|
+
return 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
int
|
|
160
|
+
fs_ext_unlock(uv_os_fd_t fd, uint64_t offset, size_t length) {
|
|
161
|
+
return fs_ext__unlock(fd, offset, length);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
static void
|
|
165
|
+
fs_ext__trim_work(uv_work_t *req) {
|
|
166
|
+
fs_ext_trim_t *r = (fs_ext_trim_t *) req->data;
|
|
167
|
+
|
|
168
|
+
r->result = fs_ext__trim(r->fd, r->offset, r->length);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
static void
|
|
172
|
+
fs_ext__trim_after_work(uv_work_t *req, int status) {
|
|
173
|
+
fs_ext_trim_t *r = (fs_ext_trim_t *) req->data;
|
|
174
|
+
|
|
175
|
+
if (r->cb) r->cb(r, r->result);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
int
|
|
179
|
+
fs_ext_trim(uv_loop_t *loop, fs_ext_trim_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_trim_cb cb) {
|
|
180
|
+
req->fd = fd;
|
|
181
|
+
req->offset = offset;
|
|
182
|
+
req->length = length;
|
|
183
|
+
req->cb = cb;
|
|
184
|
+
req->req.data = (void *) req;
|
|
185
|
+
|
|
186
|
+
return uv_queue_work(loop, &req->req, fs_ext__trim_work, fs_ext__trim_after_work);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
static void
|
|
190
|
+
fs_ext__sparse_work(uv_work_t *req) {
|
|
191
|
+
fs_ext_sparse_t *r = (fs_ext_sparse_t *) req->data;
|
|
192
|
+
|
|
193
|
+
r->result = fs_ext__sparse(r->fd);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static void
|
|
197
|
+
fs_ext__sparse_after_work(uv_work_t *req, int status) {
|
|
198
|
+
fs_ext_sparse_t *r = (fs_ext_sparse_t *) req->data;
|
|
199
|
+
|
|
200
|
+
if (r->cb) r->cb(r, r->result);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
int
|
|
204
|
+
fs_ext_sparse(uv_loop_t *loop, fs_ext_sparse_t *req, uv_os_fd_t fd, fs_ext_sparse_cb cb) {
|
|
205
|
+
req->fd = fd;
|
|
206
|
+
req->cb = cb;
|
|
207
|
+
req->req.data = (void *) req;
|
|
208
|
+
|
|
209
|
+
return uv_queue_work(loop, &req->req, fs_ext__sparse_work, fs_ext__sparse_after_work);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static void
|
|
213
|
+
fs_ext__swap_work(uv_work_t *req) {
|
|
214
|
+
fs_ext_swap_t *r = (fs_ext_swap_t *) req->data;
|
|
215
|
+
|
|
216
|
+
r->result = fs_ext__swap(r->from, r->to);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static void
|
|
220
|
+
fs_ext__swap_after_work(uv_work_t *req, int status) {
|
|
221
|
+
fs_ext_swap_t *r = (fs_ext_swap_t *) req->data;
|
|
222
|
+
|
|
223
|
+
char *from = r->from;
|
|
224
|
+
char *to = r->to;
|
|
225
|
+
|
|
226
|
+
if (r->cb) r->cb(r, r->result);
|
|
227
|
+
|
|
228
|
+
free(from);
|
|
229
|
+
free(to);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
int
|
|
233
|
+
fs_ext_swap(uv_loop_t *loop, fs_ext_swap_t *req, const char *from, const char *to, fs_ext_swap_cb cb) {
|
|
234
|
+
int err;
|
|
235
|
+
|
|
236
|
+
req->from = strdup(from);
|
|
237
|
+
req->to = strdup(to);
|
|
238
|
+
req->cb = cb;
|
|
239
|
+
req->req.data = (void *) req;
|
|
240
|
+
|
|
241
|
+
err = uv_queue_work(loop, &req->req, fs_ext__swap_work, fs_ext__swap_after_work);
|
|
242
|
+
|
|
243
|
+
if (err < 0) {
|
|
244
|
+
free(req->from);
|
|
245
|
+
free(req->to);
|
|
246
|
+
|
|
247
|
+
return err;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return 0;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
static void
|
|
254
|
+
fs_ext__get_attr_work(uv_work_t *req) {
|
|
255
|
+
fs_ext_get_attr_t *r = (fs_ext_get_attr_t *) req->data;
|
|
256
|
+
|
|
257
|
+
r->result = fs_ext__get_attr(r->fd, r->name, &r->value);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
static void
|
|
261
|
+
fs_ext__get_attr_after_work(uv_work_t *req, int status) {
|
|
262
|
+
fs_ext_get_attr_t *r = (fs_ext_get_attr_t *) req->data;
|
|
263
|
+
|
|
264
|
+
uv_buf_t value = r->value;
|
|
265
|
+
char *name = r->name;
|
|
266
|
+
|
|
267
|
+
if (r->cb) r->cb(r, r->result, &value);
|
|
268
|
+
|
|
269
|
+
free(value.base);
|
|
270
|
+
free(name);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
int
|
|
274
|
+
fs_ext_get_attr(uv_loop_t *loop, fs_ext_get_attr_t *req, uv_os_fd_t fd, const char *name, fs_ext_get_attr_cb cb) {
|
|
275
|
+
int err;
|
|
276
|
+
|
|
277
|
+
req->fd = fd;
|
|
278
|
+
req->name = strdup(name);
|
|
279
|
+
req->value.base = NULL;
|
|
280
|
+
req->value.len = 0;
|
|
281
|
+
req->cb = cb;
|
|
282
|
+
req->req.data = (void *) req;
|
|
283
|
+
|
|
284
|
+
err = uv_queue_work(loop, &req->req, fs_ext__get_attr_work, fs_ext__get_attr_after_work);
|
|
285
|
+
|
|
286
|
+
if (err < 0) {
|
|
287
|
+
free(req->name);
|
|
288
|
+
|
|
289
|
+
return err;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return 0;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
static void
|
|
296
|
+
fs_ext__set_attr_work(uv_work_t *req) {
|
|
297
|
+
fs_ext_set_attr_t *r = (fs_ext_set_attr_t *) req->data;
|
|
298
|
+
|
|
299
|
+
r->result = fs_ext__set_attr(r->fd, r->name, &r->value);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
static void
|
|
303
|
+
fs_ext__set_attr_after_work(uv_work_t *req, int status) {
|
|
304
|
+
fs_ext_set_attr_t *r = (fs_ext_set_attr_t *) req->data;
|
|
305
|
+
|
|
306
|
+
char *name = r->name;
|
|
307
|
+
|
|
308
|
+
if (r->cb) r->cb(r, r->result);
|
|
309
|
+
|
|
310
|
+
free(name);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
int
|
|
314
|
+
fs_ext_set_attr(uv_loop_t *loop, fs_ext_set_attr_t *req, uv_os_fd_t fd, const char *name, const uv_buf_t *value, fs_ext_set_attr_cb cb) {
|
|
315
|
+
int err;
|
|
316
|
+
|
|
317
|
+
req->fd = fd;
|
|
318
|
+
req->name = strdup(name);
|
|
319
|
+
req->value = *value;
|
|
320
|
+
req->cb = cb;
|
|
321
|
+
req->req.data = (void *) req;
|
|
322
|
+
|
|
323
|
+
err = uv_queue_work(loop, &req->req, fs_ext__set_attr_work, fs_ext__set_attr_after_work);
|
|
324
|
+
|
|
325
|
+
if (err < 0) {
|
|
326
|
+
free(req->name);
|
|
327
|
+
|
|
328
|
+
return err;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return 0;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
static void
|
|
335
|
+
fs_ext__remove_attr_work(uv_work_t *req) {
|
|
336
|
+
fs_ext_remove_attr_t *r = (fs_ext_remove_attr_t *) req->data;
|
|
337
|
+
|
|
338
|
+
r->result = fs_ext__remove_attr(r->fd, r->name);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
static void
|
|
342
|
+
fs_ext__remove_attr_after_work(uv_work_t *req, int status) {
|
|
343
|
+
fs_ext_remove_attr_t *r = (fs_ext_remove_attr_t *) req->data;
|
|
344
|
+
|
|
345
|
+
char *name = r->name;
|
|
346
|
+
|
|
347
|
+
if (r->cb) r->cb(r, r->result);
|
|
348
|
+
|
|
349
|
+
free(name);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
int
|
|
353
|
+
fs_ext_remove_attr(uv_loop_t *loop, fs_ext_remove_attr_t *req, uv_os_fd_t fd, const char *name, fs_ext_remove_attr_cb cb) {
|
|
354
|
+
int err;
|
|
355
|
+
|
|
356
|
+
req->fd = fd;
|
|
357
|
+
req->name = strdup(name);
|
|
358
|
+
req->cb = cb;
|
|
359
|
+
req->req.data = (void *) req;
|
|
360
|
+
|
|
361
|
+
err = uv_queue_work(loop, &req->req, fs_ext__remove_attr_work, fs_ext__remove_attr_after_work);
|
|
362
|
+
|
|
363
|
+
if (err < 0) {
|
|
364
|
+
free(req->name);
|
|
365
|
+
|
|
366
|
+
return err;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return 0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
static void
|
|
373
|
+
fs_ext__list_attrs_work(uv_work_t *req) {
|
|
374
|
+
fs_ext_list_attrs_t *r = (fs_ext_list_attrs_t *) req->data;
|
|
375
|
+
|
|
376
|
+
r->result = fs_ext__list_attrs(r->fd, &r->names, &r->length);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
static void
|
|
380
|
+
fs_ext__list_attrs_after_work(uv_work_t *req, int status) {
|
|
381
|
+
fs_ext_list_attrs_t *r = (fs_ext_list_attrs_t *) req->data;
|
|
382
|
+
|
|
383
|
+
const char **names = (const char **) r->names;
|
|
384
|
+
|
|
385
|
+
if (r->cb) r->cb(r, r->result, names, r->length);
|
|
386
|
+
|
|
387
|
+
free(names);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
int
|
|
391
|
+
fs_ext_list_attrs(uv_loop_t *loop, fs_ext_list_attrs_t *req, uv_os_fd_t fd, fs_ext_list_attrs_cb cb) {
|
|
392
|
+
req->fd = fd;
|
|
393
|
+
req->cb = cb;
|
|
394
|
+
req->req.data = (void *) req;
|
|
395
|
+
|
|
396
|
+
return uv_queue_work(loop, &req->req, fs_ext__list_attrs_work, fs_ext__list_attrs_after_work);
|
|
397
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
#ifndef FS_NT_H
|
|
2
|
+
#define FS_NT_H
|
|
3
|
+
|
|
4
|
+
// Definitions of needed Windows kernel APIs, mostly taken from winternl.h and
|
|
5
|
+
// the Windows SDK documentation.
|
|
6
|
+
//
|
|
7
|
+
// Copyright (c) Microsoft Corp. All rights reserved.
|
|
8
|
+
|
|
9
|
+
#include <windows.h>
|
|
10
|
+
|
|
11
|
+
#include <ntstatus.h>
|
|
12
|
+
|
|
13
|
+
#define FILE_SUPERSEDE 0x00000000
|
|
14
|
+
#define FILE_OPEN 0x00000001
|
|
15
|
+
#define FILE_CREATE 0x00000002
|
|
16
|
+
#define FILE_OPEN_IF 0x00000003
|
|
17
|
+
#define FILE_OVERWRITE 0x00000004
|
|
18
|
+
#define FILE_OVERWRITE_IF 0x00000005
|
|
19
|
+
#define FILE_MAXIMUM_DISPOSITION 0x00000005
|
|
20
|
+
|
|
21
|
+
#define FILE_SUPERSEDED 0x00000000
|
|
22
|
+
#define FILE_OPENED 0x00000001
|
|
23
|
+
#define FILE_CREATED 0x00000002
|
|
24
|
+
#define FILE_OVERWRITTEN 0x00000003
|
|
25
|
+
#define FILE_EXISTS 0x00000004
|
|
26
|
+
#define FILE_DOES_NOT_EXIST 0x00000005
|
|
27
|
+
|
|
28
|
+
#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
|
|
29
|
+
|
|
30
|
+
typedef struct _UNICODE_STRING {
|
|
31
|
+
USHORT Length;
|
|
32
|
+
USHORT MaximumLength;
|
|
33
|
+
PWSTR Buffer;
|
|
34
|
+
} UNICODE_STRING, *PUNICODE_STRING;
|
|
35
|
+
|
|
36
|
+
typedef struct _OBJECT_ATTRIBUTES {
|
|
37
|
+
ULONG Length;
|
|
38
|
+
HANDLE RootDirectory;
|
|
39
|
+
PUNICODE_STRING ObjectName;
|
|
40
|
+
ULONG Attributes;
|
|
41
|
+
PVOID SecurityDescriptor;
|
|
42
|
+
PVOID SecurityQualityOfService;
|
|
43
|
+
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
|
|
44
|
+
|
|
45
|
+
typedef struct _IO_STATUS_BLOCK {
|
|
46
|
+
union {
|
|
47
|
+
NTSTATUS Status;
|
|
48
|
+
PVOID Pointer;
|
|
49
|
+
};
|
|
50
|
+
ULONG_PTR Information;
|
|
51
|
+
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
|
|
52
|
+
|
|
53
|
+
typedef struct _FILE_STANDARD_INFORMATION {
|
|
54
|
+
LARGE_INTEGER AllocationSize;
|
|
55
|
+
LARGE_INTEGER EndOfFile;
|
|
56
|
+
ULONG NumberOfLinks;
|
|
57
|
+
BOOLEAN DeletePending;
|
|
58
|
+
BOOLEAN Directory;
|
|
59
|
+
} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION;
|
|
60
|
+
|
|
61
|
+
typedef struct _FILE_STREAM_INFORMATION {
|
|
62
|
+
ULONG NextEntryOffset;
|
|
63
|
+
ULONG StreamNameLength;
|
|
64
|
+
LARGE_INTEGER StreamSize;
|
|
65
|
+
LARGE_INTEGER StreamAllocationSize;
|
|
66
|
+
WCHAR StreamName[1];
|
|
67
|
+
} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION;
|
|
68
|
+
|
|
69
|
+
typedef enum _FILE_INFORMATION_CLASS {
|
|
70
|
+
FileDirectoryInformation = 1,
|
|
71
|
+
FileFullDirectoryInformation, // 2
|
|
72
|
+
FileBothDirectoryInformation, // 3
|
|
73
|
+
FileBasicInformation, // 4
|
|
74
|
+
FileStandardInformation, // 5
|
|
75
|
+
FileInternalInformation, // 6
|
|
76
|
+
FileEaInformation, // 7
|
|
77
|
+
FileAccessInformation, // 8
|
|
78
|
+
FileNameInformation, // 9
|
|
79
|
+
FileRenameInformation, // 10
|
|
80
|
+
FileLinkInformation, // 11
|
|
81
|
+
FileNamesInformation, // 12
|
|
82
|
+
FileDispositionInformation, // 13
|
|
83
|
+
FilePositionInformation, // 14
|
|
84
|
+
FileFullEaInformation, // 15
|
|
85
|
+
FileModeInformation, // 16
|
|
86
|
+
FileAlignmentInformation, // 17
|
|
87
|
+
FileAllInformation, // 18
|
|
88
|
+
FileAllocationInformation, // 19
|
|
89
|
+
FileEndOfFileInformation, // 20
|
|
90
|
+
FileAlternateNameInformation, // 21
|
|
91
|
+
FileStreamInformation, // 22
|
|
92
|
+
FilePipeInformation, // 23
|
|
93
|
+
FilePipeLocalInformation, // 24
|
|
94
|
+
FilePipeRemoteInformation, // 25
|
|
95
|
+
FileMailslotQueryInformation, // 26
|
|
96
|
+
FileMailslotSetInformation, // 27
|
|
97
|
+
FileCompressionInformation, // 28
|
|
98
|
+
FileObjectIdInformation, // 29
|
|
99
|
+
FileCompletionInformation, // 30
|
|
100
|
+
FileMoveClusterInformation, // 31
|
|
101
|
+
FileQuotaInformation, // 32
|
|
102
|
+
FileReparsePointInformation, // 33
|
|
103
|
+
FileNetworkOpenInformation, // 34
|
|
104
|
+
FileAttributeTagInformation, // 35
|
|
105
|
+
FileTrackingInformation, // 36
|
|
106
|
+
FileIdBothDirectoryInformation, // 37
|
|
107
|
+
FileIdFullDirectoryInformation, // 38
|
|
108
|
+
FileValidDataLengthInformation, // 39
|
|
109
|
+
FileShortNameInformation, // 40
|
|
110
|
+
FileIoCompletionNotificationInformation, // 41
|
|
111
|
+
FileIoStatusBlockRangeInformation, // 42
|
|
112
|
+
FileIoPriorityHintInformation, // 43
|
|
113
|
+
FileSfioReserveInformation, // 44
|
|
114
|
+
FileSfioVolumeInformation, // 45
|
|
115
|
+
FileHardLinkInformation, // 46
|
|
116
|
+
FileProcessIdsUsingFileInformation, // 47
|
|
117
|
+
FileNormalizedNameInformation, // 48
|
|
118
|
+
FileNetworkPhysicalNameInformation, // 49
|
|
119
|
+
FileIdGlobalTxDirectoryInformation, // 50
|
|
120
|
+
FileIsRemoteDeviceInformation, // 51
|
|
121
|
+
FileUnusedInformation, // 52
|
|
122
|
+
FileNumaNodeInformation, // 53
|
|
123
|
+
FileStandardLinkInformation, // 54
|
|
124
|
+
FileRemoteProtocolInformation, // 55
|
|
125
|
+
FileRenameInformationBypassAccessCheck, // 56
|
|
126
|
+
FileLinkInformationBypassAccessCheck, // 57
|
|
127
|
+
FileVolumeNameInformation, // 58
|
|
128
|
+
FileIdInformation, // 59
|
|
129
|
+
FileIdExtdDirectoryInformation, // 60
|
|
130
|
+
FileReplaceCompletionInformation, // 61
|
|
131
|
+
FileHardLinkFullIdInformation, // 62
|
|
132
|
+
FileIdExtdBothDirectoryInformation, // 63
|
|
133
|
+
FileDispositionInformationEx, // 64
|
|
134
|
+
FileRenameInformationEx, // 65
|
|
135
|
+
FileRenameInformationExBypassAccessCheck, // 66
|
|
136
|
+
FileDesiredStorageClassInformation, // 67
|
|
137
|
+
FileStatInformation, // 68
|
|
138
|
+
FileMemoryPartitionInformation, // 69
|
|
139
|
+
FileStatLxInformation, // 70
|
|
140
|
+
FileCaseSensitiveInformation, // 71
|
|
141
|
+
FileLinkInformationEx, // 72
|
|
142
|
+
FileLinkInformationExBypassAccessCheck, // 73
|
|
143
|
+
FileStorageReserveIdInformation, // 74
|
|
144
|
+
FileCaseSensitiveInformationForceAccessCheck, // 75
|
|
145
|
+
FileKnownFolderInformation, // 76
|
|
146
|
+
FileMaximumInformation
|
|
147
|
+
} FILE_INFORMATION_CLASS,
|
|
148
|
+
*PFILE_INFORMATION_CLASS;
|
|
149
|
+
|
|
150
|
+
typedef VOID(NTAPI *PIO_APC_ROUTINE)(
|
|
151
|
+
IN PVOID ApcContext,
|
|
152
|
+
IN PIO_STATUS_BLOCK IoStatusBlock,
|
|
153
|
+
IN ULONG Reserved
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
157
|
+
NtClose(
|
|
158
|
+
IN HANDLE Handle
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
162
|
+
NtCreateFile(
|
|
163
|
+
OUT PHANDLE FileHandle,
|
|
164
|
+
IN ACCESS_MASK DesiredAccess,
|
|
165
|
+
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|
166
|
+
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
167
|
+
IN PLARGE_INTEGER AllocationSize OPTIONAL,
|
|
168
|
+
IN ULONG FileAttributes,
|
|
169
|
+
IN ULONG ShareAccess,
|
|
170
|
+
IN ULONG CreateDisposition,
|
|
171
|
+
IN ULONG CreateOptions,
|
|
172
|
+
IN PVOID EaBuffer OPTIONAL,
|
|
173
|
+
IN ULONG EaLength
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
177
|
+
NtOpenFile(
|
|
178
|
+
OUT PHANDLE FileHandle,
|
|
179
|
+
IN ACCESS_MASK DesiredAccess,
|
|
180
|
+
IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|
181
|
+
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
182
|
+
IN ULONG ShareAccess,
|
|
183
|
+
IN ULONG OpenOptions
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
187
|
+
NtReadFile(
|
|
188
|
+
IN HANDLE FileHandle,
|
|
189
|
+
IN HANDLE Event,
|
|
190
|
+
IN PIO_APC_ROUTINE ApcRoutine,
|
|
191
|
+
IN PVOID ApcContext,
|
|
192
|
+
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
193
|
+
OUT PVOID Buffer,
|
|
194
|
+
IN ULONG Length,
|
|
195
|
+
IN PLARGE_INTEGER ByteOffset,
|
|
196
|
+
IN PULONG Key
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
200
|
+
NtWriteFile(
|
|
201
|
+
IN HANDLE FileHandle,
|
|
202
|
+
IN HANDLE Event,
|
|
203
|
+
IN PIO_APC_ROUTINE ApcRoutine,
|
|
204
|
+
IN PVOID ApcContext,
|
|
205
|
+
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
206
|
+
IN PVOID Buffer,
|
|
207
|
+
IN ULONG Length,
|
|
208
|
+
IN PLARGE_INTEGER ByteOffset,
|
|
209
|
+
IN PULONG Key
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
213
|
+
NtDeleteFile(
|
|
214
|
+
IN POBJECT_ATTRIBUTES ObjectAttributes
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
__kernel_entry NTSYSCALLAPI NTSTATUS NTAPI
|
|
218
|
+
NtQueryInformationFile(
|
|
219
|
+
IN HANDLE FileHandle,
|
|
220
|
+
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
221
|
+
OUT PVOID FileInformation,
|
|
222
|
+
IN ULONG Length,
|
|
223
|
+
IN FILE_INFORMATION_CLASS FileInformationClass
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
#endif // FS_NT_H
|