Bug 117526 - m4 creates sendmail.cf with additional blank lines
Summary: m4 creates sendmail.cf with additional blank lines
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: m4
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-03-04 22:33 UTC by Don Levey
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2004-04-20 13:08:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
sendmail.mc file (6.58 KB, text/plain)
2004-03-04 22:35 UTC, Don Levey
no flags Details
First 100 or so lines of faulty sendmail.cf created by m4 (3.18 KB, text/plain)
2004-03-04 22:36 UTC, Don Levey
no flags Details
Diff to original .mc file (3.77 KB, patch)
2004-03-04 22:48 UTC, Kaj J. Niemi
no flags Details | Diff
File as it sits on the machine (6.44 KB, text/plain)
2004-03-05 00:18 UTC, Don Levey
no flags Details

Description Don Levey 2004-03-04 22:33:16 UTC
Description of problem:
The sendmail.mc file (below) creates an invalid sendmail.cf file
when run through m4.  The .cf file has approx 23 blank lines
between line 68 and 90; starting sendmail with such a file
gives an error:
Starting sendmail: 554 5.0.0 /etc/mail/sendmail.cf: line 68: unknown 
configuration line "
"

Deleting the extra blank lines permits sendmail to start.
I've been over and over the .mc file but can't find anything that 
would account for this.

Version-Release number of selected component (if applicable):
m4-1.4.1-14

How reproducible:
Every Time

Steps to Reproduce:
1. Save the above text of the sendmail.mc file to disk
2. From command line, run 'm4 [filename.mc] > [filename.cf]
3. open the resulting .cf file and observe extra blank lines starting 
at line 68.
4. For extra credit, use above-created cf file as sendmail.cf, 
restart sendmail.
    
  
Actual results:
I receive a .cf file with 23 extra blank lines starting at line 68.

Expected results:
I should have received a .cf file without those extra lines.

Additional info:

Comment 1 Don Levey 2004-03-04 22:35:27 UTC
Created attachment 98305 [details]
sendmail.mc file

Comment 2 Don Levey 2004-03-04 22:36:08 UTC
Created attachment 98306 [details]
First 100 or so lines of faulty sendmail.cf created by m4

Comment 3 Kaj J. Niemi 2004-03-04 22:48:09 UTC
Created attachment 98307 [details]
Diff to original .mc file

This is NOT a bug. Your editor (or you) mangle the lines somehow.

[kajtzu@jill ~/a]% cp original.mc new.mc
[kajtzu@jill ~/a]% patch -p0 < workingmc.diff
patching file new.mc
[kajtzu@jill ~/a]% m4 new.mc > sendmail.cf
[78 kajtzu@jill ~/a]% /usr/sbin/sendmail -C./sendmail.cf
./sendmail.cf: line 170: fileclass: cannot open '/etc/mail/generics-domains':
No such file or directory

(the error is normal as I don't use a generics-domains file but the new
sendmailcf specified it)

Comment 4 Don Levey 2004-03-05 00:18:39 UTC
Created attachment 98308 [details]
File as it sits on the machine

Previous example was translated through a Windows machine.  This version is as
it sits on the Fedora box.

When I attempt to apply the patch as suggested in the previous message, I get
the following output:
root@davinci root]# patch -p0 < workingmc.diff
patching file new.mc
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n] y
Hunk #1 FAILED at 13.
Hunk #2 FAILED at 37.
Hunk #3 FAILED at 65.
Hunk #4 FAILED at 88.
4 out of 4 hunks FAILED -- saving rejects to file new.mc.rej

I am using vi as an editor at the command-line.  Can you give me any more
details as to how I (or vi) might be mangling these lines?

Comment 5 Don Levey 2004-03-05 00:45:02 UTC
...The thrust of the original problem, which I lost before entering
the original entry:

If my input .mc file is mangling the lines somehow, why does m4
continue and output what would seem to be a valid file for use?  Why
doesn't it error out, as the output is not valid?

Comment 6 Thomas Woerner 2004-04-20 13:08:32 UTC
I am sorry, but this is the way m4 works.
Closing as wontfix.

Comment 7 Don Levey 2004-04-20 13:14:49 UTC
Uh, *what* is the way that m4 works?
Just adding random lines?  What is it that's actually causing the 
problem?  If m4 can be expected to produce this output every time, 
there must be something in the input which is doing it - what is it?


Note You need to log in before you can comment on or make changes to this bug.