all repos — honk @ d23f5ab00e020cd65d2519fe2b1531e57e13d565

my fork of honk

only allow big M to forge new content
Ted Unangst tedu@tedunangst.com
Sun, 28 Apr 2019 23:26:12 -0400
commit

d23f5ab00e020cd65d2519fe2b1531e57e13d565

parent

e857d06e4e277639ef58f5d542f6f941178d47d4

2 files changed, 5 insertions(+), 2 deletions(-)

jump to
M fun.gofun.go

@@ -385,7 +385,7 @@ }

return false } -func keymatch(keyname string, actor string, userid int64) bool { +func keymatch(keyname string, actor string, what string, userid int64) bool { hash := strings.IndexByte(keyname, '#') if hash == -1 { hash = len(keyname)

@@ -393,6 +393,9 @@ }

owner := keyname[0:hash] if owner == actor { return true + } + if what != "Create" { + return false } row := stmtHasHonker.QueryRow(owner, userid) var id int64
M honk.gohonk.go

@@ -314,7 +314,7 @@ if what == "Like" {

return } who, _ := jsongetstring(j, "actor") - if !keymatch(keyname, who, user.ID) { + if !keymatch(keyname, who, what, user.ID) { log.Printf("keyname actor mismatch: %s <> %s", keyname, who) return }