Changeset 532

Show
Ignore:
Timestamp:
02/18/07 20:02:12 (2 years ago)
Author:
chtekk
Message:

Fix/add checks to vx.create.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vcd/methods/vx/vx_create.c

    r517 r532  
    673673        method_return_if_fault(env); 
    674674 
     675        /* validate name */ 
     676        if (!validate_name(name)) 
     677                method_return_faultf(env, MEINVAL, 
     678                        "invalid name value: %s", name); 
     679 
    675680        /* get template dir */ 
    676681        if (str_isempty(template) || !str_isgraph(template)) 
     
    697702                        if (!force) 
    698703                                method_return_fault(env, MEEXIST); 
     704 
    699705                        else if (vx_info(xid, NULL) == 0) 
    700706                                method_return_fault(env, MERUNNING); 
     
    702708 
    703709                else 
    704                         method_return_fault(env, MENOVPS); 
     710                        method_return_fault(env, MEPERM); 
    705711        } 
    706712 
     
    710716 
    711717        /* check vdir */ 
    712         if (str_isempty(vdir) || !auth_isowner(user, name)) 
     718        if (str_isempty(vdir) || !auth_isadmin(user, name)) 
    713719                vdir = vxdb_getvdir(name); 
    714720