chiark / gitweb /
memfd: reduce name escaping logic to utf-8 checks
authorDaniel Mack <zonque@gmail.com>
Tue, 19 Aug 2014 19:09:16 +0000 (21:09 +0200)
committerDaniel Mack <zonque@gmail.com>
Tue, 19 Aug 2014 19:49:05 +0000 (21:49 +0200)
commit8f2807bab569b27eae5459854a48cdd4dead4d2c
treea69e12dc60ee2d7c9a38b87bb0df3c5c721963bc
parent4531a9bc206c0c22e29b56ac4a7528afba2e9c83
memfd: reduce name escaping logic to utf-8 checks

As memfds are now created by proper kernel API, and not by our functions, we
can't rely on names being escaped/unescaped according to our current logic.

Thus, the only safe way is to remove the escaping and when reading names,
just escape names that are not properly encoded in UTF-8.

Also, remove assert(name) lines from the memfd creation functions, as we
explictly allow name to be NULL.
src/shared/memfd.c