Changeset 1745

Show
Ignore:
Timestamp:
11/28/06 01:56:51 (2 years ago)
Author:
anarcat
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/src/mem_add

    r1618 r1745  
    1414delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; 
    1515 
    16 if (!($name =~ /^([a-z0-9_\+\.-]+)$/)) { 
     16if (!($name =~ /^([a-z0-9]+)$/)) { 
    1717    die "Account name is incorrect."; 
    1818} 
     
    2929 
    3030mkdir($PTH); 
    31 system("/bin/chown 33:$uid '".quotemeta($PTH)."'"); 
    32 system("/bin/chmod 02770 '".quotemeta($PTH)."'"); 
     31system("/bin/chown 33:$uid '$PTH'"); 
     32system("/bin/chmod 02770 '$PTH'"); 
    3333 
    34340;