Felix Palmen :freebsd: :c64:

Next #swad improvement: Make sure to #wipe #passwords from RAM directly after used. That's more of a #security precaution, because there *should* be no way how an attacker can access a running process' memory, but you never know which bugs surface 🙈.

Unexpectedly, that posed #portability issues. #C11 has #memset_s ... a pretty weird function, but suitable for wiping. It's there on #FreeBSD and on #OpenBSD. Not on #NetBSD though. But NetBSD offers the much saner #C23 function #memset_explicit. Looking at #Linux, there's neither. But there is the (non-standard!) #explicit_bzero 🤯 .. and with glibc, it requires _DEFAULT_SOURCE to be defined as soon as you compile with a C standard version given to the compiler. This function exists on some other systems as well, but there's confusion whether it should be declared in string.h or strings.h. 🤪

Here's the full set of compile-tests I'm now doing, only to find the best way to really erase memory:
github.com/Zirias/swad/blob/ma

And if none of these functions is found, swad uses the "hacky" way that most likely works as well: Access the normal memset function via a volatile pointer.

swad/src/bin/swad/swad.mk at master · Zirias/swad

Simple Web Authentication Daemon. Contribute to Zirias/swad…

GitHub
Eugene :emacs: :freebsd:

@wolf480pl @nytpu A little addition: the BSD (at least #FreeBSD, I don't touch any other BSDs) has a strong distinction between a "base system" (kernel, bootloader, compiler(s), sh) and a "user system" (all userspace programs).

They are updates separately, so some update of user programs will not break the core.

The nuances are well described in this vermaden's blog post: vermaden.wordpress.com/2020/09

Quare FreeBSD?

I really wanted to make this article short … but I…

𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗
Justine Smithies
I see the #FreeBSD pkg servers still haven't resolved issues regarding Go related packages. Still cannot find the LF TUI file manager anymore on Latest. I wonder how long it will take for things to get back to normal ?
Garrett Wollman

Reporting something positive for a change: at work, I recently retired the last six of our 13-year-old Dell R415 servers, which were replaced with a combination of new Dell R360s and 7-year-old whitebox Supermicro machines. I cloned the old machines onto the new machines' disks, made small configuration tweaks (UEFI, serial console settings, network interface configuration) and after a couple of initial hitches everything Just Worked. #FreeBSD of course.

Felix Palmen :freebsd: :c64:

Today, I implemented the #async / #await pattern (as known from #csharp and meanwhile quite some other languages) ...

... in good old #C! 😎

Well, at least sort of.

* It requires some standard library support, namely #POSIX user context switching with #getcontext and friends, which was deprecated in POSIX-1.2008. But it's still available on many systems, including #FreeBSD, #NetBSD, #Linux (with #glibc). It's NOT available e.g. on #OpenBSD, or Linux with some alternative libc.

* I can't do anything about the basic language syntax, so some boilerplate comes with using it.

* It has some overhead (room for extra stacks, even extra syscalls as getcontext unfortunately also always saves/restores the signal mask)

But then ... async/await in C! 🥳

Here are the docs:
zirias.github.io/poser/api/lat

#C #coding

poser: PSC_AsyncTask Class Reference

zirias.github.io
LeJax

F*CK!

I try to unsubscribe to #FreeBSD mailing lists. Each time I do the right way, the day after I'm still subscriber.

Is there a way to stop that?

#MAILINGLISTS
#Unsubcribe

Felix Palmen :freebsd: :c64:

I finally eliminated the need for a dedicated #thread controlling the pam helper #process in #swad. 🥳

The building block that was still missing from #poser was a way to await some async I/O task performed on the main thread from a worker thread. So I added a class to allow exactly that. The naive implementation just signals the main thread to carry out the requested task and then waits on a #semaphore for completion, which of course blocks the worker thread.

Turns out we can actually do better, reaching similar functionality like e.g. #async / #await in C#: Release the worker thread to do other jobs while waiting. The key to this is user context switching support like offered by #POSIX-1.2001 #getcontext and friends. Unfortunately it was deprecated in POSIX-1.2008 without an obvious replacement (the docs basically say "use threads", which doesn't work for my scenario), but still lots of systems provide it, e.g. #FreeBSD, #NetBSD, #Linux (with #glibc) ...

The posercore lib now offers both implementations, prefering to use user context switching if available. It comes at a price: Every thread job now needs its private stack space (I allocated 64kiB there for now), and of course the switching takes some time as well, but that's very likely better than leaving a task idle waiting. And there's a restriction, resuming must still happen on the same thread that called the "await", so if this thread is currently busy, we have to wait a little bit longer. I still think it's a very nice solution. 😎

In any case, the code for the PAM credential checker module looks much cleaner now (the await "magic" happens on line 174):
github.com/Zirias/swad/blob/57

#C #coding

swad/src/bin/swad/cred/pamchecker.c at 57eefe93cdad0df55ebede4bd877d22e7be1a7f8 · Zirias/swad

Simple Web Authentication Daemon. Contribute to Zirias/swad…

GitHub
Apr 17, 2025, 14:34 · · · 1 · 0
Garrett :gnome: :debian:

Really enjoying my outing with #freebsd on the desktop (laptop specifically). I love how you need nothing but the handbook and your ports tree.

That said, I chose an inopportune time it seems, at the quarterly push for 14.2 Release... because meta packages, or at least desktop environment meta packages, are just completely missing from the pkg repos which is a bad feeling when you're setting up a new system!

Joshua Aspinall

Good evening #FreeBSD friends, I'm taking the plunge on a spare Laptop to install and use FreeBSD with a GNOME desktop under Wayland.

Having checked and re-checked the manual for Wayland and Desktop Environment install I can't get beyond a console. GDM does not start and gnome-session has a list of complaints I am unfamiliar with.

Is there a guide someone has written of achieving such a setup I could link to?

Thanks in advance!

hyperreal

Is there a FreeBSD-equivalent to systemd drop-in replacements for services?

The only way I can see at the moment is just by backing up the original /etc/rc.d/service file and creating a new one to replace it.

#FreeBSD #BSD #FOSS #sysadmin

ぷーざ

FreeBSD 15が来るということは、13が終わるということか。
訳あってもう少し13系が必要な状況だが、解決しないとな…

#FreeBSD

Puffy Fan

To run KDE Plasma 6, is it mandatory to install xorg or will it work only off Wayland? #freebsd

mms :runbsd: :emacs: :c64:

4chan servers were running #freebsd 10.1....

ax6761

@vermaden @justine
Addendum: prefix "pkg upgrade" with "make-snapshots" to be able to rollback the file systems(s) without fuss ...

make-snapshots \
&& pkg upgrade && make-snapshots \
&& pkg autoremove && make-snapshots \
&& pkg clean && make-snapshots

... I had made the change before the issue of {missing,disappearing}-packages-on-upgrade that various other peoples are experiencing currently.

#FreeBSD #ZFSEverywhere_possible #ZFS

Apr 16, 2025, 10:13 · · · 1 · 0
Eugene :emacs: :freebsd:

I found the problem even with ImageMagick7, which can't convert SVG to PNG. Instead it crashes with coredump.

Before April's update all programs works perfectly fine.

For now, I creating the account in the #FreeBSD bugtracker to describe this bug...