Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 157994 Details for
Bug 196326
IPv6: bad interaction between tcp_wrappers and DNS, vsftpd
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
a little test
test.c (text/x-csrc), 1.22 KB, created by
Tomas Janousek
on 2007-06-27 11:15:45 UTC
(
hide
)
Description:
a little test
Filename:
MIME Type:
Creator:
Tomas Janousek
Created:
2007-06-27 11:15:45 UTC
Size:
1.22 KB
patch
obsolete
>/* tcp_wrappers address debugprint > * > * Compile: > * cc -Wall -g test.c -lwrap -o test > * > * Use: > * echo "test:localhost" >/etc/hosts.allow > * echo "test:ALL" >/etc/hosts.deny > * ./test > * nc localhost 12345 (from another terminal) > */ > >#include <stdio.h> >#include <tcpd.h> >#include <sys/types.h> >#include <sys/socket.h> >#include <netinet/in.h> >#include <assert.h> > >int main(int argc, char *argv[]) >{ > int sock = socket(AF_INET6, SOCK_STREAM, 0); > assert(sock >= 0); > > struct sockaddr_in6 sin = { > .sin6_family = AF_INET6, > .sin6_port = htons(12345), > .sin6_addr = IN6ADDR_ANY_INIT > }; > > int set_opt = 1; > assert(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*) &set_opt, sizeof(set_opt)) == 0); > > assert(bind(sock, (struct sockaddr *) &sin, sizeof(sin)) == 0); > > assert(listen(sock, 5) == 0); > > int cli = accept(sock, 0, 0); > assert(cli >= 0); > > struct request_info req; > request_init(&req, RQ_DAEMON, "test", RQ_FILE, cli, 0); > fromhost(&req); > int ret = hosts_access(&req); > > if (!ret) > puts("denied"); > else > puts("allowed"); > > printf("hostname: %s\n", eval_hostname(req.client)); > printf("hostaddr: %s\n", eval_hostaddr(req.client)); > > return 0; >}
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 Raw
Actions:
View
Attachments on
bug 196326
: 157994