mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
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:
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user