]> granicus.if.org Git - sudo/commitdiff
added exempt group support
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 10 Nov 1994 00:48:55 +0000 (00:48 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 10 Nov 1994 00:48:55 +0000 (00:48 +0000)
check.c

diff --git a/check.c b/check.c
index c332a18e2e3d8b4a36d709c04ef926972c51cf69..12d8412e28cc17504d4815689e75f18908aec0a9 100644 (file)
--- a/check.c
+++ b/check.c
@@ -86,6 +86,7 @@ static char rcsid[] = "$Id$";
  * Prototypes for local functions
  */
 static int   check_timestamp   __P((void));
+static int   user_is_exempt    __P((void));
 static void  check_passwd      __P((void));
 static void  update_timestamp  __P((void));
 static void  reminder          __P((void));
@@ -110,6 +111,9 @@ void check_user()
     register int rtn;
     mode_t oldmask;
 
+    if (user_is_exempt())      /* some users don't need to enter a passwd */
+       return;
+
     oldmask = umask(077);      /* make sure the timestamp files are private */
 
     rtn = check_timestamp();
@@ -126,6 +130,25 @@ void check_user()
 
 
 
+/********************************************************************
+ *
+ *  user_is_exempt()
+ *
+ *  this function checks the user is exempt from supplying a password
+ *  XXX - should check more that just real gid.
+ */
+
+static int user_is_exempt()
+{
+#ifdef EXEMPTGROUP
+    return ((getgid() == EXEMPTGROUP));
+#else
+    return (1);
+#endif
+}
+
+
+
 /********************************************************************
  *
  *  check_timestamp()