]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge topic branch t/afs-ls-a into master
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 15 Oct 2023 15:54:41 +0000 (17:54 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 15 Oct 2023 15:55:31 +0000 (17:55 +0200)
A new feature for the ls command. Unfortunately, several bugs were
found after the topic graduated to next, so the series contains a few
fixup commits on top of the single patch which implements the feature.

* refs/heads/t/afs-ls-a:
  afs: Really fix memory leak in mood_load().
  afs: Fix memory leak in mood_load().
  playlist: Fix error handling of playlist_load().
  server: Fix NULL pointer dereference in com_ls().
  Implement ls --admissible=m/foo.

1  2 
NEWS.md
afs.c
aft.c
mood.c

diff --cc NEWS.md
index a0484f09d177cb3f7effdd4962650cdce28281ad,598db71fae93734158509fa5f76853ceb09ccb7b..22816b1911a7613a233481df0ff4ac7e07bb6a81
+++ b/NEWS.md
@@@ -1,21 -1,6 +1,24 @@@
  NEWS
  ====
  
 +----------------------------------------------
 +0.7.3 (to be announced) "weighted correctness"
 +----------------------------------------------
 +
 +- Old style PEM keys are now deprecated. They still work but their
 +  use results in a run-time warning. The removal of PEM key support is
 +  scheduled for paraslash-0.8.0.
 +- Version 1.0 of the openssl library has been deprecated. A warning
 +  is printed at compile-time on systems which have this outdated version
 +  because it will no longer be supported once paraslash-0.8.0 comes out.
 +- A spring cleanup for the senescent code in fd.c.
++- The --admissible option of the ls command now takes an optional
++  argument. When invoked like --admissible=m/foo, only files which are
++  admissible with respect to mood foo are listed.
 +
 +Downloads:
 +[tarball](./releases/paraslash-git.tar.xz)
 +
  -------------------------------------
  0.7.2 (2023-03-08) "optical friction"
  -------------------------------------
diff --cc afs.c
index 865effde671a4848298ab09d502898c6225a937c,9e679dcf14ebee2a36a83aa02882ba96950e7b21..3083084c25ac793cfd3a5cad1f93c6e78f0fa413
--- 1/afs.c
--- 2/afs.c
+++ b/afs.c
@@@ -951,8 -962,7 +951,8 @@@ __noreturn void afs_init(int socket_fd
        }
        ret = schedule(&s);
        sched_shutdown(&s);
-       mood_unload();
-       playlist_unload();
+       mood_unload(NULL);
++      playlist_unload(NULL);
  out_close:
        close_afs_tables();
  out:
diff --cc aft.c
Simple merge
diff --cc mood.c
index e85cf36a35b9e533370bddd95c5c5db74a214e85,18c02f7fa2f0529175c4b84bfc73600354fa3211..b4d50c88e73533c69e7473c072e3aaef1c196d99
--- 1/mood.c
--- 2/mood.c
+++ b/mood.c
@@@ -628,12 -657,15 +657,16 @@@ int mood_load(const char *mood_name, st
        if (msg)
                *msg = get_statistics(aa.m, rnow.tv_sec);
        ret = aa.m->stats.num;
-       mood_unload();
-       current_mood = aa.m;
+       if (result)
+               *result = aa.m;
+       else {
+               mood_unload(NULL);
+               current_mood = aa.m;
+       }
 +      ret = 1;
  out:
        free(aa.array);
 -      if (ret < 0)
 +      if (ret <= 0) /* error, or no admissible files */
                destroy_mood(aa.m);
        return ret;
  }