Closed wiinxt closed 3 weeks ago
Describe the bug The "File chmod" option is not working because fs.chmodSync mode parameter needs an octal and not a decimal. The default value 775 in decimal gives 1407 in octal, so chmod sets -r-----rwt instead of -rwxrwxr-x.
fs.chmodSync
-r-----rwt
-rwxrwxr-x
The error is here: https://github.com/MrBrax/LiveStreamDVR/blob/bcde36baa432f9c22321f8d9b60fe8ae33e3e8ed/server/src/Core/Providers/Base/BaseVOD.ts#L2577
Node.js doc of fs.chmod: https://nodejs.org/api/fs.html#fschmodpath-mode-callback
fs.chmod
I suggest this change to fix the error (convert the number to a string, then parse it as octal) :
fs.chmodSync(fullpath, parseInt(Config.getInstance().cfg("file_chmod").toString(), 8));
To Reproduce
Expected behavior The permission must be 775 (-rwxrwxr-x)
Server:
Workaround I set 509 (which is 775 in octal) for now, it works well.
good catch, probably an oversight that carried over from the php version
Describe the bug The "File chmod" option is not working because
fs.chmodSync
mode parameter needs an octal and not a decimal. The default value 775 in decimal gives 1407 in octal, so chmod sets-r-----rwt
instead of-rwxrwxr-x
.The error is here: https://github.com/MrBrax/LiveStreamDVR/blob/bcde36baa432f9c22321f8d9b60fe8ae33e3e8ed/server/src/Core/Providers/Base/BaseVOD.ts#L2577
Node.js doc of
fs.chmod
: https://nodejs.org/api/fs.html#fschmodpath-mode-callbackI suggest this change to fix the error (convert the number to a string, then parse it as octal) :
To Reproduce
-r-----rwt
instead of-rwxrwxr-x
)Expected behavior The permission must be 775 (
-rwxrwxr-x
)Server:
Workaround I set 509 (which is 775 in octal) for now, it works well.