pivot_root - wrong check on mount(2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good morning,

reading the pivot_root man page
(https://man7.org/linux/man-pages/man2/pivot_root.2.html)
there seems to be an error in the example source program
"pivot_root_demo.c".
In particular, there is a wrong check on the return value of mount(2).
https://man7.org/linux/man-pages/man2/mount.2.html#RETURN_VALUE

The error is in this line
if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL) == 1)

that should be
if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL) == -1)


Thank you for your work, kind regards
-- 
Davide Antonino Giorgio
http://giorgiodavide.it

Attachment: 0x4BAA68CE23187566.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux