CURRENT branch

Julien ÉLIE julien at trigofacile.com
Mon Jan 14 16:22:39 UTC 2008


Hi The Doctor,

> What is happening with the CURRENT branch?
>
> No updates since 11 Jan 2008.

Ooops...  It looks like as though I broke something with
my last commit on January, 12th for the new
runasnews/runasgroup options.

Sorry I did not compile with warnings on :(

newsuser.c: In function 'get_news_uid_gid':
newsuser.c:38: warning: implicit declaration of function 'die'
newsuser.c:38: warning: nested extern declaration of 'die'

inews.c: In function 'AnAdministrator':
inews.c:345: warning: unused variable 'p'
inews.c:344: warning: unused variable 'mem'
inews.c:340: warning: unused parameter 'name'
inews.c:340: warning: unused parameter 'group'

innbind.c: In function 'main':
innbind.c:269: warning: unused variable 'pwd'


Well, I have just committed a patch.  Sorry again for the disturbance.

Julien


Index: frontends/inews.c
===================================================================
--- frontends/inews.c   (révision 7703)
+++ frontends/inews.c   (copie de travail)
@@ -337,12 +337,10 @@
 **  See if the user is the news administrator.
 */
 static bool
-AnAdministrator(char *name, gid_t group)
+AnAdministrator(void)
 {
     uid_t               news_uid;
     gid_t               news_gid;
-    char               **mem;
-    char               *p;

     if (Revoked)
        return false;
@@ -383,12 +381,11 @@
 **  Check the control message, and see if it's legit.
 */
 static void
-CheckControl(char *ctrl, struct passwd *pwp)
+CheckControl(char *ctrl)
 {
     char       *p;
     char       *q;
     char               save;
-    char               name[SMBUF];

     /* Snip off the first word. */
     for (p = ctrl; ISWHITE(*p); p++)
@@ -416,8 +413,7 @@
          || strcmp(ctrl, "sendsys")     == 0
          || strcmp(ctrl, "senduuname")  == 0
          || strcmp(ctrl, "version")     == 0) {
-       strlcpy(name, pwp->pw_name, SMBUF);
-       if (!AnAdministrator(name, pwp->pw_gid))
+       if (!AnAdministrator())
             die("ask your news administrator to do the %s for you", ctrl);
     }
     else {
@@ -570,14 +566,14 @@

     /* Set Subject; Control overrides the subject. */
     if (HDR(_control)) {
-       CheckControl(HDR(_control), pwp);
+       CheckControl(HDR(_control));
     }
     else {
        p = HDR(_subject);
        if (p == NULL)
             die("required Subject header is missing or empty");
        else if (HDR(_alsocontrol))
-           CheckControl(HDR(_alsocontrol), pwp);
+           CheckControl(HDR(_alsocontrol));
 #if    0
        if (strncmp(p, "Re: ", 4) == 0 && HDR(_references) == NULL)
             die("article subject begins with \"Re: \" but has no references");
Index: lib/newsuser.c
===================================================================
--- lib/newsuser.c      (révision 7703)
+++ lib/newsuser.c      (copie de travail)
@@ -14,6 +14,7 @@
 #include <grp.h>

 #include "inn/innconf.h"
+#include "inn/messages.h"
 #include "inn/newsuser.h"

 /*
@@ -35,8 +36,8 @@
     } else if ((pwd = getpwnam(runasuser)) != 0) {
         *uid = pwd->pw_uid;
     } else if (may_die) {
-        die (("can't resolve %s to a UID"
-              " (account doesn't exist?)"), runasuser);
+        die ("can't resolve %s to a UID"
+              " (account doesn't exist?)", runasuser);
     } else {
         fail = true;
     }
@@ -47,8 +48,8 @@
     } else if ((grp = getgrnam(runasgroup)) != 0) {
         *gid = grp->gr_gid;
     } else if (may_die) {
-        die (("can't resolve %s to a GID"
-              " (group doesn't exist?)"), runasgroup);
+        die ("can't resolve %s to a GID"
+              " (group doesn't exist?)", runasgroup);
     } else {
         fail = true;
     }
Index: backends/innbind.c
===================================================================
--- backends/innbind.c  (révision 7703)
+++ backends/innbind.c  (copie de travail)
@@ -266,7 +266,6 @@
 int
 main(int argc, char *argv[])
 {
-    struct passwd *pwd;
     uid_t real_uid, uid;
     int i;
     bool done;



More information about the inn-workers mailing list