- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
noauto = has_option(options, "noauto");
nofail = has_option(options, "nofail");
noauto = has_option(options, "noauto");
nofail = has_option(options, "nofail");
- if (asprintf(&p, "%s/%s", arg_dest, n) < 0) {
+ p = join(arg_dest, "/", n, NULL);
+ if (!p) {
"Conflicts=umount.target\n"
"DefaultDependencies=no\n"
"BindTo=%s dev-mapper-%%i.device\n"
"Conflicts=umount.target\n"
"DefaultDependencies=no\n"
"BindTo=%s dev-mapper-%%i.device\n"
if (password && (streq(password, "/dev/urandom") ||
streq(password, "/dev/random") ||
streq(password, "/dev/hw_random")))
if (password && (streq(password, "/dev/urandom") ||
streq(password, "/dev/random") ||
streq(password, "/dev/hw_random")))
- if (asprintf(&to, "%s/%s.wants/%s", arg_dest, d, n) < 0) {
+ to = join(arg_dest, "/", d, ".wants/", n, NULL);
+ if (!to) {
if (symlink(from, to) < 0) {
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
r = -errno;
if (symlink(from, to) < 0) {
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
r = -errno;
- asprintf(&to, "%s/cryptsetup.target.requires/%s", arg_dest, n);
+ to = join(arg_dest, "/cryptsetup.target.requires/", n, NULL);
- asprintf(&to, "%s/cryptsetup.target.wants/%s", arg_dest, n);
-
+ to = join(arg_dest, "/cryptsetup.target.wants/", n, NULL);
if (symlink(from, to) < 0) {
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
r = -errno;
goto fail;
}
if (symlink(from, to) < 0) {
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
r = -errno;
goto fail;
}
- if (asprintf(&to, "%s/dev-mapper-%s.device.requires/%s", arg_dest, e, n) < 0) {
+ to = join(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL);
+ if (!to) {
if (symlink(from, to) < 0) {
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
r = -errno;
if (symlink(from, to) < 0) {
log_error("Failed to create symlink '%s' to '%s': %m", from, to);
r = -errno;
char *name = NULL, *device = NULL, *password = NULL, *options = NULL;
int k;
char *name = NULL, *device = NULL, *password = NULL, *options = NULL;
int k;
- if ((k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options)) < 2 || k > 4) {
+ k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options);
+ if (k < 2 || k > 4) {