* Avoid SUSE specific sulogin prompt
authorDr. Werner Fink <werner@suse.de>
Tue, 30 Mar 2010 17:38:27 +0000 (17:38 +0000)
committerDr. Werner Fink <werner@suse.de>
Tue, 30 Mar 2010 17:38:27 +0000 (17:38 +0000)
git-svn-id: svn://svn.sv.gnu.org/sysvinit/sysvinit/trunk@53 456724a4-4300-0410-8514-c89748c515a2

src/sulogin.c

index 2043a4a7cfc5598ee6bb808393e0b9179050b862..67e587bd8819561a2f034ba632d82a24a30ce75b 100644 (file)
@@ -347,11 +347,18 @@ char *getpasswd(char *crypted)
        static char pass[128];
        char *ret = pass;
        int i;
-
-       if (crypted[0]) {
+#if defined(USE_ONELINE)
+       if (crypted[0])
                printf("Give root password for login: ");
-       else
+       else
                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);
 
        tcgetattr(0, &old);
@@ -545,7 +552,7 @@ int main(int argc, char **argv)
                                close(2);
                                if (fd > 2)
                                        close(fd);
-                               if ((fd = open(tty, O_RDWR)) < 0) {
+                               if ((fd = open(tty, O_RDWR|O_NOCTTY)) < 0) {
                                        perror(tty);
                                } else {
                                        ioctl(0, TIOCSCTTY, (char *)1);