Przeglądaj źródła

update chmod settings

Toby Chui 6 lat temu
rodzic
commit
4e67385396
4 zmienionych plików z 2 dodań i 3 usunięć
  1. BIN
      fsexec_amd64.elf
  2. BIN
      fsexec_armv6l.elf
  3. BIN
      fsexec_i386.elf
  4. 2 3
      main.go

BIN
fsexec_amd64.elf


BIN
fsexec_armv6l.elf


BIN
fsexec_i386.elf


+ 2 - 3
main.go

@@ -114,8 +114,10 @@ func moveLogFile(logfile string, target string, uuid string) {
 	//If then else is used to prevent invalid move target
 	if target == "done" {
 		os.Rename(logfile, "log/done/"+uuid+".log")
+		os.Chmod("log/done/"+uuid+".log", 0777) //Unlock the file for read write from php
 	} else if target == "error" {
 		os.Rename(logfile, "log/error/"+uuid+".log")
+		os.Chmod("log/error/"+uuid+".log", 0777) //Unlock the file for read write from php
 	} else {
 		//What happened?o
 		panic("ERROR. Undefined log file sattle location.")
@@ -129,9 +131,6 @@ func finishFileOperation(logfile string, uuid string) {
 	writeLog(logfile, "[done] ", "Task finished successfully")
 	moveLogFile(logfile, "done", uuid)
 	fmt.Println("Done")
-	os.Chmod("log/", 0777) //Try to give log folder permissions to PHP for removal.
-	os.Chmod("log/done/", 0777)
-	os.Chmod("log/error/", 0777)
 }
 
 func initChk() {