mirror of
https://github.com/go-shiori/shiori.git
synced 2024-09-20 15:06:14 +08:00
fix: data dir permissions having execute for all (#493)
This commit is contained in:
parent
d0210447d2
commit
158c52a325
|
@ -38,7 +38,7 @@ func exportHandler(cmd *cobra.Command, args []string) {
|
|||
|
||||
// Make sure destination directory exist
|
||||
dstDir := fp.Dir(args[0])
|
||||
if err := os.MkdirAll(dstDir, os.ModePerm); err != nil {
|
||||
if err := os.MkdirAll(dstDir, model.DataDirPerm); err != nil {
|
||||
cError.Printf("Error crating destination directory: %s", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
fp "path/filepath"
|
||||
|
||||
"github.com/go-shiori/shiori/internal/database"
|
||||
"github.com/go-shiori/shiori/internal/model"
|
||||
apppaths "github.com/muesli/go-app-paths"
|
||||
"github.com/spf13/cobra"
|
||||
"golang.org/x/net/context"
|
||||
|
@ -55,7 +56,7 @@ func preRunRootHandler(cmd *cobra.Command, args []string) {
|
|||
os.Exit(1)
|
||||
}
|
||||
|
||||
err = os.MkdirAll(dataDir, os.ModePerm)
|
||||
err = os.MkdirAll(dataDir, model.DataDirPerm)
|
||||
if err != nil {
|
||||
cError.Printf("Failed to create data dir: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
|
|
@ -165,7 +165,7 @@ func downloadBookImage(url, dstPath string) error {
|
|||
|
||||
// At this point, the download has finished successfully.
|
||||
// Prepare destination file.
|
||||
err = os.MkdirAll(fp.Dir(dstPath), os.ModePerm)
|
||||
err = os.MkdirAll(fp.Dir(dstPath), model.DataDirPerm)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create image dir: %v", err)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
package model
|
||||
|
||||
// DataDirPerm the default filesystem permissions for the data directory/archives
|
||||
const DataDirPerm = 0744
|
||||
|
||||
// DatabaseDateFormat the string formatting of datetimes for the database
|
||||
const DatabaseDateFormat = "2006-01-02 15:04:05"
|
||||
|
|
Loading…
Reference in a new issue