Fix status device call to fail if running as non-root.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@139 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2009-11-14 21:33:57 +00:00
parent ecf73237e2
commit e618f38929
2 changed files with 4 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
2009-11-14 Milan Broz <mbroz@redhat.com>
* Add CRYPT_ prefix to enum defined in libcryptsetup.h.
* Fix status call to fail when running as non-root user.
2009-09-30 Milan Broz <mbroz@redhat.com>
* Fix exported symbols and versions in libcryptsetup.

View File

@@ -48,6 +48,8 @@ int dm_init(struct crypt_device *context, int check_kernel)
log_err(context, _("Cannot initialize device-mapper. Is dm_mod kernel module loaded?\n"));
return -1;
}
if (getuid() || geteuid())
log_dbg(("WARNING: Running as a non-root user. Functionality may be unavailable."));
dm_log_init(set_dm_error);
dm_log_init_verbose(10);
}
@@ -419,7 +421,7 @@ int dm_status_device(const char *name)
}
if (!dm_task_run(dmt)) {
r = -ENODEV;
r = -EINVAL;
goto out;
}