List for cgit developers and users
 help / color / mirror / Atom feed
* OpenBSD - Error reading owner-info for <REPOPATH>: No such file or directory (2)
@ 2021-02-25  7:00 Paul W. Rankin
  2021-02-25 10:26 ` John Keeping
  0 siblings, 1 reply; 3+ messages in thread
From: Paul W. Rankin @ 2021-02-25  7:00 UTC (permalink / raw)
  To: cgit

Hello,

I'm running cgit v1.2.3 on OpenBSD 6.8 with httpd and slowcgi. I'm 
getting tons of log errors in the form:
     Error reading owner-info for <REPOPATH>: No such file or directory 
(2)

I've found this Stack Overflow question 
https://stackoverflow.com/questions/48450631/ which suggests that the 
problem is with the call to getpwuid trying to access /etc/passwd:

     if ((pwd = getpwuid(st.st_uid)) == NULL) {
	    fprintf(stderr, "Error reading owner-info for %s: %s (%d)\n",
		    path->buf, strerror(errno), errno);
	    break;
     }

@ https://git.zx2c4.com/cgit/tree/scan-tree.c#n139

On OpenBSD, httpd runs in a chroot at /var/www, which would seem to 
suggest why cgit would not be able to access /etc/passwd

In my cgitrc I have
     enable-git-config=0
     enable-index-owner=0
so that doesn't help.

Is there any way to prevent all these error logs? Currently this fills 
up a log file about once an hour...

Thanks!

-- 
Paul W. Rankin
https://bydasein.com

The single best thing you can do for the world is delete your social 
media accounts.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: OpenBSD - Error reading owner-info for <REPOPATH>: No such file or directory (2)
  2021-02-25  7:00 OpenBSD - Error reading owner-info for <REPOPATH>: No such file or directory (2) Paul W. Rankin
@ 2021-02-25 10:26 ` John Keeping
  2021-02-25 12:09   ` Paul W. Rankin
  0 siblings, 1 reply; 3+ messages in thread
From: John Keeping @ 2021-02-25 10:26 UTC (permalink / raw)
  To: Paul W. Rankin; +Cc: cgit

On Thu, Feb 25, 2021 at 05:00:57PM +1000, Paul W. Rankin wrote:
> I'm running cgit v1.2.3 on OpenBSD 6.8 with httpd and slowcgi. I'm 
> getting tons of log errors in the form:
>      Error reading owner-info for <REPOPATH>: No such file or directory 
> (2)
> 
> I've found this Stack Overflow question 
> https://stackoverflow.com/questions/48450631/ which suggests that the 
> problem is with the call to getpwuid trying to access /etc/passwd:
> 
>      if ((pwd = getpwuid(st.st_uid)) == NULL) {
> 	    fprintf(stderr, "Error reading owner-info for %s: %s (%d)\n",
> 		    path->buf, strerror(errno), errno);
> 	    break;
>      }
> 
> @ https://git.zx2c4.com/cgit/tree/scan-tree.c#n139
> 
> On OpenBSD, httpd runs in a chroot at /var/www, which would seem to 
> suggest why cgit would not be able to access /etc/passwd
> 
> In my cgitrc I have
>      enable-git-config=0
>      enable-index-owner=0
> so that doesn't help.
> 
> Is there any way to prevent all these error logs? Currently this fills 
> up a log file about once an hour...

Without any changes to the code, if you set "repo.owner" (or
"gitweb.owner" if you have "enable-git-config" set) then this value will
be used and the loop that tries getpwuid() won't be entered.

I think it would be reasonable to provide a way to disable the "owner
from filesystem" code via cgitrc.  It's probably meaningless in many
setups, for example with Gitolite, where all the repositories are owned
by a "git" user anyway.


John

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: OpenBSD - Error reading owner-info for <REPOPATH>: No such file or directory (2)
  2021-02-25 10:26 ` John Keeping
@ 2021-02-25 12:09   ` Paul W. Rankin
  0 siblings, 0 replies; 3+ messages in thread
From: Paul W. Rankin @ 2021-02-25 12:09 UTC (permalink / raw)
  To: John Keeping; +Cc: cgit

On 2021-02-25 20:26, John Keeping wrote:
> On Thu, Feb 25, 2021 at 05:00:57PM +1000, Paul W. Rankin wrote:
>> I'm running cgit v1.2.3 on OpenBSD 6.8 with httpd and slowcgi. I'm
>> getting tons of log errors in the form:
>>      Error reading owner-info for <REPOPATH>: No such file or 
>> directory
>> (2)
> 
> Without any changes to the code, if you set "repo.owner" (or
> "gitweb.owner" if you have "enable-git-config" set) then this value 
> will
> be used and the loop that tries getpwuid() won't be entered.
> 
> I think it would be reasonable to provide a way to disable the "owner
> from filesystem" code via cgitrc.  It's probably meaningless in many
> setups, for example with Gitolite, where all the repositories are owned
> by a "git" user anyway.

Thank you John, this solved it!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-25 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25  7:00 OpenBSD - Error reading owner-info for <REPOPATH>: No such file or directory (2) Paul W. Rankin
2021-02-25 10:26 ` John Keeping
2021-02-25 12:09   ` Paul W. Rankin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).