Hi all,

I do not know if this is the correct list, or even method to send
patches, but did not found anything appropriate on the OpenBSD website.

I'd like to propose a little feature enhancement for the authpf. Here
are the details:
- authpf can show a message to an user successfully logged in
- this message is read from /etc/authpf/authpf.message
- the message is the same for every user
- i'll want to change it ;-)

Below is a patch which change current behavior, so that the message is
searched first in the /etc/authpf/USER dir, and if it's not found
there, then the old behavior is used (so fully backward compatible).
The patch looks very simple, but I did NOT tested it at all! Anyway it
would be nice, if something like this make it's way into the HEAD. ;-)

PS. Sorry for any language errors

-- 
Greetings
Rafal Bisingier


diff -u authpf.c.orig authpf.c
--- authpf.c.orig       2008-09-09 17:23:43.315714111 +0200
+++ authpf.c    2008-09-10 21:07:06.258107858 +0200
@@ -314,10 +314,16 @@
        signal(SIGQUIT, need_death);
        signal(SIGTSTP, need_death);
        while (1) {
+               char    *fn = NULL;
                printf("\r\nHello %s. ", luser);
                printf("You are authenticated from host \"%s\"\r\n",
ipsrc); setproctitle("[EMAIL PROTECTED]", luser, ipsrc);
-               print_message(PATH_MESSAGE);
+               if (asprintf(&fn, "%s/%s/authpf.message",
+                   PATH_USER_DIR, luser) == -1)
+                       print_message(PATH_MESSAGE);
+               else
+                       print_message(fn);
+               free(fn);
                while (1) {
                        sleep(10);
                        if (want_death)

Reply via email to