@@ -256,18 +256,20 @@ (exn (busy) (debug:print 0 *default-log-port* "ERROR: database " fname " is locked. Try copying to another location, remove original and copy back.")) (exn (permission)(debug:print 0 *default-log-port* "ERROR: database " fname " has some permissions problem.")) (exn () (debug:print 0 *default-log-port* "ERROR: Unknown error with database " fname " message: " ((condition-property-accessor 'exn 'message) exn)))) ))) - +;; this routine is used to determine if we are in write mode or read-only mode (define (db:mtdbpath-writable? mtdbpath) (let* ((parent-dir (pathname-directory mtdbpath)) (logdir (conc parent-dir "/logs"))) (and (file-write-access? parent-dir) (file-write-access? mtdbpath) (or (not (common:file-exists? logdir)) (file-write-access? logdir)) + (or (not (configf:lookup *configdat* "setup" "write-requires-ownership")) + (equal? (file-owner mtdbpath)(current-effective-user-id))) ))) ;; ;; This routine creates the db. It is only called if the db is not already opened @@ -387,11 +389,11 @@ (db (db:lock-create-open dbpath (lambda (db) (db:initialize-main-db db) ;;(db:initialize-run-id-db db) ))) - (write-access (file-write-access? dbpath))) + (write-access (db:mtdbpath-writable? dbpath))) (debug:print-info 13 *default-log-port* "db:open-megatest-db "dbpath) (if (and dbexists (not write-access)) (set! *db-write-access* #f)) (cons db dbpath)))