Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/runit/chpst.c


Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/runit/chpst.c

    r3232 r3621  
    2727
    2828/* Busyboxed by Denys Vlasenko <vda.linux@googlemail.com> */
    29 /* Dependencies on runit_lib.c removed */
     29
     30//config:config CHPST
     31//config:   bool "chpst"
     32//config:   default y
     33//config:   help
     34//config:     chpst changes the process state according to the given options, and
     35//config:     execs specified program.
     36//config:
     37//config:config SETUIDGID
     38//config:   bool "setuidgid"
     39//config:   default y
     40//config:   help
     41//config:     Sets soft resource limits as specified by options
     42//config:
     43//config:config ENVUIDGID
     44//config:   bool "envuidgid"
     45//config:   default y
     46//config:   help
     47//config:     Sets $UID to account's uid and $GID to account's gid
     48//config:
     49//config:config ENVDIR
     50//config:   bool "envdir"
     51//config:   default y
     52//config:   help
     53//config:     Sets various environment variables as specified by files
     54//config:     in the given directory
     55//config:
     56//config:config SOFTLIMIT
     57//config:   bool "softlimit"
     58//config:   default y
     59//config:   help
     60//config:     Sets soft resource limits as specified by options
     61
     62//applet:IF_CHPST(APPLET(chpst, BB_DIR_USR_BIN, BB_SUID_DROP))
     63//applet:IF_ENVDIR(APPLET_ODDNAME(envdir, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envdir))
     64//applet:IF_ENVUIDGID(APPLET_ODDNAME(envuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, envuidgid))
     65//applet:IF_SETUIDGID(APPLET_ODDNAME(setuidgid, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, setuidgid))
     66//applet:IF_SOFTLIMIT(APPLET_ODDNAME(softlimit, chpst, BB_DIR_USR_BIN, BB_SUID_DROP, softlimit))
     67
     68//kbuild:lib-$(CONFIG_CHPST) += chpst.o
     69//kbuild:lib-$(CONFIG_ENVDIR) += chpst.o
     70//kbuild:lib-$(CONFIG_ENVUIDGID) += chpst.o
     71//kbuild:lib-$(CONFIG_SETUIDGID) += chpst.o
     72//kbuild:lib-$(CONFIG_SOFTLIMIT) += chpst.o
    3073
    3174//usage:#define chpst_trivial_usage
     
    213256    }
    214257    closedir(dir);
    215     if (fchdir(wdir) == -1)
    216         bb_perror_msg_and_die("fchdir");
     258    xfchdir(wdir);
    217259    close(wdir);
    218260}
     
    237279    struct bb_uidgid_t ugid;
    238280    char *set_user = set_user; /* for compiler */
    239     char *env_user = env_user;
    240281    char *env_dir = env_dir;
    241282    char *root;
     
    265306            &limita, &limitc, &limitd, &limitf, &limitl,
    266307            &limitm, &limito, &limitp, &limitr, &limits, &limitt,
    267             &set_user, &env_user, &env_dir
     308            &set_user, &set_user, &env_dir
    268309            IF_CHPST(, &root, &nicestr));
    269310        argv += optind;
     
    293334    // envuidgid?
    294335    if (ENABLE_ENVUIDGID && applet_name[0] == 'e' && applet_name[3] == 'u') {
    295         env_user = *argv++;
     336        set_user = *argv++;
    296337        opt |= OPT_U;
    297338    }
Note: See TracChangeset for help on using the changeset viewer.