1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/edit
Martijn Dekker 8264d2089a Remove ineffective check for login shell; require -p for suid/sgid
In main.c:

158:		if(sh.ppid==1)
159:			sh.login_sh++;

If that was ever valid, it certainly is not now. As far as I know,
there is no currently existing system where PID 1 (init or systemd
or whatever) is the parent shell of the login shell, even straight
after bootup; login shells are invoked via a program like login(1).
Plus, there is no guarantee the init process actually has PID 1.

This invalidates all use of login_sh that couldn't be replaced by
checks for the login_shell option, so this commit does just that.

src/cmd/ksh93/include/shell.h:
- Remove login_sh flag.

src/cmd/ksh93/sh/init.c:
- If a login shell was detected, just set the login_shell option.
- Remove obsolete check for #! setuid scripts. This was meant to
  guard against a symlink called '-i' to a setuid script with a
  hashbang path, which used to give users a root shell. All modern
  Unixes ignore the setuid bit when they detect a hashbang path.

src/cmd/ksh93/SHOPT.sh:
- By default, let's require the -p/--privileged invocation option
  for the setuid/setgid bit on the shell binary to be respected,
  for all user IDs (>= 0). This is what bash and mksh do, and
  it seems sensible. (See init.c 1475-1483)
2022-07-21 05:51:07 +02:00
..
completion.c Streamline some nval(3) and related flaggery 2022-07-20 04:32:43 +02:00
edit.c Yet another round of accumulated tweaks and cleanups 2022-07-04 00:29:05 +02:00
emacs.c Another build system overhaul (re: 35672208, 580ff616, 6cc2f6a0) 2022-06-12 05:47:02 +01:00
hexpand.c Another build system overhaul (re: 35672208, 580ff616, 6cc2f6a0) 2022-06-12 05:47:02 +01:00
history.c Remove ineffective check for login shell; require -p for suid/sgid 2022-07-21 05:51:07 +02:00
vi.c Yet another round of accumulated tweaks and cleanups 2022-07-04 00:29:05 +02:00