diff options
author | vk154806 <none@none> | 2008-03-26 04:57:29 -0700 |
---|---|---|
committer | vk154806 <none@none> | 2008-03-26 04:57:29 -0700 |
commit | 4983fdb5373239f810c1288128badcb36d079b78 (patch) | |
tree | c0d5091776ed3d2a31711099cc53b48a76ea75b7 /usr/src/cmd/backup | |
parent | 132c40dc222ee0e9f7faaa420d097f632a9d35bb (diff) | |
download | illumos-gate-4983fdb5373239f810c1288128badcb36d079b78.tar.gz |
6648652 ufsdump prints confusing error messages when run as non-root user
Diffstat (limited to 'usr/src/cmd/backup')
-rw-r--r-- | usr/src/cmd/backup/dump/dumpmain.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/cmd/backup/dump/dumpmain.c b/usr/src/cmd/backup/dump/dumpmain.c index ac84389f16..b0266ee50a 100644 --- a/usr/src/cmd/backup/dump/dumpmain.c +++ b/usr/src/cmd/backup/dump/dumpmain.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -41,6 +41,7 @@ #include <limits.h> #include <priv_utils.h> #include "roll_log.h" +#include <unistd.h> int notify = 0; /* notify operator flag */ int blockswritten = 0; /* number of blocks written on current tape */ @@ -612,11 +613,12 @@ main(int argc, char *argv[]) */ /* - * Attempt to roll the log before doing the dump. There's nothing - * the user can do if we are unable to roll the log, so we'll silently - * ignore failures. + * Attempt to roll the log if its root user before doing the dump. + * There's nothing the user can do if we are unable to roll the log, + * so we'll silently ignore failures. */ - if ((rl_roll_log(disk) != RL_SUCCESS) && (disk[0] != '/')) { + if (getuid() == 0 && rl_roll_log(disk) != RL_SUCCESS && + disk[0] != '/') { /* Try it again with leading '/'. */ char *slashed; |