Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What I want is to specify that for a directory, every file creation/modification within said directory will be checked by the kernel and if the filename has unsupported characters the offending process will be given a "permission denied" error.

I was thinking about writing a fuse-driver that rejects non-compliant filenames. But that does not seem practical.

I am not looking for solutions that recommend things like a cronjob or inotify that clean up unwanted characters after-the fact. I'm looking for something that is preemptively preventative.

share|improve this question
    
What filesystem are you using? mount has some file system specific options that could (I said could, never tried it) help. Search man mount for unicode or utf8. –  terdon Mar 4 '13 at 15:10
    
I'm using ext4. I read the manpage: nothing interesting. The classic unix way regarding filenames is not to care about them at all, as long as they don't contain / or the 0-byte. I have never heard of the feature I'm requesting, thus my question. –  life of pi Mar 4 '13 at 15:23
2  
What does "unicode filename" even mean in this context? Do you want to ensure all filenames are valid UTF-8? –  Cairnarvon Mar 4 '13 at 15:54
    
Yes. sorry I didn't say that. –  life of pi Mar 4 '13 at 16:16
1  
You're out of luck - the filesystem doesn't have a concept of "character set", filenames are simply byte sequences, with only / and \0 disallowed, as you say. You'd need to intercept all filename creation calls (linking, renaming, creating), either at the filesystem layer or by changing glibc (directly or monkey-patching via LD_PRELOAD - that one's easier to do and hard to enforce). There's no "intended" way to do this. –  Gabe Apr 26 '13 at 12:50
show 1 more comment

1 Answer

ZFS has mechanisms for making datasets (and maybe pools) be UTF8 only, potentially with different normalization mechanisms.

Further reading:

http://www.mail-archive.com/zfs-discuss@opensolaris.org/msg28314.html

http://www.freebsd.org/cgi/man.cgi?query=zfs&manpath=FreeBSD+9.1-RELEASE

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.