Re: Deleting a file from within the kernel

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

 



> > 
> > > > > Of course you can. Kernel can do everything what the machine can do...
> > > > 
> > > > to delete a file you need both the parent directory and the namespace it
> > > > belongs in. Kernel mode has no such namespace realistically (or rather a
> > > > standardized one that doesn't have to be the same one userspace apps
> > > > have).
> > > 
> > > What do you mean with namespace? What do you need it for? All you should
> > > need is the pathname.
> > 
> > pathnames are relative to the namespace. See CLONE_NEWNS and related
> > things. Also chroots mess things up in this context (a name space is
> > sort of kinda a "super chroot").
> 
> Does this imply that the path "/" is not unique in the whole system 
> even when not using chroot?

>From the clone manpage it seems that "yes", but:

"CLONE_NEWNS (Linux 2.4.19 onwards)
....

CONFORMING TO

The clone and sys_clone calls are Linux-specific and should not be used in
programs intended to be portable. For programming threaded applications
(multiple threads of control in the same memory space), it is better to use
a library implementing the POSIX 1003.1c thread API...."

I think it is quite unclean thing :)

But in general you were right that it is not possible without specifying the
namespace.

	Tomas


> 
> Thanks,
> 	Tomas
> 
> > 
> > 
> > 
> > --
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive:       http://mail.nl.linux.org/kernelnewbies/
> > FAQ:           http://kernelnewbies.org/faq/
> 
> -- 
>  "No Software Patents!" -- Allowing patents over software ideas will
> seriously affect the Creativity, Productivity and Freedom of all.
> Link: http://www.nosoftwarepatents.com/
> --
> Defend your freedom by signing a petition.
> Link: http://petition.eurolinux.org/index_html?LANG=en
> 
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/

-- 
 "No Software Patents!" -- Allowing patents over software ideas will
seriously affect the Creativity, Productivity and Freedom of all.
Link: http://www.nosoftwarepatents.com/
--
Defend your freedom by signing a petition.
Link: http://petition.eurolinux.org/index_html?LANG=en

--
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