diff options
author | Jan Parcel <Jan.Parcel@Sun.COM> | 2010-08-09 15:53:32 -0700 |
---|---|---|
committer | Jan Parcel <Jan.Parcel@Sun.COM> | 2010-08-09 15:53:32 -0700 |
commit | 7248adcb841e89c33c8b56bb2616710a788afbf5 (patch) | |
tree | b7f3fe259cd8c38629e5a1ac6a4a4dda344d4914 /usr/src | |
parent | 1e05b03fa76ee89d509f0c461b36cb865f1e6794 (diff) | |
download | illumos-joyent-7248adcb841e89c33c8b56bb2616710a788afbf5.tar.gz |
6949966 deallocate's mk_revoke should be more careful
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/allocate/allocate3.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/src/cmd/allocate/allocate3.c b/usr/src/cmd/allocate/allocate3.c index 521a5f541f..9da5745e0c 100644 --- a/usr/src/cmd/allocate/allocate3.c +++ b/usr/src/cmd/allocate/allocate3.c @@ -20,8 +20,7 @@ */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. */ #include <auth_attr.h> @@ -818,6 +817,12 @@ mk_revoke(int optflag, char *file) fuserpid); continue; } + if (strcmp(info.pr_fname, "deallocate") + == NULL) { + dprintf("%d matched deallocate name\n", + fuserpid); + continue; + } dprintf("killing %s", info.pr_fname); dprintf("(%d)\n", fuserpid); if ((r = @@ -1051,6 +1056,11 @@ _deallocate_dev(int optflag, devalloc_t *da, devmap_t *dm_in, uid_t uid, goto out; } is_authorized = _is_dev_authorized(da, uid); + if (is_authorized == ALLOC_BY_NONE) { + dprintf("Not deallocating %s, not allocatable\n", + da->da_devname); + goto out; + } if (!(optflag & (FORCE | FORCE_ALL)) && !is_authorized) { dprintf("User %d is unauthorized to deallocate\n", (int)uid); error = UAUTHERR; |