Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Marsaud Smb2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Marsaud Smb2
Commits
9309fb9c
Commit
9309fb9c
authored
Dec 03, 2018
by
Julien Fontanet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: bigint → BigInt
parent
596e5dbf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
lib/api/readFile.js
lib/api/readFile.js
+2
-2
lib/api/rename.js
lib/api/rename.js
+5
-5
lib/api/rmdir.js
lib/api/rmdir.js
+2
-2
lib/api/unlink.js
lib/api/unlink.js
+2
-2
lib/api/writeFile.js
lib/api/writeFile.js
+4
-4
No files found.
lib/api/readFile.js
View file @
9309fb9c
var
SMB2Forge
=
require
(
'
../tools/smb2-forge
'
);
var
SMB2Request
=
SMB2Forge
.
request
;
var
bigi
nt
=
require
(
'
../tools/bigint
'
);
var
BigI
nt
=
require
(
'
../tools/bigint
'
);
var
MAX_READ_LENGTH
=
require
(
'
../structures/constants
'
).
MAX_READ_LENGTH
;
/*
...
...
@@ -29,7 +29,7 @@ module.exports = function readFile(filename, options, cb) {
// SMB2 read file content
else
{
var
fileLength
=
0
;
var
offset
=
new
bigi
nt
(
8
);
var
offset
=
new
BigI
nt
(
8
);
var
stop
=
false
;
var
nbRemainingPackets
=
0
;
// get file length
...
...
lib/api/rename.js
View file @
9309fb9c
var
bigi
nt
=
require
(
'
../tools/bigint
'
);
var
BigI
nt
=
require
(
'
../tools/bigint
'
);
var
SMB2Request
=
require
(
'
../tools/smb2-forge
'
).
request
;
var
FILE_OPEN_IF
=
require
(
'
../structures/constants
'
).
FILE_OPEN_IF
;
...
...
@@ -68,16 +68,16 @@ function renameBuffer(newPath, options) {
return
Buffer
.
concat
([
// ReplaceIfExists 1 byte
new
bigi
nt
(
1
,
options
.
replace
?
1
:
0
).
toBuffer
(),
new
BigI
nt
(
1
,
options
.
replace
?
1
:
0
).
toBuffer
(),
// Reserved 7 bytes
new
bigi
nt
(
7
,
0
).
toBuffer
(),
new
BigI
nt
(
7
,
0
).
toBuffer
(),
// RootDirectory 8 bytes
new
bigi
nt
(
8
,
0
).
toBuffer
(),
new
BigI
nt
(
8
,
0
).
toBuffer
(),
// FileNameLength 4 bytes
new
bigi
nt
(
4
,
filename
.
length
).
toBuffer
(),
new
BigI
nt
(
4
,
filename
.
length
).
toBuffer
(),
// FileName
filename
,
...
...
lib/api/rmdir.js
View file @
9309fb9c
var
SMB2Forge
=
require
(
'
../tools/smb2-forge
'
);
var
SMB2Request
=
SMB2Forge
.
request
;
var
bigi
nt
=
require
(
'
../tools/bigint
'
);
var
BigI
nt
=
require
(
'
../tools/bigint
'
);
/*
* rmdir
...
...
@@ -28,7 +28,7 @@ module.exports = function rmdir(path, cb) {
{
FileId
:
file
.
FileId
,
FileInfoClass
:
'
FileDispositionInformation
'
,
Buffer
:
new
bigi
nt
(
1
,
1
).
toBuffer
(),
Buffer
:
new
BigI
nt
(
1
,
1
).
toBuffer
(),
},
connection
,
function
(
err
,
files
)
{
...
...
lib/api/unlink.js
View file @
9309fb9c
var
SMB2Forge
=
require
(
'
../tools/smb2-forge
'
);
var
SMB2Request
=
SMB2Forge
.
request
;
var
bigi
nt
=
require
(
'
../tools/bigint
'
);
var
BigI
nt
=
require
(
'
../tools/bigint
'
);
/*
* unlink
...
...
@@ -31,7 +31,7 @@ module.exports = function unlink(path, cb) {
{
FileId
:
file
.
FileId
,
FileInfoClass
:
'
FileDispositionInformation
'
,
Buffer
:
new
bigi
nt
(
1
,
1
).
toBuffer
(),
Buffer
:
new
BigI
nt
(
1
,
1
).
toBuffer
(),
},
connection
,
function
(
err
,
files
)
{
...
...
lib/api/writeFile.js
View file @
9309fb9c
var
SMB2Forge
=
require
(
'
../tools/smb2-forge
'
);
var
SMB2Request
=
SMB2Forge
.
request
;
var
bigi
nt
=
require
(
'
../tools/bigint
'
);
var
BigI
nt
=
require
(
'
../tools/bigint
'
);
/*
* writeFile
...
...
@@ -30,7 +30,7 @@ module.exports = function writeFile(filename, data, options, cb) {
var
fileContent
=
Buffer
.
isBuffer
(
data
)
?
data
:
Buffer
.
from
(
data
,
options
.
encoding
);
var
fileLength
=
new
bigi
nt
(
8
,
fileContent
.
length
);
var
fileLength
=
new
BigI
nt
(
8
,
fileContent
.
length
);
function
createFile
(
fileCreated
)
{
SMB2Request
(
'
create
'
,
{
path
:
filename
},
connection
,
function
(
err
,
f
)
{
...
...
@@ -70,10 +70,10 @@ module.exports = function writeFile(filename, data, options, cb) {
}
function
writeFile
(
fileWritten
)
{
var
offset
=
new
bigi
nt
(
8
);
var
offset
=
new
BigI
nt
(
8
);
var
stop
=
false
;
var
nbRemainingPackets
=
0
;
var
maxPacketSize
=
new
bigi
nt
(
8
,
0x00010000
-
0x71
);
var
maxPacketSize
=
new
BigI
nt
(
8
,
0x00010000
-
0x71
);
// callback manager
function
callback
()
{
return
function
(
err
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment