Broken su in current - trying to fix myself, help needed!

Artem Kuchin matrix at itlegion.ru
Thu Oct 18 05:45:53 PDT 2007


> What Artem is seeing is not (yet) a 'bug' in su in my mind.
> 

You missed reply from David Xu in the list on this matter.

To me there is CLEARLY a bug in the source code. It tried
to get group of already dead process.

Here is quote from my and David's letters:

> The weird thing is that if i just comment out those lines like this
> 
> /* child_pgrp = getpgid(child_pid);
>   if (tcgetpgrp(STDERR_FILENO) == child_pgrp) */
>   tcsetpgrp(STDERR_FILENO, getpgrp());
> 
> su starts working again just fine.
> 
> Any idea why getpgid fails and why tcgetpgrp return 100000 (always the same
> number)? What will brak if i leave these lines commented?
> 
> -- 
> Regards,
> Artem

file su.c, line 472 may be incorrect since line 456 is a while loop 
which only
exits if child process is exited. just remove line 472 and 473 to see if 
problem
is fixed.

--
Artem



More information about the freebsd-current mailing list