| Summary: | [PATCH] setpgrp does not behave as manual says | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | SANETO Takanori <sanewo> | ||||||
| Component: | kern | Assignee: | David Schultz <das> | ||||||
| Status: | Closed FIXED | ||||||||
| Severity: | Affects Only Me | ||||||||
| Priority: | Normal | ||||||||
| Version: | 5.0-CURRENT | ||||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| Attachments: |
|
||||||||
Responsible Changed From-To: freebsd-bugs->standards Can the standards people please have a look at this and decide which of the patches is the way to go? Responsible Changed From-To: standards->das I'll take a look at this. State Changed From-To: open->closed The documentation was outdated. Fixed in src/lib/libc/sys/setpgid.2,v 1.14. Thanks for the report! This PR is closed. However the fix still needs to be MFC. |
As superuser, setpgrp(1,1) fails (errno=ESRCH). setpgrp(2) says: If the invoker is not the super-user, then the affected process must have the same effective user-id as the invoker or be a descendant of the invoking process. Actually, document says nothing about what should happen when the invoker is the super-user. So it might not be a software bug, but a poor documentation... Fix: 1. Fix the document Or 2. Fix the kernel source How-To-Repeat: Compile following program: main() { if (setpgrp(1,1) < 0) perror("setpgrp"); } and run it as root.