S.u.S.E. 5.2 lpc Vulnerabilty
BID:328
Info
S.u.S.E. 5.2 lpc Vulnerabilty
| Bugtraq ID: | 328 |
| Class: | Boundary Condition Error |
| CVE: | |
| Remote: | No |
| Local: | Yes |
| Published: | Feb 03 1999 12:00AM |
| Updated: | Feb 03 1999 12:00AM |
| Credit: | First posted to BugTraq by xnec <[email protected]> on Feb 3, 1999. |
| Vulnerable: |
SuSE Linux 5.2 |
| Not Vulnerable: |
SuSE Linux 5.1 SuSE Linux 5.0 |
Solution / Fix
S.u.S.E. 5.2 lpc Vulnerabilty
Solution:
There is an alternative lpc suite that can be used, or the patch below.
lpr, the alternative to lpc, is included in the S.u.S.E. 5.2 source library in the form of lpr-tlr-971016.tar.gz (or newer).
If you wish to continue using the vulnerable version of lpc, apply the following patch:
--- /usr/src/packages/SOURCES/origplp/plp-4.0.3/src/common/control_ops.c Thu Jun 15 14:09:12 1995
+++ /usr/src/packages/SOURCES/newplp/plp-4.0.3/src/common/control_ops.c Wed Feb
3 12:36:17 1999
@@ -676,7 +676,7 @@
att_mark = False;
if ((afp = fopen_daemon (Attach_file, "r"))) { /* Try to open attach file */
- if (fscanf (afp, "%s", afname) == 1) {
+ if (fgets (afname, sizeof(afname), afp) != NULL) {
if (strsame (afname, Printer)) {
fatal (XLOG_INFO, "Printer '%s' attached to itself", Printer);
}
@@ -1622,7 +1622,7 @@
if ((s = C_abort ())) {
if (stat (Attach_file, &statb) == 0) {
if ((afp = fopen_daemon (Attach_file, "r"))) {
- if (fscanf (afp, "%s", afname) != 1) {
+ if (fgets (afname, sizeof(afname), afp) != NULL) {
fatal (XLOG_INFO, "attach file for printer %s corrupted!",
Printer);
}
--- /usr/src/packages/SOURCES/origplp/plp-4.0.3/src/common/displayq.c Tue Aug
29 12:44:35 1995
+++ /usr/src/packages/SOURCES/newplp/plp-4.0.3/src/common/displayq.c Wed Feb
3 12:35:37 1999
@@ -99,7 +99,7 @@
* check to see if attached to another printerq, alter printer if attached
*/
if (Attach_file && *Attach_file && ((afp = fopen (Attach_file, "r")))) {
- if (fscanf (afp, "%s", afname) == 1) {
+ if (fgets (afname, sizeof(afname), afp) != NULL) {
if (strsame (afname, Printer)) {
fatal (XLOG_INFO, "Printer '%s' attached to itself", Printer);
}
Solution:
There is an alternative lpc suite that can be used, or the patch below.
lpr, the alternative to lpc, is included in the S.u.S.E. 5.2 source library in the form of lpr-tlr-971016.tar.gz (or newer).
If you wish to continue using the vulnerable version of lpc, apply the following patch:
--- /usr/src/packages/SOURCES/origplp/plp-4.0.3/src/common/control_ops.c Thu Jun 15 14:09:12 1995
+++ /usr/src/packages/SOURCES/newplp/plp-4.0.3/src/common/control_ops.c Wed Feb
3 12:36:17 1999
@@ -676,7 +676,7 @@
att_mark = False;
if ((afp = fopen_daemon (Attach_file, "r"))) { /* Try to open attach file */
- if (fscanf (afp, "%s", afname) == 1) {
+ if (fgets (afname, sizeof(afname), afp) != NULL) {
if (strsame (afname, Printer)) {
fatal (XLOG_INFO, "Printer '%s' attached to itself", Printer);
}
@@ -1622,7 +1622,7 @@
if ((s = C_abort ())) {
if (stat (Attach_file, &statb) == 0) {
if ((afp = fopen_daemon (Attach_file, "r"))) {
- if (fscanf (afp, "%s", afname) != 1) {
+ if (fgets (afname, sizeof(afname), afp) != NULL) {
fatal (XLOG_INFO, "attach file for printer %s corrupted!",
Printer);
}
--- /usr/src/packages/SOURCES/origplp/plp-4.0.3/src/common/displayq.c Tue Aug
29 12:44:35 1995
+++ /usr/src/packages/SOURCES/newplp/plp-4.0.3/src/common/displayq.c Wed Feb
3 12:35:37 1999
@@ -99,7 +99,7 @@
* check to see if attached to another printerq, alter printer if attached
*/
if (Attach_file && *Attach_file && ((afp = fopen (Attach_file, "r")))) {
- if (fscanf (afp, "%s", afname) == 1) {
+ if (fgets (afname, sizeof(afname), afp) != NULL) {
if (strsame (afname, Printer)) {
fatal (XLOG_INFO, "Printer '%s' attached to itself", Printer);
}
References
S.u.S.E. 5.2 lpc Vulnerabilty
References:
References: