fix: use os.Tempdir instead of /tmp

This commit is contained in:
mzz2017 committed 2021-09-03 13:48:58 +08:00
1 parent 6f0f2a11cf
commit e9feddd483
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -96,7 +96,7 @@ func Down(request *Request, to string) error {
// allocate file
nanoid, _ := gonanoid.Nanoid()
filename := response.Name + "." + nanoid
tmpPath := path.Join("/tmp", filename)
tmpPath := path.Join(os.TempDir(), filename)
file, err := os.Create(tmpPath)
if err != nil {
return err
+4 -4
View File
@@ -39,10 +39,10 @@ func checkEnvironment() {
config := conf.GetEnvironmentConfig()
if !config.PassCheckRoot || config.ResetPassword {
if os.Getegid() != 0 {
log.Fatal("Please execute this program with sudo or as a root user for the best experience.\n"+
"If you are sure you are root user, use the --passcheckroot parameter to skip the check.\n",
"If you don't want to run as root or you are a non-linux user, use --lite please.",
"For example:",
log.Fatal("Please execute this program with sudo or as a root user for the best experience.\n" +
"If you are sure you are root user, use the --passcheckroot parameter to skip the check.\n" +
"If you don't want to run as root or you are a non-linux user, use --lite please.\n" +
"For example:\n" +
"$ v2raya --lite",
)
}