Forum: Cfengine Help
Subject: Re: segfault using edit_line with 3.1.0b2
Author: babudro
Link to topic: https://cfengine.com/forum/read.php?3,18764,18766#msg-18766

Hi.  Thanks for the reply.

I did think of trying the SVN version, but only my Windows box has web access 
-- corporate security policies won't allow http/https access from the servers, 
and I am also not allowed to install software on my Windows box.  If there is a 
ViewVC-type of web interface where I could tar up a snapshot of the svn, please 
let me know and I can grab it from my Windows machine and transfer it to the 
servers.

My policy is rather small yet, just this:


# Authentication promises
# - local password policies
# - LDAP policies and settings
#
# 2010-10-13 ptab Creation
# 2010-10-15 ptab Added /etc/pam.d/system-auth-ac stuff

bundle agent auth_defaults 
{ files:
    linux::
      "/etc/login.defs"
      comment       => "Maintain password policy settings",
      create        => "false",
      edit_defaults => etc_files,
      edit_line     => pass_days("90", "1", "8");

      "/etc/default/useradd"
      comment       => "Maintain new user defaults",
      create        => "false",
      edit_defaults => etc_files,
      edit_line     => useradd_defaults("21");

      "/etc/pam.d/system-auth-ac"
      comment       => "Maintain PAM system-auth-ac file",
      create        => "true",
      edit_defaults => empty,
      edit_line     => pam_auth;
}

bundle edit_line pass_days(maxday, minday, minlen)
{ field_edits:
    "^(PASS_MAX_DAYS\t)([0-9]+)$"
      edit_field    => col("\t","2","$(maxday)","set"),
      comment       => "Reset PASS_MAX_DAYS log-in value according to policy, 
if necessary.";

    "^(PASS_MIN_DAYS\t)([0-9]+)$"
      edit_field    => col("\t","2","$(minday)","set"),
      comment       => "Reset PASS_MIN_DAYS log-in value according to policy, 
if necessary.";

    "^(PASS_MIN_LEN\t)([0-9]+)$"
      edit_field    => col("\t","2","$(minlen)","set"),
      comment       => "Reset PASS_MIN_LEN log-in value according to policy, if 
necessary.";
}

bundle edit_line useradd_defaults(inactive)
{ field_edits:
    "^(INACTIVE=)([0-9]+)$"
      edit_field    => col("=","2","$(inactive)","set"),
      comment       => "Reset INACTIVE value according to policy, if 
necessary.";
}

bundle edit_line pam_auth
{ insert_lines:
'# PAM system authentication configuration
(various lines are here...)
';
}

body edit_defaults etc_files
{ empty_file_before_editing => "false";         #|We will just verify & 
re-write single lines
  edit_backup               => "true";          #|Keep a back-up if it changes
  max_file_size             => "64k";           #|Most config files are under 
64k
  }



Backtrace on a 64-bit box per your instructions:


GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/local/sbin/cf-agent...(no debugging symbols 
found)...done.
(gdb) run
Starting program: /usr/local/sbin/cf-agent -IKb auth_defaults -f ./promises.cf

Detaching after fork from child process 9725.
Detaching after fork from child process 9726.
 >> Using command line specified bundlesequence
 -> Setting field sub-value 90 in /etc/login.defs
 -> Edited field inside file object /etc/login.defs
Edited file /etc/login.defs

Program received signal SIGSEGV, Segmentation fault.
0x0000000000452b04 in DeleteRvalItem ()
(gdb) back
#0  0x0000000000452b04 in DeleteRvalItem ()
#1  0x0000000000452b18 in DeleteRvalItem ()
#2  0x0000000000424694 in EditLineByColumn ()
#3  0x0000000000424ea2 in EditColumns ()
#4  0x000000000042614f in VerifyColumnEdits ()
#5  0x0000000000426563 in KeepEditLinePromise ()
#6  0x000000000044942d in ExpandPromiseAndDo ()
#7  0x0000000000449b39 in ExpandPromise ()
#8  0x00000000004266c2 in ScheduleEditLineOperations ()
#9  0x00000000004224c7 in ScheduleEditOperation ()
#10 0x000000000041d0a8 in VerifyFilePromise ()
#11 0x000000000042abfc in LocateFilePromiserGroup ()
#12 0x00000000004061b1 in FindAndVerifyFilesPromises ()
#13 0x0000000000404ac4 in KeepAgentPromise ()
#14 0x000000000044942d in ExpandPromiseAndDo ()
#15 0x0000000000449b39 in ExpandPromise ()
#16 0x0000000000404d6d in ScheduleAgentOperations ()
#17 0x0000000000404f8c in KeepPromiseBundles ()
#18 0x0000000000405b63 in KeepPromises ()
#19 0x00000000004060ed in main ()
(gdb)


What do you think?

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to