Page MenuHomeFreeBSD

Early WIP: convert login.conf to UCL
Needs RevisionPublic

Authored by allanjude on Jun 19 2020, 9:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 2 2024, 3:34 PM
Unknown Object (File)
Dec 20 2023, 4:10 AM
Unknown Object (File)
Dec 10 2023, 9:22 PM
Unknown Object (File)
Dec 3 2023, 8:58 PM
Unknown Object (File)
Nov 15 2023, 4:56 PM
Unknown Object (File)
Nov 10 2023, 12:40 AM
Unknown Object (File)
Nov 5 2023, 1:23 AM
Unknown Object (File)
Oct 11 2023, 11:13 AM

Details

Summary

This revives a very old project that has been langishing in my local tree

It adds UCL support to cap_mkdb so login.conf can be parsed from UCL (or the original format)

The .db file that is created stays the same, so it doesn't impact compatibility

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31836
Build 29396: arc lint + arc unit

Event Timeline

pstef added inline comments.
usr.bin/cap_mkdb/cap_mkdb.c
89

Is this the BUFSIZ from stdio.h? If so, it's perhaps an unnecessary connotation with setbuf.

138

I'm almost sure that err() and friends terminate output with a newline by definition.

148

I'd suggest || uclver < 1 because this case doesn't seem to be handled below.

301

A leftover comment?

347

realloc() can return a null pointer

349

a leftover comment?

freqlabs added inline comments.
usr.bin/cap_mkdb/cap_mkdb.c
232

Doesn't look like you use i, was it for debugging?

361

Again, i doesn't seem to be used.

usr.bin/login/login.conf
21

Comments about the format will need to be updated.

182

I see a mixture of foo -> foo and bar@ -> bar=true. Presumably they all are supposed to be booleans set to true?

As an aside, I would really like to get UCL to add implicit booleans: https://github.com/vstakhov/libucl/issues/227

Your login.conf changes need to be rebased against an up-to-date version from current - you're undoing the introduction of the "mail" capability and other changes related to environment vars from D21481.

Is it an issue that the login_cap code will now no longer be able to fall back to the text file if the database is not present?

usr.bin/login/login.conf
182

github.com think it's worth being explicit, and instead of having three formats,we should standardise on foo=true

michaelo requested changes to this revision.Aug 9 2023, 8:57 AM
michaelo added a subscriber: michaelo.
michaelo added inline comments.
usr.bin/login/login.conf
30

Will this change support colon, spaces and commons in env var values? E.g.

setenv=BLOCKSIZE=K FOO="bar baz" NO_PROXY="example.com,company.net" HTTPS_PROXY="http://my-proxy.example.com:8000"

Especially the last two are crucial for enterprise usage...

This revision now requires changes to proceed.Aug 9 2023, 8:57 AM