INN commit: trunk (backends/innbind.c frontends/inews.c lib/newsuser.c)
INN Commit
Russ_Allbery at isc.org
Mon Jan 14 16:24:16 UTC 2008
Date: Monday, January 14, 2008 @ 08:24:16
Author: iulius
Revision: 7705
Fix compilation errors when warnings are on.
(Following commit 7703 for runasnews/runasgroup.)
Modified:
trunk/backends/innbind.c
trunk/frontends/inews.c
trunk/lib/newsuser.c
--------------------+
backends/innbind.c | 1 -
frontends/inews.c | 14 +++++---------
lib/newsuser.c | 9 +++++----
3 files changed, 10 insertions(+), 14 deletions(-)
Modified: backends/innbind.c
===================================================================
--- backends/innbind.c 2008-01-12 09:54:59 UTC (rev 7704)
+++ backends/innbind.c 2008-01-14 16:24:16 UTC (rev 7705)
@@ -266,7 +266,6 @@
int
main(int argc, char *argv[])
{
- struct passwd *pwd;
uid_t real_uid, uid;
int i;
bool done;
Modified: frontends/inews.c
===================================================================
--- frontends/inews.c 2008-01-12 09:54:59 UTC (rev 7704)
+++ frontends/inews.c 2008-01-14 16:24:16 UTC (rev 7705)
@@ -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");
Modified: lib/newsuser.c
===================================================================
--- lib/newsuser.c 2008-01-12 09:54:59 UTC (rev 7704)
+++ lib/newsuser.c 2008-01-14 16:24:16 UTC (rev 7705)
@@ -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;
}
More information about the inn-committers
mailing list