[PATCH] Hardening for the homes directory

Ralph Böhme slow at samba.org
Mon Dec 3 10:54:26 UTC 2018


Hi Andreas,

lgtm besides one nitpick (see below):

On Mon, Dec 03, 2018 at 11:41:35AM +0100, Andreas Schneider via samba-technical wrote:
>From 82dd883797fc4fef68bbc6af7f1b9ee10bea2d44 Mon Sep 17 00:00:00 2001
>From: Andreas Schneider <asn at samba.org>
>Date: Thu, 22 Nov 2018 18:23:24 +0100
>Subject: [PATCH 3/4] s3:smbd: Make sure we do not export "/" (root) as home
> dir
>
> ...
>
>diff --git a/source3/smbd/password.c b/source3/smbd/password.c
>index f472bda2c70..8e2eb1312c5 100644
>--- a/source3/smbd/password.c
>+++ b/source3/smbd/password.c
>@@ -122,13 +122,21 @@ int register_homes_share(const char *username)
>
> 	pwd = Get_Pwnam_alloc(talloc_tos(), username);
>
>-	if ((pwd == NULL) || (pwd->pw_dir[0] == '\0')) {
>+	if ((pwd == NULL) ||
>+	    (pwd->pw_dir[0] == '\0')) {

is there a logical change I fail to spot on a miserable Monday morning? :)

If you want the line wrap for readability please also wrap the closing brace as 
mentioned in README.Coding:

	if ((pwd == NULL) ||
	    (pwd->pw_dir[0] == '\0'))
        {

-slow

-- 
Ralph Boehme, Samba Team                https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
GPG-Fingerprint   FAE2C6088A24252051C559E4AA1E9B7126399E46



More information about the samba-technical mailing list