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

Diff for /src/usr.bin/ssh/sftp.c between version 1.221 and 1.222

version 1.221, 2022/09/19 10:41:58 version 1.222, 2022/09/19 10:46:00
Line 49 
Line 49 
 #include "sshbuf.h"  #include "sshbuf.h"
 #include "sftp-common.h"  #include "sftp-common.h"
 #include "sftp-client.h"  #include "sftp-client.h"
   #include "sftp-usergroup.h"
   
 /* File to read commands from */  /* File to read commands from */
 FILE* infile;  FILE* infile;
Line 850 
Line 851 
                 qsort(d, n, sizeof(*d), sdirent_comp);                  qsort(d, n, sizeof(*d), sdirent_comp);
         }          }
   
           get_remote_user_groups_from_dirents(conn, d);
         for (n = 0; d[n] != NULL && !interrupted; n++) {          for (n = 0; d[n] != NULL && !interrupted; n++) {
                 char *tmp, *fname;                  char *tmp, *fname;
   
Line 861 
Line 863 
                 free(tmp);                  free(tmp);
   
                 if (lflag & LS_LONG_VIEW) {                  if (lflag & LS_LONG_VIEW) {
                         if (lflag & (LS_NUMERIC_VIEW|LS_SI_UNITS)) {                          if ((lflag & (LS_NUMERIC_VIEW|LS_SI_UNITS)) != 0 ||
                               can_get_users_groups_by_id(conn)) {
                                 char *lname;                                  char *lname;
                                 struct stat sb;                                  struct stat sb;
   
                                 memset(&sb, 0, sizeof(sb));                                  memset(&sb, 0, sizeof(sb));
                                 attrib_to_stat(&d[n]->a, &sb);                                  attrib_to_stat(&d[n]->a, &sb);
                                 lname = ls_file(fname, &sb, 1,                                  lname = ls_file(fname, &sb, 1,
                                     (lflag & LS_SI_UNITS), NULL, NULL);                                      (lflag & LS_SI_UNITS),
                                       ruser_name(sb.st_uid),
                                       rgroup_name(sb.st_gid));
                                 mprintf("%s\n", lname);                                  mprintf("%s\n", lname);
                                 free(lname);                                  free(lname);
                         } else                          } else
Line 990 
Line 995 
                 sort_glob = NULL;                  sort_glob = NULL;
         }          }
   
           get_remote_user_groups_from_glob(conn, &g);
         for (j = 0; j < nentries && !interrupted; j++) {          for (j = 0; j < nentries && !interrupted; j++) {
                 i = indices[j];                  i = indices[j];
                 fname = path_strip(g.gl_pathv[i], strip_path);                  fname = path_strip(g.gl_pathv[i], strip_path);
Line 999 
Line 1005 
                                 continue;                                  continue;
                         }                          }
                         lname = ls_file(fname, g.gl_statv[i], 1,                          lname = ls_file(fname, g.gl_statv[i], 1,
                             (lflag & LS_SI_UNITS), NULL, NULL);                              (lflag & LS_SI_UNITS),
                               ruser_name(g.gl_statv[i]->st_uid),
                               rgroup_name(g.gl_statv[i]->st_gid));
                         mprintf("%s\n", lname);                          mprintf("%s\n", lname);
                         free(lname);                          free(lname);
                 } else {                  } else {

Legend:
Removed from v.1.221  
changed lines
  Added in v.1.222