Explorar el Código

libdpkg: Handle EACCES as a permission error in modstatdb_lock()

The current code only considers EPERM, but EACCES is also a valid error
concerning permission issues from open(2).
Guillem Jover hace 15 años
padre
commit
2ed67cedac
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lib/dpkg/dbmodify.c

+ 1 - 1
lib/dpkg/dbmodify.c

@@ -215,7 +215,7 @@ modstatdb_lock(void)
   if (dblockfd == -1) {
     dblockfd = open(lockfile, O_RDWR | O_CREAT | O_TRUNC, 0660);
     if (dblockfd == -1) {
-      if (errno == EPERM)
+      if (errno == EACCES || errno == EPERM)
         ohshit(_("you do not have permission to lock the dpkg status database"));
       ohshite(_("unable to open/create status database lockfile"));
     }