Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'd think that some tool exists like this, but I've never heard of anything like it in my travels.
I have a user who habitually saves documents where he shouldn't. His mp3's will show up in a folder where his Word files are supposed to go... he'll have strange files in a folder which is only supposed to house a certain project, YouSendIt files show up in his iTunes folders, etc. I could probably train him more-effectively (and keep things from getting too bad before I could step in to fix things) if I could be alerted as soon as he starts saving stuff in the wrong place.
It dawned on me that I really need a tool which would crawl the filesystem a few times per day looking for files called, say, ".folderpolicy". Within that file, you might see something like:
# Only music files!
ALLOW .mp3 .aif .flac .aac
DENY ALL
- or... you could deny things like sub-folders and symbolic links...
DENY FOLDER SYMLINK
The folder policy would be in effect for all files and folders within and below the folder where .folderpolicy was found until a new .folderpolicy was encountered.
Any violations to the policy could either... email me, put a pop-up in front of the user, whatever.
I don't know if there's a native utility for this but you could set up a cron job that runs a script that does what you want.. Shouldn't be too difficult to implement.
I have a user who habitually saves documents where he shouldn't. His mp3's will show up in a folder where his Word files are supposed to go... he'll have strange files in a folder which is only supposed to house a certain project ...
Slightly confused, so I will assume you are asking about doing this on a Linux type system, so check out:
I think setfacl(1) should work for the OP, for example
Code:
setfacl -m "u:user:---" dirname
will prevent access to Dir "dirname", changing '---' to 'r-x' will give the dir just read access. This assumes the 'global' access (chmod) does not allow access by all users.
The OP will have experiment with settings. I would suggest one should prevent access by everyone and add access to people you want to have read/write access on a per user basis via setfacl(1).
I believe the OP is looking for a way to restrict placement of files in directories based on file type though - e.g. PDF/ houses only PDF files, Documents/ houses only *.doc* files, etc. Locking down access won't achieve that because the offending user would still need access to the directory to perform daily tasks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.