@homeofthings/sqlite3 6.1.1 → 6.2.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.
Files changed (2) hide show
  1. package/binding.gyp +48 -9
  2. package/package.json +1 -1
package/binding.gyp CHANGED
@@ -8,14 +8,10 @@
8
8
  "targets": [
9
9
  {
10
10
  "target_name": "<(module_name)",
11
- "cflags!": [ "-fno-exceptions" ],
12
- "cflags_cc!": [ "-fno-exceptions" ],
13
- "xcode_settings": { "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
11
+ "xcode_settings": {
14
12
  "CLANG_CXX_LIBRARY": "libc++",
15
13
  "MACOSX_DEPLOYMENT_TARGET": "10.7",
16
- },
17
- "msvs_settings": {
18
- "VCCLCompilerTool": { "ExceptionHandling": 1 },
14
+ "OTHER_CFLAGS": [ "-fstack-protector-strong" ]
19
15
  },
20
16
  "include_dirs": [
21
17
  "<!@(node -p \"require('node-addon-api').include\")"],
@@ -40,11 +36,32 @@
40
36
  },
41
37
  {
42
38
  "dependencies": [
43
- "<!(node -p \"require('node-addon-api').gyp\")",
39
+ "<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
44
40
  "deps/sqlite3.gyp:sqlite3"
45
41
  ]
46
42
  }
47
- ]
43
+ ],
44
+ # Linux hardening flags (apply to all builds)
45
+ ["OS=='linux'", {
46
+ "cflags+": [
47
+ "-fstack-protector-strong",
48
+ "-fPIC"
49
+ ],
50
+ "ldflags+": [ "-Wl,-z,relro,-z,now" ]
51
+ }],
52
+ # Windows hardening flags (apply to all builds)
53
+ ["OS=='win'", {
54
+ "msvs_settings": {
55
+ "VCCLCompilerTool": {
56
+ "ExceptionHandling": 1,
57
+ "BufferSecurityCheck": "true",
58
+ "ControlFlowGuard": "Guard"
59
+ },
60
+ "VCLinkerTool": {
61
+ "AdditionalOptions": [ "/DYNAMICBASE", "/NXCOMPAT" ]
62
+ }
63
+ }
64
+ }]
48
65
  ],
49
66
  "sources": [
50
67
  "src/backup.cc",
@@ -52,7 +69,29 @@
52
69
  "src/node_sqlite3.cc",
53
70
  "src/statement.cc"
54
71
  ],
55
- "defines": [ "NAPI_VERSION=<(napi_build_version)", "NAPI_DISABLE_CPP_EXCEPTIONS=1" ]
72
+ "defines": [ "NAPI_VERSION=<(napi_build_version)" ],
73
+ # Release-specific hardening flags
74
+ "configurations": {
75
+ "Release": {
76
+ "conditions": [
77
+ # _FORTIFY_SOURCE applies to all Linux architectures
78
+ ["OS=='linux'", {
79
+ "defines+": [ "_FORTIFY_SOURCE=2" ]
80
+ }],
81
+ # Control Flow Protection only for x86_64 (Intel CET)
82
+ ["OS=='linux' and target_arch=='x64'", {
83
+ "cflags+": [ "-fcf-protection=full" ]
84
+ }],
85
+ ["OS=='win'", {
86
+ "msvs_settings": {
87
+ "VCCLCompilerTool": {
88
+ "AdditionalOptions": [ "/sdl" ]
89
+ }
90
+ }
91
+ }]
92
+ ]
93
+ }
94
+ }
56
95
  }
57
96
  ]
58
97
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@homeofthings/sqlite3",
3
3
  "description": "Asynchronous, non-blocking SQLite3 bindings",
4
- "version": "6.1.1",
4
+ "version": "6.2.0",
5
5
  "homepage": "https://github.com/gms1/node-sqlite3",
6
6
  "author": {
7
7
  "name": "Mapbox",