/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to dracut-module/password-agent.c

  • Committer: Teddy Hogeborn
  • Date: 2024-11-17 18:43:11 UTC
  • Revision ID: teddy@recompile.se-20241117184311-ox25kvngy62h209g
Debian package: Avoid suggesting a C compiler unnecessarily

The list of suggested packages, meant to enable the "mandos" program
to find the correct value of SO_BINDTODEVICE by using a C compiler,
are not necessary when Python 3.3 or later is used, since it has the
SO_BINDTODEVICE constant defined in the "socket" module.  Also, Python
2.6 or older has the same constant in the old "IN" module.  Therefore,
we should suggest these Python versions as alternatives to a C
compiler, so that a C compiler is not installed unnecessarily.

debian/control (Package: mandos/Suggests): Add "python3 (>= 3.3)" and
"python (<= 2.6)" as alternatives to "libc6-dev | libc-dev" and
"c-compiler".

Show diffs side-by-side

added added

removed removed

Lines of Context:
1488
1488
    if(send_buffer == NULL){
1489
1489
      error(0, errno, "Failed to allocate send_buffer");
1490
1490
    } else {
 
1491
#if defined(__GNUC__) and __GNUC__ >= 5
 
1492
#pragma GCC diagnostic push
 
1493
  /* mlock() does not access the memory */
 
1494
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
 
1495
#endif
1491
1496
      if(mlock(send_buffer, send_buffer_length) != 0){
 
1497
#if defined(__GNUC__) and __GNUC__ >= 5
 
1498
#pragma GCC diagnostic pop
 
1499
#endif
1492
1500
        /* Warn but do not treat as fatal error */
1493
1501
        if(errno != EPERM and errno != ENOMEM){
1494
1502
          error(0, errno, "Failed to lock memory for password"
2661
2669
  bool password_is_read = false;
2662
2670
  const char helper_directory[] = "/nonexistent";
2663
2671
  const char *const argv[] = { "/bin/sh", "-c",
2664
 
    "echo -n ${MANDOSPLUGINHELPERDIR}", NULL };
 
2672
    "printf %s \"${MANDOSPLUGINHELPERDIR}\"", NULL };
2665
2673
 
2666
2674
  const bool success = start_mandos_client(queue, epoll_fd,
2667
2675
                                           &mandos_client_exited,
4847
4855
  memcpy(ievent->name, dummy_file_name, sizeof(dummy_file_name));
4848
4856
  const size_t ievent_size = (sizeof(struct inotify_event)
4849
4857
                              + sizeof(dummy_file_name));
 
4858
#if defined(__GNUC__) and __GNUC__ >= 11
 
4859
#pragma GCC diagnostic push
 
4860
  /* ievent is pointing into a struct which is of sufficient size */
 
4861
#pragma GCC diagnostic ignored "-Wstringop-overread"
 
4862
#endif
4850
4863
  g_assert_cmpint(write(pipefds[1], (char *)ievent, ievent_size),
4851
4864
                  ==, ievent_size);
 
4865
#if defined(__GNUC__) and __GNUC__ >= 11
 
4866
#pragma GCC diagnostic pop
 
4867
#endif
4852
4868
  g_assert_cmpint(close(pipefds[1]), ==, 0);
4853
4869
 
4854
4870
  bool quit_now = false;