Commit 790e71fa authored by claes's avatar claes

Change permissions on database, and some other bugfixes

parent 636a1f2e
...@@ -41,6 +41,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */ ...@@ -41,6 +41,7 @@ This module contains the API-routines to the Local Data Handler, LDH. */
#include "wb_vrepmem.h" #include "wb_vrepmem.h"
#include "wb_vrepwbl.h" #include "wb_vrepwbl.h"
#include "wb_vrepdbs.h" #include "wb_vrepdbs.h"
#include "wb_merep.h"
#include "wb_db.h" #include "wb_db.h"
#include "wb_print_wbl.h" #include "wb_print_wbl.h"
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
...@@ -250,6 +251,7 @@ ldh_ChangeObjectName(ldh_tSession session, pwr_tOid oid, char *name) ...@@ -250,6 +251,7 @@ ldh_ChangeObjectName(ldh_tSession session, pwr_tOid oid, char *name)
try { try {
wb_name n(name); wb_name n(name);
if ( !n) return n.sts();
wb_object o = sp->object(oid); wb_object o = sp->object(oid);
if (!o) return o.sts(); if (!o) return o.sts();
...@@ -784,8 +786,13 @@ ldh_GetReferenceInfo(ldh_tSession session, pwr_tOid oid, ldh_sRefInfo *rip) ...@@ -784,8 +786,13 @@ ldh_GetReferenceInfo(ldh_tSession session, pwr_tOid oid, ldh_sRefInfo *rip)
wb_object o = sp->object(oid); wb_object o = sp->object(oid);
if (!o) return o.sts(); if (!o) return o.sts();
o.refinfo(rip); try {
return o.sts(); sp->refinfo( o, rip);
} catch (wb_error& e) {
return e.sts();
}
return LDH__SUCCESS;
} }
/* Get first object in root list. */ /* Get first object in root list. */
...@@ -1330,6 +1337,8 @@ ldh_SetObjectName(ldh_tSession session, pwr_tOid oid, char *name) ...@@ -1330,6 +1337,8 @@ ldh_SetObjectName(ldh_tSession session, pwr_tOid oid, char *name)
try { try {
wb_name n(name); wb_name n(name);
if ( !n) return n.sts();
sp->renameObject(o, n); sp->renameObject(o, n);
} }
catch ( wb_error& e) { catch ( wb_error& e) {
...@@ -1572,6 +1581,12 @@ ldh_WbLoad( ldh_tSession session, char *loadfile) ...@@ -1572,6 +1581,12 @@ ldh_WbLoad( ldh_tSession session, char *loadfile)
wb_db db( pwr_cNVid); wb_db db( pwr_cNVid);
db.copy( *vdbs, db_name); db.copy( *vdbs, db_name);
db.close(); db.close();
erep->merep()->copyFiles( db_name);
// Set permissions from umask
char cmd[200];
sprintf( cmd, "$pwr_exe/wb_dbchmod.sh %s", db_name);
system( cmd);
delete vdbs; delete vdbs;
} }
...@@ -1598,6 +1613,12 @@ ldh_WbLoad( ldh_tSession session, char *loadfile) ...@@ -1598,6 +1613,12 @@ ldh_WbLoad( ldh_tSession session, char *loadfile)
wb_db db( pwr_cNVid); wb_db db( pwr_cNVid);
db.copy( *vwbl, db_name); db.copy( *vwbl, db_name);
db.close(); db.close();
erep->merep()->copyFiles( db_name);
// Set permissions from umask
char cmd[200];
sprintf( cmd, "$pwr_exe/wb_dbchmod.sh %s", db_name);
system( cmd);
delete vwbl; delete vwbl;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment