From: Andre Noll Date: Sun, 9 Jun 2013 15:48:36 +0000 (+0200) Subject: Fix user summary accounting if pattern is given. X-Git-Tag: v1.0.0~19 X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=commitdiff_plain;h=3a51a868784e755c34f19a16970118936fbf299f;hp=61a9284a7dbcffd2a770135d5f2482ae10459ab9 Fix user summary accounting if pattern is given. In user summary select mode we iterate over each row in the user info table and get the directory name from the number stored in the row. Next we match this name against the given pattern and only take matching directories into account for the user summary. Currently we call get_dir_name_of_row(), but this is wrong: Since we iterate over the user info table, we must call get_dir_name_of_user_row() instead as the former function expects a pointer to a dir table row. This bug caused wrong directory names to be matched against the pattern, hence the results of the user summary were incorrect. --- diff --git a/select.c b/select.c index df68b67..15ad707 100644 --- a/select.c +++ b/select.c @@ -436,6 +436,7 @@ static int print_global_summary(struct format_info *fi) return output("%s", select_conf.trailer_arg); } +/* row: a pointer to a row of the *user* table */ static int user_summary_loop_function(struct osl_row *row, void *data) { struct user_summary_info *usi = data; @@ -444,7 +445,7 @@ static int user_summary_loop_function(struct osl_row *row, void *data) if (usi->preg) { char *dirname; - ret = get_dir_name_of_row(row, &dirname); + ret = get_dir_name_of_user_row(row, usi->ui, &dirname); if (ret < 0) goto err; ret = dir_is_admissible(dirname, usi->preg, usi->inverse_matching);