win32utils-devel@rubyforge.org
2004-Mar-11 20:37 UTC
[Win32utils-devel] win32-etc-0.2.2 testing wanted
I''ve commited code for win32-etc 0.2.2, which adds the configure_user and configure_group methods. Testing appreciated. On my home system, I can''t get configure_user to work, but I haven''t any real idea why it fails. The configure_group method seems to work fine, however. Dan _________________________________________________________________ Fast. Reliable. Get MSN 9 Dial-up - 3 months for the price of 1! (Limited-time Offer) http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/
win32utils-devel@rubyforge.org
2004-Mar-11 21:52 UTC
[Win32utils-devel] win32-etc-0.2.2 testing wanted
See attached test results on Win XP (Home). ----- Original Message ----- From: <win32utils-devel@rubyforge.org> To: <win32utils-devel@rubyforge.org> Sent: Thursday, March 11, 2004 7:23 PM Subject: [Win32utils-devel] win32-etc-0.2.2 testing wanted> I''ve commited code for win32-etc 0.2.2, which adds the configure_user and > configure_group methods. Testing appreciated. On my home system, I can''t > get configure_user to work, but I haven''t any real idea why it fails. The > configure_group method seems to work fine, however. > > Dan > > _________________________________________________________________ > Fast. Reliable. Get MSN 9 Dial-up - 3 months for the price of 1! > (Limited-time Offer)http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/> > _______________________________________________ > win32utils-devel mailing list > win32utils-devel@rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel >-------------- next part -------------- Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\win32utils\win32-etc>..\install.cmd C:\win32utils\win32-etc>ruby extconf.rb checking for main() in netapi32.lib... yes creating Makefile C:\win32utils\win32-etc>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cl -nologo -MD -Zi -O2b2xg- -G6 -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -I. -I./.. -I./../missing -c -Tcetc.c etc.c cl -nologo -LD -Feetc.so etc.obj msvcrt-ruby18.lib netapi32.lib oldnames.lib user32.lib advapi32.lib wsock32.lib -link -incremental:no -debug -opt:ref -opt:icf -dll -libpath:"c:/ruby/lib" -def:etc-i386-mswin32.def Creating library etc.lib and object etc.exp C:\win32utils\win32-etc>nmake site-install Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. install -c -p -m 0755 etc.so c:/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt/win32 C:\win32utils\win32-etc>cd test C:\win32utils\win32-etc\test>ruby tc_etc.rb Loaded suite tc_etc Started .............. Finished in 10.265 seconds. 14 tests, 28 assertions, 0 failures, 0 errors C:\win32utils\win32-etc\test>ruby test.rb VERSION: 0.2.2 getlogin test ============Shashank Date getpwnam test ============#<struct Struct::Passwd name="Guest", uid=501, comment="Built-in account for guest access to the computer/domain", usr_comment="", full_name="", priv="guest", auth_flags=[], password_age=0, home_dir="", parms="", last_logon=1078538516, last_logoff=0, bad_pw_count=0, num_logons=2, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> getpwuid test ============#<struct Struct::Passwd name="Guest", uid=501, comment="Built-in account for guest access to the computer/domain", usr_comment="", full_name="", priv="guest", auth_flags=[], password_age=0, home_dir="", parms="", last_logon=1078538516, last_logoff=0, bad_pw_count=0, num_logons=2, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> getgrgid test ============#<struct Struct::Group name="None", comment="Ordinary users", gid=513, type="global"> getgrnam test ============#<struct Struct::Group name="Guests", comment="Guests have the same access as members of the Users group by default, except for the Guest account which is further restricted", gid=nil, type="local"> group test =========#<struct Struct::Group name="Administrators", comment="Administrators have complete and unrestricted access to the computer", gid=nil, type="local"> #<struct Struct::Group name="Guests", comment="Guests have the same access as members of the Users group by default, except for the Guest account which is further restricted", gid=nil, type="local"> #<struct Struct::Group name="Users", comment="Users are prevented from making accidental or intentional system-wide changes. Thus, Users can run certified applications, but not most legacy applications", gid=nil, type="local"> #<struct Struct::Group name="Debugger Users", comment="Debugger users can debug processes on this machine, both locally and remotely", gid=nil, type="local"> #<struct Struct::Group name="HelpServicesGroup", comment="Group for the Help and Support Center", gid=nil, type="local"> #<struct Struct::Group name="None", comment="Ordinary users", gid=513, type="global"> passwd test ==========#<struct Struct::Passwd name="Administrator", uid=500, comment="Built-in account for administering the computer/domain", usr_comment="", full_name="", priv="admin", auth_flags=[], password_age=0, home_dir="", parms="", last_logon=0, last_logoff=0, bad_pw_count=0, num_logons=0, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="ASPNET", uid=1013, comment="Account used for running the ASP.NET worker process (aspnet_wp.exe)", usr_comment="Account used for running the ASP.NET worker process (aspnet_wp.exe)", full_name="ASP.NET Machine Account", priv="user", auth_flags=[], password_age=8629732, home_dir="", parms=" P\004\032\010\001CtxCfgPresent????\030\010\001CtxCfgFlags1????\022\010\001CtxShadow????*\002\001CtxMinEncryptionLevel?", last_logon=0, last_logoff=0, bad_pw_count=0, num_logons=0, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="Guest", uid=501, comment="Built-in account for guest access to the computer/domain", usr_comment="", full_name="", priv="guest", auth_flags=[], password_age=0, home_dir="", parms="", last_logon=1078538516, last_logoff=0, bad_pw_count=0, num_logons=2, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="HelpAssistant", uid=1005, comment="Account for Providing Remote Assistance", usr_comment="", full_name="Remote Desktop Help Assistant Account", priv="guest", auth_flags=[], password_age=13729710, home_dir="", parms="", last_logon=0, last_logoff=0, bad_pw_count=0, num_logons=0, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="Shashank Date", uid=1006, comment="", usr_comment="", full_name="", priv="admin", auth_flags=[], password_age=13735974, home_dir="", parms="", last_logon=1079007403, last_logoff=0, bad_pw_count=0, num_logons=352, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="SUPPORT_388945a0", uid=1002, comment="This is a vendor''s account for the Help and Support Service", usr_comment="", full_name="CN=Microsoft Corporation,L=Redmond,S=Washington,C=US", priv="guest", auth_flags=[], password_age=47458110, home_dir="", parms="", last_logon=0, last_logoff=0, bad_pw_count=0, num_logons=0, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="SUPPORT_b326ad0c", uid=1004, comment="This is a vendor''s account for the Help and Support Service", usr_comment="", full_name="CN=Compaq Computer Corporation,L=Houston,S=Texas,C=US", priv="guest", auth_flags=[], password_age=37639629, home_dir="", parms="", last_logon=0, last_logoff=0, bad_pw_count=0, num_logons=0, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> #<struct Struct::Passwd name="VUSR_MYLAPTOP", uid=1012, comment="Account for the Visual Studio Analyzer server components", usr_comment="", full_name="VSA Server Account", priv="guest", auth_flags=[], password_age=13755096, home_dir="", parms="", last_logon=0, last_logoff=0, bad_pw_count=0, num_logons=0, logon_server="\\\\*", country_code=0, workstations="", max_storage=4294967295, code_page=0> Everything seems ok. Now run ''nmake site-install'' if you wish to install C:\win32utils\win32-etc\test>ruby test_admin.rb test_admin.rb:51: syntax error :flags => 0, ^ test_admin.rb:53: syntax error C:\win32utils\win32-etc\test>
win32utils-devel@rubyforge.org
2004-Mar-11 23:25 UTC
[Win32utils-devel] win32-etc-0.2.2 testing wanted
>C:\win32utils\win32-etc\test>ruby test_admin.rb >test_admin.rb:51: syntax error > :flags => 0, > ^ >test_admin.rb:53: syntax errorNo, that''s just a typo. Here''s what happens if I just try this: Etc::Admin.configure_user( :user_name => user, :description => "Total loser - delete asap" ) C:\eclipse\workspace\win32-etc-0.2.2\test>ruby test_admin.rb -k foo VERSION: 0.2.2 test_admin.rb:48:in `configure_user'': unknown error: 87 (Win32::Etc::AdminError) 87 is "bad parameter". I didn''t actually track down *which* parameter (uh, still trying to figure that out) but knowing that won''t make me less confused (will it?). Any ideas? Dan _________________________________________________________________ Frustrated with dial-up? Lightning-fast Internet access for as low as $29.95/month. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
win32utils-devel@rubyforge.org
2004-Mar-12 00:07 UTC
[Win32utils-devel] win32-etc-0.2.2 testing wanted
Hi Dan,> No, that''s just a typo. Here''s what happens if I just try this:Yes, indeed ! Sorry for the noise ...> C:\eclipse\workspace\win32-etc-0.2.2\test>ruby test_admin.rb -k foo > VERSION: 0.2.2 > test_admin.rb:48:in `configure_user'': unknown error: 87 > (Win32::Etc::AdminError) > > 87 is "bad parameter". I didn''t actually track down *which* parameter(uh,> still trying to figure that out) but knowing that won''t make me less > confused (will it?).I get a different error number 2221 which means: 2221 The user name could not be found. NERR_UserNotFound C:\win32utils\win32-etc\test>ruby test_admin.rb -k foo VERSION: 0.2.2 test_admin.rb:48:in `configure_user'': unknown error: 2221 (Win32::Etc::AdminError) from test_admin.rb:48 C:\win32utils\win32-etc\test>
win32utils-devel@rubyforge.org
2004-Mar-12 09:56 UTC
[Win32utils-devel] win32-etc-0.2.2 testing wanted
> -----Original Message----- > From: win32utils-devel-bounces@rubyforge.org > [mailto:win32utils-devel-bounces@rubyforge.org] On Behalf Of > win32utils-devel@rubyforge.org > Sent: Thursday, March 11, 2004 9:54 PM > To: win32utils-devel@rubyforge.org > Subject: Re: [Win32utils-devel] win32-etc-0.2.2 testing wanted > > > > Hi Dan, > > > No, that''s just a typo. Here''s what happens if I just try this: > > Yes, indeed ! Sorry for the noise ... > > > C:\eclipse\workspace\win32-etc-0.2.2\test>ruby test_admin.rb -k foo > > VERSION: 0.2.2 > > test_admin.rb:48:in `configure_user'': unknown error: 87 > > (Win32::Etc::AdminError) > > > > 87 is "bad parameter". I didn''t actually track down > *which* parameter > (uh, > > still trying to figure that out) but knowing that won''t > make me less > > confused (will it?). > > I get a different error number 2221 which means: > 2221 The user name could not be found. NERR_UserNotFound > > > C:\win32utils\win32-etc\test>ruby test_admin.rb -k foo > VERSION: 0.2.2 > test_admin.rb:48:in `configure_user'': unknown error: 2221 > (Win32::Etc::AdminError) > from test_admin.rb:48 > > C:\win32utils\win32-etc\test>Hmm...I wondered if somehow it wasn''t finding the user. The only thing I could think of was that maybe it was a wide-character issue again (I''ve seen that happen before). That, or it''s not looking for local users, only global, but the docs don''t say that. Ideas anyone? Dan
win32utils-devel@rubyforge.org
2004-Mar-12 10:06 UTC
[Win32utils-devel] win32-etc-0.2.2 testing wanted
Hi, ----- Original Message ----- From: <win32utils-devel@rubyforge.org> To: <win32utils-devel@rubyforge.org> Sent: Friday, March 12, 2004 1:12 PM Subject: [Win32utils-devel] win32-etc-0.2.2 testing wanted> > >C:\win32utils\win32-etc\test>ruby test_admin.rb > >test_admin.rb:51: syntax error > > :flags => 0, > > ^ > >test_admin.rb:53: syntax error > > No, that''s just a typo. Here''s what happens if I just try this: > > Etc::Admin.configure_user( > :user_name => user, > :description => "Total loser - delete asap" > ) > > C:\eclipse\workspace\win32-etc-0.2.2\test>ruby test_admin.rb -k foo > VERSION: 0.2.2 > test_admin.rb:48:in `configure_user'': unknown error: 87 > (Win32::Etc::AdminError) > > 87 is "bad parameter". I didn''t actually track down *which* parameter(uh,> still trying to figure that out) but knowing that won''t make me less > confused (will it?). > > Any ideas? > > Dan >There was two bugs in etc.c First, line 664 in function etc_add_user switch(rv) should be switch(r) Second, related USER_INFO_1 structure in etc_config_user Try with LPUSER_INFO_1 like this: =======================================================static VALUE etc_config_user(VALUE mod, VALUE rbHash){ LPUSER_INFO_1 puiUser = NULL; LPCWSTR lpServerName = NULL; LPCWSTR lpUser = NULL; VALUE rbVal; DWORD dwLevel = 1; NET_API_STATUS nStatus; LPDWORD index = 0; Check_Type(rbHash,T_HASH); rbHash = normalize(rbHash,"user"); if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("user_name"))) != Qnil){ Check_Type(rbVal,T_STRING); lpUser = AllocWideLString(rbVal); } else{ rb_raise(rb_eStandardError,"No user name provided"); } if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("host"))) != Qnil){ Check_Type(rbVal,T_STRING); lpServerName = AllocWideLString(rbVal); } // Get the current info, change whatever is set by programmer nStatus = NetUserGetInfo( NULL, lpUser, dwLevel, (LPBYTE*)&puiUser ); if(NERR_Success != nStatus){ handle_user_error(nStatus); } if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("password"))) != Qnil){ puiUser->usri1_password = AllocWideLString(rbVal); } if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("home_dir"))) != Qnil){ Check_Type(rbVal,T_STRING); puiUser->usri1_home_dir = AllocWideLString(rbVal); } if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("description"))) != Qnil){ puiUser->usri1_comment = AllocWideLString(rbVal); } if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("flags"))) != Qnil){ puiUser->usri1_flags = NUM2INT(rbVal); // The docs say this value must be set, so I''ll do it automatically puiUser->usri1_flags |= UF_SCRIPT; } if( (rbVal = rb_hash_aref(rbHash,rb_str_new2("script_path"))) != Qnil){ puiUser->usri1_script_path = AllocWideLString(rbVal); } nStatus = NetUserSetInfo( NULL, lpUser, dwLevel, (LPBYTE)(puiUser), index ); if(NERR_Success != nStatus){ handle_user_error(nStatus); } return Qtrue; } ===================================================== Regards, Park Heesob