[BACK]Return to session.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/session.c between version 1.12 and 1.12.2.1

version 1.12, 2000/05/03 18:03:07 version 1.12.2.1, 2000/06/12 02:37:35
Line 248 
Line 248 
                                 packet_send_debug("X11 forwarding disabled in server configuration file.");                                  packet_send_debug("X11 forwarding disabled in server configuration file.");
                                 break;                                  break;
                         }                          }
 #ifdef XAUTH_PATH                          if (!options.xauth_location) {
                                   packet_send_debug("No xauth program; cannot forward with spoofing.");
                                   break;
                           }
                         if (no_x11_forwarding_flag) {                          if (no_x11_forwarding_flag) {
                                 packet_send_debug("X11 forwarding not permitted for this authentication.");                                  packet_send_debug("X11 forwarding not permitted for this authentication.");
                                 break;                                  break;
Line 289 
Line 292 
                         fatal_add_cleanup(xauthfile_cleanup_proc, NULL);                          fatal_add_cleanup(xauthfile_cleanup_proc, NULL);
                         success = 1;                          success = 1;
                         break;                          break;
 #else /* XAUTH_PATH */  
                         packet_send_debug("No xauth program; cannot forward with spoofing.");  
                         break;  
 #endif /* XAUTH_PATH */  
   
                 case SSH_CMSG_AGENT_REQUEST_FORWARDING:                  case SSH_CMSG_AGENT_REQUEST_FORWARDING:
                         if (no_agent_forwarding_flag || compat13) {                          if (no_agent_forwarding_flag || compat13) {
Line 300 
Line 299 
                                 break;                                  break;
                         }                          }
                         debug("Received authentication agent forwarding request.");                          debug("Received authentication agent forwarding request.");
                         auth_input_request_forwarding(pw);                          success = auth_input_request_forwarding(pw);
                         success = 1;  
                         break;                          break;
   
                 case SSH_CMSG_PORT_FORWARD_REQUEST:                  case SSH_CMSG_PORT_FORWARD_REQUEST:
Line 613 
Line 611 
                         }                          }
                 }                  }
                 /* Do common processing for the child, such as execing the command. */                  /* Do common processing for the child, such as execing the command. */
                 do_child(command, pw, s->term, s->display, s->auth_proto, s->auth_data, s->tty);                  do_child(command, pw, s->term, s->display, s->auth_proto,
                       s->auth_data, s->tty);
                 /* NOTREACHED */                  /* NOTREACHED */
         }          }
         if (pid < 0)          if (pid < 0)
Line 717 
Line 716 
                         fprintf(stderr, "Bad line in %.100s: %.200s\n", filename, buf);                          fprintf(stderr, "Bad line in %.100s: %.200s\n", filename, buf);
                         continue;                          continue;
                 }                  }
                 /* Replace the equals sign by nul, and advance value to the value string. */                  /*
                    * Replace the equals sign by nul, and advance value to
                    * the value string.
                    */
                 *value = '\0';                  *value = '\0';
                 value++;                  value++;
                 child_set_env(env, envsize, cp, value);                  child_set_env(env, envsize, cp, value);
Line 737 
Line 739 
 {  {
         const char *shell, *cp = NULL;          const char *shell, *cp = NULL;
         char buf[256];          char buf[256];
           char cmd[1024];
         FILE *f;          FILE *f;
         unsigned int envsize, i;          unsigned int envsize, i;
         char **env;          char **env;
Line 744 
Line 747 
         struct stat st;          struct stat st;
         char *argv[10];          char *argv[10];
   
           /* login(1) is only called if we execute the login shell */
           if (options.use_login && command != NULL)
                   options.use_login = 0;
   
         f = fopen("/etc/nologin", "r");          f = fopen("/etc/nologin", "r");
         if (f) {          if (f) {
                 /* /etc/nologin exists.  Print its contents and exit. */                  /* /etc/nologin exists.  Print its contents and exit. */
Line 862 
Line 869 
   
         /* read $HOME/.ssh/environment. */          /* read $HOME/.ssh/environment. */
         if (!options.use_login) {          if (!options.use_login) {
                 snprintf(buf, sizeof buf, "%.200s/.ssh/environment", pw->pw_dir);                  snprintf(buf, sizeof buf, "%.200s/.ssh/environment",
                       pw->pw_dir);
                 read_environment_file(&env, &envsize, buf);                  read_environment_file(&env, &envsize, buf);
         }          }
         if (debug_flag) {          if (debug_flag) {
Line 944 
Line 952 
                                 pclose(f);                                  pclose(f);
                         } else                          } else
                                 fprintf(stderr, "Could not run %s\n", SSH_SYSTEM_RC);                                  fprintf(stderr, "Could not run %s\n", SSH_SYSTEM_RC);
                 }                  } else if (options.xauth_location != NULL) {
 #ifdef XAUTH_PATH  
                 else {  
                         /* Add authority data to .Xauthority if appropriate. */                          /* Add authority data to .Xauthority if appropriate. */
                         if (auth_proto != NULL && auth_data != NULL) {                          if (auth_proto != NULL && auth_data != NULL) {
                                 if (debug_flag)                                  char *screen = strchr(display, ':');
                                         fprintf(stderr, "Running %.100s add %.100s %.100s %.100s\n",                                  if (debug_flag) {
                                                 XAUTH_PATH, display, auth_proto, auth_data);                                          fprintf(stderr,
                                               "Running %.100s add %.100s %.100s %.100s\n",
                                 f = popen(XAUTH_PATH " -q -", "w");                                              options.xauth_location, display,
                                               auth_proto, auth_data);
                                           if (screen != NULL)
                                                   fprintf(stderr,
                                                       "Adding %.*s/unix%s %s %s\n",
                                                       screen-display, display,
                                                       screen, auth_proto, auth_data);
                                   }
                                   snprintf(cmd, sizeof cmd, "%s -q -",
                                       options.xauth_location);
                                   f = popen(cmd, "w");
                                 if (f) {                                  if (f) {
                                         fprintf(f, "add %s %s %s\n", display, auth_proto, auth_data);                                          fprintf(f, "add %s %s %s\n", display,
                                               auth_proto, auth_data);
                                           if (screen != NULL)
                                                   fprintf(f, "add %.*s/unix%s %s %s\n",
                                                       screen-display, display,
                                                       screen, auth_proto, auth_data);
                                         pclose(f);                                          pclose(f);
                                 } else                                  } else {
                                         fprintf(stderr, "Could not run %s -q -\n", XAUTH_PATH);                                          fprintf(stderr, "Could not run %s\n",
                                               cmd);
                                   }
                         }                          }
                 }                  }
 #endif /* XAUTH_PATH */  
   
                 /* Get the last component of the shell name. */                  /* Get the last component of the shell name. */
                 cp = strrchr(shell, '/');                  cp = strrchr(shell, '/');
                 if (cp)                  if (cp)
Line 988 
Line 1009 
                                 struct stat mailstat;                                  struct stat mailstat;
                                 mailbox = getenv("MAIL");                                  mailbox = getenv("MAIL");
                                 if (mailbox != NULL) {                                  if (mailbox != NULL) {
                                         if (stat(mailbox, &mailstat) != 0 || mailstat.st_size == 0)                                          if (stat(mailbox, &mailstat) != 0 ||
                                               mailstat.st_size == 0)
                                                 printf("No mail.\n");                                                  printf("No mail.\n");
                                         else if (mailstat.st_mtime < mailstat.st_atime)                                          else if (mailstat.st_mtime < mailstat.st_atime)
                                                 printf("You have mail.\n");                                                  printf("You have mail.\n");

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.12.2.1