lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121231154559.GG7564@quack.suse.cz>
Date:	Mon, 31 Dec 2012 16:45:59 +0100
From:	Jan Kara <jack@...e.cz>
To:	Chen Gang <gang.chen@...anux.com>
Cc:	jack@...e.cz, akpm@...ux-foundation.org, adilger.kernel@...ger.ca,
	Theodore Ts'o <tytso@....edu>, jaegeuk.kim@...sung.com,
	dwmw2@...radead.org, torvalds@...ux-foundation.org,
	linux-ext4@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
	linux-mtd@...ts.infradead.org, reiserfs-devel@...r.kernel.org
Subject: Re: [PATCH] fs/ext*,f2fs,jffs2,reiserfs: give comments for acl
 size and count calculation

On Fri 28-12-12 12:31:46, Chen Gang wrote:
> 
>   give comments (by Theodore Ts'o)
> 
>     ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER
> 
>     [1] Where * is the regexp sense of "0 or more times"
>     [2] Only if there is at least one ACL_USER or ACL_GROUP tag;
>         otherwise skip ACL_MASK.
> 
>   use macro instead of hard code number (by Chen Gang)
> 
> Signed-off-by: Theodore Ts'o <tytso@....edu>
> Signed-off-by: Chen Gang <gang.chen@...anux.com>
> ---
...
> diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
> index 7931efe..d75d2f6 100644
> --- a/include/linux/posix_acl.h
> +++ b/include/linux/posix_acl.h
> @@ -26,6 +26,15 @@
>  #define ACL_MASK		(0x10)
>  #define ACL_OTHER		(0x20)
>  
> +/*
> + * ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER
> + *
> + * [1] Where * is the regexp sense of "0 or more times"
> + * [2] Only if there is at least one ACL_USER or ACL_GROUP tag;
> + *     otherwise skip ACL_MASK.
> + */
> +#define ACL_MAX_SHORT_ENTRY     (4)
> +
  I agree that defining a constant for this makes sence. Just please be
more verbose with the comment. This is hardly readable for anyone not
knowing what's going on in advance. Also braces around 4 are superfluous.
Add something like the comment below before posix_acl_valid():

/*
 * posix_acl_valid() makes sure ACL format is the following:
 * ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER
 *
 * [1] Where * is the regexp sense of "0 or more times"
 * [2] If ACL_USER or ACL_GROUP is present, then ACL_MASK must be present.
 */

Then add comment before definition of ACL_MAX_SHORT_ENTRY:
/*
 * posix_acl_valid() makes sure that if there are <= 4 ACL entries, then
 * all of them are short. Otherwise exactly 4 entries are short ones and
 * other have full length. See comment before that function for exact ACL
 * format.
 */

								Honza
>  /* permissions in the e_perm field */
>  #define ACL_READ		(0x04)
>  #define ACL_WRITE		(0x02)
> -- 
> 1.7.10.4
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ