From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [RFC][PATCH 2/3] ext2: Enable atomic inode security labeling Date: Mon, 11 Jul 2005 00:39:27 +0100 Message-ID: <20050710233927.GA1301@infradead.org> References: <1120829121.19035.45.camel@moss-spartans.epoch.ncsc.mil> <1120830914.19035.62.camel@moss-spartans.epoch.ncsc.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linuxfs , Alexander Viro , Ext2-devel@lists.sourceforge.net, Andreas Gruenbacher , Andreas Dilger , Andrew Morton , Stephen Tweedie , James Morris , Chris Wright Return-path: To: Stephen Smalley Content-Disposition: inline In-Reply-To: <1120830914.19035.62.camel@moss-spartans.epoch.ncsc.mil> Sender: ext2-devel-admin@lists.sourceforge.net Errors-To: ext2-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: List-Id: linux-fsdevel.vger.kernel.org On Fri, Jul 08, 2005 at 09:55:14AM -0400, Stephen Smalley wrote: > +int > +ext2_init_security(struct inode *inode, struct inode *dir) > +{ > + int err; > + size_t len; > + void *value; > + char *name; > + > + err = security_inode_init_security(inode, dir, &name, &value, &len); > + if (err) { > + if (err == -EOPNOTSUPP) > + return 0; > + return err; > + } > + err = ext2_xattr_set(inode, EXT2_XATTR_INDEX_SECURITY, > + name, value, len, 0); > + kfree(name); > + kfree(value); Please set the xattr from security_inode_init_security by using ->setxattr, that way we don't need to duplicate this code everywhere. ------------------------------------------------------- This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual core and dual graphics technology at this free one hour event hosted by HP, AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar