assign alloc result to d

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
chmod_main: allow empty file and file with '.'

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>