projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4 release
[unix-history]
/
usr
/
src
/
cmd
/
su.c
diff --git
a/usr/src/cmd/su.c
b/usr/src/cmd/su.c
index
0e78c67
..
48de85b
100644
(file)
--- a/
usr/src/cmd/su.c
+++ b/
usr/src/cmd/su.c
@@
-1,3
+1,4
@@
+static char *sccsid = "@(#)su.c 4.1 (Berkeley) 10/1/80";
#include <stdio.h>
#include <pwd.h>
#include <stdio.h>
#include <pwd.h>
@@
-13,11
+14,15
@@
char **argv;
char *password;
int badsw = 0;
char *shell = "/bin/sh";
char *password;
int badsw = 0;
char *shell = "/bin/sh";
+ int niced = 0;
if(argc > 1)
nptr = argv[1];
if(argc > 1)
nptr = argv[1];
- else
+ else
{
nptr = "root";
nptr = "root";
+ nice(-4);
+ niced = -4;
+ }
if((pwd=getpwnam(nptr)) == NULL) {
printf("Unknown id: %s\n",nptr);
exit(1);
if((pwd=getpwnam(nptr)) == NULL) {
printf("Unknown id: %s\n",nptr);
exit(1);
@@
-37,9
+42,6
@@
bad:
}
exit(2);
}
}
exit(2);
}
- if(pwd->pw_uid == 0 && badroot(getgid(),getuid()))
- goto bad;
-
ok:
endpwent();
if(pwd->pw_uid == 0) {
ok:
endpwent();
if(pwd->pw_uid == 0) {
@@
-55,20
+57,11
@@
ok:
shell = pwd->pw_shell;
homeis(pwd->pw_dir);
shellis(shell);
shell = pwd->pw_shell;
homeis(pwd->pw_dir);
shellis(shell);
+ nice(-niced);
execl(shell, "su", 0);
printf("No shell\n");
exit(3);
}
execl(shell, "su", 0);
printf("No shell\n");
exit(3);
}
-badroot(gid,uid)
-{
-/*
- if(gid!=10 || (uid > 15 && (uid!=40 && uid!=209 && uid!=203
- && uid!=54 && uid!=245)))
- return(1);
- else
-*/
- return(0);
-}
char **environ;
char **environ;