* Avoid SUSE specific sulogin prompt
This commit is contained in:
parent
0c8868b54f
commit
f8887767cb
@ -347,11 +347,18 @@ char *getpasswd(char *crypted)
|
|||||||
static char pass[128];
|
static char pass[128];
|
||||||
char *ret = pass;
|
char *ret = pass;
|
||||||
int i;
|
int i;
|
||||||
|
#if defined(USE_ONELINE)
|
||||||
if (crypted[0]) {
|
if (crypted[0])
|
||||||
printf("Give root password for login: ");
|
printf("Give root password for login: ");
|
||||||
} else
|
else
|
||||||
printf("Press enter for login: ");
|
printf("Press enter for login: ");
|
||||||
|
#else
|
||||||
|
if (crypted[0])
|
||||||
|
printf("Give root password for maintenance\n");
|
||||||
|
else
|
||||||
|
printf("Press enter for maintenance");
|
||||||
|
printf("(or type Control-D to continue): ");
|
||||||
|
#endif
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
tcgetattr(0, &old);
|
tcgetattr(0, &old);
|
||||||
@ -545,7 +552,7 @@ int main(int argc, char **argv)
|
|||||||
close(2);
|
close(2);
|
||||||
if (fd > 2)
|
if (fd > 2)
|
||||||
close(fd);
|
close(fd);
|
||||||
if ((fd = open(tty, O_RDWR)) < 0) {
|
if ((fd = open(tty, O_RDWR|O_NOCTTY)) < 0) {
|
||||||
perror(tty);
|
perror(tty);
|
||||||
} else {
|
} else {
|
||||||
ioctl(0, TIOCSCTTY, (char *)1);
|
ioctl(0, TIOCSCTTY, (char *)1);
|
||||||
|
Loading…
Reference in New Issue
Block a user