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
4ab8fcba
Commit
4ab8fcba
authored
Feb 10, 2007
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StrNCpy -> strlcpy (not complete)
parent
1a1474b4
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
58 additions
and
58 deletions
+58
-58
src/backend/bootstrap/bootstrap.c
src/backend/bootstrap/bootstrap.c
+2
-2
src/backend/libpq/crypt.c
src/backend/libpq/crypt.c
+2
-2
src/backend/libpq/hba.c
src/backend/libpq/hba.c
+4
-4
src/backend/libpq/ip.c
src/backend/libpq/ip.c
+3
-3
src/backend/nodes/print.c
src/backend/nodes/print.c
+5
-5
src/backend/postmaster/pgarch.c
src/backend/postmaster/pgarch.c
+3
-3
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+10
-10
src/backend/tcop/postgres.c
src/backend/tcop/postgres.c
+2
-2
src/backend/utils/misc/guc-file.l
src/backend/utils/misc/guc-file.l
+2
-2
src/bin/initdb/initdb.c
src/bin/initdb/initdb.c
+2
-2
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_ctl/pg_ctl.c
+5
-5
src/bin/pg_dump/pg_dumpall.c
src/bin/pg_dump/pg_dumpall.c
+2
-2
src/bin/pg_resetxlog/pg_resetxlog.c
src/bin/pg_resetxlog/pg_resetxlog.c
+3
-3
src/interfaces/libpq/fe-auth.c
src/interfaces/libpq/fe-auth.c
+2
-2
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-connect.c
+8
-8
src/timezone/pgtz.c
src/timezone/pgtz.c
+3
-3
No files found.
src/backend/bootstrap/bootstrap.c
View file @
4ab8fcba
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.2
29 2007/01/22 01:35:19 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.2
30 2007/02/10 14:58:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -277,7 +277,7 @@ BootstrapMain(int argc, char *argv[])
SetConfigOption
(
"fsync"
,
"false"
,
PGC_POSTMASTER
,
PGC_S_ARGV
);
break
;
case
'r'
:
StrNC
py
(
OutputFileName
,
optarg
,
MAXPGPATH
);
strlc
py
(
OutputFileName
,
optarg
,
MAXPGPATH
);
break
;
case
'x'
:
xlogop
=
atoi
(
optarg
);
...
...
src/backend/libpq/crypt.c
View file @
4ab8fcba
...
...
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.7
2 2007/01/05 22:19:29 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/crypt.c,v 1.7
3 2007/02/10 14:58:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -110,7 +110,7 @@ md5_crypt_verify(const Port *port, const char *role, char *client_pass)
{
char
salt
[
3
];
StrNCpy
(
salt
,
port
->
cryptSalt
,
3
);
strlcpy
(
salt
,
port
->
cryptSalt
,
sizeof
(
salt
)
);
crypt_pwd
=
crypt
(
shadow_pass
,
salt
);
break
;
}
...
...
src/backend/libpq/hba.c
View file @
4ab8fcba
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.1
59 2007/02/08 04:52:18 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.1
60 2007/02/10 14:58:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1463,7 +1463,7 @@ ident_unix(int sock, char *ident_user)
return
false
;
}
StrNC
py
(
ident_user
,
pass
->
pw_name
,
IDENT_USERNAME_MAX
+
1
);
strlc
py
(
ident_user
,
pass
->
pw_name
,
IDENT_USERNAME_MAX
+
1
);
return
true
;
#elif defined(SO_PEERCRED)
...
...
@@ -1493,7 +1493,7 @@ ident_unix(int sock, char *ident_user)
return
false
;
}
StrNC
py
(
ident_user
,
pass
->
pw_name
,
IDENT_USERNAME_MAX
+
1
);
strlc
py
(
ident_user
,
pass
->
pw_name
,
IDENT_USERNAME_MAX
+
1
);
return
true
;
#elif defined(HAVE_STRUCT_CMSGCRED) || defined(HAVE_STRUCT_FCRED) || (defined(HAVE_STRUCT_SOCKCRED) && defined(LOCAL_CREDS))
...
...
@@ -1562,7 +1562,7 @@ ident_unix(int sock, char *ident_user)
return
false
;
}
StrNC
py
(
ident_user
,
pw
->
pw_name
,
IDENT_USERNAME_MAX
+
1
);
strlc
py
(
ident_user
,
pw
->
pw_name
,
IDENT_USERNAME_MAX
+
1
);
return
true
;
#else
...
...
src/backend/libpq/ip.c
View file @
4ab8fcba
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.
39 2007/01/05 22:19:29 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/ip.c,v 1.
40 2007/02/10 14:58:54 petere
Exp $
*
* This file and the IPV6 implementation were initially provided by
* Nigel Kukard <nkukard@lbsd.net>, Linux Based Systems Design
...
...
@@ -175,9 +175,9 @@ pg_getnameinfo_all(const struct sockaddr_storage * addr, int salen,
if
(
rc
!=
0
)
{
if
(
node
)
StrNC
py
(
node
,
"???"
,
nodelen
);
strlc
py
(
node
,
"???"
,
nodelen
);
if
(
service
)
StrNC
py
(
service
,
"???"
,
servicelen
);
strlc
py
(
service
,
"???"
,
servicelen
);
}
return
rc
;
...
...
src/backend/nodes/print.c
View file @
4ab8fcba
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.8
3 2007/01/20 20:45:38 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.8
4 2007/02/10 14:58:54 petere
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -574,28 +574,28 @@ print_plan_recursive(Plan *p, Query *parsetree, int indentLevel, char *label)
RangeTblEntry
*
rte
;
rte
=
rt_fetch
(((
Scan
*
)
p
)
->
scanrelid
,
parsetree
->
rtable
);
StrNC
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
strlc
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
}
else
if
(
IsA
(
p
,
IndexScan
))
{
RangeTblEntry
*
rte
;
rte
=
rt_fetch
(((
IndexScan
*
)
p
)
->
scan
.
scanrelid
,
parsetree
->
rtable
);
StrNC
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
strlc
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
}
else
if
(
IsA
(
p
,
FunctionScan
))
{
RangeTblEntry
*
rte
;
rte
=
rt_fetch
(((
FunctionScan
*
)
p
)
->
scan
.
scanrelid
,
parsetree
->
rtable
);
StrNC
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
strlc
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
}
else
if
(
IsA
(
p
,
ValuesScan
))
{
RangeTblEntry
*
rte
;
rte
=
rt_fetch
(((
ValuesScan
*
)
p
)
->
scan
.
scanrelid
,
parsetree
->
rtable
);
StrNC
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
strlc
py
(
extraInfo
,
rte
->
eref
->
aliasname
,
NAMEDATALEN
);
}
else
extraInfo
[
0
]
=
'\0'
;
...
...
src/backend/postmaster/pgarch.c
View file @
4ab8fcba
...
...
@@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.2
8 2007/01/05 22:19:36 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/pgarch.c,v 1.2
9 2007/02/10 14:58:54 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -429,14 +429,14 @@ pgarch_archiveXlog(char *xlog)
case
'p'
:
/* %p: relative path of source file */
sp
++
;
StrNC
py
(
dp
,
pathname
,
endp
-
dp
);
strlc
py
(
dp
,
pathname
,
endp
-
dp
);
make_native_path
(
dp
);
dp
+=
strlen
(
dp
);
break
;
case
'f'
:
/* %f: filename of source file */
sp
++
;
StrNC
py
(
dp
,
xlog
,
endp
-
dp
);
strlc
py
(
dp
,
xlog
,
endp
-
dp
);
dp
+=
strlen
(
dp
);
break
;
case
'%'
:
...
...
src/backend/postmaster/postmaster.c
View file @
4ab8fcba
...
...
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.51
8 2007/02/08 15:46:04 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.51
9 2007/02/10 14:58:54 petere
Exp $
*
* NOTES
*
...
...
@@ -3828,7 +3828,7 @@ save_backend_variables(BackendParameters * param, Port *port,
memcpy
(
&
param
->
port
,
port
,
sizeof
(
Port
));
write_inheritable_socket
(
&
param
->
portsocket
,
port
->
sock
,
childPid
);
StrNC
py
(
param
->
DataDir
,
DataDir
,
MAXPGPATH
);
strlc
py
(
param
->
DataDir
,
DataDir
,
MAXPGPATH
);
memcpy
(
&
param
->
ListenSocket
,
&
ListenSocket
,
sizeof
(
ListenSocket
));
...
...
@@ -3859,14 +3859,14 @@ save_backend_variables(BackendParameters * param, Port *port,
memcpy
(
&
param
->
syslogPipe
,
&
syslogPipe
,
sizeof
(
syslogPipe
));
StrNC
py
(
param
->
my_exec_path
,
my_exec_path
,
MAXPGPATH
);
strlc
py
(
param
->
my_exec_path
,
my_exec_path
,
MAXPGPATH
);
StrNC
py
(
param
->
pkglib_path
,
pkglib_path
,
MAXPGPATH
);
strlc
py
(
param
->
pkglib_path
,
pkglib_path
,
MAXPGPATH
);
StrNC
py
(
param
->
ExtraOptions
,
ExtraOptions
,
MAXPGPATH
);
strlc
py
(
param
->
ExtraOptions
,
ExtraOptions
,
MAXPGPATH
);
StrNC
py
(
param
->
lc_collate
,
setlocale
(
LC_COLLATE
,
NULL
),
LOCALE_NAME_BUFLEN
);
StrNC
py
(
param
->
lc_ctype
,
setlocale
(
LC_CTYPE
,
NULL
),
LOCALE_NAME_BUFLEN
);
strlc
py
(
param
->
lc_collate
,
setlocale
(
LC_COLLATE
,
NULL
),
LOCALE_NAME_BUFLEN
);
strlc
py
(
param
->
lc_ctype
,
setlocale
(
LC_CTYPE
,
NULL
),
LOCALE_NAME_BUFLEN
);
return
true
;
}
...
...
@@ -4060,11 +4060,11 @@ restore_backend_variables(BackendParameters * param, Port *port)
memcpy
(
&
syslogPipe
,
&
param
->
syslogPipe
,
sizeof
(
syslogPipe
));
StrNC
py
(
my_exec_path
,
param
->
my_exec_path
,
MAXPGPATH
);
strlc
py
(
my_exec_path
,
param
->
my_exec_path
,
MAXPGPATH
);
StrNC
py
(
pkglib_path
,
param
->
pkglib_path
,
MAXPGPATH
);
strlc
py
(
pkglib_path
,
param
->
pkglib_path
,
MAXPGPATH
);
StrNC
py
(
ExtraOptions
,
param
->
ExtraOptions
,
MAXPGPATH
);
strlc
py
(
ExtraOptions
,
param
->
ExtraOptions
,
MAXPGPATH
);
setlocale
(
LC_COLLATE
,
param
->
lc_collate
);
setlocale
(
LC_CTYPE
,
param
->
lc_ctype
);
...
...
src/backend/tcop/postgres.c
View file @
4ab8fcba
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.52
1 2007/01/05 22:19:39 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.52
2 2007/02/10 14:58:55 petere
Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
...
...
@@ -2846,7 +2846,7 @@ PostgresMain(int argc, char *argv[], const char *username)
case
'r'
:
/* send output (stdout and stderr) to the given file */
if
(
secure
)
StrNC
py
(
OutputFileName
,
optarg
,
MAXPGPATH
);
strlc
py
(
OutputFileName
,
optarg
,
MAXPGPATH
);
break
;
case
'S'
:
...
...
src/backend/utils/misc/guc-file.l
View file @
4ab8fcba
...
...
@@ -4,7 +4,7 @@
*
* Copyright (c) 2000-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.4
6 2007/01/05 22:19:46 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc-file.l,v 1.4
7 2007/02/10 14:58:55 petere
Exp $
*/
%{
...
...
@@ -218,7 +218,7 @@ ParseConfigFile(const char *config_file, const char *calling_file,
if (!is_absolute_path(config_file))
{
Assert(calling_file != NULL);
StrNCpy(abs_path, calling_file, MAXPGPATH
);
strlcpy(abs_path, calling_file, sizeof(abs_path)
);
get_parent_directory(abs_path);
join_path_components(abs_path, abs_path, config_file);
canonicalize_path(abs_path);
...
...
src/bin/initdb/initdb.c
View file @
4ab8fcba
...
...
@@ -42,7 +42,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.13
1 2007/02/01 19:10:28 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.13
2 2007/02/10 14:58:55 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2706,7 +2706,7 @@ main(int argc, char *argv[])
char
full_path
[
MAXPGPATH
];
if
(
find_my_exec
(
argv
[
0
],
full_path
)
<
0
)
StrNCpy
(
full_path
,
progname
,
MAXPGPATH
);
strlcpy
(
full_path
,
progname
,
sizeof
(
full_path
)
);
if
(
ret
==
-
1
)
fprintf
(
stderr
,
...
...
src/bin/pg_ctl/pg_ctl.c
View file @
4ab8fcba
...
...
@@ -4,7 +4,7 @@
*
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.7
7 2007/02/01 19:10:28 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.7
8 2007/02/10 14:58:55 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -416,7 +416,7 @@ test_postmaster_connection(void)
/* advance past whitespace/quoting */
while
(
isspace
((
unsigned
char
)
*
p
)
||
*
p
==
'\''
||
*
p
==
'"'
)
p
++
;
StrNC
py
(
portstr
,
p
,
Min
(
strcspn
(
p
,
"
\"
'"
WHITESPACE
)
+
1
,
strlc
py
(
portstr
,
p
,
Min
(
strcspn
(
p
,
"
\"
'"
WHITESPACE
)
+
1
,
sizeof
(
portstr
)));
/* keep looking, maybe there is another -p */
}
...
...
@@ -449,7 +449,7 @@ test_postmaster_connection(void)
p
++
;
while
(
isspace
((
unsigned
char
)
*
p
))
p
++
;
StrNC
py
(
portstr
,
p
,
Min
(
strcspn
(
p
,
"#"
WHITESPACE
)
+
1
,
strlc
py
(
portstr
,
p
,
Min
(
strcspn
(
p
,
"#"
WHITESPACE
)
+
1
,
sizeof
(
portstr
)));
/* keep looking, maybe there is another */
}
...
...
@@ -458,7 +458,7 @@ test_postmaster_connection(void)
/* environment */
if
(
!*
portstr
&&
getenv
(
"PGPORT"
)
!=
NULL
)
StrNC
py
(
portstr
,
getenv
(
"PGPORT"
),
sizeof
(
portstr
));
strlc
py
(
portstr
,
getenv
(
"PGPORT"
),
sizeof
(
portstr
));
/* default */
if
(
!*
portstr
)
...
...
@@ -594,7 +594,7 @@ do_start(void)
char
full_path
[
MAXPGPATH
];
if
(
find_my_exec
(
argv0
,
full_path
)
<
0
)
StrNCpy
(
full_path
,
progname
,
MAXPGPATH
);
strlcpy
(
full_path
,
progname
,
sizeof
(
full_path
)
);
if
(
ret
==
-
1
)
write_stderr
(
_
(
"The program
\"
postgres
\"
is needed by %s "
...
...
src/bin/pg_dump/pg_dumpall.c
View file @
4ab8fcba
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.
89 2007/01/25 03:30:43 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.
90 2007/02/10 14:58:55 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -150,7 +150,7 @@ main(int argc, char *argv[])
char
full_path
[
MAXPGPATH
];
if
(
find_my_exec
(
argv
[
0
],
full_path
)
<
0
)
StrNCpy
(
full_path
,
progname
,
MAXPGPATH
);
strlcpy
(
full_path
,
progname
,
sizeof
(
full_path
)
);
if
(
ret
==
-
1
)
fprintf
(
stderr
,
...
...
src/bin/pg_resetxlog/pg_resetxlog.c
View file @
4ab8fcba
...
...
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.5
6 2007/02/01 19:10:29 momjian
Exp $
* $PostgreSQL: pgsql/src/bin/pg_resetxlog/pg_resetxlog.c,v 1.5
7 2007/02/10 14:58:55 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -498,14 +498,14 @@ GuessControlValues(void)
fprintf
(
stderr
,
_
(
"%s: invalid LC_COLLATE setting
\n
"
),
progname
);
exit
(
1
);
}
StrNCpy
(
ControlFile
.
lc_collate
,
localeptr
,
LOCALE_NAME_BUFLEN
);
strlcpy
(
ControlFile
.
lc_collate
,
localeptr
,
sizeof
(
ControlFile
.
lc_collate
)
);
localeptr
=
setlocale
(
LC_CTYPE
,
""
);
if
(
!
localeptr
)
{
fprintf
(
stderr
,
_
(
"%s: invalid LC_CTYPE setting
\n
"
),
progname
);
exit
(
1
);
}
StrNCpy
(
ControlFile
.
lc_ctype
,
localeptr
,
LOCALE_NAME_BUFLEN
);
strlcpy
(
ControlFile
.
lc_ctype
,
localeptr
,
sizeof
(
ControlFile
.
lc_ctype
)
);
/*
* XXX eventually, should try to grovel through old XLOG to develop more
...
...
src/interfaces/libpq/fe-auth.c
View file @
4ab8fcba
...
...
@@ -10,7 +10,7 @@
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.12
2 2007/01/05 22:20:00 momjian
Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.12
3 2007/02/10 14:58:55 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -418,7 +418,7 @@ pg_password_sendauth(PGconn *conn, const char *password, AuthRequest areq)
{
char
salt
[
3
];
StrNCpy
(
salt
,
conn
->
cryptSalt
,
3
);
strlcpy
(
salt
,
conn
->
cryptSalt
,
sizeof
(
salt
)
);
crypt_pwd
=
crypt
(
password
,
salt
);
break
;
}
...
...
src/interfaces/libpq/fe-connect.c
View file @
4ab8fcba
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.34
2 2007/02/08 11:10:27
petere Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.34
3 2007/02/10 14:58:55
petere Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2208,7 +2208,7 @@ internal_cancel(SockAddr *raddr, int be_pid, int be_key,
*/
if
((
tmpsock
=
socket
(
raddr
->
addr
.
ss_family
,
SOCK_STREAM
,
0
))
<
0
)
{
StrNC
py
(
errbuf
,
"PQcancel() -- socket() failed: "
,
errbufsize
);
strlc
py
(
errbuf
,
"PQcancel() -- socket() failed: "
,
errbufsize
);
goto
cancel_errReturn
;
}
retry3:
...
...
@@ -2218,7 +2218,7 @@ retry3:
if
(
SOCK_ERRNO
==
EINTR
)
/* Interrupted system call - we'll just try again */
goto
retry3
;
StrNC
py
(
errbuf
,
"PQcancel() -- connect() failed: "
,
errbufsize
);
strlc
py
(
errbuf
,
"PQcancel() -- connect() failed: "
,
errbufsize
);
goto
cancel_errReturn
;
}
...
...
@@ -2239,7 +2239,7 @@ retry4:
if
(
SOCK_ERRNO
==
EINTR
)
/* Interrupted system call - we'll just try again */
goto
retry4
;
StrNC
py
(
errbuf
,
"PQcancel() -- send() failed: "
,
errbufsize
);
strlc
py
(
errbuf
,
"PQcancel() -- send() failed: "
,
errbufsize
);
goto
cancel_errReturn
;
}
...
...
@@ -2297,7 +2297,7 @@ PQcancel(PGcancel *cancel, char *errbuf, int errbufsize)
{
if
(
!
cancel
)
{
StrNC
py
(
errbuf
,
"PQcancel() -- no cancel object supplied"
,
errbufsize
);
strlc
py
(
errbuf
,
"PQcancel() -- no cancel object supplied"
,
errbufsize
);
return
FALSE
;
}
...
...
@@ -2328,7 +2328,7 @@ PQrequestCancel(PGconn *conn)
if
(
conn
->
sock
<
0
)
{
StrNC
py
(
conn
->
errorMessage
.
data
,
strlc
py
(
conn
->
errorMessage
.
data
,
"PQrequestCancel() -- connection is not open
\n
"
,
conn
->
errorMessage
.
maxlen
);
conn
->
errorMessage
.
len
=
strlen
(
conn
->
errorMessage
.
data
);
...
...
@@ -3609,7 +3609,7 @@ PasswordFromFile(char *hostname, char *port, char *dbname, char *username)
if
((
passfile_env
=
getenv
(
"PGPASSFILE"
))
!=
NULL
)
/* use the literal path from the environment, if set */
StrNCpy
(
pgpassfile
,
passfile_env
,
MAXPGPATH
);
strlcpy
(
pgpassfile
,
passfile_env
,
sizeof
(
pgpassfile
)
);
else
{
char
homedir
[
MAXPGPATH
];
...
...
@@ -3700,7 +3700,7 @@ pqGetHomeDirectory(char *buf, int bufsize)
if
(
pqGetpwuid
(
geteuid
(),
&
pwdstr
,
pwdbuf
,
sizeof
(
pwdbuf
),
&
pwd
)
!=
0
)
return
false
;
StrNC
py
(
buf
,
pwd
->
pw_dir
,
bufsize
);
strlc
py
(
buf
,
pwd
->
pw_dir
,
bufsize
);
return
true
;
#else
char
tmppath
[
MAX_PATH
];
...
...
src/timezone/pgtz.c
View file @
4ab8fcba
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.
49 2007/01/05 22:20:04 momjian
Exp $
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.
50 2007/02/10 14:58:55 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -566,7 +566,7 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry * tt,
if
(
score
>
*
bestscore
)
{
*
bestscore
=
score
;
StrNC
py
(
bestzonename
,
tzdirsub
,
TZ_STRLEN_MAX
+
1
);
strlc
py
(
bestzonename
,
tzdirsub
,
TZ_STRLEN_MAX
+
1
);
}
else
if
(
score
==
*
bestscore
)
{
...
...
@@ -574,7 +574,7 @@ scan_available_timezones(char *tzdir, char *tzdirsub, struct tztry * tt,
if
(
strlen
(
tzdirsub
)
<
strlen
(
bestzonename
)
||
(
strlen
(
tzdirsub
)
==
strlen
(
bestzonename
)
&&
strcmp
(
tzdirsub
,
bestzonename
)
<
0
))
StrNC
py
(
bestzonename
,
tzdirsub
,
TZ_STRLEN_MAX
+
1
);
strlc
py
(
bestzonename
,
tzdirsub
,
TZ_STRLEN_MAX
+
1
);
}
}
...
...
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