Skip to content

Commit

Permalink
V0.9.0 to master (#125)
Browse files Browse the repository at this point in the history
* Cut branch for 0.9

* Started adding acl/xaddr support

* Added definitions for acls

* (Not working) ACL work

* Initial working acl flag on MacOS

* Added xattr support for MacOS

* Swapped to ifdef

* Added ACL for Linux

* Added dummy -l flag for accidental `ls` muscle memory human (PEBKAC) related issues

* Testing SELinux checks

* Adding display test for SELinux acl

* Added flag for showing security context

* Adding context to struct

* Add Context Text to struct

* Actually copy the value to the variable

* Added libselinux

* Reworked automake linkers

* Handle -1 size

* Show stopping memory issues

* Fixed memory issue with attr field

* Starting work adding context to file output

* Added context header on -Z

* Added emacs files to ignore list

* Adding length of context and cleaning print entry

* Reverting printEntry change, adding contextlen

* Buffer overflow for perms

* Buffer overflow driver/size

* Buffer overflow driver/size - again

* Added context on -Z

* Fixed heading spacing for context

* Added missing padding on context larger than header

* starting work on segments

* Added segment pointers

* Added context segment

* Fixed padding on segments

* Made selinux optional

* Added extra memory for log10 calculations

* Context doesn't follow symlinks

* Switched attrs and hlink to segmemts

* Configured Travis to use SELinux as part of testing

* Sorting by name first before date and size

* This is to give the same results as ls if two files have the same
datestamp or size.

* Added handling if hard link count is less than 1

* Owner Segment implemented

* Date segment implemented

* Made marked a segment

* Fix hiding owner column

* Defined column names

* Add context to default conf file

* Fix issue where Driver header is shown when reading simlink to device.

Addresses #114 which happens when color mode is enabled.

* Added Mac theme

* New segment print system (buggy)

* Fix issue in new segment print system

* Updated mac theme

* Further fixes to new print segment routine

* Added default

* Fix driver/size display issue

* Removing entryMeta

* Preping for name segment

* Added Name Segment system

* Finishing name segment system

* Fix buffer overflow issue when displaying some directories

* Added TI theme inspired by NET-DFEDIT

* Started work on segmenting headers

* Completed working segmented headers

* Initalising header

* Updated copyright

* Allow reordering of segments

* Initialising memory in write segment routines

* Add one item per line option from ls

* Fixed segment size for name. Also cleaned up getseglength routine

* Made length of array dynamic

* Stopped --no-sf flag defaulting back to sf if no PAGER env is set

* Fixed header posiitoning if marked segment isn't shown

* Fixed size header justification

* Fixed header positioning when scrolling side ways

* Fixed over scrolling issue

* Making blank headers match data alignment

* Started working on skipping to first file

* Fixed skippable funtion to work on correct directory

* Added skip to first file option to config

* Fixed trailing slash issue.

Addresses issue #121

* Added skip to first file option argument

* Store xattrs in struct

* Freeing memory for xattrs

* Fixed memory issue with xattr storage

* Get size of xattr

* Corrected positioning of selected item

* Fixed issue where show segfaults if the directory it was launched in is
removed.

* Addresses issue #116

* Added skip-to-first option to default config file

* Further fixes to skip to first file

* Started work on the -@ flag

* More -@ work

* Further work on Xattr Mac support

* Fixed refresh issue, committing before possible refactor of display_dir

* Added entry line index struct

* Refactoring old functions

* Refactoring old functions further

* Fixed page down issue

* Displays xattrs

* XAttr segments and config settings

* Re-added support for GNU/HURD

* ACL work, reordered axFlag

* Disabling ACL view for now

* Set layout in config

* Fixed memory allocation issue with launch executable

* Made sys/xattr.h optional

* Removed xattr call when xattr not present

* Changed errorno output

* Added definitions for setting types

* Started work on moving files between devices

* Finished work moving files between devices

* Added find next on CTRL+F

Added feature for #119

* Fixed typo in help section

* Added initial autocomplete

For issue #108

* Completing autocomplete work for sf

Finishing #108

* Updated documentation

* Added SELinux support in documentation

* Reordered axFlag setting

* Fail config on missing acl library

* Reworked acl detection

* Further ACL work

* Fixed acl column not showing

* Fix incorrect disk space on some systems

Addresses #124

* Removing dev tag, prepairing for release
  • Loading branch information
roberthawdon authored May 15, 2020
1 parent b5d452d commit fd00a1d
Show file tree
Hide file tree
Showing 33 changed files with 2,156 additions and 507 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ stamp-*
*.stackdump
*~
valgrind*
*.#*
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: c
script:
- "./bootstrap"
- "./configure"
- "./configure --with-selinux"
- make

before_install:
- sudo apt-get install -y libconfig-dev
- sudo apt-get install -y libconfig-dev libacl1-dev libselinux1-dev
20 changes: 17 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,26 @@ AUTOMAKE_OPTIONS = foreign
dfshowconfdir = $(sysconfdir)
dfshowdatadir = $(datadir)/dfshow

AM_CFLAGS = -DSYSCONFIG=\"$(dfshowconfdir)\" -DDATADIR=\"$(dfshowdatadir)\" -D_XOPEN_SOURCE_EXTENDED
AM_CFLAGS = -DSYSCONFIG=\"$(dfshowconfdir)\" -DDATADIR=\"$(dfshowdatadir)\" -D_XOPEN_SOURCE_EXTENDED -fno-common

LDADD = -lm -lconfig

if DARWIN
LDADD = -lncurses -lm -lconfig
LDADD += -lncurses
else
LDADD = -lncursesw -lm -lconfig -ltinfo
LDADD += -lncursesw
endif

if LINUX
LDADD += -lacl -ltinfo
endif

if HURD
LDADD += -lacl -ltinfo
endif

if SELINUX
LDADD += -lselinux
endif

bin_PROGRAMS = $(top_builddir)/bin/show $(top_builddir)/bin/sf
Expand Down
4 changes: 4 additions & 0 deletions conf/dfshow.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ show:
group = 1;
author = 0;
};
# Show security context of objects (default: 0)
context = 0;
# Skip naviation items if at the top of list (default: 0)
skip-to-first = 0;
};

sf:
Expand Down
44 changes: 41 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
AC_INIT([dfshow], [0.8.2], [https://github.com/roberthawdon/dfshow/issues])
AC_INIT([dfshow], [0.9.0], [https://github.com/roberthawdon/dfshow/issues])
AC_GNU_SOURCE
AM_INIT_AUTOMAKE([subdir-objects])
AC_PROG_CC
AC_PROG_CC_STDC
AC_CONFIG_HEADERS([config.h:config.hin])
AC_SUBST([AM_LDFLAGS])

# Check for ACL_TYPE_NFS4
AC_CHECK_DECL([ACL_TYPE_NFS4],
[AC_DEFINE(HAVE_ACL_TYPE_NFS4, 1, [True for FreeBSD with NFSv4 ACL support])],
[],
[#include <sys/acl.h>])
# MacOS has an acl.h that isn't POSIX. It can be detected by
# checking for ACL_USER
AC_CHECK_DECL([ACL_USER],
[AC_DEFINE(HAVE_ACL_USER, 1, [True for systems with POSIX ACL support])],
[],
[#include <sys/acl.h>])
# MacOS has ACL_TYPE_EXTENDED instead
AC_CHECK_DECL([ACL_TYPE_EXTENDED],
[AC_DEFINE(HAVE_ACL_TYPE_EXTENDED, 1, [True for MacOS ACL support])],
[],
[#include <sys/types.h>
#include <sys/acl.h>])
# Solaris and derivates ACLs
AC_CHECK_LIB([sec], [acl_get])
AC_CHECK_TYPES([aclent_t], [], [], [[#include <sys/acl.h>]])
AC_CHECK_TYPES([ace_t], [], [], [[#include <sys/acl.h>]])
AC_CHECK_FUNCS(acl_get facl_get acl_set facl_set)


AC_CHECK_MEMBERS([struct stat.st_author])
AC_CHECK_HEADERS([stdio.h limits.h signal.h ctype.h wctype.h getopt.h sys/types.h sys/stat.h dirent.h fcntl.h pwd.h string.h stdlib.h unistd.h time.h sys/statvfs.h libgen.h errno.h wchar.h hurd.h math.h sys/sysmacros.h regex.h utime.h])
AC_CHECK_HEADERS([stdio.h limits.h signal.h ctype.h wctype.h getopt.h sys/types.h sys/stat.h dirent.h fcntl.h pwd.h string.h stdlib.h unistd.h time.h sys/statvfs.h libgen.h errno.h wchar.h hurd.h math.h sys/sysmacros.h regex.h utime.h sys/xattr.h acl/libacl.h])
AC_CHECK_HEADERS(ncurses.h, , AC_MSG_ERROR(ncurses header (ncurses.h) not found. You may need to install an ncurses development package.))
AC_CHECK_HEADERS(libconfig.h, , AC_MSG_ERROR(libconfig header (libconfig.h) not found. You may need to install a libconfig development package.))
AC_CHECK_HEADERS(sys/acl.h, , AC_MSG_ERROR(libacl header (sys/acl.h) not found. You may need to install a libacl development package.))

AM_CONDITIONAL([DARWIN], [test $(uname) = "Darwin"])
AC_ARG_WITH([selinux], AS_HELP_STRING([--with-selinux], [Build with selinux library (default: disabled)]))
AC_ARG_ENABLE([move-between-devices], AS_HELP_STRING([--enable-move-between-devices], [Enable moving objects between mounted devices (default: disabled)]))

AS_IF([test "x$with_selinux" = "xyes"], [
AC_CHECK_HEADERS(selinux/selinux.h, , AC_MSG_ERROR(selinux header (selinux/selinux.h) not found. You may need to install an selinux development package.))
])

AS_IF([test "x$enable_move_between_devices" = "xyes"], [
AC_DEFINE(HAVE_MOVE_BETWEEN_DEVICES, 1, [True for enable-move-between-devices])
])

AM_CONDITIONAL([DARWIN], [test $(uname) = "Darwin"])
AM_CONDITIONAL([LINUX], [test $(uname) = "Linux"])
AM_CONDITIONAL([HURD], [test $(uname) = "GNU"])
AM_CONDITIONAL([SELINUX], [test "x$with_selinux" = "xyes"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
# -- Project information -----------------------------------------------------

project = 'Directory File Show (DF-SHOW)'
copyright = '2019, Robert Ian Hawdon'
copyright = '2020, Robert Ian Hawdon'
author = 'Robert Ian Hawdon'

# The short X.Y version
version = ''
version = '0.9'
# The full version, including alpha/beta/rc tags
release = '0.8.2-beta'
release = '0.9.0'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Download the project and prepare sources.
./bootstrap
./configure
On systems with SELinux, you can enable support for this by passing the ``--with-selinux`` option to configure.

On some BSD systems, you may need to pass extra parameters to configure and build DF-SHOW:

.. code-block:: bash
Expand Down
3 changes: 3 additions & 0 deletions docs/source/sf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ Further information can be found in the `configuring sf <#configuring-sf>`__ sec

``Ignore Case - Enter string:``

After a search has been made, the keybinding ``CTRL + F`` will repeat the search
to find further occurrences.

``Help``
Launches the ``man`` pages for ``sf``.

Expand Down
13 changes: 13 additions & 0 deletions docs/source/show.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Command line arguments

The following options are shared with ``ls``:

``-@``
Displays extended atributes keys and sizes (macOS only).

``-a``, ``--all``
Does not ignore files or directories starting with ``.``. The
``.`` and ``..`` objects are never hidden due to their
Expand Down Expand Up @@ -69,6 +72,12 @@ The following options are shared with ``ls``:
``-U``
Displays output in the order they're found.

``-Z``, ``--context``
Shows the secuirty context of each file, if one is defined.

``-1``
Only shows the file name on display.

``--help``
Displays help message, then exits.

Expand Down Expand Up @@ -107,6 +116,9 @@ The following options are specific to ``show``:
``--edit-themes``
Launches ``show`` directly into the theme editor. (colors)

``--skip-to-first``
Sets the highlighted item to the first object that isn't ``.`` or ``..``

Commands
--------

Expand Down Expand Up @@ -615,6 +627,7 @@ The following screen is displayed.
[ ] Human readable sizes
[ ] Enter key acts like Show
< > Owner Column: <owner> <group> <author>
[ ] Skip to the first object

There are three types of configuration items, each denoted with a different
symbol:
Expand Down
7 changes: 5 additions & 2 deletions man/sf.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "SF" "1" "May 2019" "" ""
.TH "SF" "1" "May 2020" "" ""
.
.SH "NAME"
\fBsf\fR \- An interactive file viewer written for Unix\-like systems\.
Expand Down Expand Up @@ -91,6 +91,9 @@ Following this selection, one of the following prompts will be displayed:
.IP
\fBIgnore Case \- Enter string:\fR
.
.IP
After a search has been made, the keybinding \fBCTRL + F\fR will repeat the search to find further occurrences\.
.
.TP
\fBHelp\fR
Launches the \fBman\fR pages for \fBsf\fR\.
Expand Down Expand Up @@ -162,7 +165,7 @@ Saves settings for future sessions\.
Written by Robert Ian Hawdon\.
.
.SH "COPYRIGHT"
Copyright (C) 2019 License GPLv3+: GNU GPL version 3 or later \fIhttps://gnu\.org/licenses/gpl\.html\fR\.
Copyright (C) 2020 License GPLv3+: GNU GPL version 3 or later \fIhttps://gnu\.org/licenses/gpl\.html\fR\.
.
.P
This program comes with ABSOLUTELY NO WARRANTY\. This is free software, and you are welcome to redistribute it under certain conditions\.
Expand Down
8 changes: 5 additions & 3 deletions man/sf.1.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/sf.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Searches for a string provided in the form of a Regex. Case sensitivity is reque

`Ignore Case - Enter string:`

After a search has been made, the keybinding ``CTRL + F`` will repeat the search to find further occurrences.

* `Help`:
Launches the `man` pages for `sf`.

Expand Down Expand Up @@ -120,7 +122,7 @@ Saves settings for future sessions.
Written by Robert Ian Hawdon.

## COPYRIGHT
Copyright (C) 2019 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
Copyright (C) 2020 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.

Expand Down
Loading

0 comments on commit fd00a1d

Please sign in to comment.