Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-12-29 00:33:30 +0300
committerDenis Vlasenko <vda.linux@googlemail.com>2006-12-29 00:33:30 +0300
commit7fa0fcafca76454effc65f8c3121a37cf0952ff9 (patch)
tree7342a1d3a0320d586b7e18cdadb8cab580e32e79 /coreutils/id.c
parent9a44c4f91ce7e517d5325fd3743e6ad9d54ef3f0 (diff)
fix build without shadow support
Diffstat (limited to 'coreutils/id.c')
-rw-r--r--coreutils/id.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/coreutils/id.c b/coreutils/id.c
index 35f945dba..36007ae55 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -89,19 +89,16 @@ int id_main(int argc, char **argv)
#ifdef CONFIG_SELINUX
if (is_selinux_enabled()) {
- security_context_t mysid;
- char context[80];
- int len = sizeof(context);
+ security_context_t mysid;
+ const char *context;
- getcon(&mysid);
- context[0] = '\0';
- if (mysid) {
- len = strlen(mysid)+1;
- safe_strncpy(context, mysid, len);
- freecon(mysid);
- } else {
- safe_strncpy(context, "unknown", 8);
- }
+ context = "unknown";
+ getcon(&mysid);
+ if (mysid) {
+ context = alloca(strlen(mysid) + 1);
+ strcpy((char*)context, mysid);
+ freecon(mysid);
+ }
printf(" context=%s", context);
}
#endif