Skip to content
Permalink
Branch: master
Commits on Sep 11, 2019
  1. Database Change and Connection

    newnix
    newnix committed Sep 11, 2019
    	* dfbeadm.sql
    		- Changed application_id to 999
    		- Aded index to track fstab files with their checksums
    		- Added optimization pass at the end of creation
    	
    	* fsrecord.h
    		- Add macros for validating SQLite database header information
    		- Add a macro for backwards compatibility purposes if the database layout changes 
    		- Add an enum to map hash functions recognized by the database
    	
    	* fsrecord.c
    		- connect_bedb() fleshed out to validate the database handle provided is NULL and 
    		  will ensure it's NULL on failure to connect prior to returning. Success is silent
    		  with a return code of 0
  2. Minor Fixes

    newnix
    newnix committed Sep 11, 2019
    	* fsrecord.h
    		- Declare testdb()
    	
    	* fsrecord.c
    		- Fix un-terminated comment, typos, and the call to munmap(2)
    		- Added a pointer to record the start of the mmap(2)'d reigon for the SQL file
  3. Database Initialization Loop Added

    newnix
    newnix committed Sep 11, 2019
    	* fsrecord.c
    		- init_bedb() now has a more fleshed out database initialization loop, 
    			it will need to be cleaned up and corrected, but should be functional at this point
Commits on Sep 10, 2019
  1. Continue Database Bootstrapping

    newnix
    newnix committed Sep 10, 2019
    	* fsrecord.c
    		- init_bedb() has additional tests around opening the file "dfbeadm.sql" and attempting to mmap(2) the contents.
    		- Added notes about the tangle of conditional tests that shuuld be reduced and working on changing the script name to a variable
Commits on Sep 9, 2019
  1. Add Version Info to Database

    newnix
    newnix committed Sep 9, 2019
    	* dfbeadm.sql
    		- Added placeholder user_version and application_id as 0
  2. New Dependency and Database Layout

    newnix
    newnix committed Sep 9, 2019
    	* README.md
    		- Add note that LibreSSL is going to be used for hashing algorithms in the recording database
    	
    	* dfbeadm.sql
    		- First draft of database generation script
Commits on Sep 8, 2019
  1. Work on Database Initialization

    newnix
    newnix committed Sep 8, 2019
    	* fsrecord.h
    		- Added macro for database absolute path length
    	
    	* fsrecord.c
    		- Removed erroneous <error.h>
    		- Added basic logic to check for and create the record database
  2. Continuing DB Bootstrap Process

    newnix
    newnix committed Sep 8, 2019
    	* README.md
    		- Added section for dependencies
    	
    	* fsrecord.c
    		- init_bedb() updated to handle config directory creation
  3. Continue Work on Record DB

    newnix
    newnix committed Sep 8, 2019
    	* README.md
    		- Fixed an issue with the outline's line spacing
    	
    	* fsrecord.c
    		- Added entry/exit printouts to all functions if dbg is true
    		- Added a check for root's EUID before beetstrapping the database in init_bedb()
    		- Added inclusions for sys/types.h and sys/stat.h for appropriate system checks
  4. Correct Referenced Manual Section

    newnix
    newnix committed Sep 8, 2019
    	
    	* README.md
    		- Corrected to refer to section 8 rather than section 1
  5. Begin Work on BE Records

    newnix
    newnix committed Sep 8, 2019
    	* Makefile
    		- Include fsrecord.c as a source file
    	
    	* dfbeadm.h
    		- Include stdbool.h
    		- Added version macros
    		- Added license info to the top
    	
    	* dfbeadm.c
    		- Removed needless #ifdef _LINUX
    		- Debug builds now unconditionally print entry/exit statements
    		- usage() now prints version string
    	
    	* fsrecord.*
    		- Skeletal foundation for recording boot environment data
Commits on Sep 7, 2019
  1. Updated DBGFLAGS

    newnix
    newnix committed Sep 7, 2019
    	* Makefile
    		- Added compile-time macros for enabling extra information in debug builds
Commits on Aug 20, 2019
  1. Attempting to fix README formatting

    newnix
    newnix committed Aug 20, 2019
    	* README.md
    		- Attempting to fix the spacing for the "Usage" section
Commits on Aug 19, 2019
  1. Updated README and Makefile for Public Testing

    newnix
    newnix committed Aug 19, 2019
    	* Makefile
    		- Change DESTDIR to "/bin/" instead of "/bin/c/"
    		- Remove -march=native and -mtune=native to produce more generic binaries
    		- Updated the "push" target to hopefully push to a new git branch
    	
    	* README.md
    		- Provided basic execution outline
    		- Provided example usage
    		- Listed known implementation limitations, noting some potential solutions for future versions
    	
    	* fslist.c
    		- Replaced check for EUID=0 with an assertion that EUID is 0, which should cause a crash if that path is reached after envtest()
Commits on Aug 13, 2019
  1. Bail on NOTIMP(), add Runtime Traces

    newnix
    newnix committed Aug 13, 2019
    	* dfbeadm.c
    		- Return after hitting a NOTIMP() macro
    	
    	* fslist.c
    		- Added enter/exit DBG statements
    		- Added note that the EUID check should not be necessary with envtest() in dfbeadm.c
    		- Updated error message to use "ERR" preamble
Commits on Aug 8, 2019
  1. Fix Spacing in usage()

    newnix
    newnix committed Aug 8, 2019
    	* dfbeadm.c
    		- Spacing in usage() has been normalized
  2. Add Previously Untracked fslist.c

    newnix
    newnix committed Aug 8, 2019
    	* fslist.c
    		- Handles the functionality of listing known managed HAMMER2 snapshots,
    		  these are assumed to be created by dfbeadm, and it currently only checks the 
    		  PFS mounted on '/'
    		- While unfortunately not tracked, the file has recently been updated to use 
    		  simpler internal logic, rather than using strchr() to find the first instance of 
    		  BESEP and calling fprintf() on each successive character until a NULL terminator is found
    		  it now checks the value of h2be.pfs_subtype and if it matches the value for a managed snapshot,
    			fprintf() simply prints out the value of h2be.name in full.
  3. Added Assertions, Implementation Notices, and Improved listing

    newnix
    newnix committed Aug 8, 2019
    	* dfbeadm.h
    		- Add inclusion of <assert.h>
    		- Modify NOTIMP fprintf() string
    	
    	* dfbeadm.c
    		- Set bit 3 of exflags to represent the list() function
    		- Update '-l' flag to clear other bit flags in exflags
    		- Added mnemonic of "LISTBENV" to represent the '-l' flag
    		- Updated '-d' flag to throw NOTIMP message, same with '-r'
    		- Added assertions that various functions, some need to be revised, as they're redundant checks
    		- Added "LISTBENV" case to cook()
    		- Added warning to usage() specifying that this is not considered complete yet
    	
    	* fscollect.c
    		- Injected assertions ahead of entry "traces" to prevent being passed NULL pointers or other invalid data
    	
    	* snapfs.c
    		- Added an assertion that all arguments are non-NULL and valid integer values
    	
    	The assertions will need to be revisited, as some of them come after basic sanity checks for valid parameters being passed.
    	I'll be revisiting the way these values are tested and verified to make sure appropriate controls are in place, as not every
    	invalid function argument requires a hard failure, but for now, clear rationale for why the command failed is more valuable than 
    	eliminating redundant checks.
Commits on Aug 6, 2019
  1. Begin Basic Sanity Checks

    newnix
    newnix committed Aug 6, 2019
    	* dfbeadm.c
    		- New function, envtest() used to check that user has appropriate permissions to continue
    		- Added some return code mnemonics, currently just ENV_OK and E_BADUSER
    		- Updated cook() to call envtest() prior to any other processing, bailing early if the user lacks appropriate privileges
    	
    	This signifies the first step in performing additional runtime sanity checks to prevent mangling the filesystem.
    	Future releases will include assert()s to ensure there's no NULL pointers where it becomes increasingly dangerous
    	to have them, or to otherwise ensure that data hasn't been significantly modified between function calls.
    	These features will become more important as development continues, especially when spawning multiple threads/processes becomes feasible.
  2. Correct FSTAB Generation

    newnix
    newnix committed Aug 6, 2019
    	* fscollect.c
    		- Corrected generation of fs->snapshot.name in relabel() and newlabel(), 
    		  now ensuring the snapshot being generated retains the current PFS label
    	
    	* fsupdate.h
    		- Reverted autoactivate() signature to include `const char *label`
    	
    	* fsupdate.c
    		- Add a check for snapfs->snap in autoactivate() to be sure the boot environment label 
    		  is only applied to filesystems that are included
    	
    	* snapfs.h
    		- Revert snapfs() signature to include `const char *label`
    	
    	* snapfs.c
    		- Reverted call to autoactivate() to include passing the label pointer so the fstab can be properly generated
Commits on Aug 5, 2019
  1. Pre-Beta Logic Updates

    newnix
    newnix committed Aug 5, 2019
    	* fscollect.c
    		- Remove the fstab.fs_spec data from snapshot.name generation
    	
    	* fsupdate.c
    		- Update the function signature for autoactivate() as the value of *label is no longer needed 
    	
    	* fsupdate.h 
    		- Update the function signature in autoactivate() prototype to match implementation
    	
    	* snapfs.c
    		- Removed logic requiring dynamically allocated *label
    		- Moved autoactivate() to happen prior to the snapshot generation
Commits on Aug 2, 2019
  1. DFBEADM Now (Probably) Ready for Field Testing

    newnix
    newnix committed Aug 2, 2019
  2. Fixed Initial Snapshot Case, Beginning Further Testing

    newnix
    newnix committed Aug 2, 2019
    	* Makefile
    		- Added a "push" target to mirror commits to github
    	
    	* fscollect.c
    		- Added some snapshot prep mnemonics for mktargets()
    		- Handled non-zero return from relabel() for cases where no boot environment exists
    		- New function newlabel() creates snapshot labels for new boot environments
    	
    	* fscollect.h
    		- Added prototype for newlabel(), identical to relabel(), but with much less to do
    	
    	* snapfs.c
    		- Removed xtractLabel()
    	
    	* snapfs.h
    		- Removed xtractLabel() prototype
Commits on Aug 1, 2019
  1. Update to "NO-OP" Behaviour

    newnix
    newnix committed Aug 1, 2019
    	* fsupdate.c
    		- Removed noop ternary in autoactivate()
    	
    	* snapfs.c
    		- snapfs() will now simulate the act of a HAMMER2 snapshot by writing out the new PFS data to the fstab struct
Commits on Jul 31, 2019
  1. Work on Streamlining PFS Snapshots

    newnix
    newnix committed Jul 31, 2019
    * fscollect.c
    	- In relabel(), add a call to snprintf() to copy label information into fs->snapshot.name
    
    * fsupdate.c
    	- Added ternary to printfs(), works in producing test data for non-created snapshots, but fails to print existing filesystems
    
    * snapfs.c
    	- Remove loop over xtractLabel()
Commits on Jul 15, 2019
  1. Work Towards Removing Footguns

    newnix
    newnix committed Jul 15, 2019
    	* fscollect.h
    		- Added prototype for clearBElabel(), may be removed in future versions
    	
    	* fscollect.c
    		- Added implementation for clearBElabel(), which may not be necessary long-term,
    		  but is currently used to clear out any existing boot environment labels
    		- Updated some of the runtime debug messages to provide better visibility into the 
    		  transformations being done in relabel()
    	
    	* snapfs.c
    		- Removed ol comment lines
    		- Added comment stating that xtractLabel() is ready to be pruned, 
    		  though some logic in snapfs() needs to be adjusted accordingly as well
Commits on Jul 14, 2019
  1. Removed Footgun Firing Pin

    newnix
    newnix committed Jul 14, 2019
    	* fscollect.c
    		- Removed memset() call from relabel() that caused failures in later xtractLabel() calls
    	
    	* snapfs.c
    		- Adding to repo, seems to have been omitted for some time
Commits on Jul 5, 2019
  1. Minor Changes to NO-OP Handling

    newnix
    newnix committed Jul 5, 2019
    	* dfbeadm.c
    		- Removed NOOPMASK, as it's handled via a global boolean now
    		- Updated switch statement in cook() to reflect that there's no need to check for action|NOOPMASK
    	
    	* fscollect.c
    		- Updated openfs() to properly return control to the coller
Commits on Jun 24, 2019
  1. More Work on Label Generation

    newnix
    newnix committed Jun 24, 2019
    	* fscollect.c
    		- Added a "debug" printout to show the label generation in relabel()
    		- Added comments in relabel() describing the flow through the function
    		- Added note in relabel that if BESEP cannot be found, either the filesystem is not
    		  HAMMER2 or has no existing boot environments, this needs its own return code to differ from errors
    	
    	It's beginning to look like snapfs.c:xtractLabel() is no longer needed, but I'm not sure what the function was meant to handle 
    	anymore, so I'll have to proceed with caution when looking at removing it.
Commits on Jun 18, 2019
  1. Continuing Work on Streamlining

    newnix
    newnix committed Jun 18, 2019
    	* dfbeadm.c
    		- Added inclusion of the noop external boolean
    		- Updated cook() signature to accept a string instead of a string array, as there's no argument parsing needed
    		- Added switch to cook() based on flags set in main()
    	
    	* fscollect.c
    		- Updated printouts for allocation failure to include source file location
    		- Corrected call t oopenfs() to use the mountpoint of the filesystems
    	
    	* fsupdate.c
    		- Ephemeral fstab generation now sets appropriate file permissions
    		- Added noop check before attempting to install the new fstab
Commits on Jun 10, 2019
  1. Begin Work on Logic Handling

    newnix
    newnix committed Jun 10, 2019
    	* README.md
    		- Added to start explaining the process of using the utility 
    		  and considerations vs the tooling available for ZFS
    	
    	* Makefile
    		- Updated compile time flags to improve runtime security
    	
    	* dfbeadm.c
    		- Began moving logic handling out of main() and into cook()
    	
    	* dfbeadm.h
    		- Added a NOTIMP() macro to alert users of an unimplemented function
    	
    	* fscollect.c
    		- Moved openfs() out of snapfs
    		- Included call to openfs() in mktargets()
    	
    	* fscollect.h
    		- Added openfs() prototype
    	
    	* snapfs.h
    		- Removed openfs() prototype
Commits on Jun 7, 2019
  1. Code Organization Work

    newnix
    newnix committed Jun 7, 2019
    	* dfbeadm.h
    		- Added new member to bootenv_data struct, mountfd. This will track the opened file descriptors
    		  for generating the snapshots
    	
    	* fscollect.c
    		- Added entry and exit traces to functions
    		- Started work on cleaning up the relabel() function
    
    	* fsupdate.c
    		- Added enttry trace to swapfstab()
    	
    	* snapfs.h
    		- Added function prototype for openfs()
Commits on Jun 6, 2019
  1. Starting Control Flow Analysis

    newnix
    newnix committed Jun 6, 2019
    	* fcollect.c
    		- Added entry/exit traces to create()
    
    	Creation/activation should not work at this time. Will need to update the snapshot loop to acquire appropriate file descriptors,
    	possibly work on updating the bedata struct to carry the file descriptors as well.
  2. Update to FSTAB Installation

    newnix
    newnix committed Jun 6, 2019
    	* Makefile
    		- Added -Wparentheses and -ffast-math as the potential speed improvements are worth 
    		  potential inaccuracies for this application's use case
    	
    	* fsupdate.c
    		- swapfstab() updated to detect if the fstab is larger than PAGESIZE (4k), and if so, will
    		  only read a page at a time. Otherwise, read in the full file, at whatever size it is
Commits on Jun 5, 2019
  1. Work on Runtime Traces

    newnix
    newnix committed Jun 5, 2019
    	* dfbeadm.c
    		- Removed runtime debug tracing from exflags, now using an external boolean
    	
    	* fsupdate.c
    		- Added entry and exit printouts for all functions
Older
You can’t perform that action at this time.