Andre Noll [Fri, 8 May 2009 11:20:30 +0000 (13:20 +0200)]
Add an example to README.
Suggested by Sebastian Stark.
Andre Noll [Fri, 8 May 2009 08:47:48 +0000 (10:47 +0200)]
INSTALL: Add a link to the public git repo.
Andre Noll [Fri, 24 Apr 2009 09:37:08 +0000 (11:37 +0200)]
Merge commit 'athcx/bloom'
Conflicts:
create.c
Andre Noll [Sun, 19 Apr 2009 13:31:13 +0000 (15:31 +0200)]
Fix another typo.
Two typos in the same log message..
Andre Noll [Fri, 10 Apr 2009 00:05:01 +0000 (02:05 +0200)]
Fix typo.
Andre Noll [Wed, 11 Feb 2009 09:57:56 +0000 (10:57 +0100)]
Implement --trailer select option.
It works just like the --header option.
Andre Noll [Tue, 10 Feb 2009 22:08:20 +0000 (23:08 +0100)]
Merge commit 'fml/master'
Conflicts:
adu.ggo
user.c
Sebastian Stark [Sun, 1 Feb 2009 22:51:59 +0000 (23:51 +0100)]
remove paraslash relict in comment
Sebastian Stark [Mon, 2 Feb 2009 09:32:12 +0000 (10:32 +0100)]
flush output after each command in interactive mode.
Otherwise "clients" that are not terminals have difficulties
seeing adu's output.
Sebastian Stark [Mon, 2 Feb 2009 10:03:49 +0000 (11:03 +0100)]
add simple install target for adu and adu.1
Sebastian Stark [Wed, 4 Feb 2009 10:16:01 +0000 (11:16 +0100)]
new option database-root
If database-root is given, the database dir is computed by
appending the base dir to it. Obviously this works only if
base dir is given, even for select mode.
The needed directory structure is created below database-root
by the new function mkpath(), which recursively creates any
directory needed to copy the structure of base dir. This
has the side-effect that the database dir is always created
for the user (if permissions allow) which wasn't the case
before.
database_dir is now a global variable just like conf and should
be used whenever conf.database_dir_arg was used before.
Andre Noll [Thu, 25 Dec 2008 11:23:10 +0000 (12:23 +0100)]
Merge branch 'master' into bloom
Conflicts:
create.c
Andre Noll [Thu, 25 Dec 2008 11:19:56 +0000 (12:19 +0100)]
Make user.c independent of command line options.
Andre Noll [Thu, 25 Dec 2008 10:54:46 +0000 (11:54 +0100)]
Merge branch 'master' into bloom
Andre Noll [Thu, 25 Dec 2008 10:54:26 +0000 (11:54 +0100)]
Remove unused option --config-file.
Andre Noll [Thu, 25 Dec 2008 10:48:53 +0000 (11:48 +0100)]
bloom.c: Remove some unneccessary includes.
Andre Noll [Thu, 25 Dec 2008 10:46:41 +0000 (11:46 +0100)]
Add source code documentation for bloom_insert().
Andre Noll [Wed, 24 Dec 2008 13:02:50 +0000 (14:02 +0100)]
Rename bloom_test_and_insert() to bloom_insert().
In order to keep statistics up to date, we always need to do the test.
Andre Noll [Wed, 24 Dec 2008 12:59:14 +0000 (13:59 +0100)]
Rename bloom_init() to bloom_new().
Andre Noll [Wed, 24 Dec 2008 12:51:29 +0000 (13:51 +0100)]
bloom: Add some source documentation.
Andre Noll [Wed, 24 Dec 2008 12:14:11 +0000 (13:14 +0100)]
Merge branch 'master' into bloom
Andre Noll [Wed, 24 Dec 2008 12:13:52 +0000 (13:13 +0100)]
Document the stat64 compatibility fix.
Andre Noll [Tue, 23 Dec 2008 16:27:06 +0000 (17:27 +0100)]
Merge branch 'master' into bloom
Andre Noll [Tue, 23 Dec 2008 16:26:52 +0000 (17:26 +0100)]
Make it compile on FreeBSD and NetBSD.
off_t on BSD is 64 bit even on 32bit machines, so there are no
special tricks needed to get large file support. In fact, getconf
has no options for large file support and struct stat64 and lstat64()
do not exist on BSD systems. This caused the compilation to fail on
those systems.
Fix this problem by checking for BSD via uname -s in the Makefile. If
uname indicates we're on BSD, then do not use getconf and #define
stat64 and lstat64() to stat and lstat() respectively.
Andre Noll [Sun, 21 Dec 2008 22:47:28 +0000 (23:47 +0100)]
First draft of hard link detection via bloom filters.
Andre Noll [Wed, 17 Dec 2008 22:32:21 +0000 (23:32 +0100)]
Fix a design bug concerning struct user_info.
It was a bad idea to include the accounting data (#files, #dirs,
information about the user only.
So move the accounting data to user_summary_info. This allows
to get rid of the ugly uid_hash_table_sort_idx construct and of
sort_hash_table(). These were only needed because of the broken
design. We now never sort the hash table but allocate an array of
user_summary_info structures on each query and sort that array instead.
This patch not only simplifies code but also fixes a real bug noted by
Sebastian Stark: If the user_summary was requested more than once in
interactive mode, the old code computed incorrect values because the
above mentioned accounting fields were only initialized once. The new
code gets this right automatically because a fresh array is created
on each query.
Andre Noll [Sat, 22 Nov 2008 22:40:18 +0000 (23:40 +0100)]
print_complete_help_and_die() does not return.
So change the return type to void.
Andre Noll [Sat, 22 Nov 2008 22:38:39 +0000 (23:38 +0100)]
Merge commit 'fml/master'
Andre Noll [Wed, 12 Nov 2008 21:40:00 +0000 (22:40 +0100)]
Some more source code documentation.
Andre Noll [Wed, 12 Nov 2008 20:28:55 +0000 (21:28 +0100)]
Add documentation of parse_select_options().
Andre Noll [Wed, 12 Nov 2008 17:12:40 +0000 (18:12 +0100)]
Fix a compiler warning.
It's kinda bogus, but anyway. It fixes
select.c:532: warning: 'comp' may be used uninitialized in this function
Andre Noll [Tue, 11 Nov 2008 22:39:50 +0000 (23:39 +0100)]
Add documentation of DEFINE_ERRLIST.
Andre Noll [Tue, 11 Nov 2008 22:39:06 +0000 (23:39 +0100)]
Start writing the mainpage for the API reference.
This should also contain a general overview..
Andre Noll [Tue, 11 Nov 2008 22:08:43 +0000 (23:08 +0100)]
Add yet more source code documentation.
Andre Noll [Tue, 11 Nov 2008 21:09:00 +0000 (22:09 +0100)]
Add some more souce code documentation.
Andre Noll [Tue, 11 Nov 2008 20:58:33 +0000 (21:58 +0100)]
Make close_all_tables() static.
It's only used in adu.c.
Andre Noll [Mon, 10 Nov 2008 21:32:24 +0000 (22:32 +0100)]
Merge commit 'fml/master'
Andre Noll [Mon, 10 Nov 2008 21:30:09 +0000 (22:30 +0100)]
string.c: Replace "paralash" by "adu" in source code documentation.
Andre Noll [Mon, 10 Nov 2008 21:29:17 +0000 (22:29 +0100)]
Add source code documentation for run_select_query() and com_select().
Andre Noll [Mon, 10 Nov 2008 21:00:06 +0000 (22:00 +0100)]
Add missing source code documentation of user.c.
This completes the documentation of user.c.
Andre Noll [Mon, 10 Nov 2008 09:24:57 +0000 (10:24 +0100)]
adu-0.0.5.
Andre Noll [Mon, 10 Nov 2008 09:23:15 +0000 (10:23 +0100)]
Merge commit 'meins/master'
Andre Noll [Mon, 10 Nov 2008 09:23:06 +0000 (10:23 +0100)]
Add documentation of the enhancments to --output.
Code for the new features is still missing.
Andre Noll [Mon, 10 Nov 2008 00:39:18 +0000 (01:39 +0100)]
Add \brief command to file header to make doxygen happy.
Andre Noll [Mon, 10 Nov 2008 00:38:10 +0000 (01:38 +0100)]
Remove sha1.c
This was never needed.
Andre Noll [Mon, 10 Nov 2008 00:28:58 +0000 (01:28 +0100)]
user.c: Add some more source code documentation.
Andre Noll [Mon, 10 Nov 2008 00:06:13 +0000 (01:06 +0100)]
Add copyright header and COPYING file.
Andre Noll [Sun, 9 Nov 2008 23:57:02 +0000 (00:57 +0100)]
Cosmetic cleanups.
Andre Noll [Sun, 9 Nov 2008 22:20:20 +0000 (23:20 +0100)]
Remove duplicate whitespaces in documentation.
man2html does not like that.
Andre Noll [Sun, 9 Nov 2008 22:18:40 +0000 (23:18 +0100)]
Implement pattern matching for select mode.
Andre Noll [Sun, 9 Nov 2008 19:37:41 +0000 (20:37 +0100)]
Minor documentation updates/fixes/improvements.
Andre Noll [Sun, 9 Nov 2008 19:37:09 +0000 (20:37 +0100)]
Make the header line configurable.
This replaces the --no-header flag by --header string option. The
argument is the header of the summary/list.
This was not a straight-forward task because the headers for the
user lists contain the uid and the user name. So introduce another
set of format string directives to still allow this.
Andre Noll [Sun, 9 Nov 2008 19:30:08 +0000 (20:30 +0100)]
format.c: Return an empty buffer for empty format strings rather than NULL.
Andre Noll [Sun, 9 Nov 2008 15:27:10 +0000 (16:27 +0100)]
Rename short option -L to -l.
Also, add a more descriptive help text.
Andre Noll [Sun, 9 Nov 2008 15:21:54 +0000 (16:21 +0100)]
Make --limit work also for the user summary.
Andre Noll [Sun, 9 Nov 2008 15:13:38 +0000 (16:13 +0100)]
compute_user_summary does not need any private data.
Consequently, pass a NULL pointer rather than a pointer to struct
format_info which is not used anyway.
Andre Noll [Sun, 9 Nov 2008 14:33:16 +0000 (15:33 +0100)]
Fix sorting of the uid hash table.
We must not blindy sort the whole table because in interactive mode
this table may be modified by later commands and lookup_uid() gets
confused if the entries have been permuted. So introduce
uid_hash_table_sort_idx, an array of indices that describes the current
sorting of the hash table. The order of the entries in the table itsself
never gets changed any more with this patch.
Also, simplify the uid comparators by introducing a wrapper that does
the casts which were previously contained in each comparator.
Andre Noll [Sun, 9 Nov 2008 12:21:04 +0000 (13:21 +0100)]
Make the summary comparators non-static.
Andre Noll [Sun, 9 Nov 2008 12:15:42 +0000 (13:15 +0100)]
Implement the new interactive command "source".
Andre Noll [Sun, 9 Nov 2008 12:15:16 +0000 (13:15 +0100)]
Fix a typo in interactive.c.
Andre Noll [Sun, 9 Nov 2008 00:55:12 +0000 (01:55 +0100)]
Make user_summary the default select mode.
Andre Noll [Sun, 9 Nov 2008 00:45:42 +0000 (01:45 +0100)]
Do not close tables on each query.
This speeds up interactive mode where many queries may be executed
in a row. User tables are opened on demand (if the uid is admissible)
and only closed on exit. Also the dir table is opened only once per
session rather than on each query.
Andre Noll [Sun, 9 Nov 2008 00:38:32 +0000 (01:38 +0100)]
Increase default loglevel to 4 (WARN).
Andre Noll [Sat, 8 Nov 2008 23:03:06 +0000 (00:03 +0100)]
Fix segfault in select mode if --uid was given.
We must not close tables for non-admissible users.
Andre Noll [Sat, 8 Nov 2008 22:54:16 +0000 (23:54 +0100)]
Fix a couple of gengetopt-related memory leaks.
It's still a bit leaky..
Andre Noll [Sat, 8 Nov 2008 22:05:54 +0000 (23:05 +0100)]
User handling improvments.
- move global variable num_uids to user.c.
- logging improvements.
- replace search_uid() by create_user_table(). search_uid() had a
horrible interface.
- in user.c, use FOR_EACH_USER() to loop over all users rather than
for_each_admissible_user().
Andre Noll [Sat, 8 Nov 2008 17:58:01 +0000 (18:58 +0100)]
Simplify user table closing.
No need for an extra function for freeing the hash table.
Andre Noll [Sat, 8 Nov 2008 17:26:24 +0000 (18:26 +0100)]
select.c: Fix two return values.
ERRNO_TO_ERROR() takes a _positive_ error code.
Andre Noll [Sat, 8 Nov 2008 17:21:13 +0000 (18:21 +0100)]
Output improvements.
- Implement appending to an output file.
- Do not override the output file by default
- Implement piping the output into a command.
Andre Noll [Fri, 7 Nov 2008 09:31:50 +0000 (10:31 +0100)]
Merge commit 'meins/master'
Andre Noll [Fri, 7 Nov 2008 09:31:20 +0000 (10:31 +0100)]
Rename error message for E_OUTPUT.
We might as well get this error without using an output file.
Andre Noll [Thu, 6 Nov 2008 23:09:50 +0000 (00:09 +0100)]
Add new select option to specify users by name.
This patch renames the short option -u for --uid to -U and introduces
the new --user option (short: -u) to specify admissible users by name.
The new option may be given mutltiple times to allow more than one user.
Andre Noll [Thu, 6 Nov 2008 22:15:21 +0000 (23:15 +0100)]
Move user and user ID related functions to separate files.
Andre Noll [Thu, 6 Nov 2008 20:16:30 +0000 (21:16 +0100)]
Move code for setting up the format string to an own function.
Andre Noll [Wed, 5 Nov 2008 17:30:28 +0000 (18:30 +0100)]
Fix return codes for loop functions.
The four different loop functions must set the return value in
their private struct because these functions are called from
within the osl library which will replace any negative return value
by -E_OSL_LOOP.
Andre Noll [Sun, 2 Nov 2008 21:41:12 +0000 (22:41 +0100)]
adu-0.0.4.
Andre Noll [Sun, 2 Nov 2008 21:39:22 +0000 (22:39 +0100)]
Add the latex and html directories to .gitignore.
These are created by doxygen.
Andre Noll [Sun, 2 Nov 2008 21:38:31 +0000 (22:38 +0100)]
Add more source code documentation.
Andre Noll [Sun, 2 Nov 2008 19:56:33 +0000 (20:56 +0100)]
Add more derived files to .gitignore.
Andre Noll [Sun, 2 Nov 2008 19:53:38 +0000 (20:53 +0100)]
make clean: Remove more derived files.
Andre Noll [Sun, 2 Nov 2008 19:53:24 +0000 (20:53 +0100)]
Add targets %.ppm and %.png.
Andre Noll [Sun, 2 Nov 2008 19:48:17 +0000 (20:48 +0100)]
Add man page, README, INSTALL, generate index.html.
Change the layout of the help text so that both the man page and
the index.html look nice.
Andre Noll [Sun, 2 Nov 2008 15:54:59 +0000 (16:54 +0100)]
Fix quoting of \n and \t in detailed select help.
Andre Noll [Sun, 2 Nov 2008 15:45:34 +0000 (16:45 +0100)]
Allow comments in interactive input.
This allows to put comments into adu scripts.
Andre Noll [Sun, 2 Nov 2008 15:41:31 +0000 (16:41 +0100)]
Fix interactive reset command.
We have to invalidate both the format info and the array of
admissible urls.
Andre Noll [Sat, 1 Nov 2008 23:35:29 +0000 (00:35 +0100)]
Make sure we never use a stale format info pointer in interactive mode.
Andre Noll [Sat, 1 Nov 2008 23:33:33 +0000 (00:33 +0100)]
parse_format_string(): Explicitly set the result pointer to NULL on errors.
Andre Noll [Sat, 1 Nov 2008 23:31:38 +0000 (00:31 +0100)]
format_items(): Check for NULL pointers.
And return NULL in this case, just as for an empty item list.
Andre Noll [Sat, 1 Nov 2008 22:56:46 +0000 (23:56 +0100)]
Fix a memory lead in interactive mode.
Andre Noll [Sat, 1 Nov 2008 22:47:03 +0000 (23:47 +0100)]
Init the format info struct in interactive mode.
Another bug which causes adu to segfault if used in interactive mode
and without setting any options.
Andre Noll [Sat, 1 Nov 2008 22:45:47 +0000 (23:45 +0100)]
Improve interactive feeling, kill dump command.
It's no good to spam the user with syntax errors on empty lines.
In popular shells, the set command prints the current environment
if called without arguments. So do the same and kill the dump command.
Andre Noll [Sat, 1 Nov 2008 21:57:15 +0000 (22:57 +0100)]
parse_select_options(): Check directly for NULL strings.
This is equivalent to checking whether a select option was given
in select mode, but it makes a difference in interactive mode.
Andre Noll [Sat, 1 Nov 2008 21:55:38 +0000 (22:55 +0100)]
Make free_format_info() cope with NULL pointers.
Be liberal with what you take, just as the usual free() function.
Andre Noll [Sat, 1 Nov 2008 21:42:33 +0000 (22:42 +0100)]
print_statistics(): Fix return value.
gengeopt should protect us from ever executing this code path,
but anyway.
Andre Noll [Sat, 1 Nov 2008 21:41:01 +0000 (22:41 +0100)]
parse_select_options(): Add missing break statements.
Doooh. This bug caused that we always used the user_summary_atoms.
Andre Noll [Sat, 1 Nov 2008 21:18:58 +0000 (22:18 +0100)]
Fix a bug in exec_interactive_command().
In case a command iwthout further options was given, p pointed one
byte after the malloced string, and this pointer is passed to the
command handler..
Andre Noll [Sat, 1 Nov 2008 21:07:23 +0000 (22:07 +0100)]
Minor documentation improvments.
Andre Noll [Sat, 1 Nov 2008 21:06:16 +0000 (22:06 +0100)]
Make it easier to print the help for select options.
It was always a bit awkward to print the help for the select options
because one had to specify a valid mode (-C -S or -I) and the required
-d option just to make gengetopt not bail out early.
Fix this flaw by not using gengetopt's internal help.
Andre Noll [Sat, 1 Nov 2008 19:22:09 +0000 (20:22 +0100)]
Fix parse_uid_arg().
The old code could segfault if an invalid --user argument was given.
Andre Noll [Sat, 1 Nov 2008 19:21:18 +0000 (20:21 +0100)]
Add format string doku, simplify format string handling.
As adu now only prints one list/summary at a time, there's only need
for one format string. So replace the four format-string related
option by a single --format option and add a detailed description
on how adu format strings may be used.
This further simplifies the select code a bit.