[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.294 and 1.295

version 1.294, 2018/03/03 03:15:51 version 1.295, 2018/06/01 03:33:53
Line 1058 
Line 1058 
 void  void
 do_setusercontext(struct passwd *pw)  do_setusercontext(struct passwd *pw)
 {  {
         char *chroot_path, *tmp;          char uidstr[32], *chroot_path, *tmp;
   
         if (getuid() == 0 || geteuid() == 0) {          if (getuid() == 0 || geteuid() == 0) {
                 /* Prepare groups */                  /* Prepare groups */
Line 1072 
Line 1072 
                     strcasecmp(options.chroot_directory, "none") != 0) {                      strcasecmp(options.chroot_directory, "none") != 0) {
                         tmp = tilde_expand_filename(options.chroot_directory,                          tmp = tilde_expand_filename(options.chroot_directory,
                             pw->pw_uid);                              pw->pw_uid);
                           snprintf(uidstr, sizeof(uidstr), "%llu",
                               (unsigned long long)pw->pw_uid);
                         chroot_path = percent_expand(tmp, "h", pw->pw_dir,                          chroot_path = percent_expand(tmp, "h", pw->pw_dir,
                             "u", pw->pw_name, (char *)NULL);                              "u", pw->pw_name, "U", uidstr, (char *)NULL);
                         safely_chroot(chroot_path, pw->pw_uid);                          safely_chroot(chroot_path, pw->pw_uid);
                         free(tmp);                          free(tmp);
                         free(chroot_path);                          free(chroot_path);

Legend:
Removed from v.1.294  
changed lines
  Added in v.1.295