• 1
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 9
Adding new password dialog to protect share access
#76
slacker, i used to have it that when the password was pw_prompt it would prompt for a real password. then i switched to using lock_mode = lock_mode_samba. what ocurred to me today is that it just might be best if i put a "samba login" in the main menu where (among other things) scripts are launched from. this would cache both user name and password for the entire session but just for those bookmarks tagged with lock_mode_samba.

it's not just what i want though that matters and there are other choices. for instance, the code could cache different session passwords for each lock_mode_samba tagged share.

also, where to add the code is up in the air. i currently have it in your subroutine havebookmarkpermisions in cguiwindowvideobase but then it would have to be put in each of those base classes for the other categories. it may be that it should be stuck in csmbdirectory so that it can be used by all categories. i'm thinking that if we cache the password, the cache would be in that class also.

i hear you on the password entry issue. i've thought of making a dialog which displays '*' for each character typed. i've also though about keeping the password complex in the samba world (for security reasons) and simple in the xbmc world by mapping the simple password. but then you go back to how to store the complex password securely (encryption) and it just seems a little over kill for me (as a user, i don't mind entering the complex password as little as i would use that type of access).

windows password policy is defined in local account policy. you can define how complex the passwords must be, how many retries and how long before the locked account is unlocked after to many bad attempts. i wouldn't use my main login but one just for the special access shares. if they get locked out, no big deal.

i agree somthing needs to be done about the password dialog. i'd be interested. i believe there is still a need for bookmark based "lock_code" style access for hd, etc.

i still don't have a clue why i'm not going back to the proper parent directory after access of samba share using entered password (see my previous entry on this topic). if anyone has any ideas, let me know. be nice if a developer could lend his expertise here (jonathan??).
Reply
#77
will this be able to lock directories?

my first thought was to "lock" the games rated "mature" so my son won't play them... i setup subdirs under my games dir for teen everyone and mature. i setup bookmarks and lockmode for the mature dir, but it doesn't lock..

after reading your original post, this was not you original intent, however i believe it would be useful....i'd even like to lock him out of the "apps" bookmark to avoid any messing around and possible deletion of stuff...

if this does work today (and i've missed something) please let me know...

thanks!!
Reply
#78
btemp, i am totally reworking my password code right now, and when i'm done you should be able to add your samba lock code just about any of the ways you proposed above.  i have added a new guipassword.cpp file, which currently houses a single function as follows:
   bool cguipassword::isitemunlocked(cfileitem* pitem, const cstdstring &strtype)
this function will replace the current havebookmarkpermissions() in use throughout the various xbmc ui, and the individual havebookmarkpermissions() functions in each of the ui base classes will be removed.  later on, this new guipassword class could be expanded with new functions to support password checking on objects other than cfileitem (like the programs bookmarks for example, locking them is broken right now).

the guidialogpasswordnumeric and guidialogpasswordgamepad code has been renamed to just guidialognumeric and guidialoggamepad, and the following functions have been added to each:
   bool showandgetinput(cstdstringw& atextstring, const cstdstringw &strheading, bool bhideuserinput);
   bool showandgetnewpassword(cstdstringw& strnewpassword);
   int          showandverifypassword(cstdstringw& strpassword, const cstdstringw& strheading, int iretries);
   bool showandverifyinput(cstdstringw& strpassword, const cstdstringw& dlgheading, const cstdstringw& dlgline0, const cstdstringw& dlgline1, const cstdstringw& dlgline2, bool bgetuserinput, bool bhideinputchars);
i have also added a couple functions showandverifypassword and showandgetnewpassword to guidialogkeyboard.cpp.  i've also gone through all three dialogs and converted all strings/char arrays to wide string/wchar_t formats.  
currently i'm hooking up these functions to the music dialogs and finding/fixing the new bugs i just wrote.  then when i've got that done, i will go back and add input-masking capability to the existing guidialogkeyboard ui (and also create overrides to support its previous non-masking, non-wide string functionality).  as you can probably guess, this is taking a bit of time to do.  once it's finished though, you should be able to move your code into it without too much effort.

scampa123, the feature was supposed to support locking top level application bookmarks, but as mentioned above that seems to be broken right now.  i will fix the app bookmark locking in awhile, and i might also add locking for the scripts menu on the main ui.  locking subdirectories within a bookmark is not currently planned.  in the future, if anyone ever figures out how it works, we might be able to directly read the rating level from ntsc games and prompt for an unlock code before launching it...
Reply
#79
hmm....

does anyone have a thought on how i may accomplish this then? is it possible with what you have today to do something similar?

my main goal is to lock-out the possibility of modifying/deleting things....and to lock out the "mature" games from my son...(i have no problem denoting which games are mature)...

so i just need to understand if there is a way to do this today, that maybe i am missing.....

thanks!!
Reply
#80
you cant "lock" the settings screen or anything like that but you can remove it from the menu to prevent people from tampering. you can also remove controls from the windows by modifying the skin.

and if you want to prevent ppl from deleting stuff, just lock all your bookmarks in "my files"

and as slacker said, the locking of my programs currently doesnt work.
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
#81
is it possible to add top level entries then?

in other words, if i add a "games-mature" to the front page, it sounds like i may be able to lock that...if it is possible to add to the top-level menu (i.e. programs, games-mature, music....)

i know there are entries in the xml file for these, i just don't understand the dialogs they are being assinged to to add my own...

thanks!!
Reply
#82
@scampa123

no, you cant lock anything but a share. once the password protection works for my programs bookmarks, you can setup a bookmark for it, example:

Quote:<myprograms>
<bookmark>
<name>games</name>
<path>f:\games</name>
</bookmark>
<bookmark>
<name>mature games</name>
<path>f:\mature games</name>
<lockmode>1</lockmode>
<lockcode>12345678</lockcode>
</bookmark>
</myprograms>

again, this currently does not work for my programs but does work for the other sections. slacker is working on it though.

@slacker

the problem you may be having with my programs could be related to the fact that everything is automaticly added to the database. i'm thinking you probably need to do the check inside the "// launch xbe" section of onclick using the "szpath" parameter.

take a look at my patch for activatewindow, you can copy some of that code. (look in guiwindowmymusicsongs.cpp)

http://sourceforge.net/tracker....=581840

in short, i had to match up a full path to the appropriate bookmark, and then create a temporary pitem to pass to havebookmarkpermissions before allowing the window to open up to that full path.
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
#83
slacker, you been busy! this is all great news. pm me when you get the developers to add the code to cvs so i can do my part but to be honest, the samba password entry code is really very small. i wish i could do more.
Reply
#84
kraqh3d ,

thank you...that is exactly what i want to do...

i will keep looking for this fix in future releases...

thanks again!
Reply
#85
submitted sf patch 1097753. here is the readme.txt:
patch merge instructions:
1) download the 6-jan-2005 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) remove the following new files from the xbmc project in solution explorer:
guidialogpasswordgamepad.cpp and guidialogpasswordnumeric.cpp -> located
in /xbmc/source files/gui dialog
guidialogpasswordgamepad.h and guidialogpasswordnumeric.h -> located in
/xbmc/header files
5) add the following files to the xbmc project in solution explorer:
guidialoggamepad.cpp and guidialognumeric.cpp -> add to
/xbmc/source files/gui dialog
guipassword.cpp -> add to /xbmc/source files/utils
guidialoggamepad.h, guidialognumeric.h, guipassword.h -> add to
/xbmc/header files
6) build the solution, make sure there are no errors (warnings are ok)
7) close vs. run build.bat.
4) delete the following files, they are no longer needed:
xbmc\xbmc\guidialogpassword*.*
8) you're done, the patched cvs is built.


notes:
- rewrote most of the masterlock/share lock code so that it is cleaner
and more reusable elsewhere in xbmc
- added ability to en/disable masterlock and configure it as a
numeric/gamepad/fulltext lock
- added logic which automatically overrides share locks if masterlock
is disabled
- changed default xml config to no security (masterlock disabled)
- added ability to reactivate a share lock after it's already been unlocked
- added ui prompt to remember masterlock until xbmc is rebooted, and
optionally override locally stored lock passwords
- changed numeric lock dialog to put focus on enter button by default
- changed numeric lock remote input so that select == a instead of start
- renamed guidialogpasswordnumeric and guidialogpasswordgamepad code to the
same names without "password" since they are now reusable for other purposes
- added new functions to the cguidialogyesno and cguidialogok to make it
easier to show these dialogs in other code
- edited build.bat to allow it to work on machines with non-standard vs 2003
install paths. you may want to verify the env var used exists on a bunch
of different user installations before accepting the change.


note to xbmc devs merging this into cvs:
i did not convert any dos carriage returns my editing apps may have
inserted to the unix format. i have tools that can do this, but
i'm too paranoid to use them right now for fear that they'll
munge everything up.
i did moderate to heavy testing on this patch. there are some bugs
that i did not fix which are listed below:

1) add/update/delete bookmarks in my videos using the context menu fails
to actually save them to the xml file. the reason is because the strtype
being used is "videos" when the xml specifies "video". i thought i fixed
this once already, but it seems to now be wrong in several different
places that i'm pretty sure i never touched.
2) headings are no longer showing up in gamepad and keyboard dialogs. this
bug also currently is in the cvs. it used to work awhile ago.
3) guikeyboard.cpp has some override cstdstringw functions which use cstdstring
functions, thereby losing the wide data. they need to be reversed so the
cstdstringw is the main function and the cstdstring is the override.
4) the new ui functions i added to some of the guidialog* classes cannot show a
string as a heading or line if it begins with a number, even if the rest of
the string contains text. this is because _wtoi returns the number and drops
the rest of the string, instead of returning -1 as i expected it to do.
Reply
#86
doh, i just realized that i need to go back and fix a lot of the usage comments for the new functions i wrote. most of them have either incorrect or missing usage comments.
Reply
#87
slacker,
you forgot to add the header for xkutils.h to guipassword.cpp. this only hits when compiling a release version which i did because i was looking to see if the linker error i was getting would go away under a release build. it didn't.

i don't know why but i was missing some lib files in the download i did today from cvs. i kept getting "cannot open file" to the path xbmc/lib/liblame/liblame.lib. i just copied the liblame directory from a december download i had. also, the liboggvorbis lib directory was missing.
Reply
#88
thanks btemp, good catch.  i've just fixed the xkutils bug, added usage comments for the new functions i wrote, and thanks to a tip from kraqh3d i also fixed the bug #4 ("can't show a string that begins with a number") i listed in the previous patch readme.txt.  i also picked up the cvs changes all the way up to this point:
 - 08-01-2005 changed: minor guiimage & xprfont performance tweaks
posting to sf now...

i'm not sure what's the deal with your missing directories.  personally, i always d/l the cvs to a folder, make a copy of that folder, and work strictly with the copy.
Reply
#89
is there a certain version of the xdk that the xbmc is meant to be built with?
Reply
#90
5788 and above should be fine.
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
  • 4
  • 5
  • 6(current)
  • 7
  • 8
  • 9

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