summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2000-08-29 14:38:38 +0000
committerGerald Carter <jerry@samba.org>2000-08-29 14:38:38 +0000
commit92d1e90d497b7795dd671c1a52092ef7ba6d542b (patch)
treed8abb52a749a3867b2559c9dbcd34625a1bc930a /source3/smbd
parent28c07a5e9f45b6a7e0f8f1419572a24c24fa883b (diff)
downloadsamba-92d1e90d497b7795dd671c1a52092ef7ba6d542b.tar.gz
samba-92d1e90d497b7795dd671c1a52092ef7ba6d542b.tar.bz2
samba-92d1e90d497b7795dd671c1a52092ef7ba6d542b.zip
fixed previous bug spotted by Elrond in get_printerdrivernumber().
Thought I had already committed this. jerry (This used to be commit 2ceb704c3d06a92b97ba67ac82c007a7ba084b75)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/lanman.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 712016285e..170bb9e6bd 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -542,16 +542,16 @@ static void fill_printq_info_52(connection_struct *conn, int snum, int uLevel,
desc->errcode=NERR_notsupported;
return;
}
- else
+
+ /* lookup the long printer driver name in the file description */
+ for (i=0;lines[i] && !ok;i++)
{
- /* lookup the long printer driver name in the file description */
- for (i=0;lines[i] && !ok;i++)
+ p = lines[i];
+ if (next_token(&p,tok,":",sizeof(tok)) &&
+ (strlen(lp_printerdriver(snum)) == strlen(tok)) &&
+ (!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
{
- p = lines[i];
- if (next_token(&p,tok,":",sizeof(tok)) &&
- (strlen(lp_printerdriver(snum)) == strlen(tok)) &&
- (!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
- ok = True;
+ ok = True;
}
}
}
@@ -777,17 +777,18 @@ static int get_printerdrivernumber(int snum)
if (!lines)
{
DEBUG(3,("Can't open %s - %s\n", lp_driverfile(snum),strerror(errno)));
+ return 0;
}
- else
+
+ /* lookup the long printer driver name in the file description */
+ for (i=0;lines[i] && !ok;i++)
{
- /* lookup the long printer driver name in the file description */
- for (i=0;lines[i] && !ok;i++)
+ p = lines[i];
+ if (next_token(&p,tok,":",sizeof(tok)) &&
+ (strlen(lp_printerdriver(snum)) == strlen(tok)) &&
+ (!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
{
- p = lines[i];
- if (next_token(&p,tok,":",sizeof(tok)) &&
- (strlen(lp_printerdriver(snum)) == strlen(tok)) &&
- (!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
- ok = True;
+ ok = True;
}
}
}