Changing d_name from dirent in getdents64

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

 



What I am trying to do is something like this:

For a file, say named 'config', I want to have 2 names for it ,say
'config' and 'donfig'. So when I do an 'ls' on that directory, I
should be able to see 2 files 'config' and 'donfig'

$ ls
config donfig
$

I DO NOT have the liberty of using symlinks. Other changes in the open
syscall to handle 'donfig' as a name will be done later. Rite now I
just want the above mentioned directory listing.

To achieve, I have hooked the getdents64 syscall. The algorithm for my
getdents64 routine is as follows:

1) Call the original getdents64
2) Make a copy the dirent entry of 'config' and in that replace the
name 'config' with 'donfig'; keeping other things the same.

But as you might have guessed correctly, this does not work :((

If I do not change the name to 'donfig', I do see 2 entries for
'config'. But if change any character of the name, the entry is not
seen in the output.
Is there any checksum or anything similar involved?

I am on Fedora Core 1, Kernel 2.4.22

-Shri

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux