]> arthur.barton.de Git - netatalk.git/commitdiff
Changed behaviour for TimeMachine volumes in case there's a problem
authorFrank Lahm <franklahm@googlemail.com>
Tue, 15 May 2012 11:43:08 +0000 (13:43 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 15 May 2012 11:43:08 +0000 (13:43 +0200)
talking to the CNID daemons. Previously the volume was flagged read-only
and an AFP message was sent to the client. As this might result in
TimeMachine assuming the backup sparse bundle is damaged, we now just
switch the CNID database to an in-memory tdb without the additional stuff.

NEWS
etc/afpd/file.c

diff --git a/NEWS b/NEWS
index 68da4aa24729e00a6a2e29707bf626ad9157382b..cf67388f135ec46ff04a7dca171d8b8bb4c1f146 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,11 @@ Changes in 2.2.3
 * UPD: afpd: Ensure our umask is not altered by eg pam_umask
 * UPD: afpd: Use GSS_C_NO_NAME as server principal when Kerberos options -fqdn
        and -krb5service are not set, from Jamie Gilbertson
+* UPD: afpd: Changed behaviour for TimeMachine volumes in case there's a problem
+       talking to the CNID daemons. Previously the volume was flagged read-only
+       and an AFP message was sent to the client. As this might result in
+       TimeMachine assuming the backup sparse bundle is damaged, we now just
+       switch the CNID database to an in-memory tdb without the additional stuff.
 * FIX: afpd: sendfile() on FreeBSD was broken, courtesy of Denis Ahrens
 * FIX: afpd: Dont use searchdb when doing partial name search
 * FIX: afpd: Fix a possible bug handling disconnected sessions,
index 36798904ad0802b9d5d89ca25d17432f456be6af..efc002bc0bfd11eb8797e8046b1aa71bda92e240 100644 (file)
@@ -264,21 +264,17 @@ restart:
                         vol->v_path);
                     vol->v_cdb = cnid_open(vol->v_path, vol->v_umask, "tdb", flags, NULL, NULL);
                     if (vol->v_cdb) {
-                        /* deactivate cnid caching/storing in AppleDouble files and set ro mode*/
                         vol->v_flags &= ~AFPVOL_CACHE;
-                        vol->v_flags |= AFPVOL_RO;
-#ifdef SERVERTEXT
-                        /* kill ourself with SIGUSR2 aka msg pending */
-                        setmessage("Something wrong with the volume's CNID DB, using temporary CNID DB instead."
-                                   "Check server messages for details. Switching to read-only mode.");
-                        kill(getpid(), SIGUSR2);
-#endif
-                        goto restart; /* not try again with the temp CNID db */
+                        if (!(vol->v_flags & AFPVOL_TM)) {
+                            vol->v_flags |= AFPVOL_RO;
+                            setmessage("Something wrong with the volume's CNID DB, using temporary CNID DB instead."
+                                       "Check server messages for details. Switching to read-only mode.");
+                            kill(getpid(), SIGUSR2);
+                        }
+                        goto restart; /* now try again with the temp CNID db */
                     } else {
-#ifdef SERVERTEXT
                         setmessage("Something wrong with the volume's CNID DB, using temporary CNID DB failed too!"
                                    "Check server messages for details, can't recover from this state!");
-#endif
                     }
                 }
                 afp_errno = AFPERR_MISC;