root/alternc/tags/0.9.6/src/quota_edit

Revision 1618, 0.6 kB (checked in by benjamin, 3 years ago)

ajout des perl suid scripts (desole, j'avais oublie...)

  • Property svn:executable set to *
Line 
1 #!/usr/bin/perl
2
3 use strict;
4
5 my ($uid,$size) = @ARGV;
6
7 if (!$size || !$uid) {
8     print "Usage: quota_edit <uid> <size>\n";
9     print " Edit the quota of the AlternC account having uid <uid> the the available space to <size>\n";
10     exit(1);
11 }
12
13 $ENV{PATH} = "";
14 delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
15
16 if (!($uid =~ /^([0-9]+)$/)) {
17     die "uid is incorrect.";
18 }
19 $uid=$1;
20
21 if (!($size =~ /^([0-9]+)$/)) {
22     die "size is incorrect.";
23 }
24 $size=$1;
25
26 $< = $>;
27 $( = $);
28
29 my $PTH="/usr/lib/alternc/quota_edit.sh '".quotemeta($uid)."' '".quotemeta($size)."'";
30
31 system($PTH);
32
33 0;
Note: See TracBrowser for help on using the browser.