--- embedtools/src/cfexec.c 2018/01/01 23:48:32 1.5.20.6 +++ embedtools/src/cfexec.c 2018/01/01 23:52:54 1.5.20.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: cfexec.c,v 1.5.20.6 2018/01/01 23:48:32 misho Exp $ + * $Id: cfexec.c,v 1.5.20.7 2018/01/01 23:52:54 misho Exp $ * ************************************************************************* The ELWIX and AITNET software is distributed under the following @@ -48,7 +48,7 @@ SUCH DAMAGE. cfg_root_t cfg; int Verbose, Timeout, kq; -ait_val_t User, Mount, Dev, Chroot; +ait_val_t User, Mount, Chroot; char szSess[MAXPATHLEN], szSLCK[MAXPATHLEN], szConfig[MAXPATHLEN]; extern char compiled[], compiledby[], compilehost[]; @@ -63,7 +63,6 @@ Usage() "\t-v\t\tVerbose ...\n" "\t-c \tAfter execute chroot to dir [default=/]\n" "\t-u \tAfter execute suid to user [default=root]\n" - "\t-d \tOther device [default=/dev/ufs/elwix]\n" "\t-m \tOther mount dir [default=/]\n" "\t-t \tTimeout for autolock mount dir after seconds [default=300]\n" "\t-L \tService lock and set RW state of device with reason\n" @@ -105,8 +104,9 @@ update(int flags) return -1; } - VERB(5) printf("Info(5):: safe mount for device %s to %s operation (%s)\n", - AIT_GET_STR(&Dev), AIT_GET_STR(&Mount), (flags & MNT_RDONLY) ? "ro" : "rw"); + VERB(5) printf("Info(5):: safe mount %s for device %s to %s operation (%s)\n", + mntfs->f_fstypename, mntfs->f_mntfromname, mntfs->f_mntonname, + (flags & MNT_RDONLY) ? "ro" : "rw"); return 0; } @@ -166,7 +166,6 @@ static void cleanexit() { AIT_FREE_VAL(&User); - AIT_FREE_VAL(&Dev); AIT_FREE_VAL(&Mount); AIT_FREE_VAL(&Chroot); @@ -246,7 +245,6 @@ main(int argc, char **argv) } cfg_loadAttribute(&cfg, "cfexec", "suid", &User, DEFAULT_USER); cfg_loadAttribute(&cfg, "cfexec", "mount", &Mount, DEFAULT_MOUNT); - cfg_loadAttribute(&cfg, "cfexec", "device", &Dev, DEFAULT_DEVICE); cfg_loadAttribute(&cfg, "cfexec", "chroot", &Chroot, DEFAULT_CHROOT); cfgUnloadConfig(&cfg); @@ -254,14 +252,13 @@ main(int argc, char **argv) Timeout = atoi(DEFAULT_TIMEOUT); AIT_SET_STR(&User, DEFAULT_USER); AIT_SET_STR(&Mount, DEFAULT_MOUNT); - AIT_SET_STR(&Dev, DEFAULT_DEVICE); AIT_SET_STR(&Chroot, DEFAULT_CHROOT); } atexit(cleanexit); /* Load variables from arguments if exists */ - while ((ch = getopt(argc, argv, "hvUu:c:d:m:t:L:")) != -1) + while ((ch = getopt(argc, argv, "hvUu:c:m:t:L:")) != -1) switch (ch) { case 'v': Verbose++; @@ -272,9 +269,6 @@ main(int argc, char **argv) case 'c': AIT_SET_STR(&Chroot, optarg); break; - case 'd': - AIT_SET_STR(&Dev, optarg); - break; case 'm': AIT_SET_STR(&Mount, optarg); break; @@ -320,8 +314,8 @@ main(int argc, char **argv) return ret; } - VERB(3) printf("Info(3):: Chroot=%s SUID=%s Device=%s Mount=%s Timeout=%d Session=%s\n", - AIT_GET_STR(&Chroot), AIT_GET_STR(&User), AIT_GET_STR(&Dev), + VERB(3) printf("Info(3):: Chroot=%s SUID=%s Mount=%s Timeout=%d Session=%s\n", + AIT_GET_STR(&Chroot), AIT_GET_STR(&User), AIT_GET_STR(&Mount), Timeout, szSess); if (!access(szSess, F_OK)) {