merge: Merge upstream v1.14.6

This commit is contained in:
Shtorm
2026-11-30 19:46:00 +03:00
292 changed files with 6311 additions and 5159 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ func main() {
}
}
var standaloneVersionUpdated bool
newContent, standaloneVersionUpdated = findAndReplace(objectsMap, newContent, []string{"io.nekohasekai.sfamt.standalone", "io.nekohasekai.sfamt.system"}, newVersion.String())
newContent, standaloneVersionUpdated = findAndReplace(objectsMap, newContent, []string{"io.nekohasekai.sfamt.standalone", "io.nekohasekai.sfamt.system", "io.nekohasekai.sfamt.helper"}, newVersion.String())
if standaloneVersionUpdated {
marketingVersionUpdated = true
log.Info("updated version to ", newVersion.String())
+7 -1
View File
@@ -15,6 +15,8 @@ import (
"golang.org/x/sys/unix"
)
var initialDir, _ = os.Getwd()
func runInUserNamespaceIfNeeded(options option.Options, optionsList []*OptionsEntry) error {
if !common.Any(options.NetworkNamespaces, func(namespace option.NetworkNamespace) bool {
return namespace.Type == C.NetNsTypeUnshare
@@ -31,8 +33,12 @@ func runInUserNamespaceIfNeeded(options option.Options, optionsList []*OptionsEn
if data[0].Effective&(1<<unix.CAP_SYS_ADMIN) != 0 {
return nil
}
if data[0].Effective != 0 || data[1].Effective != 0 {
return E.New("unshare network namespace requires CAP_SYS_ADMIN when running with other capabilities, as the rootless user namespace drops them")
}
command := exec.Command("/proc/self/exe", os.Args[1:]...)
command.Args = os.Args
command.Dir = initialDir
command.Stdin = os.Stdin
for _, entry := range optionsList {
if entry.path == "stdin" {
@@ -50,7 +56,7 @@ func runInUserNamespaceIfNeeded(options option.Options, optionsList []*OptionsEn
{ContainerID: os.Getegid(), HostID: os.Getegid(), Size: 1},
},
GidMappingsEnableSetgroups: false,
AmbientCaps: []uintptr{unix.CAP_SYS_ADMIN, unix.CAP_NET_ADMIN, unix.CAP_NET_RAW},
AmbientCaps: []uintptr{unix.CAP_SYS_ADMIN, unix.CAP_NET_ADMIN, unix.CAP_NET_RAW, unix.CAP_NET_BIND_SERVICE},
Setpgid: true,
Pdeathsig: syscall.SIGKILL,
}
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build generate && generate_completions
//go:build generate_completions
package main
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build !generate
//go:build !generate_completions
package main