• 1
  • 2(current)
  • 3
  • 4
  • 5
  • 9
Adding new password dialog to protect share access
#16
i'm 99% done, but have been stuck at one last part for the past week and a half (i haven't been doing much with it though lately).  i currently have two functions:
   bool setbookmarklocks(const cstdstring& strtype, bool bengagelocks);
   bool setbookmarklocks(tixmldocument* xmldoc, const cstdstring& strtype, vecshares& items, bool bengagelocks);
the first one is used to easily update lock status from within the various guiwindow places, and actually just calls the second function with the same xbmcxml and m_vecmyfooshares objects that csettings::addbookmark uses.  the second one is used within csettings::load to update the locks and xml file just after loading it with csettings:getshares.  here's the problem:  everything compiles, but i keep getting a link error as follows ("thiscall" was preceded by two underscores but that seems to mess up the forum post form-- it deletes everything in between the two double underscores):

xbmc error lnk2019: unresolved external symbol "public: bool thiscall csettings:Confusedetbookmarklocks(class tixmldocument *,class cstdstr<char> const &,class std::vector<class cshare,class std::allocator<class cshare> > &,bool)const " (?setbookmarklocks@csettings@@qbe_npavtixmldocument@@abv?$cstdstr@d@@aav?$vector@vcshare@@v?$allocator@vcshare@@@std@@@std@@_n@z) referenced in function "public: bool thiscall csettings::load(bool &,bool &)" (?load@csettings@@qae_naa_n0@z)

i can't figure out what would be external; both functions are in the same piece of code.  the error is not very helpful at all to me, i'm still new to the world of c++.  any pointers (no pun intended)?
Reply
#17
disregard my previous post, i got it working.  i gave up on trying to passing in a tixmldocument just so i can reset the locks from within csettings::load.  so now i instead just use this one function right at the very end of capplication::create to re-enable locks during boot as well as to en/disable them in the guiwindow ui.
  bool setbookmarklocks(const cstdstring& strtype, bool bengagelocks);

i will now move my changes into the latest cvs, comment the changes, and submit a patch.  how do i submit a patch?

also, i've always gotten tons of benign but annoying warnings that look like this every time i build xbmc.  is this normal?
xeniumspig.lib(xeniumspi.obj) : warning lnk4204: 'h:\xbmc_src-cvs\xbmc\debug\vc70.pdb' is missing debugging information for referencing module; linking object as if no debug info
libxbmsd.lib(ccbuffer.obj) : warning lnk4204: 'h:\xbmc_src-cvs\xbmc\debug\vc70.pdb' is missing debugging information for referencing module; linking object as if no debug info
libxbmsd.lib(ccutil.obj) : warning lnk4204: 'h:\xbmc_src-cvs\xbmc\debug\vc70.pdb' is missing debugging information for referencing module; linking object as if no debug info
(on and on ad nauseum, 673 of these warnings total)
Reply
#18
Question 
(slacker @ dec. 03 2004,07:03 Wrote:how do i submit a patch?
http://www.xboxmediacenter.com/info_faq.htm#patches :thumbsup:
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#19
and warnings are kinda ok. you only have to worry about errors. Wink
read the xbmc online-manual, faq and search the forums before posting! do not e-mail the xbmc-team asking for support!
read/follow the forum rules! note! team-xbmc never have and never will host or distribute ms-xdk binaries/executables!
Reply
#20
patch submitted on sf, #1079275.  also submitted via xbmc website incase i didn't get the sf submission done right.

here are the sf details i posted:
adds ability to lock bookmarks.  here are the new sections in the updated xboxmediacenter.xml, which explains most of it pretty well.  i've also added context menus to lock/remove/reset bookmarks directly in the xbmc ui.  in order to do this, i had to make some changes to some of the existing bookmark editing functions.  i've tested it all a bunch, but there is probably a couple minor issues lurking around.  also, this is my first work in c++, ever.  i've read a lot of it, and i've written stuff in c#, assembly and other languages/scripts, but i had to learn a bunch of new stuff to get this working.  please feel free to post questions, tips, rants, etc. to the thread at http://www.xboxmediaplayer.de/cgi-bin....3;st=0.

 <masterlock>
   <!--  set to 0 to allow infinite password retries in xbmc. setting a positive  !-->
   <!--  number n will deny access to any locked bookmark if n consecutive bad    !-->
   <!--  passwords are sent for any locked bookmark.                              !-->
   <maxretry>0</maxretry>
   <!--  set to 1 to allow xbmc master lock to shut off the xbox if the user      !-->
   <!--  enters too many bad master lock password retries. set to 0 to disable.  !-->
   <enableshutdown>1</enableshutdown>
   <!--  set mastercode to a number between four and eight digits long.  if you   !-->
   <!--  set an alphanumeric code, you will be unable to unlock xbmc on startup!  !-->
   <mastercode>12345</mastercode>
 </masterlock>

...


 <!-- all bookmarks can be locked by adding lockmode/lockcode values as follows:  !-->
 <!-- set lockmode to:                                                            !-->
 <!--    0 = bookmark not locked. this is the default value if not specified.     !-->
 <!--    1 = numeric lock. can be typed via on screen numpad or remote control.   !-->
 <!--    2 = gamepad lock. enter by pushing xbox controller button sequence.      !-->
 <!--    3 = full-text lock. enter with on screen keyboard or usb keyboard.       !-->
 <!-- lockcode: where lockmode is set to value:                                   !-->
 <!--    1:  enter numeric password only. do not use spaces or other characters.  !-->
 <!--    2:  enter gamepad button sequence using the following letter codes:      !-->
 <!--        a b x y = same as buttons on gamepad                                 !-->
 <!--        u d l r = d-pad up, down, left, right                                !-->
 <!--        w k ( ) = white, black, left trigger, right trigger                  !-->
 <!--    3:  enter html-escaped alphanumeric password.  make sure all characters  !-->
 <!--        are available on your language's on screen keyboard/usb keyboard.    !-->
 <!-- example:                                                                    !-->
 <!--    <bookmark>                                                               !-->
 <!--       <name>smb</name>                                                      !-->
 <!--       <path>smb://domain;username:pwd@mywindowsserver/movies/</path>        !-->
 <!--       <lockmode>1</lockmode>                                                !-->
 <!--       <lockcode>12345678</lockcode>                                         !-->
 <!--    </bookmark>                                                              !-->
Reply
#21
correction: whoever merges this patch into the cvs, can you please fix the comments for the <mastercode> tax in xboxmediacenter.xml to read as follows? i didn't implement an xbmc startup lock, so the comments i submitted in the patch (the ones listed above) are inaccurate.


<!-- set mastercode to a numeric password. if you put non-numeric characters !-->
<!-- in mastercode, you will be unable to unlock the xbmc master lock! !-->
<mastercode>12345</mastercode>
Reply
#22
found some bugs already. context menu for locks in my videos isn't working properly, and gamepad lock dialogs in my pictures show up with the wrong strings. probably happened right after i resorted my localization strings and went through all my code to update the string ids. will fix tomorrow and send another patch.

also, for those picking up this patch, you will need to manually copy the defaultlocked*.png files over to the skin folder, they don't get copied by the build process automatically since xbmc is using texture.xpr.
Reply
#23
fixed patch uploaded to sf.net and also to xbmc upload page. bugs fixed:
- correct strings weren't always displayed in numeric and gamepad unlock dialogs
- video locks were totally busted due to some functions searching for "videos" xml tag instead of "video"
- full-text locks were incorrectly being saved by context menu as numeric locks
- file manager window had problems where changes to a lock' state on one list pane did not always update on the other pane

still to implement:
- my programs window does not support lock states. i tried some initial stuff to get this working, but i was getting link errors so i commented it out. search the updated patch for "locksbug:" to see what i did, maybe someone else has a better idea for getting this working.
- hook up <startuplock> tag in <masterlock> so that it prompts for the master code on xbmc startup if not set to 0. if it's a negative value, the startup lock will set it back to zero upon successful mastercode submission. this way other code that also prompts for xbmc masterlock can set it to -1 after the user inputs mastercode too many times, and then shut off the xbox.
- implement samba locks. this basically makes the user input their (username and) password when they click on the share, and xbmc uses this data for the smb auth attempt. this lets users leave the user/pass info empty in xboxmediacenter.xml.
- since we now have a gamepad password dialog, we could use it to prompt for the parental control code stored in the xbox eeprom when ntsc users try to play dvds and xbox games that are marked with parental lock data.
- searching inserted xbox memory cards for an xml file containing bookmark passwords, and if found, automatically unlock those bookmarks and show a quick ok dialog saying stuff got unlocked. this basically turns your memory card into an electronic skeleton key.
Reply
#24
great work Smile
will this be added into the cvs soon or should i work out how to patch cvs.

do patchs get embedded into cvs by anyone or is it up us?

if so is there any time frame this will happen?

nag nag bitch bitch



:thumbsup: :thumbsup:
Reply
#25
the readme.txt i put in the patch isn't very good, so here are some better instructions:
1) download the 02-12-2004 cvs to a folder
2) download the patch
3) unzip the patch and copy the files/folders in it onto the cvs, overwriting existing files.
4) open the xbmc solution in vs, then make sure that xbmc is set as the startup project in solution explorer (it should be in bold print)
5) add the following new files to the xbmc project in solution explorer:
-guidialogpasswordgamepad.cpp and guidialogpasswordnumeric.cpp  -> add them to /xbmc/source files/gui other
-guidialogpasswordgamepad.h and guidialogpasswordnumeric.h -> add them to /xbmc/header files
6) build the solution, make sure there are no errors (warnings are ok)
7) close vs.  run build.bat, then when it finishes, copy xbmc\skin\project mayhem\media\defaultlocked.png and defaultlockedbig.png to xbmc\build\skin\project mayhem\media since build.bat doesn't do it for you
8) you're done, the patched cvs is built.

note: do not attempt to load multiple patches into a cvs.  bad stuff could happen if both patches touch the same files.  bad stuff could also happen if you pick up a patch designed for an older cvs.
Reply
#26
is this going to be placed in cvs or is it going to stay as a patch?

cheers
Reply
#27
that's up to the devs and project managers.
Reply
#28
please developers can we have some info if passwords will be added to xbmc cvs build. cheers
Reply
#29
yet another update, this version is xbmcaddpwd_v3.zip. what's new:
- locked bookmarks now prompt for mastercode when user tries to add/view/edit/delete share settings with the context menu
- added <protectshares> tag in xboxmediacenter.xml which also prompts for mastercode when the user tries to add/view/edit/delete *any* share settings with the context menu. disabled by default.
prior to this update, if a user couldn't unlock a folder, all they had to do was edit its path to view the share path/credentials, and then go create another one just like it (or to just steal the credentials and use their own computer to get to the share).
Reply
#30
hi,

Quote:if (0 < ilockmode )//|| 0 != g_stsettings.m_imasterlockprotectshares)

there is no definion in your uploaded patches for-->
g_stsettings.m_imasterlockprotectshares in csettings::csettings! check this again then fix it!

regards
geminiserver
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
  • 1
  • 2(current)
  • 3
  • 4
  • 5
  • 9

Logout Mark Read Team Forum Stats Members Help
Adding new password dialog to protect share access0