Lines 1-63
Link Here
|
1 |
--- pam_mysql.c.old Sun Sep 24 02:26:17 2000 |
1 |
--- Makefile.orig Thu Nov 21 05:13:01 2002 |
2 |
+++ pam_mysql.c Sun Sep 24 02:42:23 2000 |
2 |
+++ Makefile Thu Feb 13 13:39:07 2003 |
3 |
@@ -14,7 +14,6 @@ |
3 |
@@ -3,13 +3,9 @@ |
4 |
#include <unistd.h> |
4 |
ifndef FULL_LINUX_PAM_SOURCE_TREE |
5 |
#include <syslog.h> |
5 |
export DYNAMIC=-DPAM_DYNAMIC |
6 |
#include <stdarg.h> |
6 |
export CC=gcc |
7 |
-#include <alloca.h> |
7 |
-export CFLAGS=-O2 -Dlinux -DLINUX_PAM \ |
8 |
#include <string.h> |
8 |
- -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \ |
|
|
9 |
- -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional \ |
10 |
- -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \ |
11 |
- -Wshadow -pedantic -fPIC |
12 |
+export CFLAGS=-O2 -I/usr/local/include -fPIC |
13 |
export MKDIR=mkdir -p |
14 |
-export LD_D=gcc -shared -Xlinker -x -L/usr/lib/mysql -lz |
15 |
+export LD_D=gcc -shared -Xlinker -x -L/usr/local/lib/mysql -lz |
16 |
endif |
9 |
|
17 |
|
10 |
#include <mysql/mysql.h> |
18 |
# |
11 |
@@ -332,40 +331,40 @@ |
|
|
12 |
} |
13 |
strcpy (junk, argv[i]); |
14 |
if ((strchr (junk, (int) '=') != NULL)) { |
15 |
- strncpy (mybuf, strtok (junk, "="), 255); |
16 |
- strncpy (myval, strtok (NULL, "="), 255); |
17 |
+ strlcpy (mybuf, strtok (junk, "="), 255); |
18 |
+ strlcpy (myval, strtok (NULL, "="), 255); |
19 |
free (junk); |
20 |
if (!strcasecmp ("host", mybuf)) { |
21 |
- strncpy (options.host, myval, 255); |
22 |
+ strlcpy (options.host, myval, 255); |
23 |
D (("host changed.")); |
24 |
} else if (!strcasecmp ("where", mybuf)) { |
25 |
while ( (mj = strtok(NULL,"=")) != NULL ) |
26 |
{ |
27 |
- strcat(myval, "="); |
28 |
- strcat(myval, mj); |
29 |
+ strlcat(myval, "=", 255); |
30 |
+ strlcat(myval, mj, 255); |
31 |
} |
32 |
- strncpy (options.where, myval, 256); |
33 |
+ strlcpy (options.where, myval, 256); |
34 |
D (("where changed.")); |
35 |
#ifdef DEBUG |
36 |
syslog(LOG_ERR, "pam_mysql: where now is %s", options.where); |
37 |
#endif |
38 |
} else if (!strcasecmp ("db", mybuf)) { |
39 |
- strncpy (options.database, myval, 16); |
40 |
+ strlcpy (options.database, myval, 16); |
41 |
D (("database changed.")); |
42 |
} else if (!strcasecmp ("user", mybuf)) { |
43 |
- strncpy (options.dbuser, myval, 16); |
44 |
+ strlcpy (options.dbuser, myval, 16); |
45 |
D (("dbuser changed.")); |
46 |
} else if (!strcasecmp ("passwd", mybuf)) { |
47 |
- strncpy (options.dbpasswd, myval, 16); |
48 |
+ strlcpy (options.dbpasswd, myval, 16); |
49 |
D (("dbpasswd changed.")); |
50 |
} else if (!strcasecmp ("table", mybuf)) { |
51 |
- strncpy (options.table, myval, 16); |
52 |
+ strlcpy (options.table, myval, 16); |
53 |
D (("table changed.")); |
54 |
} else if (!strcasecmp ("usercolumn", mybuf)) { |
55 |
- strncpy (options.usercolumn, myval, 16); |
56 |
+ strlcpy (options.usercolumn, myval, 16); |
57 |
D (("usercolumn changed.")); |
58 |
} else if (!strcasecmp ("passwdcolumn", mybuf)) { |
59 |
- strncpy (options.passwdcolumn, myval, 16); |
60 |
+ strlcpy (options.passwdcolumn, myval, 16); |
61 |
D (("passwdcolumn changed.")); |
62 |
} else if (!strcasecmp ("crypt", mybuf)) { |
63 |
if ((!strcmp (myval, "1")) || |