automount.c revision f975e971accc4d50c73ae53167db3df7a7099cf2
486N/A along with systemd; If not, see <http://www.gnu.org/licenses/>.
486N/A#include "automount.h"
486N/A#include "load-fragment.h"
#include "load-dropin.h"
#include "unit-name.h"
#include "dbus-automount.h"
#include "bus-errors.h"
#include "special.h"
#include "label.h"
assert(u);
assert(a);
if (a->pipe_fd < 0)
if (a->where &&
assert(a);
unmount_autofs(a);
assert(a);
assert(m);
assert(a);
assert(a);
if ((r = unit_add_two_dependencies_by_name(UNIT(a), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true)) < 0)
assert(a);
return -EINVAL;
return -ENOMEM;
free(e);
return -EINVAL;
assert(u);
if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
if (!a->where)
return -ENOMEM;
if ((r = automount_add_mount_links(a)) < 0)
if ((r = automount_add_default_dependencies(a)) < 0)
return automount_verify(a);
assert(a);
unmount_autofs(a);
assert(a);
assert(a);
fprintf(f,
assert(a);
if (!success)
a->failure = true;
assert(m);
if (m->dev_autofs_fd >= 0)
return m->dev_autofs_fd;
return -errno;
return -errno;
return m->dev_autofs_fd;
size_t l;
return -ENOMEM;
r = -errno;
goto finish;
r = -EIO;
goto finish;
return -errno;
return -errno;
return -errno;
if (status) {
return -errno;
int ioctl_fd, r;
unsigned token;
assert(a);
r = ioctl_fd;
goto fail;
if (status)
status)) < 0)
fail:
if (ioctl_fd >= 0)
bool mounted = false;
assert(a);
if (a->tokens)
r = dev_autofs_fd;
goto fail;
r = -errno;
goto fail;
snprintf(options, sizeof(options), "fd=%i,pgrp=%u,minproto=5,maxproto=5,direct", p[1], (unsigned) getpgrp());
r = -errno;
goto fail;
mounted = true;
r = -errno;
goto fail;
r = ioctl_fd;
goto fail;
goto fail;
goto fail;
goto fail;
a->pipe_fd = p[0];
fail:
if (ioctl_fd >= 0)
if (mounted)
automount_enter_dead(a, false);
assert(a);
goto fail;
else if ((r = manager_add_job(a->meta.manager, JOB_START, UNIT(a->mount), JOB_REPLACE, true, &error, NULL)) < 0) {
goto fail;
fail:
automount_enter_dead(a, false);
assert(a);
return -EEXIST;
return -ENOENT;
a->failure = false;
assert(a);
automount_enter_dead(a, true);
Iterator i;
assert(a);
assert(f);
if (a->pipe_fd >= 0) {
int copy;
return copy;
assert(a);
a->dev_id = (unsigned) d;
unsigned token;
if (!a->tokens)
return -ENOMEM;
int fd;
if (a->pipe_fd >= 0)
assert(u);
assert(u);
assert(a);
if (!a->mount)
ssize_t l;
assert(a);
goto fail;
goto fail;
char *p = NULL;
log_debug("Got direct mount request for %s, triggered by %lu (%s)", packet.v5_packet.name, (unsigned long) packet.v5_packet.pid, strna(p));
free(p);
if (!a->tokens)
goto fail;
goto fail;
fail:
automount_enter_dead(a, false);
assert(m);
if (m->dev_autofs_fd >= 0)
assert(a);
a->failure = false;
.sections =
.no_alias = true,
.no_instances = true,