Open lmike-mnc opened 1 week ago
dirty fix for NotesDatabase.createDatabase
//write default acl entries, might lock us out
NotesACL acl = db.getACL();
LinkedHashMap<String, NotesACL.NotesACLEntry> entries = acl.getEntries();
String name="-Default-";
//write default acl entries, might lock us out
if (entries.get(name)==null) acl.addEntry(name, defaultAccessLevel, Collections.emptyList(), EnumSet.noneOf(AclFlag.class));
name="OtherDomainServers";
if (entries.get(name)==null)acl.addEntry("OtherDomainServers",AclLevel.NOACCESS, Collections.emptyList(), EnumSet.of(AclFlag.GROUP, AclFlag.SERVER));
name=manager;
if (entries.get(name)==null) acl.addEntry(name, AclLevel.MANAGER, Collections.emptyList(), EnumSet.of(AclFlag.PERSON));
if (db.isRemote()) {
name=db.getServer();
if (entries.get(name)==null) {
acl.addEntry(name, AclLevel.MANAGER, Collections.emptyList(), EnumSet.of(AclFlag.SERVER, AclFlag.ADMIN_SERVER));
acl.setAdminServer(db.getServer());
}
}
name="LocalDomainServers";
if (entries.get(name)==null) acl.addEntry(name, AclLevel.MANAGER, Collections.emptyList(), EnumSet.of(AclFlag.GROUP, AclFlag.SERVER));
here code dump (w/o trc) jitdump.20241010.152219.5668.0004.dmp
Hi! Thanks for the info and sorry for the late response. Too many things to work on and a cold. :-) So you are getting this error when reading the ACL of a newly created database? I already had some other issues there in the past. I think the design collection was missing back then. Creating new databases from scratch with valid content is incredibly hard.
Hi! Thanks for the info and sorry for the late response. Too many things to work on and a cold. :-) So you are getting this error when reading the ACL of a newly created database? I already had some other issues there in the past. I think the design collection was missing back then. Creating new databases from scratch with valid content is incredibly hard.
Hi Thanks for you reply I lauch tests from your repo public class TestACLAccess extends BaseJNATestClass More detailed test beginig changes does work
withTempDb((db) -> {
System.out.println("Starting ACL modification");
NotesACL acl = db.getACL();
acl.addRole("[PolicyReader]");
acl.addRole("[NetCreator]");
NotesACLAccess aclEntry = acl.getEntry("cn=testuser123/o=mindoo");
but after add any entry to ACL
// role "NetCreator" will be converted to [NetCreator] by addEntry
acl.addEntry("Testuser123/Mindoo", AclLevel.DESIGNER, Arrays.asList("[PolicyReader]", "NetCreator"), EnumSet.noneOf(AclFlag.class));
aclEntry = acl.getEntry("cn=testuser123/o=mindoo");
it has crashed here
public LinkedHashMap<String,NotesACLEntry> getEntries() {
//....
DHANDLE hAcl = getHandle();
short result = NotesNativeAPI.get().ACLEnumEntries(hAcl.getByValue(), callback, null);
//...
}
I've tested with fakenames.nsf (not new) and the same crash here
NotesDatabase fakeDb=getFakeNamesDb();
NotesACL aclFake = fakeDb.getACL();
aclFake.addEntry("Testuser123/Mindoo", AclLevel.DESIGNER, Arrays.asList("[PolicyReader]", "NetCreator"), EnumSet.noneOf(AclFlag.class));
//core dump here
NotesACLAccess aclEntry = aclFake.getEntry("cn=testuser123/o=mindoo");
I've error during the test TestACLAccess.java
com/mindoo/domino/jna/NotesDatabase.java:
while it trying get
part of dump
test with notes ID for current user, server is down, test code on client this issue I've observed for temp Databae (after createTempDb in com/mindoo/domino/jna/test/BaseJNATestClass.java for , fakenames.nsf on local (ACL getting) - w/o error