Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
63481f0b
Commit
63481f0b
authored
Oct 28, 1996
by
Bryan Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strncpy() and local buffers instead of snprintf(), since not everyone
has snprintf().
parent
aa1eac79
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+12
-9
No files found.
src/backend/postmaster/postmaster.c
View file @
63481f0b
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.1
6 1996/10/24 07:55:07 scrappy
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.1
7 1996/10/28 09:05:29 bryanh
Exp $
*
* NOTES
*
...
...
@@ -598,20 +598,23 @@ ConnStartup(Port *port, int *status,
(
void
)
strncpy
(
namebuf
,
sp
.
user
,
NAMEDATALEN
);
namebuf
[
NAMEDATALEN
]
=
'\0'
;
if
(
!
namebuf
[
0
])
{
snprintf
(
errormsg
,
errormsg_len
,
"No Postgres username specified in startup packet."
);
strncpy
(
errormsg
,
"No Postgres username specified in startup packet."
,
errormsg_len
);
*
status
=
STATUS_ERROR
;
}
else
{
if
(
be_recvauth
(
msgType
,
port
,
namebuf
,
&
sp
)
!=
STATUS_OK
)
{
snprintf
(
errormsg
,
errormsg_len
,
char
buffer
[
200
+
sizeof
(
namebuf
)];
sprintf
(
buffer
,
"Failed to authenticate client as Postgres user '%s' "
"using authentication scheme %d."
,
namebuf
,
msgType
);
strncpy
(
errormsg
,
buffer
,
errormsg_len
);
*
status
=
STATUS_ERROR
;
}
else
{
if
(
BackendStartup
(
&
sp
,
port
,
&
pid
)
!=
STATUS_OK
)
{
s
nprintf
(
errormsg
,
errormsg_len
,
"Startup (fork) of backend failed."
);
s
trncpy
(
errormsg
,
"Startup (fork) of backend failed."
,
errormsg_len
);
*
status
=
STATUS_ERROR
;
}
else
{
errormsg
[
0
]
=
'\0'
;
/* just for robustness */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment