Samba read-only share is not working as expected.

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6.5
  • Fusionfs (unionfs)
  • samba

Issue

  • samba read-only share is not working as expected.
  • We created a Samba share, marking it as read-only (it's actually a read-only FS created with funionfs). When Windows users access that share via Windows Explorer and try to copy a file Windows Explorer reports "You need permission from to copy this file. However, xcopy works fine.

Resolution

  • Configure samba share on local filesystem instead of using fusionfs filesystem.

Root Cause

  • Issue occurred due to broken POSIX interface of unionfs.
  • fustionfs document says :
What is working
        - File create/open/read/write/close/remove
        - Direcotry create/read/remove

What is NOT working (We might add support for the followings if some applications require them)
        - File rename/link/slink
        - Directory rename
        - Other POSIX interfaces

Diagnostic Steps

  • tcpdump output shows that samba is considering the mount point as read/write instead of read-only
QUERY_FS_INFO Data
            FS Attributes: 0x0001002f
                .... .... .... .... .... .... .... ...1 = Case Sensitive Search: This FS supports CASE SENSITIVE SEARCHes
                .... .... .... .... .... .... .... ..1. = Case Preserving: This FS supports CASE PRESERVED NAMES
                .... .... .... .... .... .... .... .1.. = Unicode On Disk: This FS supports UNICODE NAMES
                .... .... .... .... .... .... .... 1... = Persistent ACLs: This FS supports PERSISTENT ACLs
                .... .... .... .... .... .... ...0 .... = Compression: This FS does NOT support compressed files
                .... .... .... .... .... .... ..1. .... = Volume Quotas: This FS supports VOLUME QUOTAS
                .... .... .... .... .... .... .0.. .... = Sparse Files: This FS does NOT support sparse files
                .... .... .... .... .... .... 0... .... = Reparse Points: This FS does NOT support reparse points
                .... .... .... .... .... ...0 .... .... = Remote Storage: This FS does NOT support remote storage
                .... .... .... .... .0.. .... .... .... = LFN APIs: This FS does NOT support lfn apis
                .... .... .... .... 0... .... .... .... = Volume Is Compressed: This FS volume is NOT compressed
                .... .... .... ...1 .... .... .... .... = Supports OIDs: This FS supports OIDs
                .... .... .... ..0. .... .... .... .... = Supports Encryption: This FS does NOT support encryption
                .... .... .... .0.. .... .... .... .... = Named Streams: This FS does NOT support named streams
                .... .... .... 0... .... .... .... .... = Read Only Volume: This is a read/write volume     <-------------
            Max name length: 255
            Label Length: 8
            FS Name: NTFS

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.