Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 14424 Details for
Bug 22275
system domainname is never set
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for agetty
agetty.c.patch (text/plain), 1.30 KB, created by
Marius Mauch (RETIRED)
on 2003-07-12 19:31:54 UTC
(
hide
)
Description:
Patch for agetty
Filename:
MIME Type:
Creator:
Marius Mauch (RETIRED)
Created:
2003-07-12 19:31:54 UTC
Size:
1.30 KB
patch
obsolete
>--- agetty.c 2002-07-29 09:36:42.000000000 +0200 >+++ /home/users/genone/projekte/misc/agetty-with-dns.c 2003-07-13 04:24:01.000000000 +0200 >@@ -30,6 +30,7 @@ > #include <getopt.h> > #include <time.h> > #include <sys/file.h> >+#include <netdb.h> > #include "xstrncpy.h" > #include "nls.h" > >@@ -122,6 +123,17 @@ > #define BUFSIZ 1024 > #endif > >+/* set a maximum length for the hostname, */ >+#ifdef HOST_NAME_MAX >+ /* defined by POSIX */ >+ #define HOSTNAME_LENGTH HOST_NAME_MAX >+#elif defined(MAXHOSTNAMELEN) >+ /* implemented in current Unix-versions */ >+ #define HOSTNAME_LENGTH MAXHOSTNAMELEN >+#else >+ #define HOSTNAME_LENGTH 500 >+#endif >+ > /* > * When multiple baud rates are specified on the command line, the first one > * we will try is the first one specified. >@@ -878,7 +890,25 @@ > printf ("%s", domainname); > } > break; >- >+ >+ case 'O': >+ { >+ char *domain = NULL; >+ char host[HOSTNAME_LENGTH + 1]; >+ struct hostent *hp = NULL; >+ >+ if (gethostname(host, HOSTNAME_LENGTH) || !(hp = gethostbyname(host))) { >+ domain = "unknown_domain"; >+ } else { >+ /* get the substring after the first . */ >+ domain = strchr(hp->h_name, '.'); >+ if (domain == NULL) >+ domain = ".(none)"; >+ } >+ printf("%s", ++domain); >+ } >+ break; >+ > case 'd': > case 't': > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22275
: 14424 |
14425