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-147-ga7a5c


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_1-147-ga7a5c3e
Date: Wed, 15 Aug 2012 00:47:01 +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  a7a5c3ec659145ff8f31798f351fcd180cbc36c0 (commit)
      from  2a1bd6e98f4bbc401ea792b2158df4a17e23616b (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=a7a5c3ec659145ff8f31798f351fcd180cbc36c0


commit a7a5c3ec659145ff8f31798f351fcd180cbc36c0
Author: Mats Erik Andersson <address@hidden>
Date:   Wed Aug 15 02:44:41 2012 +0200

    Refine r-commands with libshishi.

diff --git a/ChangeLog b/ChangeLog
index f6b7fa8..d330172 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,63 @@
+2012-08-15  Mats Erik Andersson  <address@hidden>
+
+       rcp, rlogin, rsh: Host names with instances.
+
+       * libinetutils/kcmd.c (kcmd) [SHISHI]: New variable HOST.
+       Whenever `*ahost' contains a slash, separate the true host
+       name into HOST.  Use HOST in resolver, and reconstruct
+       Kerberos principal as `*ahost' afterwards.
+       * libinetutils/shishi.c (shishi_auth): New variable P.
+       Check `sname' for a slash in principal name, and construct
+       TMPSERVER with prefix "host/" if needed.
+       * src/rcp.c (kerberos) <no Kerberos service>: New variable P.
+       Strip prefix like `host/' from HOST.
+       * src/rlogin.c (main): Likewise.
+       * src/rsh.c (main): Likewise.
+
+       rlogind, rshd: Qualified Kerberos server names.
+
+       * libinetutils/shishi.c (get_auth): New variables SERVER
+       and REALM.  Decompose `srvname' using shishi_parse_name().
+       Construct SERVERNAME with prefix "host/" if needed.  Use
+       shishi_realm_default_set() to set realm if present.
+       * src/rlogind.c (options) [KERBEROS || SHISHI]: Rename
+       long option name `--servername' as `--server-principal'.
+       * src/rshd.c (options) [KERBEROS || SHISHI]: Likewise.
+
+       * src/rlogin.c (main) <try_connect> [KERBEROS]: Declare HP
+       and use gethostbyname() only for KERBEROS.
+       * src/rsh.c (main) [KERBEROS]: Likewise.
+
+       rcp, rlogin, rsh: Aborting Kerberized services.
+
+       * src/rcp.c (kerberos) [KERBEROS || SHISHI]: Fail with error
+       if Kerberos authentication fails.  Degrade to plain service
+       only on ECONNREFUSED.  Resolve service `shell/tcp' only in
+       this latter case.
+       * src/rlogin.c (main) [KERBEROS || SHISHI]: Likewise.
+       * src/rsh.c (main) [KERBEROS || SHISHI]: Likewise.
+
+       Error message handling.
+
+       * libinetutils/krcmd.c (krcmd_mutual) [SHISHI]: Report
+       errors using shishi_strerror().
+       * libinetutils/shishi.c (shishi_auth) <failed verification>:
+       Write a null character at the end of the received error
+       message, not at buffer end.
+       * src/rshd.c (doit) [SHISHI] <authentication failure>:
+       Check `err_msg && *err_msg' before use in rshd_error().
+
+       Conditionals for extra features.
+
+       * src/rcp.c (family) [WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI]:
+       Add SHISHI to conditional.
+       (options, parse_opt) [WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI]:
+       Add SHISHI as provider of `--ipv4' and `--ipv6'.
+       * src/rlogin.c: Likewise.
+       * src/rsh.c: Likewise.
+       (options) [(KERBEROS || SHISHI) && ENCRYPTION]: Condition
+       `-x/--encrypt' on ENCRYPTION.
+
 2012-08-09  Mats Erik Andersson  <address@hidden>
 
        * tests/tftp.sh: Use evaluation `${VERBOSE:+-v}'
diff --git a/libinetutils/kcmd.c b/libinetutils/kcmd.c
index 5266b15..7edca38 100644
--- a/libinetutils/kcmd.c
+++ b/libinetutils/kcmd.c
@@ -127,7 +127,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
   struct hostent *hp;
 # endif
   int rc;
-  char *host_save;
+  char *host_save, *host;
   int status;
 
 # if defined SHISHI
@@ -136,6 +136,13 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
 
   pid = getpid ();
 
+  /* Extract Kerberos instance name.  */
+  host = strchr (*ahost, '/');
+  if (host)
+    ++host;
+  else
+    host = *ahost;
+
 # ifdef HAVE_DECL_GETADDRINFO
   memset (&hints, 0, sizeof (hints));
   hints.ai_family = af;
@@ -143,10 +150,10 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned 
short rport, char *locuser,
   hints.ai_flags = AI_CANONNAME;
   snprintf (portstr, sizeof (portstr), "%hu", ntohs (rport));
 
-  rc = getaddrinfo (*ahost, portstr, &hints, &res);
+  rc = getaddrinfo (host, portstr, &hints, &res);
   if (rc)
     {
-      fprintf (stderr, "kcmd: host %s: %s\n", *ahost, gai_strerror (rc));
+      fprintf (stderr, "kcmd: host %s: %s\n", host, gai_strerror (rc));
       return (-1);
     }
 
@@ -173,10 +180,10 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned 
short rport, char *locuser,
 # else /* !HAVE_DECL_GETADDRINFO */
   /* Often the following rejects non-IPv4.
    * This is dependent on system implementation.  */
-  hp = gethostbyname (*ahost);
+  hp = gethostbyname (host);
   if (hp == NULL)
     {
-      /* fprintf(stderr, "%s: unknown host\n", *ahost); */
+      /* fprintf(stderr, "%s: unknown host\n", host); */
       return (-1);
     }
 
@@ -186,7 +193,24 @@ kcmd (Shishi ** h, int *sock, char **ahost, unsigned short 
rport, char *locuser,
   strcpy (host_save, hp->h_name);
 # endif /* !HAVE_DECL_GETADDRINFO */
 
-  *ahost = host_save;
+  if (host == *ahost)
+    *ahost = host_save;                /* Simple host name string.  */
+  else
+    {
+      /* Server name `*ahost' is a Kerberized name.  */
+      char *p;
+
+      p = malloc ((host - *ahost) + strlen (host_save) + 1);
+      if (p == NULL)
+       return (-1);
+
+      /* Extract prefix from `*ahost', excluding slash,
+       * and concatenate the host's canonical name, but
+       * preceeded by a slash.
+       */
+      sprintf (p, "%.*s/%s", host - *ahost - 1, *ahost, host_save);
+      *ahost = p;
+    }
 
 # ifdef KERBEROS
   /* If realm is null, look up from table */
diff --git a/libinetutils/krcmd.c b/libinetutils/krcmd.c
index 6e8ee35..4611273 100644
--- a/libinetutils/krcmd.c
+++ b/libinetutils/krcmd.c
@@ -213,7 +213,8 @@ krcmd_mutual (Shishi ** h, char **ahost, unsigned short 
rport, char **remuser,
 
   if (err > SHISHI_OK)
     {
-      fprintf (stderr, "krcmd_mutual: %s\n", "error");
+      fprintf (stderr, "krcmd_mutual: error %d, %s\n",
+              err, shishi_strerror (err));
       return (-1);
     }
 
diff --git a/libinetutils/shishi.c b/libinetutils/shishi.c
index 28996b1..d023081 100644
--- a/libinetutils/shishi.c
+++ b/libinetutils/shishi.c
@@ -40,7 +40,7 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
   Shishi *h;
 
   int rc;
-  char *out;
+  char *out, *p;
   size_t outlen;
   int krb5len, msglen;
   char *tmpserver;
@@ -93,8 +93,15 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
   read (sock, &auth, 1);
   if (auth)
     {
-      read (sock, errormsg, 100);
-      errormsg[100] = '\0';
+      ssize_t n;
+
+      errormsg[0] = '\0';
+      n = read (sock, errormsg, sizeof (errormsg) - 1);
+
+      if (n >= 0 && n < sizeof (errormsg))
+       errormsg[n] = '\0';
+      else
+       errormsg[sizeof (errormsg) -1] = '\0';
 
       fprintf (stderr, "Error during server authentication : %s\n", errormsg);
       return SHISHI_VERIFY_FAILED;
@@ -116,9 +123,12 @@ shishi_auth (Shishi ** handle, int verbose, char **cname,
       perror ("shishi_auth()");
       return SHISHI_TOO_SMALL_BUFFER;
     }
-  strcpy (tmpserver, SERVICE);
-  strcat (tmpserver, "/");
-  strcat (tmpserver, sname);
+
+  p = strchr (sname, '/');
+  if (p && (p != sname))
+    strcpy (tmpserver, sname); /* Non-empty prefix.  */
+  else
+    sprintf (tmpserver, "%s/%s", SERVICE, sname + (p ? 1 : 0));
 
   hint.client = (char *) *cname;
   hint.server = (char *) tmpserver;
@@ -264,7 +274,7 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   char krb5kcmd1[] = "KCMDV0.1";
   char krb5kcmd2[] = "KCMDV0.2";
   int auth_correct = 0;
-  char *servername;
+  char *servername, *server, *realm;
 
   *err_msg = NULL;
   /* Get key for the server. */
@@ -280,19 +290,40 @@ get_auth (int infd, Shishi ** handle, Shishi_ap ** ap,
   if (rc != SHISHI_OK)
     return rc;
 
-  if (srvname && *srvname)
+  rc = shishi_parse_name (*handle, srvname, &server, &realm);
+  if (rc != SHISHI_OK)
     {
-      servername = malloc (sizeof (SERVICE) + strlen (srvname) + 2);
+      *err_msg = shishi_strerror (rc);
+      return rc;
+    }
+
+  if (server && *server)
+    {
+      char *p;
+
+      servername = malloc (sizeof (SERVICE) + strlen (server) + 2);
       if (!servername)
        {
          *err_msg = "Not enough memory";
          return SHISHI_TOO_SMALL_BUFFER;
        }
-      sprintf (servername, "%s/%s", SERVICE, srvname);
+
+      p = strchr (server, '/');
+      if (p && (p != server))
+       sprintf (servername, "%s", server);     /* Non-empty prefix.  */
+      else
+       sprintf (servername, "%s/%s", SERVICE,
+                server + (p ? 1 : 0)); /* Remove initial slash.  */
     }
   else
     servername = shishi_server_for_local_service (*handle, SERVICE);
 
+  if (realm && *realm)
+    shishi_realm_default_set (*handle, realm);
+
+  free (server);
+  free (realm);
+
   /* Enable use of `~/.k5login'.  */
   if (shishi_check_version ("1.0.2"))  /* Faulty in version 1.0.1.  */
     {
diff --git a/src/rcp.c b/src/rcp.c
index c0460a2..3518a71 100644
--- a/src/rcp.c
+++ b/src/rcp.c
@@ -146,7 +146,7 @@ const char arg_doc[] = "SOURCE DEST\n"
 int preserve_option;
 int from_option, to_option;
 int iamremote, iamrecursive, targetshouldbedirectory;
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
 sa_family_t family = AF_UNSPEC;
 #endif
 
@@ -166,7 +166,7 @@ static struct argp_option options[] = {
     "turns off all Kerberos authentication",
     GRID+1 },
   { "realm", 'k', "REALM", 0,
-    "obtain tickets for the remote host in REALM instead of the remote host's 
realm",
+    "obtain tickets for a remote host in REALM instead of the remote host's 
realm",
     GRID+1 },
 #endif
 #ifdef ENCRYPTION
@@ -183,14 +183,14 @@ static struct argp_option options[] = {
   { "to", 't', NULL, 0,
     "copying to remote host (server use only)",
     GRID+1 },
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0,
     "use only IPv4",
     GRID+1 },
   { "ipv6", '6', NULL, 0,
     "use only IPv6",
     GRID+1 },
-#endif /* WITH_ORCMD_AF || WITH_RCMD_AF */
+#endif /* WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI */
   { NULL }
 };
 
@@ -199,14 +199,14 @@ parse_opt (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
     case '4':
       family = AF_INET;
       break;
     case '6':
       family = AF_INET6;
       break;
-#endif /* WITH_ORCMD_AF || WITH_RCMD_AF */
+#endif /* WITH_ORCMD_AF || WITH_RCMD_AF || SHISHI */
 
 #if defined KERBEROS || defined SHISHI
     case 'K':
@@ -1139,22 +1139,30 @@ again:
       if (rem < 0)
        {
          use_kerberos = 0;
-         if ((sp = getservbyname ("shell", "tcp")) == NULL)
-           error (EXIT_FAILURE, 0, "unknown service shell/tcp");
          if (krb_errno == ECONNREFUSED)
            oldw ("remote host doesn't support Kerberos");
          else if (krb_errno == ENOENT)
-           oldw ("can't provide Kerberos authentication data");
+           error (EXIT_FAILURE, 0, "Can't provide Kerberos authentication 
data.");
+         else
+           error (EXIT_FAILURE, 0, "Kerberos authentication failed.");
+
+         sp = getservbyname ("shell", "tcp");
+         if (sp == NULL)
+           error (EXIT_FAILURE, 0, "unknown service shell/tcp");
          port = sp->s_port;
          goto again;
        }
     }
   else
     {
+      char *p = strchr (*host, '/');
+
 # ifdef ENCRYPTION
       if (doencrypt)
        error (EXIT_FAILURE, 0, "the -x option requires Kerberos 
authentication");
 # endif
+      if (p)
+       *host = ++p;    /* Skip prefix like `host/'.  */
 # ifdef WITH_ORCMD_AF
       rem = orcmd_af (host, port, locuser, user, bp, 0, family);
 # elif defined WITH_RCMD_AF
diff --git a/src/rlogin.c b/src/rlogin.c
index a42f27a..038d76a 100644
--- a/src/rlogin.c
+++ b/src/rlogin.c
@@ -178,7 +178,7 @@ int noescape;
 char * host = NULL;
 char * user = NULL;
 unsigned char escapechar = '~';
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
 sa_family_t family = AF_UNSPEC;
 #endif
 
@@ -238,14 +238,14 @@ static struct argp_option argp_options[] = {
   {"user", 'l', "USER", 0, "run as USER on the remote system", GRP+1},
 #if defined KERBEROS || defined SHISHI
 # ifdef ENCRYPTION
-  {"encrypt", 'x', NULL, 0, "turns on DES encryption for all data passed via "
+  {"encrypt", 'x', NULL, 0, "turns on encryption for all data passed via "
    "the rlogin session", GRP+1},
 # endif
   {"kerberos", 'K', NULL, 0, "turns off all Kerberos authentication", GRP+1},
   {"realm", 'k', "REALM", 0, "obtain tickets for the remote host in REALM "
    "realm instead of the remote's realm", GRP+1},
-#endif
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#endif /* KERBEROS || SHISHI */
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0, "use only IPv4" },
   { "ipv6", '6', NULL, 0, "use only IPv6" },
 #endif
@@ -258,7 +258,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
     case '4':
       family = AF_INET;
       break;
@@ -449,6 +449,7 @@ try_connect:
   if (use_kerberos)
     {
       int krb_errno = 0;
+# if defined KERBEROS
       struct hostent *hp;
 
       /* Fully qualified hostname (needed for krb_realmofhost).  */
@@ -456,7 +457,6 @@ try_connect:
       if (hp != NULL && !(host = strdup (hp->h_name)))
        error (EXIT_FAILURE, errno, "strdup");
 
-# if defined KERBEROS
       rem = KSUCCESS;
       errno = 0;
       if (dest_realm == NULL)
@@ -546,25 +546,32 @@ try_connect:
       if (rem < 0)
        {
          use_kerberos = 0;
+         if (krb_errno == ECONNREFUSED)
+           warning ("remote host doesn't support Kerberos");
+         else if (krb_errno == ENOENT)
+           error (EXIT_FAILURE, 0, "Can't provide Kerberos auth data.");
+         else
+           error (EXIT_FAILURE, 0, "Kerberos authentication failed.");
+
          sp = getservbyname ("login", "tcp");
          if (sp == NULL)
            error (EXIT_FAILURE, 0, "unknown service login/tcp.");
-         if (krb_errno == ECONNREFUSED)
-           warning ("remote host doesn't support Kerberos");
-         if (krb_errno == ENOENT)
-           warning ("can't provide Kerberos auth data");
          goto try_connect;
        }
     }
 
   else
     {
+      char *p = strchr (host, '/');
+
 # ifdef ENCRYPTION
       if (doencrypt)
        error (EXIT_FAILURE, 0, "the -x flag requires Kerberos 
authentication.");
-# endif        /* CRYPT */
+# endif        /* ENCRYPTION */
       if (!user)
        user = pw->pw_name;
+      if (p)
+       host = ++p;     /* Skip prefix like `host/'.  */
 
 # ifdef WITH_ORCMD_AF
       rem = orcmd_af (&host, sp->s_port, pw->pw_name, user, term, 0, family);
diff --git a/src/rlogind.c b/src/rlogind.c
index 76e2a27..3d2f987 100644
--- a/src/rlogind.c
+++ b/src/rlogind.c
@@ -294,7 +294,7 @@ static struct argp_option options[] = {
 #if defined KERBEROS || defined SHISHI
   { "kerberos", 'k', NULL, 0,
     "use kerberos IV/V authentication" },
-  { "servername", 'S', "NAME", 0,
+  { "server-principal", 'S', "NAME", 0,
     "set Kerberos server name, overriding canonical hostname" },
 #endif
 #if defined ENCRYPTION
diff --git a/src/rsh.c b/src/rsh.c
index e01d662..153ca33 100644
--- a/src/rsh.c
+++ b/src/rsh.c
@@ -96,7 +96,7 @@
 int debug_option = 0;
 int null_input_option = 0;
 char *user = NULL;
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
 sa_family_t family = AF_UNSPEC;
 #endif
 
@@ -151,11 +151,13 @@ static struct argp_option options[] = {
   { "kerberos", 'K', NULL, 0,
     "turns off all Kerberos authentication" },
   { "realm", 'k', "REALM", 0,
-    "obtain tickets for the remote host in REALM "
-    "instead of the remote host's realm" },
+    "obtain tickets for a remote host in REALM, "
+    "instead of the remote host's default realm" },
+# ifdef ENCRYPTION
   { "encrypt", 'x', NULL, 0,
     "encrypt all data transfer" },
-#endif
+# endif /* ENCRYPTION */
+#endif /* KERBEROS || SHISHI */
 #if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
   { "ipv4", '4', NULL, 0, "use only IPv4" },
   { "ipv6", '6', NULL, 0, "use only IPv6" },
@@ -168,7 +170,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
 {
   switch (key)
     {
-#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF
+#if defined WITH_ORCMD_AF || defined WITH_RCMD_AF || defined SHISHI
     case '4':
       family = AF_INET;
       break;
@@ -345,6 +347,7 @@ main (int argc, char **argv)
 try_connect:
   if (use_kerberos)
     {
+# if defined KERBEROS
       struct hostent *hp;
 
       /* fully qualify hostname (needed for krb_realmofhost) */
@@ -352,7 +355,6 @@ try_connect:
       if (hp != NULL && !(host = strdup (hp->h_name)))
        error (EXIT_FAILURE, errno, "strdup");
 
-# if defined KERBEROS
       rem = KSUCCESS;
       krb_errno = 0;
       if (dest_realm == NULL)
@@ -438,7 +440,7 @@ try_connect:
        }
       else
 #  endif
-# endif
+# endif /* ENCRYPTION */
        {
 # if defined SHISHI
          rem = krcmd (&h, &host, sp->s_port, &user, args, &rfd2,
@@ -451,22 +453,30 @@ try_connect:
       if (rem < 0)
        {
          use_kerberos = 0;
+         if (krb_errno == ECONNREFUSED)
+           warning ("remote host doesn't support Kerberos");
+         else if (krb_errno == ENOENT)
+           error (EXIT_FAILURE, 0, "Can't provide Kerberos auth data.");
+         else
+           error (EXIT_FAILURE, 0, "Kerberos authentication failed.");
+
          sp = getservbyname ("shell", "tcp");
          if (sp == NULL)
            error (EXIT_FAILURE, 0, "shell/tcp: unknown service");
-         if (krb_errno == ECONNREFUSED)
-           warning ("remote host doesn't support Kerberos");
-         if (krb_errno == ENOENT)
-           warning ("can't provide Kerberos auth data");
          goto try_connect;
        }
     }
   else
     {
+      char *p = strchr (host, '/');
+
       if (!user)
        user = pw->pw_name;
       if (doencrypt)
        error (EXIT_FAILURE, 0, "the -x flag requires Kerberos authentication");
+      if (p)
+       host = ++p;     /* Skip prefix like `host/'.  */
+
 # ifdef WITH_ORCMD_AF
       rem = orcmd_af (&host, sp->s_port, pw->pw_name, user, args, &rfd2, 
family);
 # elif defined WITH_RCMD_AF
diff --git a/src/rshd.c b/src/rshd.c
index 3805d9a..03965eb 100644
--- a/src/rshd.c
+++ b/src/rshd.c
@@ -218,13 +218,13 @@ static struct argp_option options[] = {
   { "log-sessions", 'L', NULL, 0,
     "log successful logins" },
 #if defined KERBEROS || defined SHISHI
-  /* FIXME: The option semantics does not match that of others r* utilities */
+  /* FIXME: The option semantics does not match that of other r* utilities */
   { "kerberos", 'k', NULL, 0,
     "use kerberos authentication" },
   /* FIXME: Option name is misleading */
   { "vacuous", 'v', NULL, 0,
     "fail for non-Kerberos authentication" },
-  { "servername", 'S', "NAME", 0,
+  { "server-principal", 'S', "NAME", 0,
     "set Kerberos server name, overriding canonical hostname" },
 #endif /* KERBEROS */
   { NULL }
@@ -832,7 +832,7 @@ doit (int sockfd, struct sockaddr *fromp, socklen_t fromlen)
       if (rc != SHISHI_OK)
        {
          rshd_error ("Kerberos authentication failure: %s\n",
-                     err_msg ? err_msg : shishi_strerror (rc));
+                     (err_msg && *err_msg) ? err_msg : shishi_strerror (rc));
          exit (EXIT_FAILURE);
        }
     }

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

Summary of changes:
 ChangeLog             |   60 +++++++++++++++++++++++++++++++++++++++++++++++++
 libinetutils/kcmd.c   |   36 ++++++++++++++++++++++++-----
 libinetutils/krcmd.c  |    3 +-
 libinetutils/shishi.c |   51 +++++++++++++++++++++++++++++++++--------
 src/rcp.c             |   26 ++++++++++++++-------
 src/rlogin.c          |   29 ++++++++++++++---------
 src/rlogind.c         |    2 +-
 src/rsh.c             |   32 +++++++++++++++++---------
 src/rshd.c            |    6 ++--
 9 files changed, 193 insertions(+), 52 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

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