use same regexp for allowed usernames as in the php code
(m_admin::add_mem()) do not quote_meta in shell command, since all variables are now considered safe see #998 see #427
This commit is contained in:
		
							parent
							
								
									c6109e63ea
								
							
						
					
					
						commit
						6e63ed701b
					
				| 
						 | 
					@ -13,7 +13,7 @@ if (!$name || !$uid) {
 | 
				
			||||||
$ENV{PATH} = "";
 | 
					$ENV{PATH} = "";
 | 
				
			||||||
delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
 | 
					delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (!($name =~ /^([a-z0-9_\+\.-]+)$/)) {
 | 
					if (!($name =~ /^([a-z0-9]+)$/)) {
 | 
				
			||||||
    die "Account name is incorrect.";
 | 
					    die "Account name is incorrect.";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
$name=$1;
 | 
					$name=$1;
 | 
				
			||||||
| 
						 | 
					@ -28,8 +28,8 @@ $( = $);
 | 
				
			||||||
my $PTH="/var/alternc/html/".substr($name,0,1)."/".$name;
 | 
					my $PTH="/var/alternc/html/".substr($name,0,1)."/".$name;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkdir($PTH);
 | 
					mkdir($PTH);
 | 
				
			||||||
system("/bin/chown 33:$uid '".quotemeta($PTH)."'");
 | 
					system("/bin/chown 33:$uid '$PTH'");
 | 
				
			||||||
system("/bin/chmod 02770 '".quotemeta($PTH)."'");
 | 
					system("/bin/chmod 02770 '$PTH'");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
0;
 | 
					0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue