#701·nedb

Regarding the issue of writing permissions

Author: ArSrNaCreated Jul 28, 2023Updated Jul 28, 2023

If I run a nodejs code with root permission, including the content of the db.update updates database, nedb will change the corresponding database file uid and gid to root permission (uid and gid is 0). Use fs.statSync() for checking.

This will cause me to use a non root user to execute the nodejs code that db.find() reads nedb, and will prompt ErrorEACCES: permission denied, open mnt/data.json.

This problem can be replicated on the SCF mount to CFS of Tencent Cloud, which is used as the storage database. image