]> arthur.barton.de Git - netatalk.git/commitdiff
Per volume login message
authorFrank Lahm <franklahm@googlemail.com>
Sat, 7 Apr 2012 09:24:35 +0000 (11:24 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Sat, 7 Apr 2012 09:24:35 +0000 (11:24 +0200)
NEWS
etc/afpd/messages.c
etc/afpd/volume.c
libatalk/util/netatalk_conf.c
man/man5/afp.conf.5.tmpl

diff --git a/NEWS b/NEWS
index c6f50991886bc6096be179465fcc6e83aa202edd..612d6892c9b09fe304b11d131e0a481f8facbde4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Changes in 3.0 alpha3
+=====================
+
+* NEW: afpd: Per volume "login message", NetAFP bug ID #18
+
 Changes in 3.0 alpha2
 =====================
 
index e2dd1535c443a60a13a35d353603721a30b77e55..241f0d08166a166ed2a4b22f8d8b5e088c0b7876 100644 (file)
@@ -133,10 +133,11 @@ int afp_getsrvrmesg(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, siz
          * it has asked the login msg...
          * Workaround: concatenate the two if any, ugly.
          */
-        if (*message && *obj->options.loginmesg) {
-            strlcat(message, " - ", MAXMESGSIZE);
+        if (obj->options.loginmesg) {
+            if (*message)
+                strlcat(message, " - ", MAXMESGSIZE);
+            strlcat(message, obj->options.loginmesg, MAXMESGSIZE);
         }
-        strlcat(message, obj->options.loginmesg, MAXMESGSIZE);
         break;
     case AFPMESG_SERVER: /* server */
         break;
index 61d744ca70cdc980d21b98734a06b25682e3e1d9..56398145557272778651efd7b4c1a6d6e9bc12a7 100644 (file)
@@ -871,6 +871,14 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
                 goto openvol_err;
             }
         }
+
+        char *msg;
+        if ((msg = iniparser_getstrdup(obj->iniconfig, volume->v_configname, "login message",  NULL)) != NULL) {
+            if (obj->options.loginmesg)
+                free(obj->options.loginmesg);
+            obj->options.loginmesg = msg;
+        }
+
         return( AFP_OK );
     }
 
index a75ded21b552486f505da5e87bcc5fb5f624053a..8720ff54db913eedfd3a4809d206d0bf0879fe09 100644 (file)
@@ -1427,7 +1427,7 @@ int afp_config_parse(AFPObj *AFPObj)
         options->passwdbits |= PASSWD_SET;
 
     /* figure out options w values */
-    options->loginmesg      = iniparser_getstrdup(config, INISEC_GLOBAL, "login message",      "");
+    options->loginmesg      = iniparser_getstrdup(config, INISEC_GLOBAL, "login message",  NULL);
     options->guest          = iniparser_getstrdup(config, INISEC_GLOBAL, "guest account",  "nobody");
     options->passwdfile     = iniparser_getstrdup(config, INISEC_GLOBAL, "passwd file",_PATH_AFPDPWFILE);
     options->uampath        = iniparser_getstrdup(config, INISEC_GLOBAL, "uam path",       _PATH_AFPDUAMPATH);
index c96eddb828d95ab0c585d260245112ec3f1a9cc8..096cce0376d073393e3c1592464848ad288d2ec5 100644 (file)
@@ -624,7 +624,7 @@ guest account = \fIname\fR \fB(G)\fR
 Specifies the user that guests should use (default is "nobody")\&. The name should be quoted\&.
 .RE
 .PP
-login message = \fImessage\fR \fB(G)\fR
+login message = \fImessage\fR \fB(G)/(V)\fR
 .RS 4
 Sets a message to be displayed when clients logon to the server\&. The message should be in
 \fBunix charset\fR