Chattr
From WL-HDD Wiki
| WL-HDD Contents |
|---|
| What is the WL-HDD |
| Features |
| Pro's/con's |
| Reviews |
| Hacking |
| Inserting the HDD |
| Hacking Guides |
| Basic setup guides |
| Packages guides |
| Requests |
| Troubleshooting |
| This Wiki |
| Credits |
| Editing help |
| Contact Me |
Contents |
Prerequisites
To complete this guide, the following is assumed:
| You are running Oleg's firmware (1.9.2.7-6b or later) |
| You have harddisk partitions up and running with an extended filesystem mounted to /opt |
| You have installed the Ipkg package system. |
| You have configured your partitions to automount. |
| You have setup and successfully ran VSFTP from within your LAN. |
| You have already completed the Samba with Users guide |
Purpose
The purpose of this guide is to show how to protect single file from being deleted.
Consider following scenario: You are using Samba as well as VSFTP. Both methods of access uses same directory structure. You want to use the .message files to send messages to ftp users. And you don not want the .message files to be deleted by samba users. Samba user can delete any file if he has write permission for directory. even if the file does not belong to the user or group and user has not privilege to write into it. The way how to prevent deletion of such file if us chattr.
Installation
In puty type
ipkg install e2fsprogs
Now you can use chattr and lsattr utilities.
Usage
To make file non-deletable just set its immutable attribute
chattr +i .message
Now the file is not deletable unless you use -i on it.
Behavior
- Folder that contain non-deletable file cannot be deleted.
- My Windows Vista looks quite puzzled by such non-deletable file. When I delete it from Windows Explorer it disappears and when I reload the folder it appears again.
- Total Commander (7RC) is also a little puzzled. It doesn't delete such file but it throws no error.
See also
Categories: Utilities | Troubleshooting | Tips and tricks | FTP | Samba | File system
