Bug 493336 - Policy problem when starting smbd via Swat
Policy problem when starting smbd via Swat
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted (Show other bugs)
10
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-01 09:55 EDT by Jon Senior
Modified: 2009-11-18 08:04 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-18 08:04:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jon Senior 2009-04-01 09:55:01 EDT
Description of problem:

When starting the samba daemon via the Swat interface, a context of "swat_t" is assigned to smbd. This causes SELinux access constraints.

Version-Release number of selected component (if applicable):


How reproducible:

Very easily

Steps to Reproduce:
1. Connect to http://localhost:901 and use Swat to start the smb daemon
2. Connect to the machine remotely via Samba and attempt to access an enabled share (Tested using WinXP access from a KVM virtual machine).
  
Actual results:

Access denied.

Expected results:

Access granted.
Comment 1 Daniel Walsh 2009-04-01 14:45:43 EDT
So swat directly starts samba or does it use the initrc script?
Comment 2 Jon Senior 2009-04-01 15:08:47 EDT
Judging by the code in startstop.c in the git repository for SWAT, it's started by swat itself:

-------------

void start_smbd(void)
{
	pstring binfile;

	if (geteuid() != 0) return;

	if (fork()) {
		return;
	}

	slprintf(binfile, sizeof(pstring) - 1, "%s/smbd", dyn_SBINDIR);

	become_daemon(True, False);

	execl(binfile, binfile, "-D", NULL);

	exit(0);
}

-------------

If you perform a restart using the initrc script, the context becomes "smbd_t" as expected. I don't understand SELinux well enough to know whether this is correctable safely in the policy or whether it needs swat to be modified.
Comment 3 Daniel Walsh 2009-04-01 15:40:57 EDT
Miroslac could you add

samba_domtrans_smb(swat_t) in place of 
can_exec(swat_t, smbd_exec_t)
Comment 4 Miroslav Grepl 2009-04-07 09:33:12 EDT
Fixed in selinux-policy-3.5.13-55.fc10
Comment 5 Bug Zapper 2009-11-18 06:39:30 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 6 Daniel Walsh 2009-11-18 08:04:47 EST
Closing as closed in the current release.

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