Git Product home page Git Product logo

Comments (7)

mrclksr avatar mrclksr commented on June 12, 2024 1

Could you please try to set the for()-loop's limit in dsbmd.c, line 446, from 16 to 3?:

for (i = 0; i < 3; i++) {
        if (pidfile_fileno(pfh) != i)
                (void)close(i);
}

from dsbmd.

Zirias avatar Zirias commented on June 12, 2024

Anything else I could add to help tracking down the problem? Other than digging into the source myself ;) (might do that as well, but I guess it's easier for someone already knowing the structure…)

from dsbmd.

mrclksr avatar mrclksr commented on June 12, 2024

Hi Felix,

thank you for the report. I haven't found the time to dig into this, yet. But I'm going work on it later.

from dsbmd.

Zirias avatar Zirias commented on June 12, 2024

Ok, that fixes the problem. So, does this happen after opening the socket to winbind? ;) Thanks so far!

from dsbmd.

mrclksr avatar mrclksr commented on June 12, 2024

Excellent :)

DSBMD itself doesn't open the winbind socket. I guess it is involved thru PAM when getpwnam() gets called before DSBMD opens the listening socket. PAM/winbind opens a file, then DSBMD closes all file descriptors except for the logfile if -f is not given. DSBMD opens its listening socket, which has the same number as the fd opened by PAM/winbind. Some time after the first call to accept(), PAM/winbind closes its fd, which is now DSBMD's listening socket, and therefore further calls to accept() will fail.

from dsbmd.

Zirias avatar Zirias commented on June 12, 2024

DSBMD itself doesn't open the winbind socket.

I know ;)

I guess it is involved thru PAM when getpwnam() gets called

Certainly! (well probably NSS in that case..)

I was just wondering why some "daemonizing" code gets executed after accepting a connection. Probably, just closing fds is somewhat unsafe ;) I never did that, only used /dev/null to replace the stdio streams (to not risk opening an fd 1 that's later confused for stdout, for example).

Well, thanks again, I'm happy I can use this tool now! :)

from dsbmd.

mrclksr avatar mrclksr commented on June 12, 2024

Certainly! (well probably NSS in that case..)

Ah, thanks.

I was just wondering why some "daemonizing" code gets executed after accepting a connection. Probably, just closing fds is somewhat unsafe ;) I never did that, only used /dev/null to replace the stdio streams (to not risk opening an fd 1 that's later confused for stdout, for example).

Yes.

Well, thanks again, I'm happy I can use this tool now! :)

Me too :)

from dsbmd.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.