f11ff8650d
A new elevate request verifies the web sign-in password (scrypt hash, read-only, rate-limited, constant time) and elevates that connection for 15 minutes. chat_shell_run/input, rename/move/delete, terminal_open/input and POST /files (via a per-connection upload token) are refused with code elevation_required until then.
14 lines
209 B
Go
14 lines
209 B
Go
//go:build darwin || linux
|
|
|
|
package server
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
func ownedByCurrentUser(info os.FileInfo) bool {
|
|
stat, ok := info.Sys().(*syscall.Stat_t)
|
|
return ok && int(stat.Uid) == os.Getuid()
|
|
}
|