b***@freebsd.org
2016-10-19 13:16:51 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213611
Bug ID: 213611
Summary: ports-mgmt/pkg: 1.9.1 pkgdb locking doesn't work on
NFS
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: ***@FreeBSD.org
Reporter: ***@gmail.com
Assignee: ***@FreeBSD.org
Flags: maintainer-feedback?(***@FreeBSD.org)
pkg info fails with following error, if /var/db/pkg is on NFS:
pkg: sqlite error while executing iterator in file pkgdb_iterator.c:1033:
database is locked
ktrace:
61912 pkg CALL setgroups(0x1,0x802780abc)
61912 pkg RET setgroups 0
61912 pkg CALL setegid(0xfffe)
61912 pkg RET setegid 0
61912 pkg CALL setgid(0xfffe)
61912 pkg RET setgid 0
61912 pkg CALL seteuid(0xfffe)
61912 pkg RET seteuid 0
61912 pkg CALL setuid(0xfffe)
61912 pkg RET setuid 0
61912 pkg CALL
mkdir(0x80301c2e8,0x1ff<S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH>)
61912 pkg NAMI "/var/db/pkg/local.sqlite.lock"
61912 pkg RET mkdir -1 errno 13 Permission denied
==> privileges get dropped and only afterwards mkdir
/var/db/pkg/local.sqlite.lock is tried, which has to fail as user "nobody".
Verified with "chmod 777 /var/db/pkg/"
drwxr-xr-x 2 nobody nobody 4096 Oct 19 12:50 local.sqlite.lock
From src/info.c:
322
323 drop_privileges();
324 if (pkgdb_obtain_lock(db, PKGDB_LOCK_READONLY) != EPKG_OK) {
325 pkgdb_close(db);
Probably wrong order of drop_privileges and pkgdb_obtain_lock?
This happens only on NFS because of this in src/pkgdb.c:
1026 /*
1027 * Fall back on unix-dotfile locking strategy if on a network filesystem
1028 */
(...)
1034 sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1);
(Our quick workaround was to comment out the whole "fall back on unix-dotfile
on NFS" part. Probably not the best solution ...)
Bug ID: 213611
Summary: ports-mgmt/pkg: 1.9.1 pkgdb locking doesn't work on
NFS
Product: Ports & Packages
Version: Latest
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: Individual Port(s)
Assignee: ***@FreeBSD.org
Reporter: ***@gmail.com
Assignee: ***@FreeBSD.org
Flags: maintainer-feedback?(***@FreeBSD.org)
pkg info fails with following error, if /var/db/pkg is on NFS:
pkg: sqlite error while executing iterator in file pkgdb_iterator.c:1033:
database is locked
ktrace:
61912 pkg CALL setgroups(0x1,0x802780abc)
61912 pkg RET setgroups 0
61912 pkg CALL setegid(0xfffe)
61912 pkg RET setegid 0
61912 pkg CALL setgid(0xfffe)
61912 pkg RET setgid 0
61912 pkg CALL seteuid(0xfffe)
61912 pkg RET seteuid 0
61912 pkg CALL setuid(0xfffe)
61912 pkg RET setuid 0
61912 pkg CALL
mkdir(0x80301c2e8,0x1ff<S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH>)
61912 pkg NAMI "/var/db/pkg/local.sqlite.lock"
61912 pkg RET mkdir -1 errno 13 Permission denied
==> privileges get dropped and only afterwards mkdir
/var/db/pkg/local.sqlite.lock is tried, which has to fail as user "nobody".
Verified with "chmod 777 /var/db/pkg/"
drwxr-xr-x 2 nobody nobody 4096 Oct 19 12:50 local.sqlite.lock
From src/info.c:
322
323 drop_privileges();
324 if (pkgdb_obtain_lock(db, PKGDB_LOCK_READONLY) != EPKG_OK) {
325 pkgdb_close(db);
Probably wrong order of drop_privileges and pkgdb_obtain_lock?
This happens only on NFS because of this in src/pkgdb.c:
1026 /*
1027 * Fall back on unix-dotfile locking strategy if on a network filesystem
1028 */
(...)
1034 sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1);
(Our quick workaround was to comment out the whole "fall back on unix-dotfile
on NFS" part. Probably not the best solution ...)
--
You are receiving this mail because:
You are the assignee for the bug.
You are receiving this mail because:
You are the assignee for the bug.