Bug bash fixes: special-file reads, per-client lockout, prefs validation, security headers, kernel-thread guard, login feedback, error text; plus journal-quiet sudoers + journal groups, upload overwrite guard, machines pattern, dnf freshness, cron/services speed, clean version
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
57c58ebffb
commit
27f9665606
@@ -1093,9 +1093,14 @@ func (c *Collector) Processes() ProcTable {
|
||||
|
||||
// Signal sends a signal to a pid; falls back to sudo when the process isn't ours.
|
||||
func Signal(pid int, sig syscall.Signal) error {
|
||||
if pid <= 1 {
|
||||
if pid <= 1 || pid == os.Getpid() {
|
||||
return errors.New("refusing to signal pid " + strconv.Itoa(pid))
|
||||
}
|
||||
if strings.TrimRight(readStr("/proc/"+strconv.Itoa(pid)+"/cmdline"), "\x00") == "" {
|
||||
if _, err := os.Stat("/proc/" + strconv.Itoa(pid)); err == nil {
|
||||
return errors.New("refusing to signal a kernel thread")
|
||||
}
|
||||
}
|
||||
if err := syscall.Kill(pid, sig); err == nil {
|
||||
return nil
|
||||
} else if !errors.Is(err, syscall.EPERM) {
|
||||
|
||||
Reference in New Issue
Block a user