Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcdAo-00047k-W0 for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 02:16:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcdAm-0004Im-Mu for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 02:16:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcdAm-0004Id-An for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 02:16:56 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcdAh-0001Lr-H3 for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 02:16:55 +0000 Received: by mail-pj1-x1036.google.com with SMTP id u3-20020a17090a450300b00239db6d7d47so138642pjg.4 for ; Wed, 15 Mar 2023 19:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678933008; h=content-transfer-encoding:mime-version:user-agent:from:subject:to :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=nsxOX3gJoaMwtrHYcbq5X6vsS1FzcNXuX4+p4H/3Vq0=; b=CWe3f40ObsEm/sYMSqX/BV9pjK/BV2k+npkco+RhdU8NoZLqdqXPvBf6YOoI2Jou+9 K4JkZgrqBkik/Idvrh3O7uYNhU+Jlfs2micaS3jZFrBsxb0kNdjWfDyJ5r20m1wqsd6w jge1YxYDWNUS9SFJX5w5PzZGAX+9CJE4Vcx+r/pcQATs7BUXUzuTP4mWV3WkYhyqgH7X g60MI5nVEcZHhWfokeDbnezqCRWX5TX45bLL/6Qbut4ziJUn1s7Vyk+NGyHtf38XQwyw 5ARfg3mm6DAVlTAbIiXcnuYno3Oq+f7qaH6cOuconsE6Iotj4toudZnEa38jc2FbwC5d G4tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678933008; h=content-transfer-encoding:mime-version:user-agent:from:subject:to :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=nsxOX3gJoaMwtrHYcbq5X6vsS1FzcNXuX4+p4H/3Vq0=; b=7yHU5nJJhM1AHQTUQRSaxs94Y+Z9H0uYqHgXNIhFGJVp4SQmpQXjH/nDZ9Ha9eNwiR ChAA1b0tCBBkiMS4/OXFEuJtj1HJN6t5YzCRSVO4TMmhiZvugfR6yMKOVPnskbsW1Izu 9LnvPxE06FabJ6fYf1bnSku/Xrd16YP2eH3je57HFk0it1kMF6PwThbqE4BUIn855RAh Af1f1mVCY526nU25OCUU00l3isJKdQxkzQ6kk69GsHhfzj/GJo5ZN3hPMAoYzy+HpX86 d57aaASX4BHu/clJIC2ZHBWnmgRCt8tLnOeYdjc5+CFDp8iFVNGGSnCqYX05PtjcxEqB 4OFw== X-Gm-Message-State: AO0yUKX/fxo2dBGChZSZuD4gUkdEkzhtpPv91FwWRTnHDwamBfTgZBqz dMgYrrxJm5eMu+Mlb2Hmqf9K+bDZdGk= X-Google-Smtp-Source: AK7set+Teke18Q70D3tvti6tIhatVHIc1ZHRJ+8YAymkh1db+DtT+OZFsS44voJoijauw22UyGBm2A== X-Received: by 2002:a17:902:d081:b0:19e:e39b:6da3 with SMTP id v1-20020a170902d08100b0019ee39b6da3mr1361699plv.16.1678933008571; Wed, 15 Mar 2023 19:16:48 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id a14-20020a170902710e00b001943d58268csm24271pll.55.2023.03.15.19.16.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Mar 2023 19:16:48 -0700 (PDT) Date: Thu, 16 Mar 2023 11:16:46 +0900 (JST) Message-Id: <20230316.111646.1564684434328830712.horikyota.ntt@gmail.com> To: pgsql-hackers@lists.postgresql.org Subject: "current directory" in a server error message From: Kyotaro Horiguchi User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Mar_16_11_16_46_2023_962)--" Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ----Next_Part(Thu_Mar_16_11_16_46_2023_962)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello. When I ran pg_ls_dir('..'), the error message I received was somewhat difficult to understand. postgres=> select * from pg_ls_dir('..'); ERROR: path must be in or below the current directory As far as I know the concept of a "current directory" doesn't apply to the server side. In fact, the function comment for convert_and_check_filename explicitly states that: > * Filename may be absolute or relative to the DataDir Thus I think that the message should read "path must be in or below the data directory" instead. What do you think about making this change? regards. -- Kyotaro Horiguchi NTT Open Source Software Center ----Next_Part(Thu_Mar_16_11_16_46_2023_962)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="change_an_error_message.diff" diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c index 75588eebb3..f281ce9806 100644 --- a/src/backend/utils/adt/genfile.c +++ b/src/backend/utils/adt/genfile.c @@ -86,7 +86,7 @@ convert_and_check_filename(text *arg) else if (!path_is_relative_and_below_cwd(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - errmsg("path must be in or below the current directory"))); + errmsg("path must be in or below the data directory"))); return filename; } ----Next_Part(Thu_Mar_16_11_16_46_2023_962)----