bug-hurd
[Top][All Lists]
Advanced

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

Re: Truncated filenames in struct directs returned from dir_readdir


From: Andrew Eggenberger
Subject: Re: Truncated filenames in struct directs returned from dir_readdir
Date: Sun, 18 Apr 2021 20:27:09 -0500


Please send us the actual source code so we can check the details. It's
the details that matter, not the high-level description


The procedure below demonstrates the behavior.

int
orgifydir (char** buf, mach_port_t root)
{
  error_t err;
  data_t dirents;
  struct direct d;
  mach_msg_type_number_t dataCnt;

  err = dir_readdir(root, &dirents, &dataCnt, 0, -1, 0, &amt);
  if (err != KERN_SUCCESS)
    error(1, 0, "dir_readdir failed with error code %d", err);

  while(i++ < amt){
    d = *(struct direct*)dirents;
    error(0, errno, "name: %s\n", d.d_name);

    error(0, errno, "namelen: %d\n", d.d_namlen);

    dirents += d.d_reclen;

  }
}
 

reply via email to

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