mirror of https://github.com/MidnightCommander/mc
setuid vs. setreuid
Sun Feb 14 02:59:09 1999 Timur Bakeyev <mc@bat.ru> * utilunix.c (my_system): Fix the order of preferenses, as setuid more desirable on BSD systems. Terminate execl[p]() with NULL, as this is formally correct.
This commit is contained in:
parent
7ca0948527
commit
86ede6c1ca
|
@ -1,7 +1,12 @@
|
|||
Sun Feb 14 02:59:09 1999 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* utilunix.c (my_system): Fix the order of preferenses, as setuid
|
||||
more desirable on BSD systems. Terminate execl[p]() with NULL, as
|
||||
this is formally correct.
|
||||
|
||||
1999-02-12 Miguel de Icaza <miguel@nuclecu.unam.mx>
|
||||
|
||||
* dir.c (do_load_dir): Added missing calls to
|
||||
tree_store_end_check.
|
||||
* dir.c (do_load_dir): Added missing calls to tree_store_end_check.
|
||||
|
||||
* find.c (add_to_list): Pass the data pointer as well.
|
||||
|
||||
|
|
|
@ -283,17 +283,19 @@ int my_system (int flags, const char *shell, const char *command)
|
|||
|
||||
#ifdef USE_VFS
|
||||
if (flags & EXECUTE_SETUID)
|
||||
#if defined (HAVE_SETREUID)
|
||||
setreuid (vfs_uid, vfs_uid);
|
||||
#elif defined (HAVE_SETUID)
|
||||
# if defined (HAVE_SETUID)
|
||||
setuid (vfs_uid);
|
||||
#endif
|
||||
# elif defined (HAVE_SETREUID)
|
||||
setreuid (vfs_uid, vfs_uid);
|
||||
# else
|
||||
; /* Can't drop privileges */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if (flags & EXECUTE_AS_SHELL)
|
||||
execl (shell, shell, "-c", command, (char *) 0);
|
||||
execl (shell, shell, "-c", command, NULL);
|
||||
else
|
||||
execlp (shell, shell, command, (char *) 0);
|
||||
execlp (shell, shell, command, NULL);
|
||||
|
||||
_exit (127); /* Exec error */
|
||||
} else {
|
||||
|
|
32
src/xmkdir
32
src/xmkdir
|
@ -1,32 +0,0 @@
|
|||
#!/bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Last modified: 1994-03-25
|
||||
# Public domain
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file in ${1+"$@"} ; do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d in ${1+"$@"} ; do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
mkdir "$pathcomp" || errstatus=$?
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
Loading…
Reference in New Issue