]> arthur.barton.de Git - netatalk.git/commitdiff
Support newlines in -loginmesg
authorFrank Lahm <franklahm@googlemail.com>
Sat, 16 Oct 2010 14:33:26 +0000 (16:33 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Sat, 16 Oct 2010 14:33:26 +0000 (16:33 +0200)
NEWS
etc/afpd/afp_options.c

diff --git a/NEWS b/NEWS
index 875a4e84ee3e427e58e029bced8eecee48c32a62..f801444b30eae20f5346e67adcee94c3b0722ba6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Changes in 2.1.5
+================
+* UPD: afpd: support newlines in -loginmesg with \n escaping syntax
+
 Changes in 2.1.4
 ================
 
index 057a1a32954164ef13330e27398273d27c65c9e9..418e044d2803851fee4f597bcb11199a22c97782 100644 (file)
@@ -280,8 +280,22 @@ int afp_options_parseline(char *buf, struct afp_options *options)
         options->defaultvol.name = opt;
     if ((c = getoption(buf, "-systemvol")) && (opt = strdup(c)))
         options->systemvol.name = opt;
-    if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c)))
+    if ((c = getoption(buf, "-loginmesg")) && (opt = strdup(c))) {
+        int i = 0, j = 0;
+        while (c[i]) {
+            if (c[i] != '\\') {
+                opt[j++] = c[i];
+            } else {
+                i++;
+                if (c[i] == 'n')
+                    opt[j++] = '\n';
+            }
+            i++;
+        }
+        opt[j] = 0;
         options->loginmesg = opt;
+        
+    }
     if ((c = getoption(buf, "-guestname")) && (opt = strdup(c)))
         options->guest = opt;
     if ((c = getoption(buf, "-passwdfile")) && (opt = strdup(c)))