root/alternc/trunk/src/quota_edit

Revision 1758, 0.5 kB (checked in by anarcat, 2 years ago)

remove quotemeta everywhere, and make sure variables are safe before using them. Closes: #1003

  • 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 '$uid' '$size'";
30
31 system($PTH);
32
33 0;
Note: See TracBrowser for help on using the browser.