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

[PATCH] Really honor umask when creating files

From
Junio C Hamano <junkio@cox.net>
Date
Apr 17, 2005, 08:15 UTC
Message-ID
<7v7jj124zv.fsf@assigned-by-dhcp.cox.net>

The stated plan was to create new files with either 0666 or 0777 and let the system take care of applying umask(). Running fchmod afterwards defeats this plan, so drop it.

You still need to spell your octals with prefix in addition to this patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 checkout-cache.c |    2 --
 1 files changed, 2 deletions(-)

checkout-cache.c: a87022a97c4604ef42ae6c31d641dc749a076ca3 --- checkout-cache.c +++ checkout-cache.c 2005-04-17 01:11:17.000000000 -0700

@@ -62,8 +62,6 @@
 			fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
 		}
 	}
-	if (fd >= 0)
-		fchmod(fd, mode);
 	return fd;
 }
 
Message 1 of 1 in “Really honor umask when creating files”
  1. Really honor umask when creating filesJunio C Hamano, Apr 17, 2005

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.