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]
Date:	Tue, 03 Mar 2009 09:15:42 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
CC:	Paul Menage <menage@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linux Containers <containers@...ts.linux-foundation.org>
Subject: Re: [PATCH 0/4] cgroups: show correct file mode

>> +/**
>> + * cgroup_file_mode - deduce file mode of a control file
>> + * @cft: the control file in question
>> + *
>> + * returns cftype->mode if ->mode is not 0
>> + * returns 0644 if it has both a read and a write handler
>> + * returns 0444 if it has only a read handler
>> + * returns 0200 if it has only a write hander
>> + */
>> +static int cgroup_file_mode(const struct cftype *cft)
>> +{
>> +	int mode = 0;
>> +
>> +	if (cft->mode)
>> +		return cft->mode;
>> +
>> +	if (cft->read || cft->read_u64 || cft->read_s64 ||
>> +	    cft->read_map || cft->read_seq_string)
>> +		mode += 0444;
>> +
>> +	if (cft->write || cft->write_u64 || cft->write_s64 ||
>> +	    cft->write_string || cft->trigger)
>> +		mode += 0200;
>> +
> 
> += is not |=...
> 

Ah, yes, though both happen to result in 0644.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ