ownership on /var/spool/sms directories incorrect

Bug #1685802 reported by Marco van Zwetselaar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
smstools (Ubuntu)
New
Undecided
Unassigned

Bug Description

As installed out of the box on Ubuntu, the primary group of smsd is smsd. It is also member of group dialout. This makes sense because smsd needs access to modem devices, which normally are crw-rw---- for root:dialout.

As configured in /etc/default/smstools, smsd runs with effective group dialout. Though this makes sense, it is not strictly necessary, given that smsd is a member of group dialout.

Smsd's spool directories (/var/spool/sms/*) are rwxrwsr-t for smsd:smsd. Thus to give a user permission to send SMS it suffices to add them to group smsd. This gives them write access to /var/spool/sms/outgoing. Additionally, due to the setgid when they put a file there, it will be owned user:smsd.

So far, so good. Smsd has ownership of the outgoing directory, so can read and r(re)move the file. However, it gives the error "Cannot handle /var/spool/sms/outgoing/somefile.sms: Access denied. Check the file and directory permissions."

As is apparent from the files in the sent and failed spools (when smsd is run with effective group smsd instead of dialout), what smsd is trying to do is to *take ownership* of the file. This however it cannot do: it is not a privileged user and its effective user nor group match the files owner or group.

There are two solutions: chown the /var/spool/sms directories to smsd:dialout (while keeping effective group dialout), or set smsd's effective group in /etc/default/smstools to smsd (while keeping /var/spool/sms owned smsd:smsd).

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: smstools 3.1.15-1.2
ProcVersionSignature: Ubuntu 4.8.0-46.49~16.04.1-generic 4.8.17
Uname: Linux 4.8.0-46-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Apr 24 13:32:23 2017
InstallationDate: Installed on 2015-12-04 (507 days ago)
InstallationMedia: Ubuntu 15.10 "Wily Werewolf" - Release amd64 (20151021)
SourcePackage: smstools
UpgradeStatus: Upgraded to xenial on 2016-04-25 (364 days ago)

Revision history for this message
Marco van Zwetselaar (zwets) wrote :

Setting smsd's effective group to 'smsd' (in /etc/default/smstools) seems to me the better option. That way users can be given access to the smstools spool directories (by adding them to group 'smsd') without granting them access to the "raw" modems (which would happen if they were added to 'dialout').

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.