Bug 1401330 - SELinux is preventing smbd from 'lock' accesses on the file /home/scans/scan.pdf.
Summary: SELinux is preventing smbd from 'lock' accesses on the file /home/scans/scan....
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:6a3b941a06aa43627c4848d172c...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-04 20:40 UTC by Fred Odendaal
Modified: 2016-12-06 16:54 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-06 16:54:33 UTC
Type: ---


Attachments (Terms of Use)

Description Fred Odendaal 2016-12-04 20:40:03 UTC
Description of problem:
Trying to scan from network printer to samba shared folder. Get error message at printer indicating wrong credentials. SELinux 
indicates error with smbd trying to lock file.
SELinux is preventing smbd from 'lock' accesses on the file /home/scans/scan.pdf.

*****  Plugin restorecon (85.9 confidence) suggests   ************************

If you want to fix the label. 
/home/scans/scan.pdf default label should be user_home_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/scans/scan.pdf

*****  Plugin catchall_boolean (7.33 confidence) suggests   ******************

If you want to allow samba to export all ro
Then you must tell SELinux about this by enabling the 'samba_export_all_ro' boolean.
You can read 'None' man page for more details.
Do
setsebool -P samba_export_all_ro 1

*****  Plugin catchall_boolean (7.33 confidence) suggests   ******************

If you want to allow samba to export all rw
Then you must tell SELinux about this by enabling the 'samba_export_all_rw' boolean.
You can read 'None' man page for more details.
Do
setsebool -P samba_export_all_rw 1

*****  Plugin catchall (1.35 confidence) suggests   **************************

If you believe that smbd should be allowed lock access on the scan.pdf file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'smbd' --raw | audit2allow -M my-smbd
# semodule -X 300 -i my-smbd.pp

Additional Information:
Source Context                system_u:system_r:smbd_t:s0
Target Context                system_u:object_r:home_root_t:s0
Target Objects                /home/scans/scan.pdf [ file ]
Source                        smbd
Source Path                   smbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.21.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 4.8.10-200.fc24.x86_64 #1 SMP Mon
                              Nov 21 17:55:46 UTC 2016 x86_64 x86_64
Alert Count                   4
First Seen                    2016-12-02 12:15:49 EST
Last Seen                     2016-12-02 13:28:18 EST
Local ID                      f45e25f9-c656-4f08-9232-88809b971685

Raw Audit Messages
type=AVC msg=audit(1480703298.972:353): avc:  denied  { lock } for  pid=15832 comm="smbd" path="/home/scans/scan.pdf" dev="sdb3" ino=2621475 scontext=system_u:system_r:smbd_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=file permissive=1


Hash: smbd,smbd_t,home_root_t,file,lock

Version-Release number of selected component:
selinux-policy-3.13.1-191.21.fc24.noarch

Additional info:
reporter:       libreport-2.8.0
hashmarkername: setroubleshoot
kernel:         4.8.10-300.fc25.x86_64
type:           libreport

Potential duplicate: bug 906850

Comment 1 Lukas Vrabec 2016-12-06 16:54:33 UTC
*****  Plugin restorecon (85.9 confidence) suggests   ************************

If you want to fix the label. 
/home/scans/scan.pdf default label should be user_home_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /home/scans/scan.pdf

Adn then enable  samba_enable_home_dirs boolean:
# setsebool -P  samba_enable_home_dirs 1


Note You need to log in before you can comment on or make changes to this bug.