Tarantool development patches archive
 help / color / mirror / Atom feed
From: Konstantin Osipov <kostja@tarantool.org>
To: tarantool-patches@freelists.org
Cc: georgy@tarantool.org
Subject: [tarantool-patches] Re: [security 2/3] security: Refactor reads from systems spaces
Date: Sun, 13 May 2018 15:49:18 +0300	[thread overview]
Message-ID: <20180513124918.GA10552@atlas> (raw)
In-Reply-To: <0c1d9e810129869e39003ca696de774a4d4f7a09.1522308989.git.imarkov@tarantool.org>

* Ilya Markov <imarkov@tarantool.org> [18/03/29 12:10]:
> +const uint32_t PRIV_WRDA = PRIV_W | PRIV_D | PRIV_A | PRIV_R;
> +
>  static bool
>  vspace_filter(struct space *source, struct tuple *tuple)

What did you need this for?


> +	if (PRIV_WRDA & cr->universal_access)
> +		return true;
> +	if (source->access[cr->auth_token].effective & PRIV_R)
> +		return true;

Stray change.

> -	return uid == cr->uid || owner_id == cr->uid;
> +	return uid == cr->uid || owner_id == cr->uid || uid == PUBLIC;

What is this change for?

> +	/* If user has global alter, drop privilege
> +	 * she may access all privileges
> +	 */
> +	if (PRIV_WRDA & cr->universal_access)
> +		return true;

The comment only talks about global alter/drop, what about global
'write'? Why did you include it into the list?

> +	if (source->access[cr->auth_token].effective & PRIV_R)
> +		return true;
> +	const char *type;
> +	uint32_t obj_id;
> +	if ((type = tuple_field_cstr(tuple, BOX_PRIV_FIELD_OBJECT_TYPE)) == NULL ||
> +		tuple_field_u32(tuple, BOX_PRIV_FIELD_OBJECT_ID, &obj_id) != 0)
> +		return false;
> +	return grantor_id == cr->uid || grantee_id == cr->uid ||
> +		(strncmp(type, "role", 4) == 0 && obj_id == PUBLIC);

What is this for?

> +	uint32_t effective = sequence->access[cr->auth_token].effective;
> +	return sequence->def->uid == cr->uid ||
> +		(PRIV_WRDA & effective);

Stray changes make things harder to follow.


-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov

  reply	other threads:[~2018-05-13 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29  7:36 [tarantool-patches] [security 0/3] System space access check lists Ilya Markov
2018-03-29  7:36 ` [tarantool-patches] [security 1/3] box: Add system view for _sequence system space Ilya Markov
2018-03-29  7:37 ` [tarantool-patches] [security 2/3] security: Refactor reads from systems spaces Ilya Markov
2018-05-13 12:49   ` Konstantin Osipov [this message]
2018-03-29  7:37 ` [tarantool-patches] [security 3/3] security: Refactor system space access checks Ilya Markov
2018-04-03 14:01 ` [tarantool-patches] Re: [security 0/3] System space access check lists Georgy Kirichenko

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=20180513124918.GA10552@atlas \
    --to=kostja@tarantool.org \
    --cc=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [security 2/3] security: Refactor reads from systems spaces' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox