From owner-freebsd-pkg@freebsd.org Wed Oct 19 13:16:52 2016 Return-Path: Delivered-To: freebsd-pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21B28C17CE8 for ; Wed, 19 Oct 2016 13:16:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9A3909 for ; Wed, 19 Oct 2016 13:16:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 0AECCC17CE6; Wed, 19 Oct 2016 13:16:52 +0000 (UTC) Delivered-To: pkg@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E3BC17CE5 for ; Wed, 19 Oct 2016 13:16:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D468D906 for ; Wed, 19 Oct 2016 13:16:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u9JDGp8l001889 for ; Wed, 19 Oct 2016 13:16:51 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: pkg@FreeBSD.org Subject: [Bug 213611] ports-mgmt/pkg: 1.9.1 pkgdb locking doesn't work on NFS Date: Wed, 19 Oct 2016 13:16:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mwennrich@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: pkg@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2016 13:16:52 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213611 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: pkg@FreeBSD.org Reporter: mwennrich@gmail.com Assignee: pkg@FreeBSD.org Flags: maintainer-feedback?(pkg@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=20 mkdir(0x80301c2e8,0x1ff) 61912 pkg NAMI "/var/db/pkg/local.sqlite.lock" 61912 pkg RET mkdir -1 errno 13 Permission denied =3D=3D> 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) !=3D 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 filesys= tem 1028 */ (...) 1034 sqlite3_vfs_register(sqlite3_vfs_find("unix-dotfile"), 1); (Our quick workaround was to comment out the whole "fall back on unix-dotfi= le on NFS" part. Probably not the best solution ...) --=20 You are receiving this mail because: You are the assignee for the bug.=