🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90312

inn-secrets.conf, cancels, and cancel locks

#90312
From: Adam W.
Date: Wed, 19 Apr 2023 13:25
75 lines
3908 bytes
Hi,

To be honest, I was never really that much interested in how cancel locks 
work, so forgive me if my questions are naive.

I want to use the newly added cancel-lock feature to inn 2.7.0, but it's 
not entirely clear to me from the documentation if my intended 
configuration is correct.

From what I understand:

- canlockadmin is used when generating cancels from hand by gencancel

- cancel generated by gencancel should just be posted to the server, by 
  any user, authenticated or not

- canlockuser is used when authenticated user generates cancels

- authenticated user's name is taken from the "user:" field in "access" 
  section of readers.conf

- if canlockuser is set and not disabled in readers.conf, and posting is 
  allowed for users without "user:" field in "access" section of 
  readers.conf, then they will be able to cancel posts made by other 
  non-authenticated users (but not those made by authenticated ones)

- if the posting agent doesn't support cancel locks, then it's enough for 
  it to generate a normal cancel and as long as the authenticated user 
  matches, the hash will match and the cancel will be honored by other 
  servers using this feature

- if the posting agent supports cancel locks, then it generates its own 
  Cancel-Lock header and the user possessing the key can cancel the 
  article even if he changes the identity or server

- the feature doesn't interfere with cancel locks supported by posting 
  agents, it just adds more possibilities to generate a honored cancel

- INN servers starting with 2.7.0 will refuse to honor cancels without 
  correct Cancel-Lock headers (I'm not sure about this)

Is my understanding of this mechanism correct?

Now, from theory to practice.

- I set canlockadmin (during testing I kept canlockuser empty)

- I posted a message to my local group (kept in timehash, if that matters)

- I generated two cancels with gencancel

- I altered one of them so the hashes won't match

- I posted the altered one

- I posted the unaltered one

I expected to have the post available after posting the altered cancel, 
but gone after posting the unaltered cancel. But the post is still on the 
group. Why didn't it work?

I also posted the unauthenticated cancel (without Cancel-Lock header), but 
it didn't change anything. The article is still there.

All three cancels landed properly in control.cancel group.

I also expected to have something logged about incorrect cancel hash, but 
I can't find anything. Should there be some log line about it?

Also, can I control if my server accepts cancels or not (even better, by 
matching the pattern)? It would be best if there were three settings: 
never accept, always accept (even unauthenticated), or accept only if 
cancel-lock matches.

Thank you!
Technical Details
Message-ID: <u1oq4d$baa$2$arnold@news.chmurka.net>
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

Show Full Headers
Complete Article Headers
Message-ID: <u1oq4d$baa$2$arnold@news.chmurka.net>
Subject: inn-secrets.conf, cancels, and cancel locks
Date: Wed, 19 Apr 2023 13:25:33 +0000
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
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
Newsgroups: news.software.nntp
Organization: news.chmurka.net
Nntp-Posting-Host: s.v.chmurka.net
Injection-Date: Wed, 19 Apr 2023 13:25:33 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20"; logging-data="11594"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.32-v7+ (armv7l))
Cancel-Lock: sha1:lHxUJm1WcYLhRpdnL6G+8/JpZNA= sha1:qYCqfLrA4ErHnfpFXDie95Cu1lY= sha256:VdBlkjsDrY/Ch6zljCw3Q+9RoEJpP/cDymMXgK0dYKw= sha1:jJCW/e3nnwt9BscLdF+YEErvqa0= sha256:Yp+GGaJUHJupvRX6L4P3rN+4+vRL6WRGJTdgD0YZP+k=