Subject: mtree(8) and directory permissions
To: None <tech-misc@netbsd.org>
From: Igor Sobrado <igor@string1.ciencias.uniovi.es>
List: tech-misc
Date: 12/19/2005 18:35:31
Submitted to tech-misc@ as I am not really sure were this question
fits better and, usually, when I have idea were it fits I am wrong.  :-)

I have a question about the output of mtree(8) on NetBSD 2.0.2.
Perhaps someone can help me understanding the output of this command
on NetBSD.  I will try it on NetBSD 2.1 as soon as I arrive at home
(I cannot run it from here as I did not turn on that machine when
I left my home some hours ago) and on NetBSD 3 as soon as it is
available for production systems.  This is the output of mtree(8)
I want to understand:

$ mtree -e -f /etc/mtree/NetBSD.dist
var/spool/ftp:
        permissions (0755, 0555)
var/spool/ftp/bin:
        permissions (0755, 0555)
var/spool/ftp/etc:
        permissions (0755, 0555)
dev:    permissions (0755, 0555)
dev/fd: permissions (0755, 0555)

Should not be ~ftp, ~ftp/bin, and ~ftp/etc unwritable by anyone
(mode 0555) instead of 0755?

From ftpd(8):

           ~ftp           Make the home directory owned by ``root'' and
                          unwritable by anyone.

           ~ftp/bin       Make this directory owned by ``root'' and unwritable
                          by anyone (mode 555).  [...]

           ~ftp/etc       Make this directory owned by ``root'' and unwritable
                          by anyone (mode 555).  [...]
 
Don't know about /dev and /dev/fd.  Currently, /dev is a mount point
for a fdesc filesystem and perhaps it changes the permissions of
replaced file descriptors.  I suppose we must not care about the
last two warnings.

Is it my fault or is the specification file for NetBSD wrong?

Cheers,
Igor.