[Bug 118671] mkfifo(3) & mknod(2) and EPERM

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

 



https://bugzilla.kernel.org/show_bug.cgi?id=118671

--- Comment #4 from Navin <navinp1912@xxxxxxxxx> ---
I don't think so . This is not a bug. Please see below for the details.

>From mount command manpage 
          For most types all the mount program has to do is issue a simple
mount(2) system call, and no detailed knowledge of the filesystem type is 
required.For  a  few types however (like nfs, nfs4, cifs, smbfs, ncpfs) an ad
hoc code is necessary.  The nfs, nfs4, cifs, smbfs, and ncpfs filesystems have
a separate mount program.  In order to make it possible to treat all types in a
uniform way, mount will execute the program /sbin/mount.type  (if  that        
   exists)  when called with type type.  Since different versions of the
smbmount program have different calling conventions, /sbin/mount.smbfs may have
           to be a shell script that sets up the desired call.


Now looking at mount.cifs(8)

>From mount.cifs(8) from cifs-utils not related to kernel manpages.

sfu
           When the CIFS Unix Extensions are not negotiated, attempt to create
device files and fifos in a format compatible with Services for Unix (SFU). In
addition retrieve bits 10-12 of the mode via the SETFILEBITS extended attribute
(as SFU does). In the future the bottom 9 bits of the mode mode also        
will be emulated using queries of the security descriptor (ACL). [NB: requires
version 1.39 or later of the CIFS VFS. To recognize symlinks and be able       
  to create symlinks in an SFU interoperable form requires version 1.40 or
later of the CIFS VFS kernel module.

 nounix
           Disable the CIFS Unix Extensions for this mount. This can be useful
in order to turn off multiple settings at once. This includes POSIX acls, POSIX
          locks, POSIX paths, symlink support and retrieving uids/gids/mode
from the erver. This can also be useful to work around a bug in a server that  
        supports Unix Extensions.


INODE NUMBERS
       When Unix Extensions are enabled, we use the actual inode number
provided by the server in response to the POSIX calls as an inode number.

       When Unix Extensions are disabled and "serverino" mount option is
enabled there is no way to get the server inode number. The client typically
maps the server-assigned "UniqueID" onto an inode number.

       Note that the UniqueID is a different value from the server inode
number. The UniqueID value is unique over the scope of the entire server and is
often  greater than 2 power 32. This value often makes programs that are not
compiled with LFS (Large File Support), to trigger a glibc EOVERFLOW error as
this won´t fit in the target structure field. It is strongly recommended to
compile your programs with LFS support (i.e. with -D_FILE_OFFSET_BITS=64) to
prevent this problem. You can also use "noserverino" mount option to generate
inode numbers smaller than 2 power 32 on the client. But you may not be able to
detect hardlinks properly.


Here is for volume smb running on ubuntu , this CIFS extensions are coming from
server

smbclient -N //127.0.0.1/Movies -c "posix"
WARNING: The "syslog" option is deprecated
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.9-Ubuntu]
Server supports CIFS extensions 1.0
Server supports CIFS capabilities locks acls pathnames posix_path_operations
large_read posix_encrypt
junk@junk-foo:~/android/samba-4.4.5/source3$ smbclient -N //127.0.0.1/Movies -c
"volume"
WARNING: The "syslog" option is deprecated
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.9-Ubuntu]
Volume: |Movies| serial number 0x735d0d3c
junk@junk-foo:~/android/samba-4.4.5/source3$ 

win10

Domain=[DESKTOP-T9GDCOU] OS=[Windows 10 Pro 10240] Server=[Windows 10 Pro 6.3]
smb: \> posix
Server doesn't support UNIX CIFS extensions.
smb: \> 

root@junk-foo:/mnt/24# touch foo
root@junk-foo:/mnt/24# ls -l foo
-rwxr-xr-x 1 root root 0 Jul  8 20:11 foo
root@junk-foo:/mnt/24# mkfifo abcd
mkfifo: cannot create fifo 'abcd': Operation not permitted
root@junk-foo:/mnt/24# ls
foo
root@junk-foo:/mnt/24# mknod dev b 1 2
mknod: dev: Operation not permitted


root@junk-foo:/mnt/24# mount | grep PerfLogs
//192.168.122.12/PerfLogs on /mnt/24 type cifs
(rw,relatime,vers=1.0,cache=strict,username=junk,domain=DESKTOP-T9GDCOU,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.122.12,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

Default mount.smbfs disables this creation below it does with nounix option and
without sfu.



Now add sfu option and  mount 

root@junk-foo:/mnt/24# mount | grep PerfLogs
//192.168.122.12/PerfLogs on /mnt/24 type cifs
(rw,relatime,vers=1.0,cache=strict,username=junk,domain=DESKTOP-T9GDCOU,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.122.12,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,sfu,dynperm,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
root@junk-foo:/mnt/24# mknod devsmb b 1 2
root@junk-foo:/mnt/24# mkfifo fifosmb
root@junk-foo:/mnt/24# ls
devsmb  fifosmb  foo  newfoo
root@junk-foo:/mnt/24# cd
root@junk-foo:~# umount /mnt/24
root@junk-foo:~# 


Now without dynperm

mount.cifs //192.168.122.12/PerfLogs /mnt/24 -o
user=junk,dom=DESKTOP-T9GDCOU,sfu
Password for junk@//192.168.122.12/PerfLogs:  *********
root@junk-foo:~# cd /mnt/24
root@junk-foo:/mnt/24# ls
devsmb  fifosmb  foo  newfoo
root@junk-foo:/mnt/24# ls -l
total 1
brwxr-xr-x 1 root root 1, 2 Jul  8 20:13 devsmb
prwxr-xr-x 1 root root    0 Jul  8 20:14 fifosmb
-rwxr-xr-x 1 root root    0 Jul  8 20:11 foo
-rwxr-xr-x 1 root root    0 Jul  8 20:12 newfoo
root@junk-foo:/mnt/24# mkfifo newsmbfifo
root@junk-foo:/mnt/24# ls -l
total 1
brwxr-xr-x 1 root root 1, 2 Jul  8 20:13 devsmb
prwxr-xr-x 1 root root    0 Jul  8 20:14 fifosmb
-rwxr-xr-x 1 root root    0 Jul  8 20:11 foo
-rwxr-xr-x 1 root root    0 Jul  8 20:12 newfoo
prwxr-xr-x 1 root root    0 Jul  8 20:15 newsmbfifo
root@junk-foo:/mnt/24# 


It is clear that even though the server doesn't support we can still create
fifos and mknod and if the server does support you definitely can.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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