Sorry, I confused -p and -q! <div><br></div><div>In any case, since this is called at installs, <i>no </i>prompting is allowed, and it totally breaks an install when it comes up.  </div><div><br></div><div>The -p option "Fixes errors but does not report them." (<a href="http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds2/grpck.htm">http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds2/grpck.htm</a>).</div>
<div><br></div><div>I don't object to -q, but I don't see the point of calling it at all in that case. ::shrug::</div><div><br></div><div>The important case is that the prompt go away in installs. That would need to be fixed in user-setup-apply. (finish-install's postinst calls 06user-setup, which calls user-setup-apply, which calls shadowconfig, or something like that.)</div>
<div><br></div><div>Thomas</div><div><br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 1:48 PM, Nicolas François <span dir="ltr"><<a href="mailto:nicolas.francois@centraliens.net">nicolas.francois@centraliens.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<div class="im"><br>
On Tue, Sep 06, 2011 at 03:36:59PM -0700, <a href="mailto:tb@becket.net">tb@becket.net</a> wrote:<br>
> On Thu, Aug 18, 2011 at 10:10 AM, Nicolas François <<br>
> <a href="mailto:nicolas.francois@centraliens.net">nicolas.francois@centraliens.net</a>> wrote:<br>
</div><div class="im">> > On Wed, Aug 17, 2011 at 07:37:47PM -0700, <a href="mailto:tb@becket.net">tb@becket.net</a> wrote:<br>
> > ><br>
> > > /sbin/shadowconfig from the passwd package uses "pwck -p" and "grpck -p".<br>
> > On<br>
> > > some other systems, the -p flag to these programs says to silently fix<br>
> > > problems found in those files.<br>
> ><br>
> > Can you point me where "pwck -p" is called?<br>
><br>
> In /sbin/shadowconfig, in both the shadowon() and shadowoff() functions;<br>
> passwd package version 1:4.1.4.2+svn3283-2+squeeze1.<br>
<br>
</div>This uses pwck -q not pwck -p<br>
<div class="im"><br>
> > Could you provide a /etc/group - /etc/gshadow configuration where grpck<br>
> > ignores the -p option and prompt for confirmation?<br>
><br>
> # echo mumblefoo:x:5000:mumblemumble >> /etc/group<br>
> # grpck -p<br>
> group mumblefoo: no user mumblemumble<br>
> delete member 'mumblemumble'?<br>
<br>
</div>Thanks.<br>
<br>
I dig a bit regarding the -p option of grpck.<br>
It was introduced to silently fix a bug in groupdel 10 years ago. I think<br>
this Debian specific patch should be removed.<br>
<a href="http://bugs.debian.org/103385" target="_blank">http://bugs.debian.org/103385</a><br>
<br>
(Also, the patch is now buggy because it does not remove the invalid<br>
lines. It just print Yes, and continue without prompting and removing the<br>
line)<br>
<br>
Do you have a description of what the -p option does (for grpck or pwck)<br>
on other systems?<br>
(It might have come from AIX)<br>
<br>
<br>
Then the question is how shadowconfig should behave?<br>
Currently, with pwck -q, the user is prompted in case of an error which<br>
can be fixed easily interactively, but other errors are not displayed<br>
(e.g. invalid home directory or primary group).<br>
The goal is just to be a bit less verbose, especially because<br>
<br>
The -q option with the same behavior already exists for grpck. It does<br>
nothing because for each error detected, there is a proposed solution<br>
(e.g. delete an invalid line, remove an invalid user from the list of<br>
members / admins)<br>
<br>
<br>
If the intent is to show the errors without giving the opportunity to fix<br>
the errors, the -r option should be used.<br>
<br>
During installs, prompts on stdin are not allowed (debconf would have to<br>
be used), so shadowconfig could be use:<br>
pwck -q -r (to avoid too many warnings and to avoid prompting)<br>
grpck -r   (to avoid prompting)<br>
<br>
This behavior should not be the default behavior of shadowconfig, so<br>
shadowconfig should also receive a --no-prompt option to activate the -r<br>
option of the checkers.<br>
<br>
Do you agree?<br>
<br>
Best Regards<br>
<font color="#888888">--<br>
Nekral<br>
</font></blockquote></div><br></div>