Bug 493336 - Policy problem when starting smbd via Swat
Summary: Policy problem when starting smbd via Swat
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-01 13:55 UTC by Jon Senior
Modified: 2009-11-18 13:04 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-11-18 13:04:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jon Senior 2009-04-01 13:55:01 UTC
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 18:45:43 UTC
So swat directly starts samba or does it use the initrc script?

Comment 2 Jon Senior 2009-04-01 19:08:47 UTC
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 19:40:57 UTC
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 13:33:12 UTC
Fixed in selinux-policy-3.5.13-55.fc10

Comment 5 Bug Zapper 2009-11-18 11:39:30 UTC
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 13:04:47 UTC
Closing as closed in the current release.


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