LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-21-2018, 09:22 PM   #1
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 139

Rep: Reputation: Disabled
can't run "sail" as non-root


Yes, it's in the last package to be installed on a full Slackware system, but as they say, "last but not least".

The primary issue is directory ownership/privileges on /var/lib/bsdgames/sail. Mode is 0750 but ownership is root:root. That means only UID 0 can do anything in that directory.

I tried removing the bsdgames package, confirming that /var/lib/bsdgames/sail was properly deleted, then installing again, to see how the latest build of bsdgames would put things together. The directory was still root:root, mode 0750.

There is a group ID called "games" but I don't know how it could be used to remedy this. I've tried changing ownership of /var/lib/bsdgames/sail to root:games, then adding the "games" group to my UID, and even doing "chmod s+g /usr/games/sail", all to no avail.

I have confirmed this on all 4 of my Slackware installs, the most recent (freshest) being Slackware ARM on my Raspberry Pi.

I know I'm probably missing something (again). Does anyone know, definitively, what isn't right, and how to fix it?
 
Old 07-21-2018, 09:27 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 14,714
Blog Entries: 24

Rep: Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108Reputation: 4108
I duplicated this problem. Sail is owned by root, but user and group have read and execute permissions. However, when I try to choose a scenario for the game, I get this error:

Code:
$ sail
Choose a scenario:


        NUMBER  SHIPS   IN PLAY TITLE
        0):     2       no      Ranger vs. Drake
(snip)

Scenario number? 0
sail: syncfile: Permission denied
 
Old 07-21-2018, 10:02 PM   #3
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,545

Rep: Reputation: Disabled
According to strace it wants permissions for files in /var/lib/bsdgames/sail/.

For example.
Quote:
write(1, " NUMBER SHIPS IN PLAY TITLE
", 28 NUMBER SHIPS IN PLAY TITLE
) = 28
setresgid(-1, 100, -1) = 0
stat("/var/lib/bsdgames/sail/#sailsink.0", 0x7ffddd8b2e30) = -1 EACCES (Permission denied)
setresgid(-1, 100, -1) = 0
 
Old 07-22-2018, 02:47 AM   #4
kingbeowulf
Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware64 14.2 Slackware 14.2, Slackware{32,64}-current
Posts: 881
Blog Entries: 9

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
since it's "only" a game, use
Code:
cd /var/lib/bsdgames/
chmod 777 sail
to fix...or
Code:
cd /var/lib/bsdgames/
chmod 755 sail
chown root:games sail
and add your user to group 'games'.
 
Old 07-22-2018, 07:09 PM   #5
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware (x86 and ARM)
Posts: 139

Original Poster
Rep: Reputation: Disabled
I'd like to see it fixed in the installation step (i.e. when installing the package).

What I've settled on for now, is to do the following (as root).
Code:
# chown root:games /usr/games/sail /var/lib/bsdgames/sail
# chmod g+s /usr/games/sail
# chmod 770 /var/lib/bsdgames/sail
Looking through the source code for sail, every read, write, & stat inside this directory is preceded & followed by an EGID switch. "chmod g+s /usr/games/sail" sets the effective GID to "games", which then enables the program to switch to the games GID for fileops in /var/lib/bsdgames/sail, then return to original GID for fileops elsewhere.

You can observe this behavior, starting as root, with
Code:
# strace -f su -c /usr/games/sail $NAME
changing $NAME to your unprivileged username, of course.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Alternative of "updatedb" on linux(Ubuntu) or Run "updatedb" without root user(with normal user) rutul.5085 Linux - Newbie 3 05-06-2016 04:08 AM
[SOLVED] "su: must be run from a terminal" How best for root to run command as user simonb Linux - Newbie 1 04-01-2012 02:40 AM
Net-SNMP - Run a command as root with "extend" feature gimpy530 Linux - Software 0 07-13-2010 09:03 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
[SOLVED] Need to recover or change root password. And must run "nano". ShellyCat Linux - Newbie 10 07-14-2007 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration