mirror of
https://github.com/samba-team/samba.git
synced 2025-10-22 07:33:16 +03:00
r23177: Add in a new provision-backend script. This helps set up the OpenLDAP or Fedora DS backend.
This required a new mkdir() call in ejs. We can now provision just the schema for ad2oLschema to operate on (with provision_schema(), without performing the whole provision, just to wipe it again (adjustments to 'make test' to come soon). Andrew Bartlett
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
4fee8a7b77
commit
01d54d13dc
@@ -305,6 +305,33 @@ static int ejs_sys_file_save(MprVarHandle eid, int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
mkdir()
|
||||
usage:
|
||||
ok = sys.mkdir(dirname, mode);
|
||||
*/
|
||||
static int ejs_sys_mkdir(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
{
|
||||
BOOL ret;
|
||||
char *name;
|
||||
if (argc != 2) {
|
||||
ejsSetErrorMsg(eid, "sys_mkdir invalid arguments, need mkdir(dirname, mode)");
|
||||
return -1;
|
||||
}
|
||||
if (!mprVarIsString(argv[0]->type)) {
|
||||
ejsSetErrorMsg(eid, "sys_mkdir dirname not a string");
|
||||
return -1;
|
||||
}
|
||||
if (!mprVarIsNumber(argv[1]->type)) {
|
||||
ejsSetErrorMsg(eid, "sys_mkdir mode not a number");
|
||||
return -1;
|
||||
}
|
||||
mprVarToString(&name, 0, NULL, argv[0]);
|
||||
ret = mkdir(name, mprVarToNumber(argv[1]));
|
||||
mpr_Return(eid, mprCreateBoolVar(ret == 0));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
return fields of a stat() call
|
||||
@@ -438,6 +465,7 @@ static int ejs_sys_init(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
mprSetCFunction(obj, "ntgmtime", ejs_sys_ntgmtime);
|
||||
mprSetCFunction(obj, "ldaptime", ejs_sys_ldaptime);
|
||||
mprSetCFunction(obj, "httptime", ejs_sys_httptime);
|
||||
mprSetCFunction(obj, "mkdir", ejs_sys_mkdir);
|
||||
mprSetStringCFunction(obj, "unlink", ejs_sys_unlink);
|
||||
mprSetStringCFunction(obj, "file_load", ejs_sys_file_load);
|
||||
mprSetStringCFunction(obj, "file_save", ejs_sys_file_save);
|
||||
|
Reference in New Issue
Block a user