Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
990f15d1
Commit
990f15d1
authored
26 years ago
by
Hallvard Furuseth
Browse files
Options
Downloads
Patches
Plain Diff
pass struct in_addr.s_addr*, not long*, to gethostbyaddr
parent
1b51fc23
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
clients/finger/main.c
+6
-9
6 additions, 9 deletions
clients/finger/main.c
with
6 additions
and
9 deletions
clients/finger/main.c
+
6
−
9
View file @
990f15d1
...
...
@@ -61,7 +61,6 @@ main( int argc, char **argv )
{
int
i
;
char
*
myname
;
unsigned
long
mypeer
=
-
1
;
struct
hostent
*
hp
;
struct
sockaddr_in
peername
;
int
peernamelen
;
...
...
@@ -110,7 +109,6 @@ main( int argc, char **argv )
perror
(
"getpeername"
);
exit
(
1
);
}
mypeer
=
(
unsigned
long
)
peername
.
sin_addr
.
s_addr
;
}
#ifdef FINGER_BANNER
...
...
@@ -133,13 +131,12 @@ main( int argc, char **argv )
#endif
}
if
(
dosyslog
&&
mypeer
!=
(
unsigned
long
)
-
1
)
{
struct
in_addr
addr
;
hp
=
gethostbyaddr
(
(
char
*
)
&
mypeer
,
sizeof
(
mypeer
),
AF_INET
);
addr
.
s_addr
=
mypeer
;
syslog
(
LOG_INFO
,
"connection from %s (%s)"
,
(
hp
==
NULL
)
?
"unknown"
:
hp
->
h_name
,
inet_ntoa
(
addr
)
);
if
(
dosyslog
&&
!
interactive
)
{
hp
=
gethostbyaddr
(
(
char
*
)
&
peername
.
sin_addr
.
s_addr
,
sizeof
(
peername
.
sin_addr
.
s_addr
),
AF_INET
);
syslog
(
LOG_INFO
,
"connection from %s (%s)"
,
(
hp
==
NULL
)
?
"unknown"
:
hp
->
h_name
,
inet_ntoa
(
peername
.
sin_addr
)
);
}
do_query
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment