git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] compat: make sure git_mmap is not expected to write

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 23, 2018, 10:13 UTC
Message-ID
<nycvar.QRO.7.76.6.1810231212190.4546@tvgsbejvaqbjf.bet>
In-Reply-To
<20181023051216.64266-1-carenas@gmail.com>
Hi carlo,
your mail's "From:" line does not record your full name, but the
Signed-off-by: line does. Let's use the latter?
On Mon, 22 Oct 2018, carlo wrote:
Show 5 quoted lines
> in f48000fc ("Yank writing-back support from gitfakemmap.", 2005-10-08)
> support for writting back changes was removed but the specific prot
> flag that would be used was not checked for)
> 
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
ACK!

Thank you, Johannes

Show 21 quoted lines
> ---
>  compat/mmap.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/compat/mmap.c b/compat/mmap.c
> index 7f662fef7b..14d31010df 100644
> --- a/compat/mmap.c
> +++ b/compat/mmap.c
> @@ -4,7 +4,7 @@ void *git_mmap(void *start, size_t length, int prot, int flags, int fd, off_t of
>  {
>  	size_t n = 0;
>  
> -	if (start != NULL || !(flags & MAP_PRIVATE))
> +	if (start != NULL || flags != MAP_PRIVATE || prot != PROT_READ)
>  		die("Invalid usage of mmap when built with NO_MMAP");
>  
>  	start = xmalloc(length);
> -- 
> 2.19.1
> 
> 
Previous: carloNext: Carlo Marcelo Arenas Belón
Message 2 of 4 in “compat: make sure git_mmap is not expected to write”
  1. compat: make sure git_mmap is not expected to writecarlo, Oct 23, 2018
  2. Johannes SchindelinOct 23, 2018
  3. compat: make sure git_mmap is not expected to writeCarlo Marcelo Arenas Belón, Oct 23, 2018
  4. Junio C HamanoOct 24, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.