commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-171-g2425f


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-171-g2425fa8
Date: Fri, 14 Sep 2012 19:02:11 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  2425fa8d7d7b0e58e8913fe02fa985d344c5ee70 (commit)
      from  e28334cfec659d6d7ac064ecffbc7948bc91fd54 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=2425fa8d7d7b0e58e8913fe02fa985d344c5ee70


commit 2425fa8d7d7b0e58e8913fe02fa985d344c5ee70
Author: Mats Erik Andersson <address@hidden>
Date:   Fri Sep 14 20:58:21 2012 +0200

    libinetutils: Compiler warnings.

diff --git a/ChangeLog b/ChangeLog
index 21f93ea..78978e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,34 @@
 2012-09-14  Mats Erik Andersson  <address@hidden>
 
+       libinetutils: Compiler warnings.
+
+       * libinetutils/argcv.c (argcv_get): Cast element as int.
+       * libinetutils/cleansess.c [HAVE_UTMP_H && HAVE_LIBUTIL_H]:
+       Include <libutil.h>.
+       * libinetutils/daemon.c: Include <unused-parameter.h>.
+       (waitdaemon_timeout): Add _GL_UNUSED_PARAMETER.
+       * libinetutils/kcmd.c (kcmd): Cast strlen() as ssize_t.
+       Add parantheses in logical expression.
+       [SHISHI]: Declare SIN_LEN as socklen_t.  Trivial use of
+       parameter service.
+       * libinetutils/logwtmp.c (OUR_WTMP): New macro.
+       (_logwtmp): Call open() with OUR_WTMP.
+       * libinetutils/shishi.c (shishi_auth): Cast sizeof() as
+       ssize_t.  Cast sname as `char *' in assignment of P.
+       (senderror): Remove function, keeping as comment.
+       (gat_auth): Remove variables I and AUTH_CORRECT.  Cast
+       size expression as int.
+       * libinetutils/utmp_init.c [HAVE_UTMP_H && HAVE_LIBUTIL_H]:
+       Include <libutil.h>.
+       (utmp_init) [!HAVE_UTMPX_H && !HAVE_PUTUTLINE && HAVE_LOGIN]:
+       Trivially use parameter id.
+       * libinetutils/utmp_logout.c [HAVE_UTMP_H && HAVE_LIBUTIL_H]:
+       Include <libutil.h>.
+       (utmp_logout) [!HAVE_UTMPX_H && HAVE_PUTUTLINE]: Protect
+       declaration of UT.
+
+2012-09-14  Mats Erik Andersson  <address@hidden>
+
        telnetd: More compiler warnings.
 
        * am/libcurses.m4 (IU_LIB_TERMCAP): Use AC_LINK_IFELSE
diff --git a/libinetutils/argcv.c b/libinetutils/argcv.c
index f8396de..ceab19b 100644
--- a/libinetutils/argcv.c
+++ b/libinetutils/argcv.c
@@ -78,7 +78,7 @@ argcv_get (const char *command, const char *delim, int *argc, 
char ***argv)
   *argc = 0;
   *argv = NULL;
 
-  while (len > 0 && isspace (command[len - 1]))
+  while (len > 0 && isspace ((int) command[len - 1]))
     len--;
   if (len < 1)
     return 1;
diff --git a/libinetutils/cleansess.c b/libinetutils/cleansess.c
index 5fa811d..5be83ce 100644
--- a/libinetutils/cleansess.c
+++ b/libinetutils/cleansess.c
@@ -27,9 +27,12 @@
 #include <sys/time.h>
 #include <time.h>
 #ifdef HAVE_UTMP_H
-# if HAVE_UTIL_H
+# ifdef HAVE_UTIL_H
 #  include <util.h>
 # endif
+# ifdef HAVE_LIBUTIL_H
+#  include <libutil.h>
+# endif
 # include <utmp.h>
 #else
 # ifdef  HAVE_UTMPX_H
diff --git a/libinetutils/daemon.c b/libinetutils/daemon.c
index 849c86f..5606b10 100644
--- a/libinetutils/daemon.c
+++ b/libinetutils/daemon.c
@@ -55,6 +55,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#include <unused-parameter.h>
 
 /*
   According to Unix-FAQ maintained by Andrew Gierth:
@@ -103,7 +104,7 @@
 #define MAXFD 64
 
 void
-waitdaemon_timeout (int signo)
+waitdaemon_timeout (int signo _GL_UNUSED_PARAMETER)
 {
   int left;
 
@@ -147,8 +148,10 @@ waitdaemon (int nochdir, int noclose, int maxwait)
   if (setsid () == -1)
     return -1;
 
-  /* SIGHUP is ignore because when the session leader terminates
-     all process in the session (the second child) are sent the SIGHUP.  */
+  /* SIGHUP must be ignored, because when the session leader terminates,
+     then SIGHUP is sent to all process belonging to the same session,
+     i.e., also to the second child.
+   */
   signal (SIGHUP, SIG_IGN);
 
   switch (fork ())
diff --git a/libinetutils/kcmd.c b/libinetutils/kcmd.c
index 7edca38..26ee739 100644
--- a/libinetutils/kcmd.c
+++ b/libinetutils/kcmd.c
@@ -373,7 +373,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
        }
       listen (s2, 1);
       sprintf (num, "%d", lport);
-      if (write (s, num, strlen (num) + 1) != strlen (num) + 1)
+      if (write (s, num, strlen (num) + 1) != (ssize_t) strlen (num) + 1)
        {
          perror ("kcmd(write): setting up stderr");
          close (s2);
@@ -395,7 +395,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
             : ntohs (((struct sockaddr_in *) &from)->sin_port);
 
       if (port >= IPPORT_RESERVED
-          || from.ss_family != AF_INET && from.ss_family != AF_INET6)
+          || (from.ss_family != AF_INET && from.ss_family != AF_INET6))
        {
          fprintf (stderr,
                   "kcmd(socket): protocol failure in circuit setup.\n");
@@ -437,7 +437,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
 # elif defined(SHISHI)
   if (authopts & SHISHI_APOPTIONS_MUTUAL_REQUIRED)
     {
-      int sin_len;
+      socklen_t sin_len;
 
       *faddr = sin;
 
@@ -450,6 +450,8 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
        }
     }
 
+  (void) service;      /* Silence warning.  XXX: Implicit use?  */
+
   if ((status =
        shishi_auth (h, 0, remuser, *ahost, s, cmd, rport, key,
                    realm)) != SHISHI_OK)
diff --git a/libinetutils/logwtmp.c b/libinetutils/logwtmp.c
index 4f676f9..e8a0965 100644
--- a/libinetutils/logwtmp.c
+++ b/libinetutils/logwtmp.c
@@ -39,9 +39,10 @@
 #  define __USE_GNU 1
 # endif
 # include <utmpx.h>
+# define OUR_WTMP PATH_WTMPX
 #elif defined HAVE_UTMP_H
 # include <utmp.h>
-# define PATH_WTMPX PATH_WTMP  /* Simplifies file referencing.  */
+# define OUR_WTMP PATH_WTMP
 #endif
 #include <string.h>
 
@@ -61,9 +62,9 @@ _logwtmp (struct utmp *ut)
   static int fd = -1;
 
   if (fd < 0)
-    fd = open (PATH_WTMPX, O_WRONLY | O_APPEND, 0);
+    fd = open (OUR_WTMP, O_WRONLY | O_APPEND, 0);
 #else
-  int fd = open (PATH_WTMPX, O_WRONLY | O_APPEND, 0);
+  int fd = open (OUR_WTMP, O_WRONLY | O_APPEND, 0);
 #endif
 
   if (fd >= 0)
diff --git a/libinetutils/shishi.c b/libinetutils/shishi.c
index 98f3662..1df3195 100644
--- a/libinetutils/shishi.c
+++ b/libinetutils/shishi.c
@@ -98,7 +98,7 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
       errormsg[0] = '\0';
       n = read (sock, errormsg, sizeof (errormsg) - 1);
 
-      if (n >= 0 && n < sizeof (errormsg))
+      if (n >= 0 && n < (ssize_t) sizeof (errormsg))
        errormsg[n] = '\0';
       else
        errormsg[sizeof (errormsg) -1] = '\0';
@@ -136,7 +136,7 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
   if (!realm)
     {
       if (!p)
-       p = sname;
+       p = (char *) sname;
       else if (*p == '/')
        ++p;
 
@@ -260,12 +260,16 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
 
 }
 
+/*
+ * XXX: Is this ever needed?
+ *
 static void
 senderror (int s, char type, char *buf)
 {
   write (s, &type, sizeof (char));
   write (s, buf, strlen (buf));
 }
+*/
 
 /* shishi authentication, server side */
 int
@@ -280,14 +284,12 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   int buflen;
   int len;
   int rc;
-  int i;
   int error;
   /* KERBEROS 5 SENDAUTH MESSAGE */
   char krb5sendauth[] = "KRB5_SENDAUTH_V1.0";
   /* PROTOCOL VERSION */
   char krb5kcmd1[] = "KCMDV0.1";
   char krb5kcmd2[] = "KCMDV0.2";
-  int auth_correct = 0;
   char *servername, *server, *realm;
 
   *err_msg = NULL;
@@ -526,7 +528,7 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
        }
 
       rc = write (infd, out, ntohl (len));
-      if (rc != ntohl (len))
+      if (rc != (int) ntohl (len))
        {
          *err_msg = "Error sending AP-REP";
          free (out);
diff --git a/libinetutils/utmp_init.c b/libinetutils/utmp_init.c
index a15781c..b598a9f 100644
--- a/libinetutils/utmp_init.c
+++ b/libinetutils/utmp_init.c
@@ -53,9 +53,12 @@
 # endif
 # include <utmpx.h>
 #else /* !HAVE_UTMPX_H */
-# if HAVE_UTIL_H
+# ifdef HAVE_UTIL_H
 #  include <util.h>
 # endif
+# ifdef HAVE_LIBUTIL_H
+#  include <libutil.h>
+# endif
 # include <utmp.h>
 #endif
 #include <string.h>
@@ -148,6 +151,7 @@ utmp_init (char *line, char *user, char *id, char *host)
 #  endif /* wtmp updating */
   endutent ();
 # elif defined HAVE_LOGIN /* !HAVE_PUTUTLINE */
+  (void) id;           /* Silence warnings.  */
   login (&utx);
 # endif /* HAVE_LOGIN && !HAVE_PUTUTLINE */
 #endif /* !HAVE_UTMPX_H */
diff --git a/libinetutils/utmp_logout.c b/libinetutils/utmp_logout.c
index 1cab5b8..3ef74d6 100644
--- a/libinetutils/utmp_logout.c
+++ b/libinetutils/utmp_logout.c
@@ -52,9 +52,12 @@
 # endif
 # include <utmpx.h>
 #else /* !HAVE_UTMPX_H */
-# if HAVE_UTIL_H
+# ifdef HAVE_UTIL_H
 #  include <util.h>
 # endif
+# ifdef HAVE_LIBUTIL_H
+#  include <libutil.h>
+# endif
 # include <utmp.h>
 #endif
 #include <string.h>
@@ -113,7 +116,9 @@ utmp_logout (char *line)
 
 #else /* !HAVE_UTMPX_H */
   struct utmp utx;
+# ifdef HAVE_PUTUTLINE
   struct utmp *ut;
+# endif
 
   strncpy (utx.ut_line, line, sizeof (utx.ut_line));
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   29 +++++++++++++++++++++++++++++
 libinetutils/argcv.c       |    2 +-
 libinetutils/cleansess.c   |    5 ++++-
 libinetutils/daemon.c      |    9 ++++++---
 libinetutils/kcmd.c        |    8 +++++---
 libinetutils/logwtmp.c     |    7 ++++---
 libinetutils/shishi.c      |   12 +++++++-----
 libinetutils/utmp_init.c   |    6 +++++-
 libinetutils/utmp_logout.c |    7 ++++++-
 9 files changed, 67 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]