All of lore.kernel.org
 help / color / mirror / Atom feed
* First argument of matchpathcon_filespec_add
@ 2006-11-28 23:55 Yuichi Nakamura
  2006-11-29  8:23 ` Russell Coker
  0 siblings, 1 reply; 6+ messages in thread
From: Yuichi Nakamura @ 2006-11-28 23:55 UTC (permalink / raw)
  To: selinux; +Cc: kaigai

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-30  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28 23:55 First argument of matchpathcon_filespec_add Yuichi Nakamura
2006-11-29  8:23 ` 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

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.