mirror of
https://github.com/octoleo/syncthing.git
synced 2024-09-19 13:19:01 +00:00
Puller entrance warning
This commit is contained in:
parent
c7dde9499f
commit
a418771c04
@ -2,6 +2,25 @@
|
||||
// All rights reserved. Use of this source code is governed by an MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
/*
|
||||
__ __ _ _
|
||||
\ \ / /_ _ _ __ _ __ (_)_ __ __ _| |
|
||||
\ \ /\ / / _` | '__| '_ \| | '_ \ / _` | |
|
||||
\ V V / (_| | | | | | | | | | | (_| |_|
|
||||
\_/\_/ \__,_|_| |_| |_|_|_| |_|\__, (_)
|
||||
|___/
|
||||
|
||||
The code in this file is a piece of crap. Don't base anything on it.
|
||||
Refactorin ongoing in new-puller branch.
|
||||
|
||||
__ __ _ _
|
||||
\ \ / /_ _ _ __ _ __ (_)_ __ __ _| |
|
||||
\ \ /\ / / _` | '__| '_ \| | '_ \ / _` | |
|
||||
\ V V / (_| | | | | | | | | | | (_| |_|
|
||||
\_/\_/ \__,_|_| |_| |_|_|_| |_|\__, (_)
|
||||
|___/
|
||||
*/
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
@ -441,7 +460,7 @@ func (p *puller) handleBlock(b bqBlock) bool {
|
||||
err = os.MkdirAll(dirName, 0777)
|
||||
} else {
|
||||
// We need to make sure the directory is writeable so we can create files in it
|
||||
if (dirName != p.repoCfg.Directory) {
|
||||
if dirName != p.repoCfg.Directory {
|
||||
err = os.Chmod(dirName, 0777)
|
||||
}
|
||||
}
|
||||
@ -606,7 +625,7 @@ func (p *puller) handleEmptyBlock(b bqBlock) {
|
||||
// Ensure the file and the directory it is in is writeable so we can remove the file
|
||||
dirName := filepath.Dir(of.filepath)
|
||||
os.Chmod(of.filepath, 0666)
|
||||
if (dirName != p.repoCfg.Directory) {
|
||||
if dirName != p.repoCfg.Directory {
|
||||
os.Chmod(dirName, 0777)
|
||||
}
|
||||
if p.versioner != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user