Skip to contentSkip to conversation

libselinux utilities applets - please test

DISCUSSION KaiGai Kohei 2 participants 2 messages Feb 6, 2007 – Feb 7, 2007 1 message not in the archive SELinux security module

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

FYI,

The first serious of SELinux'ed-busybox patches (libselinux utilities) are merged. It enables the following facilities:

- When ENABLE_SELINUX=1, '-lselinux -lsepol' was added as a LDFLAGS
- "Selinux Utilities" group was added onto menuconfig list.
- 'getenforce' new applet was added.
- 'getsebool' new applet was added.
- 'matchpathcon' new applet was added.
- 'selinuxenabled' new applet was added.
- 'setenforce' new applet was added.

Now, we are preparing to submit next serious of patches. see, http://code.google.com/p/sebusybox/

Thanks,

Quoted 50 lines · Denis Vlasenko

int getsebool_main(int argc, char **argv)
{
...

        if (!len) {
                if (argc < 2)
                        bb_show_usage();
                len = argc - 1;
                names = xmalloc(sizeof(char *) * len);
                for (i = 0; i < len; i++)
                        names[i] = xstrdup(argv[i + 1]);
        }

Is it necessary to allocate names and xstrdup argv[i]? Maybe just do "names = argv + 1"?

bb_perror_msg_and_die("error while processing %s: ", prefix);

bb_perror prints: "<applet>: message: <strerror>" - that thrailing ": " in your code is not needed.

(quoted diff) +8 -0
+#define matchpathcon_trivial_usage \
+       "[-n] [-N] [-f file_contexts_file] [-p prefix] [-V]"
+#define matchpathcon_full_usage \
+       "\t-n\tDo not display path.\n" \
+       "\t-N\tDo not use translations.\n" \
+       "\t-f\tfile_context_file Use alternate file_context file\n" \
+       "\t-p\tprefix Use prefix to speed translations\n" \
+       "\t-V\tVerify file context on disk matches defaults"

Ehhh.... usage.h has such a nice comment at the top:

/*
* This file suffers from chronically incorrect tabification
* of messages. Before editing this file:
* 1. Switch you editor to 8-space tab mode.
* 2. Do not use \t in messages, use real tab character.
* 3. Start each source line with message as follows:
* |<7 spaces>"text with tabs"....
*/

Okay. I applied your patch to svn and did some changes. Please review & test - I can't run-test it at the moment (my kernel and userspace is not selinux-enabled).

Patch is attached for easy review. Thanks.
--
vda

Signature · 6 lines
KaiGai Kohei <[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw

Sorry, so confusable spelling miss.

Quoted 1 line

The first serious of SELinux'ed-busybox patches (libselinux utilities)

            ^^^^^^^ ... series
Quoted 14 lines

are merged. It enables the following facilities:

- When ENABLE_SELINUX=1, '-lselinux -lsepol' was added as a LDFLAGS
- "Selinux Utilities" group was added onto menuconfig list.
- 'getenforce' new applet was added.
- 'getsebool' new applet was added.
- 'matchpathcon' new applet was added.
- 'selinuxenabled' new applet was added.
- 'setenforce' new applet was added.

Now, we are preparing to submit next serious of patches. see, http://code.google.com/p/sebusybox/

Thanks,

Signature · 7 lines
Open Source Software Promotion Center, NEC
KaiGai Kohei <[email protected]>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.