Bug 117526 - m4 creates sendmail.cf with additional blank lines
m4 creates sendmail.cf with additional blank lines
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: m4 (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Thomas Woerner
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-03-04 17:33 EST by Don Levey
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-20 09:08:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sendmail.mc file (6.58 KB, text/plain)
2004-03-04 17:35 EST, 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 17:36 EST, Don Levey
no flags Details
Diff to original .mc file (3.77 KB, patch)
2004-03-04 17:48 EST, Kaj J. Niemi
no flags Details | Diff
File as it sits on the machine (6.44 KB, text/plain)
2004-03-04 19:18 EST, Don Levey
no flags Details

  None (edit)
Description Don Levey 2004-03-04 17:33:16 EST
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 17:35:27 EST
Created attachment 98305 [details]
sendmail.mc file
Comment 2 Don Levey 2004-03-04 17:36:08 EST
Created attachment 98306 [details]
First 100 or so lines of faulty sendmail.cf created by m4
Comment 3 Kaj J. Niemi 2004-03-04 17:48:09 EST
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-04 19:18:39 EST
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-04 19:45:02 EST
...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 09:08:32 EDT
I am sorry, but this is the way m4 works.
Closing as wontfix.
Comment 7 Don Levey 2004-04-20 09:14:49 EDT
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.