From: Yuichi Nakamura <ynakam@gwu.edu>
To: selinux@tycho.nsa.gov
Cc: kaigai@kaigai.gr.jp
Subject: First argument of matchpathcon_filespec_add
Date: Wed, 29 Nov 2006 08:55:39 +0900 [thread overview]
Message-ID: <ddeda73453a4.456d4b0b@gwu.edu> (raw)
Hi,
We are porting SELinux commands to busybox with friends.
# Patch set will be released in near future..
In the process, we found problem in matchpathcon_filespec_add.
1) I tried to port setfiles.c to busybox.
I ran setfiles command from busybox, but it crashed in following(line 313): "matchpathcon_filespec_add".
* setfiles.c
307 * Try to add an association between this inode and
308 * this specification. If there is already an association
309 * for this inode and it conflicts with this specification,
310 * then use the last matching specification.
311 */
312 if (add_assoc) {
313 j = matchpathcon_filespec_add(my_sb.st_ino, i, my_file);
314 if (j < 0)
315 goto err;
316
317 if (j != i) {
318 /* There was already an association and it took
precedence. */
319 goto out;
2) I found the reason why it crashed is size of mysb.st_ino is different between libselinux and busybox.
Prototype of matchpathcon_filespec_add is:
int matchpathcon_filespec_add(ino_t ino, int specind, const char *file)
The size of "ino_t" is diffenrent in busybox and libselinux.
Size of ino_t changes according to value of _FILE_OFFSET_BIT.
When libselinux is built, "-D_FILE_OFFSET_BIT=64" is defined.
However, in busybox "-D_FILE_OFFSET_BIT=64" is not defined, it depends on busybox configuration.
When we do not want to build busybox with -D_FILE_OFFSET_BIT=64,
we have to rebuild libselinux.
I think it is a problem.
Does anyone have good idea ?
--
Yuichi Nakamura
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next reply other threads:[~2006-11-28 23:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-28 23:55 Yuichi Nakamura [this message]
2006-11-29 8:23 ` First argument of matchpathcon_filespec_add Russell Coker
2006-11-29 12:14 ` KaiGai Kohei
2006-11-29 15:10 ` Stephen Smalley
2006-11-29 20:15 ` Eamon Walsh
2006-11-30 9:30 ` Yuichi Nakamura
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=ddeda73453a4.456d4b0b@gwu.edu \
--to=ynakam@gwu.edu \
--cc=kaigai@kaigai.gr.jp \
--cc=selinux@tycho.nsa.gov \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.