Message-Id: <200810150543.m9F5hZgl030603@delorie.com> X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Herb Maeder In-reply-to: Corinna Vinschen 's message of Mon, 13 Oct 2008 17:54:36 +0200. Subject: Re: invalid login gid in /etc/passwd does not show group name as 'mkgroup' Date: Tue, 14 Oct 2008 22:42:34 -0700 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 13 Oct 2008 17:54:36 +0200, Corinna Vinschen wrote: > > But if it ends up sticking around, then it probably makes sense to account > > for the additional special case that was just introduced: > > > > passwd/group_GID_clash* ) > > echo "Your group is currently \"passwd/group_GID_clash\". This indicat es" > > echo "blah, blah, blah..." > > ;; > > > > > > The "passwd/group_GID_clash" group name probably also deserves a mentio n > > > > in the Cygwin User's Guide. > > Yes, you're right, adding a case for passwd/group_GID_clash would be > nice. http://cygwin.com/acronyms/#SHTDI I'm sure the maintainer > of the base-passwd package would appreciate a patch. Sure, I'd be happy to do that. But before submitting a patch, I'd like to make sure I know what I'm talking about so I can submit a proper patch for the whole case statement. Can you confirm that the following are correct? 1) It is no longer possible to end up with the "mkgroup_l_d" group name. If I understand it correctly, this possibility went away in version 1.30 of mkgroup.c. If so, that case should be removed from the /etc/profile case statement. 2) The group name will be 'mkpasswd' if the current user's effective gid is not in /etc/group and the effective uid is not in /etc/passwd. 3) The group name will be 'passwd/group_GID_clash(%ld/%ld)' if the current user's effective gid is not in /etc/group, the effective uid is in /etc/passwd, and the gid associated with the user's SID is in /etc/group. 4) The group name will be 'mkgroup' if the current user's effective gid is not in /etc/group, the effective uid is in /etc/passwd, and the gid associated with the user's SID is not in /etc/group. If that's all correct, perhaps this chunk of pseudo-code says it more succinctly: if (current users effective gid not in /etc/group) { if (current users effective uid not in /etc/passwd) { group_name="mkpasswd"; } else if (current users SID group is in /etc/group) { group_name="passwd/group_GID_clash(egid/pgsid)" } else { group_name="mkgroup"; } } I'd like to include some version of that information in the comment above the case statement. My thinking is that if someone found where the message is being generated, they are probably looking for more information than "try running mkpasswd and mkgroup", so stating the meaning of the special group names is probably warranted. I'd also like to provide a bit more information in the statements that are printed out to the user. Perhaps something like this (where the second echo statement is new): case `id -ng` in mkpasswd ) echo "Your group is currently \"mkpasswd\". This indicates that" echo "your gid is not in /etc/group and your uid is not in /etc/passwd." echo "The /etc/passwd (and possibly /etc/group) files should be rebuilt." echo "See the man pages for mkpasswd and mkgroup then, for example, run" echo "mkpasswd -l [-d] > /etc/passwd" echo "mkgroup -l [-d] > /etc/group" echo "Note that the -d switch is necessary for domain users." ;; To summarize, I'm proposing to: * add the 'passwd/group_GID_clash' case * delete the 'mkgroup_l_d' case * provide definitions for the special group names in the comment above the case statement * modify the statements to the user to more accurately describe the nature of the problem Any opinions on if these modifications are a good idea or not? Herb. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/