[Bug 2116973] Re: mknod doesn't respect --mode argument

Andreas Hasenack 2116973 at bugs.launchpad.net
Tue Jul 15 19:11:09 UTC 2025


Tracing the syscalls, shows that both gnu and rust mknod do the same
mknodat() call, but gnu's mknod later does an fchmod:


gnu-mknod.strace:43336 execve("/usr/bin/mknod", ["mknod", "--mode", "0666", "null", "c", "1", "3"], 0x7ffe9cbf02c8 /* 25 vars */) = 0
gnu-mknod.strace:43336 mknodat(AT_FDCWD, "null", S_IFCHR|0666, makedev(0x1, 0x3)) = 0
gnu-mknod.strace:43336 fchmodat2(AT_FDCWD, "null", 0666, AT_SYMLINK_NOFOLLOW) = 0

rust-mknod.strace:42748 execve("/usr/bin/mknod", ["mknod", "--mode", "0666", "null", "c", "1", "3"], 0x7ffe7b71bcf8 /* 25 vars */) = 0
rust-mknod.strace:42748 mknodat(AT_FDCWD, "null", S_IFCHR|0666, makedev(0x1, 0x3)) = 0

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to rust-coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/2116973

Title:
  mknod doesn't respect --mode argument

Status in rust-coreutils package in Ubuntu:
  New

Bug description:
  root at q-mknod:~# rm null
  root at q-mknod:~# mknod --mode 0666 null c 1 3
  root at q-mknod:~# l null
  crw-r--r-- 1 root root 1, 3 Jul 15 18:36 null

  lrwxrwxrwx 1 root root 9 May 14 09:16 /usr/bin/mknod -> coreutils

  
  This is making livecd-rootfs an FTBFS[1] (see all the permission denied errors when writing to /dev/null):

  dpkg-buildpackage: info: host architecture amd64
   debian/rules clean
  dh clean
  sh: 1: cannot create /dev/null: Permission denied
     dh_clean
   debian/rules binary
  dh binary
  sh: 1: cannot create /dev/null: Permission denied
     dh_update_autotools_config
  (...)
  dpkg-buildpackage: info: host architecture amd64
   debian/rules clean
  dh clean
  sh: 1: cannot create /dev/null: Permission denied
     dh_clean
   debian/rules binary
  dh binary
  sh: 1: cannot create /dev/null: Permission denied
     dh_update_autotools_config

  
  1. https://launchpadlibrarian.net/805275144/buildlog_ubuntu-questing-amd64.livecd-rootfs_25.10.12_BUILDING.txt.gz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2116973/+subscriptions




More information about the foundations-bugs mailing list