Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/libbb/selinux_common.c

    r1765 r2725  
    44 *
    55 * Copyright 2007 KaiGai Kohei <kaigai@kaigai.gr.jp>
     6 *
     7 * Licensed under GPLv2, see file LICENSE in this source tree.
    68 */
    79#include "libbb.h"
    810#include <selinux/context.h>
    911
    10 context_t set_security_context_component(security_context_t cur_context,
     12context_t FAST_FUNC set_security_context_component(security_context_t cur_context,
    1113                     char *user, char *role, char *type, char *range)
    1214{
     
    3032}
    3133
    32 void setfscreatecon_or_die(security_context_t scontext)
     34void FAST_FUNC setfscreatecon_or_die(security_context_t scontext)
    3335{
    3436    if (setfscreatecon(scontext) < 0) {
    3537        /* Can be NULL. All known printf implementations
    3638         * display "(null)", "<null>" etc */
    37         bb_perror_msg_and_die("cannot set default "
     39        bb_perror_msg_and_die("can't set default "
    3840                "file creation context to %s", scontext);
    3941    }
    4042}
     43
     44void FAST_FUNC selinux_preserve_fcontext(int fdesc)
     45{
     46    security_context_t context;
     47
     48    if (fgetfilecon(fdesc, &context) < 0) {
     49        if (errno == ENODATA || errno == ENOTSUP)
     50            return;
     51        bb_perror_msg_and_die("fgetfilecon failed");
     52    }
     53    setfscreatecon_or_die(context);
     54    freecon(context);
     55}
Note: See TracChangeset for help on using the changeset viewer.