This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] mkpasswd/mkgroup check in /etc/profile [Attn: base-files maintainer]


This is a patch to /etc/profile modifying the case statement which flags
the user if the current group name is one of the cygwin special cases.
This corresponds to recent changes in the cygwin1.dll.

The mkpasswd_l_d case was deleted since it is no longer possible, and the
passwd/group_GID_clash(<gid>/<pgsid>) was added.  See this thread for more
details:
   
    http://www.cygwin.com/ml/cygwin-apps/2008-10/msg00047.html

In addition, a comment was added describing the cause of each group name
special case.  And the echo statements to the user were modified to
include more information indicating the cause of the special cases.

The wording of the comments and echo statements could definitely use
another set of eyes...

Thanks,
Herb.


ChangeLog:
    * Updated mkpasswd/mkgroup check in /etc/profile


--- profile.orig	2006-01-21 10:06:43.000000000 -0800
+++ profile	2008-10-17 19:14:09.595418500 -0700
@@ -174,43 +174,53 @@
 
 # Check to see if mkpasswd/mkgroup needs to be run try and cut down the emails
 #   about this on the lists!
+# The following are the conditions under which the group name special cases 
+#   will appear (where uid and gid are the effective user and group ids
+#   for the current user, and pgsid is the primary group associated with the
+#   SID for the current user):
+#       mkpasswd:
+#         gid is not in /etc/group
+#         uid is not in /etc/passwd
+#       passwd/group_GID_clash(<gid>/<pgsid>):
+#         gid is not in /etc/group
+#         uid is in /etc/passwd
+#         pgsid is in /etc/group (and does not match gid)
+#       mkgroup:
+#         gid is not in /etc/group
+#         uid is in /etc/passwd
+#         pgsid is not in /etc/group
 # If this message keeps appearing and you are sure it's a mistake (ie, don't
 #   email about it!), comment out the test below.
 case `id -ng` in
 mkpasswd )
-  echo "Your group is currently \"mkpasswd\".  This indicates that"
-  echo "the /etc/passwd (and possibly /etc/group) files should be rebuilt."
+  echo "Your group is currently \"mkpasswd\".  This indicates that your"
+  echo "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."
   ;;
 
-mkgroup )
-  echo "Your group is currently \"mkgroup\".  This indicates that"
-  echo "the /etc/group (and possibly /etc/passwd) files should be rebuilt."
+passwd/group_GID_clash* )
+  echo "Your group is currently \"passwd/group_GID_clash(gid/pgsid)\".  This"
+  echo "indicates that your gid is not in /etc/group, but the pgsid (primary 
+  echo "group associated with your SID) is in /etc/group.  
+  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."
   ;;
 
-mkgroup_l_d )
-  echo "Your group name is currently \"mkgroup_l_d\". This indicates that not"
-  echo "all domain users and groups are listed in the /etc/passwd and"
-  echo "/etc/group files."
+mkgroup )
+  echo "Your group is currently \"mkgroup\".  This indicates that neither"
+  echo "your gid nor your pgsid (primary group associated with your SID)" 
+  echo "is in /etc/group."
+  echo "The /etc/group (and possibly /etc/passwd) 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
-  echo "This message is only displayed once (unless you recreate /etc/group)"
-  echo "and can be safely ignored."
-
-  # only display the above once
-  cp -f /etc/group "${HOME}/group.mkgroup_l_d" \
-  && ( [ -w /etc/group ] || chmod --silent a+w /etc/group ; )\
-  && sed -e 's/^mkgroup_l_d/mkgroup-l-d/' "${HOME}/group.mkgroup_l_d" > /etc/group \
-  && chmod --silent --reference=/etc/passwd /etc/group
-  rm -f "${HOME}/group.mkgroup_l_d"
+  echo "mkpasswd -l [-d] > /etc/passwd"
+  echo "mkgroup  -l [-d] > /etc/group"
+  echo "Note that the -d switch is necessary for domain users."
   ;;
 esac


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]