🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #89694

Re: innd: SERVER cant open /var/www/inn/inn_status.html: Permission denied

#89694
From: Jeffery Small
Date: Thu, 06 Oct 2022 23:43
79 lines
4856 bytes
On Wednesday, October 5, 2022 at 9:14:57 PM UTC-7, Russ Allbery wrote:
> Okay, then it's some sort of security control related to the service 
> startup. It's not immediately jumping out to me in the service unit, 
> though. Do you have SELinux or AppArmor or anything like that enabled? 
> (Ubuntu, so AppArmor is probably more likely. I don't know if INN has 
> AppArmor rules, though.) 

AppArmor is installed and the service is running.  I have never touched
this and there is no inn2 profile, so I don't think it is the problem.

> In this case, I'm pretty sure the symlink to a different file system is 
> the root of the problem, I'm just not sure how.

I see that apache2 doesn't have any access problems.  I looked in the
/etc/apache2/apache2.conf file and see the following lines that have
been there for many years:

<Directory /u/www/>
    AddHandler cgi-script .cgi
    Options Includes Indexes FollowSymLinks ExecCGI MultiViews
    AllowOverride All
    Require all granted
</Directory>

<Directory /var/www/>
    AddHandler cgi-script .cgi
    Options Includes Indexes FollowSymLinks ExecCGI MultiViews
    AllowOverride All
    Require all granted
</Directory>

So, at some point, I apparently added a duplicate entry for /u/www
which seems strange because the disk is actually mounted on /x
and /u is a symlink pointing to /x/u just as /var/www is a symlink
to /u/www -- which is actually a path with two symlinks.

So, regarding apache2, there doesn't seem to be a restriction regarding
symlinks.

In /etc/news/inn.conf file there is only one entry that points to a symlink
path:

pathhttp:     /var/www/inn

I guess there are two things I could do.  1) change the path to eliminate
symlinks:

pathhttp:     /x/u/www/inn

or 2) completely change the location of the directory to somewhere on the
root drive.  For example:

pathhttp:     /var/inn2

The only thing under the current /var/www/inn directory is the sole
inn_status.html file.  However, I'm not sure what making a change line
this would do to the overall inn2 operations.

Suggestions?

> For some reason all the editors you're using including vim are trying to 
> connect to your X display, I think. One thing to try would be to unset 
> the DISPLAY environment variable before trying to edit the file, which 
> should hopefully clue in editors that support either using X or not that 
> there's no X display they have access to. 
> 
> It's possible that your vim actually ended up being vim-gtk3 or something 
> during the upgrade.

You are correct.  Unsetting the DISPLAY variable allowed the news user to
edit the file.  I am going to have to look into what new things auth is doing
under the hood.  One thought I had was that user news had a home directory
of /var/spool/news, but cannot login since the shell is set to "nologin".  Other
users get a ~/.Xauthority file created when they first login.  (Copying my file 
to that location doesn't work.)  Is there a way to force non-login users to get
an .Xauthority file?  If not, maybe I need to add a shell, login to create the
auth file and then reset it to nologin.

Thoughts?
Technical Details
Message-ID: <ce163f8a-c1ed-42b1-b096-82c4a761d615n@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <1fa7c51d-79c0-4411-bb01-1a01bc6ea891n@googlegroups.com> <874jwjsj66.fsf@hope.eyrie.org> <b6710de6-919f-4331-a663-b18eaed4346an@googlegroups.com> <87r0znqzj9.fsf@hope.eyrie.org> <f129b02c-cd9c-409d-b88f-8053d62f14e2n@googlegroups.com> <87edvnqqvz.fsf@hope.eyrie.org> <aecf2f19-92ee-4c4f-9334-763ad2375d0bn@googlegroups.com> <87tu4hvd23.fsf@hope.eyrie.org> <82780217-dd2d-4931-9d84-4d0b01cb7090n@googlegroups.com> <87o7upvb9c.fsf@hope.eyrie.org>

Show Full Headers
Complete Article Headers
Message-ID: <ce163f8a-c1ed-42b1-b096-82c4a761d615n@googlegroups.com>
Subject: Re: innd: SERVER cant open /var/www/inn/inn_status.html: Permission denied
Date: Thu, 06 Oct 2022 23:43:11 +0000
From: Jeffery Small <jefferysmall@gmail.com>
References: <1fa7c51d-79c0-4411-bb01-1a01bc6ea891n@googlegroups.com> <874jwjsj66.fsf@hope.eyrie.org> <b6710de6-919f-4331-a663-b18eaed4346an@googlegroups.com> <87r0znqzj9.fsf@hope.eyrie.org> <f129b02c-cd9c-409d-b88f-8053d62f14e2n@googlegroups.com> <87edvnqqvz.fsf@hope.eyrie.org> <aecf2f19-92ee-4c4f-9334-763ad2375d0bn@googlegroups.com> <87tu4hvd23.fsf@hope.eyrie.org> <82780217-dd2d-4931-9d84-4d0b01cb7090n@googlegroups.com> <87o7upvb9c.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
X-Received: by 2002:a37:9785:0:b0:6cf:55d:e554 with SMTP id z127-20020a379785000000b006cf055de554mr2108494qkd.459.1665099792322; Thu, 06 Oct 2022 16:43:12 -0700 (PDT)
X-Received: by 2002:a81:383:0:b0:350:9b62:60bc with SMTP id 125-20020a810383000000b003509b6260bcmr1966543ywd.514.1665099792052; Thu, 06 Oct 2022 16:43:12 -0700 (PDT)
Newsgroups: news.software.nntp
In-Reply-To: <87o7upvb9c.fsf@hope.eyrie.org>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:600:9100:5ca0:e23f:49ff:fee8:1a31; posting-account=HkkpOQkAAADsR9HpuB7NpuJa7KNw-XVw
Nntp-Posting-Host: 2601:600:9100:5ca0:e23f:49ff:fee8:1a31
User-Agent: G2/1.0
Mime-Version: 1.0
Injection-Date: Thu, 06 Oct 2022 23:43:12 +0000
Content-Type: text/plain; charset="UTF-8"