Smack: parse multiple rules per write to load2, up to PAGE_SIZE-1 bytes
authorRafal Krypa <r.krypa@samsung.com>
Fri, 9 Aug 2013 09:47:07 +0000 (11:47 +0200)
committerChanho Park <parkch98@gmail.com>
Fri, 23 Jan 2015 14:24:25 +0000 (23:24 +0900)
commit478aab2d242275d71494ccbe843b28ad4cd2fc67
tree4d596d3beecfe7a90a1d14d91d6c57252f5a8325
parent0e11cd7d686c68859cf5213b95a04009913da017
Smack: parse multiple rules per write to load2, up to PAGE_SIZE-1 bytes

Smack interface for loading rules has always parsed only single rule from
data written to it. This requires user program to call one write() per
each rule it wants to load.
This change makes it possible to write multiple rules, separated by new
line character. Smack will load at most PAGE_SIZE-1 characters and properly
return number of processed bytes. In case when user buffer is larger, it
will be additionally truncated. All characters after last \n will not get
parsed to avoid partial rule near input buffer boundary.

Change-Id: I81766925a9522fcb811fe3046850cdc45067838a
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Signed-off-by: Ɓukasz Stelmach <l.stelmach@samsung.com>
security/smack/smackfs.c