mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
895dec208f
OpenResty running as openflare can no longer write pid or client/proxy temp paths under the OpenResty install prefix. Templates and apply-time rendering now use __OPENFLARE_PID_PATH__ and __OPENFLARE_NGINX_CACHE_DIR__ under data_dir/var/run and data_dir/var/cache/nginx, with legacy pid path patched at apply. Consolidate runtimeuser path helpers into the main package file so IDEs resolve references across build tags.
20 lines
372 B
Go
20 lines
372 B
Go
//go:build unix
|
|
|
|
package runtimeuser
|
|
|
|
import (
|
|
"fmt"
|
|
"syscall"
|
|
)
|
|
|
|
func init() {
|
|
dropToImpl = func(account *Account) error {
|
|
if err := syscall.Setgid(account.GID); err != nil {
|
|
return fmt.Errorf("setgid %d: %w", account.GID, err)
|
|
}
|
|
if err := syscall.Setuid(account.UID); err != nil {
|
|
return fmt.Errorf("setuid %d: %w", account.UID, err)
|
|
}
|
|
return nil
|
|
}
|
|
} |