Hey,

Attached is a proposed patch for a command-line switch. I don't know if
-n is the best option, though... ideas?

Thanks,

-- 
  [EMAIL PROTECTED]: Gustavo Noronha <http://couve.no-ip.org/~kov/>
 Debian: <http://www.debian.org/>  *  <http://www.debian-br.org/>
diff -urN sudo-1.6.8p5.orig/check.c sudo-1.6.8p5/check.c
--- sudo-1.6.8p5.orig/check.c	2005-03-15 21:32:38.000000000 -0300
+++ sudo-1.6.8p5/check.c	2005-03-16 10:41:28.322018840 -0300
@@ -122,7 +122,7 @@
     char buf[BUFSIZ];
     ssize_t nread;
 
-    if (def_lecture == never ||
+    if (user_no_lecture || def_lecture == never ||
 	(def_lecture == once && status != TS_MISSING && status != TS_ERROR))
 	return;
 
diff -urN sudo-1.6.8p5.orig/debian/changelog sudo-1.6.8p5/debian/changelog
--- sudo-1.6.8p5.orig/debian/changelog	2005-03-15 21:32:38.000000000 -0300
+++ sudo-1.6.8p5/debian/changelog	2005-03-16 10:55:18.032883616 -0300
@@ -1,3 +1,10 @@
+sudo (1.6.8p5-1.1) unstable; urgency=low
+
+  * patched to provide a -n option that avoids printing
+    the lecture on the first run
+
+ -- Gustavo Noronha Silva <[EMAIL PROTECTED]>  Wed, 16 Mar 2005 10:55:18 -0300
+
 sudo (1.6.8p5-1) unstable; urgency=high
 
   * new upstream version
diff -urN sudo-1.6.8p5.orig/sudo.c sudo-1.6.8p5/sudo.c
--- sudo-1.6.8p5.orig/sudo.c	2005-03-15 21:32:38.000000000 -0300
+++ sudo-1.6.8p5/sudo.c	2005-03-16 11:14:03.281819776 -0300
@@ -820,6 +820,9 @@
 	    case 'S':
 		SET(tgetpass_flags, TGP_STDIN);
 		break;
+  	    case 'n':
+	        user_no_lecture = 1;
+		break;
 	    case '-':
 		NewArgc--;
 		NewArgv++;
@@ -1109,7 +1112,7 @@
     char **p;
     int linelen, linemax, ulen;
     static char *uvec[] = {
-	" [-HPSb]",
+	" [-HPSbn]",
 #ifdef HAVE_BSD_AUTH_H
 	" [-a auth_type]",
 #endif
diff -urN sudo-1.6.8p5.orig/sudo.h sudo-1.6.8p5/sudo.h
--- sudo-1.6.8p5.orig/sudo.h	2005-03-15 21:32:38.000000000 -0300
+++ sudo-1.6.8p5/sudo.h	2005-03-16 11:07:39.492164672 -0300
@@ -49,6 +49,7 @@
     char *cmnd_base;
     char *cmnd_safe;
     char *class_name;
+    int   no_lecture;
 };
 
 /*
@@ -134,6 +135,7 @@
 #define user_stat		(sudo_user.cmnd_stat)
 #define user_path		(sudo_user.path)
 #define user_prompt		(sudo_user.prompt)
+#define user_no_lecture	(sudo_user.no_lecture)
 #define user_host		(sudo_user.host)
 #define user_shost		(sudo_user.shost)
 #define safe_cmnd		(sudo_user.cmnd_safe)
diff -urN sudo-1.6.8p5.orig/sudo.pod sudo-1.6.8p5/sudo.pod
--- sudo-1.6.8p5.orig/sudo.pod	2005-03-15 21:32:38.000000000 -0300
+++ sudo-1.6.8p5/sudo.pod	2005-03-16 11:49:14.497866152 -0300
@@ -29,7 +29,7 @@
 
 B<sudo> B<-K> | B<-L> | B<-V> | B<-h> | B<-k> | B<-l> | B<-v>
 
-B<sudo> [B<-HPSb>] S<[B<-a> I<auth_type>]> S<[B<-c> I<class>|I<->]>
+B<sudo> [B<-HPSbn>] S<[B<-a> I<auth_type>]> S<[B<-c> I<class>|I<->]>
 S<[B<-p> I<prompt>]> S<[B<-u> I<username>|I<#uid>]>
 S<{B<-e> file [...] | B<-i> | B<-s> | I<command>}>
 
@@ -281,6 +281,15 @@
 (or whatever the timeout is set to in I<sudoers>) but does not run
 a command.
 
+=item -n
+
+Depending on build options and I<sudoers> configuration, sudo will
+print a message about the implications of using sudo for the security
+and privacy of the system and users. This message may be printed in
+the first time the user runs sudo, always or never (see the sudoers(5)
+manual page for details).  The B<-n> option disables the printing of
+this message, if given.
+
 =item --
 
 The B<--> flag indicates that B<sudo> should stop processing command

Attachment: signature.asc
Description: Esta =?ISO-8859-1?Q?=E9?= uma parte de mensagem assinada digitalmente

Reply via email to