All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aurélien Aptel" <aaptel@suse.com>
To: Christophe JAILLET
	<christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>,
	sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] SMB2: Fix share type handling
Date: Tue, 22 Nov 2016 12:18:25 +0000	[thread overview]
Message-ID: <mpspolnn1wu.fsf@suse.com> (raw)
In-Reply-To: <20161121215352.3183-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>

Christophe JAILLET <christophe.jaillet@wanadoo.fr> writes:
> Knowing that, with the current code, the SMB2_SHARE_TYPE_PRINT case can
> never trigger and printer share would be interpreted as disk share.

I've checked the SMB2 specs ([MS-SMB2] 3.2.5.5), I can confirm these are
the 3 only options. No upper bits are supposed to be set.

> So, test the ShareType value for equality instead.
>
> While at it, add some { } to fix a small style issue.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile-tested only.
>
> The proposed patch changes a bit the semantic as no masking is performed
> anymore. If some upper bits in 'ShareType' are set, it would now be rejected
> instead of silently accepted.

The semantic change is correct. I also think a switch would be more
appropriate. Beside this, Looks Good To Me.

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

WARNING: multiple messages have this Message-ID (diff)
From: "Aurélien Aptel" <aaptel-IBi9RG/b67k@public.gmane.org>
To: Christophe JAILLET
	<christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>,
	sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christophe JAILLET
	<christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
Subject: Re: [PATCH] SMB2: Fix share type handling
Date: Tue, 22 Nov 2016 13:18:25 +0100	[thread overview]
Message-ID: <mpspolnn1wu.fsf@suse.com> (raw)
In-Reply-To: <20161121215352.3183-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>

Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org> writes:
> Knowing that, with the current code, the SMB2_SHARE_TYPE_PRINT case can
> never trigger and printer share would be interpreted as disk share.

I've checked the SMB2 specs ([MS-SMB2] 3.2.5.5), I can confirm these are
the 3 only options. No upper bits are supposed to be set.

> So, test the ShareType value for equality instead.
>
> While at it, add some { } to fix a small style issue.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
> ---
> Compile-tested only.
>
> The proposed patch changes a bit the semantic as no masking is performed
> anymore. If some upper bits in 'ShareType' are set, it would now be rejected
> instead of silently accepted.

The semantic change is correct. I also think a switch would be more
appropriate. Beside this, Looks Good To Me.

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

WARNING: multiple messages have this Message-ID (diff)
From: "Aurélien Aptel" <aaptel@suse.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>, sfrench@samba.org
Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH] SMB2: Fix share type handling
Date: Tue, 22 Nov 2016 13:18:25 +0100	[thread overview]
Message-ID: <mpspolnn1wu.fsf@suse.com> (raw)
In-Reply-To: <20161121215352.3183-1-christophe.jaillet@wanadoo.fr>

Christophe JAILLET <christophe.jaillet@wanadoo.fr> writes:
> Knowing that, with the current code, the SMB2_SHARE_TYPE_PRINT case can
> never trigger and printer share would be interpreted as disk share.

I've checked the SMB2 specs ([MS-SMB2] 3.2.5.5), I can confirm these are
the 3 only options. No upper bits are supposed to be set.

> So, test the ShareType value for equality instead.
>
> While at it, add some { } to fix a small style issue.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> Compile-tested only.
>
> The proposed patch changes a bit the semantic as no masking is performed
> anymore. If some upper bits in 'ShareType' are set, it would now be rejected
> instead of silently accepted.

The semantic change is correct. I also think a switch would be more
appropriate. Beside this, Looks Good To Me.

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)

  parent reply	other threads:[~2016-11-22 12:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 21:53 [PATCH] SMB2: Fix share type handling Christophe JAILLET
2016-11-21 21:53 ` Christophe JAILLET
2016-11-22  8:19 ` walter harms
2016-11-22  8:19   ` walter harms
     [not found] ` <20161121215352.3183-1-christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
2016-11-22 12:18   ` Aurélien Aptel [this message]
2016-11-22 12:18     ` Aurélien Aptel
2016-11-22 12:18     ` Aurélien Aptel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mpspolnn1wu.fsf@suse.com \
    --to=aaptel@suse.com \
    --cc=christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
    --cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.