summaryrefslogtreecommitdiff
path: root/libmailutils
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-12-27 13:28:31 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-12-27 13:28:31 +0200
commit2a6014f9aeb0cbe5e98c5a994f9577d5e6f34208 (patch)
treed4ef77048600bc7d7c5ed9dfe388e1217e5fb2ba /libmailutils
parent5591d2b7002564432e85426df073c4804e514e16 (diff)
downloadmailutils-2a6014f9aeb0cbe5e98c5a994f9577d5e6f34208.tar.gz
mailutils-2a6014f9aeb0cbe5e98c5a994f9577d5e6f34208.tar.bz2
vacation: remove dependency on DBM; other minor fixes.
* libmu_sieve/extensions/vacation.c: Use _sget accessors where possible. Use mu_property_t instead of db database. * libmu_sieve/sieve.y (mu_sieve_get_mailer): Verbosely report errors. * libmailutils/base/locker.c (mu_locker_create): Create the locker if the file name part of its full name does not exist.
Diffstat (limited to 'libmailutils')
-rw-r--r--libmailutils/base/locker.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/libmailutils/base/locker.c b/libmailutils/base/locker.c
index dc33fdc49..5f34947c2 100644
--- a/libmailutils/base/locker.c
+++ b/libmailutils/base/locker.c
@@ -447,7 +447,37 @@ mu_locker_create (mu_locker_t *plocker, const char *fname, int flags)
return EINVAL;
if ((err = mu_unroll_symlink (fname, &filename)))
- return err;
+ {
+ if (err == ENOENT)
+ {
+ /* Try the directory part. If it unrolls successfully (i.e.
+ all its components exist), tuck the filename part back in
+ the resulting path and use it as the lock filename. */
+ char *p, *tmp = strdup (fname);
+ if (!tmp)
+ return ENOMEM;
+ p = strchr (tmp, '/');
+ if (!p)
+ filename = tmp;
+ else
+ {
+ err = mu_unroll_symlink (tmp, &filename);
+ free (tmp);
+ if (err)
+ return err;
+ tmp = realloc (filename, strlen (filename) + strlen (p) + 1);
+ if (!tmp)
+ {
+ free (filename);
+ return ENOMEM;
+ }
+ strcat (tmp, p);
+ filename = tmp;
+ }
+ }
+ else
+ return err;
+ }
l = calloc (1, sizeof (*l));

Return to:

Send suggestions and report system problems to the System administrator.