[Dnsmasq-discuss] tftp 'Permission denied' issue...

clemens fischer ino-news at spotteswoode.dnsalias.org
Sun May 16 19:32:07 BST 2010


Steve Elliott wrote:

> sudo -u nobody cp bootrom.pxe.o /tmp/
>
> Works OK and leaves the expected entry
>
> -rwxr-xr-x. 1 nobody nobody 482040 2010-05-16 11:41 /tmp/bootrom.pxe.0
>
> So user nobody CAN read the file - dnsmasq is running as nobody

The command "sudo -u nobody cp f1 f2" will run the "cp" command as user
"nobody", but "cp" _creates_ file "f2" subject to the current umask.
Also, directory "/tmp/" might be mounted with options forcing certain
permissions!

My theory is that one of the directories your bootrom.pxe.o is burried
in doesn't have execute permissions for user nobody.

For this kind of trouble I have this little bash function:

  dirperms() {
      local d="${1-$(pwd)}"
      local dlist=""
      until [[ -z "${d}" ]]
      do
          [[ $(stat --printf=%F "${d}") =~ link ]] && {
              d="/$(readlink -n ${d})"
          }
          dlist="${dlist} ${d}"
          d="${d%/*}"
      done
      ls -Ffl -d ${dlist} "/"
  }

It is used with the directory containing some file as an argument and
outputs all the directories up to the root and it should show which one
lacks proper permissions.

The cheap&quick alternative is simply to "ls -ld" all the directories.
The ones owned by anybody else than user nobody _must_ have the "x" bit
for world access.


clemens




More information about the Dnsmasq-discuss mailing list