Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Tuesday August 05, 2003
11:58 PM

/etc functions for windows

[ #13942 ]
I was going over some of the get* functions (getpwnam, getlogin, etc), and I noticed that they're still not implemented for Win32.

Then I happened across this page from MSDN and, in addition to some other interesting information for converting *nix to Win32 systems, it shows some ways to implement some of these functions use the Net* series of methods from the Windows library.

Would this be something worth adding for 5.10 or does the Win32API module already make this easy enough?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • If we can make them work on win32, it will make porting easier, but then I don't really know what I am talking about.
    --
    sky
    • The main issue would be that the API would be slightly different. In Unix-land, when you call getpwnam, you're checking against the local box. In Windows-land, you can check against the local box *or* a remote server that stores that info in a database.

      That means getpwnam would have to allow a second argument (calling NetUserGetInfo() behind the scenes), but only on Win32. I dunno if Jarkko (or whoever the 5.10 pumpking is) would be ok with that or not.

      • The main issue would be that the API would be slightly different. In Unix-land, when you call getpwnam, you're checking against the local box.

        get* are also network aware, though -- they will query NIS and other authentication systems as necessary (as configured in /etc/nsswitch.conf or its moral equivalent).

        --
        (darren)
        • Ah, ok. There would still be a slight change in that you would need to accept an optional second argument. The 2nd argument (or NULL) would then be passed on as the server name to the NetUserGetInfo() call (or whatever). Presumably, it would just be ignored on *nix.

          Also, the return values would be different. I was playing around last night and it appears that there are several options for the choice of struct you can grab, depending on your permissions level.

          I guess as long as it's documented, it sh