diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index fbf5dc35c80c4d2d72c7c60b7546bade29b5ddb2..00f3a31a24c093751ee9cc6494809d535cd47066 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1443,7 +1443,7 @@ void LocalStore::createUser(const std::string & userName, uid_t userId)
         createDirs(dir);
         if (chmod(dir.c_str(), 0755) == -1)
             throw SysError("changing permissions of directory '%s'", dir);
-        if (chown(dir.c_str(), userId, -1) == -1)
+        if (chown(dir.c_str(), userId, 0) == -1)
             throw SysError("changing owner of directory '%s'", dir);
     }
 }