Revision 23740,
1.2 KB
checked in by broder, 15 years ago
(diff) |
In moira:
* New CVS snapshot (Trac: #195)
* Drop patches that have been incorporated upstream.
* Update to build without krb4 on systems that no longer have it.
This doesn't build yet on squeeze, which lacks a krb4 library, but I'm
committing now before I start hacking away at a patch to fix that.
|
Rev | Line | |
---|
[23095] | 1 | #!/bin/csh -f |
---|
| 2 | # |
---|
[23740] | 3 | # $Header: /afs/athena.mit.edu/astaff/project/moiradev/repository/moira/gen/zero_quotas,v 1.4 1998-01-05 19:52:53 danw Exp $ |
---|
[23095] | 4 | # |
---|
| 5 | # This script zeros quotas for uid's which are not in standard input |
---|
| 6 | # Note that the input must be sorted in increasing order by uid. |
---|
| 7 | |
---|
| 8 | set dev=$1 |
---|
| 9 | set MR_SETQUOTA = 47836471 |
---|
| 10 | |
---|
| 11 | # Checking for /etc/zero_old_quotas allows us to release this program |
---|
| 12 | # one server at a time. |
---|
| 13 | |
---|
| 14 | if ( -f /etc/zero_old_quotas ) then |
---|
| 15 | |
---|
| 16 | set current_uid = 0 |
---|
| 17 | |
---|
| 18 | while (1) |
---|
| 19 | # set args = $< will NOT work. $< will be treated as a single word |
---|
| 20 | set args = `echo $<` |
---|
| 21 | |
---|
| 22 | if (${#args} != 2) break # end of input |
---|
| 23 | |
---|
| 24 | set uid = $args[1] |
---|
| 25 | @ checksorted = ($current_uid <= $uid) |
---|
| 26 | |
---|
| 27 | if (checksorted == 0) then |
---|
| 28 | echo "Input not sorted" |
---|
| 29 | exit $MR_SETQUOTA |
---|
| 30 | endif |
---|
| 31 | |
---|
| 32 | # zero all quotas between current_uid and uid (not including uid) |
---|
| 33 | if ($current_uid != $uid) then |
---|
| 34 | @ uid_high = $uid - 1 |
---|
| 35 | setquota -r $dev $current_uid $uid_high 0 |
---|
| 36 | endif |
---|
| 37 | |
---|
| 38 | # skip over $uid |
---|
| 39 | @ current_uid = $uid + 1 |
---|
| 40 | |
---|
| 41 | end |
---|
| 42 | |
---|
| 43 | # zero all remaining quotas, except for nobody (32767). |
---|
| 44 | if ($current_uid != 32767) setquota -r $dev $current_uid 32766 0 |
---|
| 45 | |
---|
| 46 | endif |
---|
| 47 | |
---|
| 48 | exit 0 |
---|
| 49 | |
---|
Note: See
TracBrowser
for help on using the repository browser.