--- src/readconfig.c +++ src/readconfig.c 2008/09/05 11:29:18 @@ -397,6 +397,25 @@ l0g(PMPREFIX "You may not use wildcards in user-defined volumes\n"); return FALSE; } + + if (config->volume[vol].type == LCLMOUNT || config->volume[vol].type == CRYPTMOUNT) { + if (!owns(config->user, config->volume[vol].volume)) { + l0g("user-defined volume (%s), volume not owned " + "by user\n", config->volume[vol].volume); + return FALSE; + } + /* + * If it does not already exist then it is okay, pam_mount will + * mkdir it (if configured to do so) + */ + if (exists(config->volume[vol].mountpoint) && + !owns(config->user, config->volume[vol].mountpoint)) { + l0g("user-defined volume (%s), mountpoint not owned " + "by user\n", config->volume[vol].volume); + return FALSE; + } + } + if (!_options_ok(config, &config->volume[vol])) { l0g(PMPREFIX "illegal option specified by user\n"); return FALSE;