Making a modal window

2018-12-09 Thread J.Arun Mani
Hello,
[I'M UNSURE WHETHER IT IS THE RIGHT PLACE TO ASK THIS QUESTION. IF NOT PLEASE 
GUIDE ME TO THE RIGHT PLACE]
I'm making a project(using Python3) which opens whenever someone opens their 
computer (assume Linux-Debain based) and asks them some details. The user 
should not be allowed to use the computer without giving the details. The 
project is based on GTK3 and is for Debian based OS. I need help in the 
following-
How can I make the application modal? That is, make sure that the user cannot 
access any thing in desktop without giving the details (the application is a 
compulsory one, thus one should not be able to close or minimise it).

I researched on this a bit and found the answers leading to Desktop Managers. 
But I'm stuck how to start with them. So need some help here.

Thank You
J. Arun Mani

Re: Making a modal window

2018-12-09 Thread Gene Heskett
On Sunday 09 December 2018 13:03:53 J.Arun Mani wrote:

> Hello,
> [I'M UNSURE WHETHER IT IS THE RIGHT PLACE TO ASK THIS QUESTION. IF NOT
> PLEASE GUIDE ME TO THE RIGHT PLACE] I'm making a project(using
> Python3) which opens whenever someone opens their computer (assume
> Linux-Debain based) and asks them some details. The user should not be
> allowed to use the computer without giving the details. The project is
> based on GTK3 and is for Debian based OS. I need help in the
> following- How can I make the application modal? That is, make sure
> that the user cannot access any thing in desktop without giving the
> details (the application is a compulsory one, thus one should not be
> able to close or minimise it).
>
> I researched on this a bit and found the answers leading to Desktop
> Managers. But I'm stuck how to start with them. So need some help
> here.
>
> Thank You
> J. Arun Mani

First, I fail to see why you should even be able to lock a computer away 
from its user. Thats the first question thatought to be answered.


-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: Making a modal window

2018-12-09 Thread Dan Ritter
J.Arun Mani wrote: 
> Hello,
> [I'M UNSURE WHETHER IT IS THE RIGHT PLACE TO ASK THIS QUESTION. IF NOT PLEASE 
> GUIDE ME TO THE RIGHT PLACE]
> I'm making a project(using Python3) which opens whenever someone opens their 
> computer (assume Linux-Debain based) and asks them some details. The user 
> should not be allowed to use the computer without giving the details. The 
> project is based on GTK3 and is for Debian based OS. I need help in the 
> following-
> How can I make the application modal? That is, make sure that the user cannot 
> access any thing in desktop without giving the details (the application is a 
> compulsory one, thus one should not be able to close or minimise it).
> 
> I researched on this a bit and found the answers leading to Desktop Managers. 
> But I'm stuck how to start with them. So need some help here.
> 

What degree of sophistication are you trying to guard against?

For example, if you need to guard against a six-year-old, it's
sufficient to make your program run before the window manager,
and only start a window manager if it is happy.

If you need to guard against a high-school student, you will need to
put the computer in an inaccessible room and only offer access via a
remote keyboard, mouse and screen. You'll need to disable ctrl-alt-delete
processing to prevent reboots, and ctrl-alt-Fx console
switching.

Maybe you should discuss your threat model in more depth.

-dsr-



Re: Making a modal window

2018-12-09 Thread Brian
On Sun 09 Dec 2018 at 13:27:21 -0500, Gene Heskett wrote:

> On Sunday 09 December 2018 13:03:53 J.Arun Mani wrote:
> 
> > Hello,
> > [I'M UNSURE WHETHER IT IS THE RIGHT PLACE TO ASK THIS QUESTION. IF NOT
> > PLEASE GUIDE ME TO THE RIGHT PLACE] I'm making a project(using
> > Python3) which opens whenever someone opens their computer (assume
> > Linux-Debain based) and asks them some details. The user should not be
> > allowed to use the computer without giving the details. The project is
> > based on GTK3 and is for Debian based OS. I need help in the
> > following- How can I make the application modal? That is, make sure
> > that the user cannot access any thing in desktop without giving the
> > details (the application is a compulsory one, thus one should not be
> > able to close or minimise it).
> >
> > I researched on this a bit and found the answers leading to Desktop
> > Managers. But I'm stuck how to start with them. So need some help
> > here.
> >
> > Thank You
> > J. Arun Mani
> 
> First, I fail to see why you should even be able to lock a computer away 
> from its user. Thats the first question thatought to be answered.

A voice of sanity.

Whatever is behind the idea, it is about as nonsensical and unsophisticted
as it gets.

-- 
Brian.



Re: Making a modal window

2018-12-09 Thread Cindy-Sue Causey
On 12/9/18, Dan Ritter  wrote:
> J.Arun Mani wrote:
>> Hello,
>> [I'M UNSURE WHETHER IT IS THE RIGHT PLACE TO ASK THIS QUESTION. IF NOT
>> PLEASE GUIDE ME TO THE RIGHT PLACE]
>> I'm making a project(using Python3) which opens whenever someone opens
>> their computer (assume Linux-Debain based) and asks them some details. The
>> user should not be allowed to use the computer without giving the details.
>> The project is based on GTK3 and is for Debian based OS. I need help in
>> the following-
>> How can I make the application modal? That is, make sure that the user
>> cannot access any thing in desktop without giving the details (the
>> application is a compulsory one, thus one should not be able to close or
>> minimise it).
>>
>> I researched on this a bit and found the answers leading to Desktop
>> Managers. But I'm stuck how to start with them. So need some help here.
>>
>
> What degree of sophistication are you trying to guard against?
>
> For example, if you need to guard against a six-year-old, it's
> sufficient to make your program run before the window manager,
> and only start a window manager if it is happy.
>
> If you need to guard against a high-school student, you will need to
> put the computer in an inaccessible room and only offer access via a
> remote keyboard, mouse and screen. You'll need to disable ctrl-alt-delete
> processing to prevent reboots, and ctrl-alt-Fx console
> switching.
>
> Maybe you should discuss your threat model in more depth.


What about either of these (basically only info gained via "apt-cache
search two step auth"):

libpam-google-authenticator - Two-step verification
ruby-saml - SAML toolkit for Ruby on Rails

Yes, I do understand they're likely not appropriate as they stand, but
maybe viewing their various files will lend some help.
libpam-google-authenticator KIND OF sounds like it's regularly
variable, but that might just mean I misunderstood its description,
not to mention its usage with which I'm not familiar.

Playing around with the keyword "saml" (Security Assertion Markup
Language?) led to more things (that led to still MORE other things).
Most notably *for me* was "keystone". Overall this became an
interesting, ever expanding topic that makes me scratch my own head as
to why a simple password login wouldn't suffice... unless this is
maybe a class project.

Then again... With an easily variable authentication, I could see both
parties having access to where the admin changes the entry key such
that the child, for example, must come forward every time to ask to
borrow that key to play online. With so many children being hurt via
their online presence, it's a great idea... *IF* one can find a method
such that other tech-savvy children can't teach one's own kids how to
override it during those every times... :D

Cindy :)
-- 
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with birdseed *



Re: Making a modal window

2018-12-09 Thread Cindy-Sue Causey
On 12/9/18, Brian  wrote:
> On Sun 09 Dec 2018 at 13:27:21 -0500, Gene Heskett wrote:
>>
>> First, I fail to see why you should even be able to lock a computer away
>> from its user. Thats the first question thatought to be answered.
>
> A voice of sanity.
>
> Whatever is behind the idea, it is about as nonsensical and unsophisticted
> as it gets.


I *did* scratch my head as to why a simple login doesn't suffice, but
I can see a really good use/dire need for parents. The.. garbage I'm
experiencing here in North Georgia... Children of ALL ages are being
targeted CONSTANTLY. It would be nice to find something that helped
parents better control children's access to their own tech
equipment

Cindy :)
-- 
Cindy-Sue Causey
Talking Rock, Pickens County, Georgia, USA

* runs with birdseed *



Re: Making a modal window

2018-12-09 Thread Brian
On Sun 09 Dec 2018 at 14:47:39 -0500, Cindy-Sue Causey wrote:

> On 12/9/18, Brian  wrote:
> > On Sun 09 Dec 2018 at 13:27:21 -0500, Gene Heskett wrote:
> >>
> >> First, I fail to see why you should even be able to lock a computer away
> >> from its user. Thats the first question thatought to be answered.
> >
> > A voice of sanity.
> >
> > Whatever is behind the idea, it is about as nonsensical and unsophisticted
> > as it gets.
> 
> 
> I *did* scratch my head as to why a simple login doesn't suffice, but
> I can see a really good use/dire need for parents. The.. garbage I'm
> experiencing here in North Georgia... Children of ALL ages are being
> targeted CONSTANTLY. It would be nice to find something that helped
> parents better control children's access to their own tech
> equipment

Sorry about this, but what you say sounds like a Trump twitter. Except
it is much more articulated.

-- 
Brian.



Re: Making a modal window

2018-12-09 Thread Dominic Knight
On Sun, 2018-12-09 at 19:54 +, Brian wrote:
> On Sun 09 Dec 2018 at 14:47:39 -0500, Cindy-Sue Causey wrote:
> 
> > On 12/9/18, Brian  wrote:
> > > On Sun 09 Dec 2018 at 13:27:21 -0500, Gene Heskett wrote:
> > > > First, I fail to see why you should even be able to lock a
> > > > computer away
> > > > from its user. Thats the first question thatought to be
> > > > answered.
> > > 
> > > A voice of sanity.
> > > 
> > > Whatever is behind the idea, it is about as nonsensical and
> > > unsophisticted
> > > as it gets.
> > 
> > I *did* scratch my head as to why a simple login doesn't suffice,
> > but
> > I can see a really good use/dire need for parents. The.. garbage
> > I'm
> > experiencing here in North Georgia... Children of ALL ages are
> > being
> > targeted CONSTANTLY. It would be nice to find something that helped
> > parents better control children's access to their own tech
> > equipment
> 
> Sorry about this, but what you say sounds like a Trump twitter.
> Except
> it is much more articulated.

As it seems they only want it to run one program - unminimsable, maybe
some kiosk type application - possibly look at how matchbox works. A
distinct lack of information to go on in the question though.

Dom



Re: Making a modal window

2018-12-09 Thread Michael Lange
Hi,

On Sun, 09 Dec 2018 18:03:53 +
"J.Arun Mani"  wrote:

> Hello,
> [I'M UNSURE WHETHER IT IS THE RIGHT PLACE TO ASK THIS QUESTION. IF NOT
> PLEASE GUIDE ME TO THE RIGHT PLACE] I'm making a project(using Python3)
> which opens whenever someone opens their computer (assume Linux-Debain
> based) and asks them some details. The user should not be allowed to
> use the computer without giving the details. The project is based on
> GTK3 and is for Debian based OS. I need help in the following- How can
> I make the application modal? That is, make sure that the user cannot
> access any thing in desktop without giving the details (the application
> is a compulsory one, thus one should not be able to close or minimise
> it).
> 
> I researched on this a bit and found the answers leading to Desktop
> Managers. But I'm stuck how to start with them. So need some help here.

you might want to have a look at

https://developer.gnome.org/pygtk/stable/gdk-functions.html

The gtk.gdk.pointer_grab(), gtk.gdk.pointer_ungrab(),
gtk.gdk.keyboard_grab() and gtk.gdk.keyboard_ungrab() functions might be
able to do what you want.

Regards

Michael



Re: Making a modal window

2018-12-09 Thread Carl Fink

On 12/9/18 3:52 PM, Dominic Knight wrote:

As it seems they only want it to run one program - unminimsable, maybe
some kiosk type application - possibly look at how matchbox works. A
distinct lack of information to go on in the question though.

Dom


It looks to me as if the OP wants to write his own display manager in 
Python, except that his DM would then hand off to another DM to actually 
start a session.


--
Carl Fink  c...@finknetwork.com
Thinking and logic and stuff at Reasonably Literate
http://reasonablyliterate.com



Re: Making a modal window

2018-12-09 Thread Bob Bernstein

On Sun, 9 Dec 2018, Gene Heskett wrote:


On Sunday 09 December 2018 13:03:53 J.Arun Mani wrote:



I'm making a project(using Python3)


First, I fail to see why you should even be able to lock a 
computer away from its user. Thats the first question 
thatought to be answered.


I think it's good for you Gene to fail in that fashion. Builds 
character, or something. Is the OP a student, and is his 
"project" part of a "course" he's taking at a "school" 
somewhere?


I love to witness the epic fail modes into which you geniuses 
(think Brian and Gene) fall whenever the subject matter drags 
you only a short distance away from your chosen areas of tech 
competence. What a hoot.


I'd simply help the guy out, rather make his day more difficult 
than it already is, but I don't know crap about programming any 
kind of window.


--
"In our age there is no such thing as 'keeping out of 
politics'. All issues are political issues, and politics 
itself is a mass of lies, evasions, folly, hatred, and 
schizophrenia."


   George Orwell "Politics and the English Language" (1946)



Making a modal window

2018-12-09 Thread Rusi Mody
[J Arun Mani]
Look up kiosk instead of DM maybe?
eg https://fedoraproject.org/wiki/Fedora_Kiosk

[Gene/Brian] Yeah I find your surprise surprising...

All operating systems (except MSDOS!) have a detailed notion of protection 
levels, the basic point being that all users are NOT equal.
And OS progress happens when this notion is refined more and more. For example 
we have users and groups
then we have ACL and cgroups and other more modern zany stuff I don't 
understand pretend to understand!

All having the basic requirement (like the OP) that some users be prevented 
from doing some things that they very much would want to do
egs
1 Try removing youtube from android
Phone and you will find it's not possible.

2 I used to teach computer science at the university. And at a time when a 
single large mini was shared by all there was this dilemma: Give students root 
access and have them learn about operating systems but putting  other people's 
stuff at jeopardy. Or let them be ordinary users and not be able to try out 
things at the OS level.

3 Parent doesn't mind child breaking the computer but would not like child to 
visit certain websites



dd: error reading '/dev/sr0': Input/output error

2018-12-09 Thread md
When copying a dvd to file on the harddrive, I'm getting the message
dd: error reading '/dev/sr0': Input/output error
If I first run dvdbackup, then Ctrl-C out of it. I can then reissue the dd 
command and it will finish fine. If I eject the dvd then insert another dvd, 
the same situation occurs.

My system:

MD> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux 9.6 (stretch)
Release:9.6
Codename:   stretch

example terminal session::

MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso
32596480 bytes (33 MB, 31 MiB) copied, 7.00018 s, 4.7 MB/s
dd: error reading '/dev/sr0': Input/output error
67688+0 records in
67688+0 records out
34656256 bytes (35 MB, 33 MiB) copied, 7.55342 s, 4.6 MB/s

MD> dvdbackup -M
libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient
libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x0142
libdvdread: Elapsed time 0

libdvdread: Elapsed time 0
^C
MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso status=progress
7996654080 bytes (8.0 GB, 7.4 GiB) copied, 1831 s, 4.4 MB/s
15621264+0 records in
15621264+0 records out
7998087168 bytes (8.0 GB, 7.4 GiB) copied, 1831.44 s, 4.4 MB/s

Re: Making a modal window

2018-12-09 Thread Gene Heskett
On Monday 10 December 2018 00:33:21 Rusi Mody wrote:

> [J Arun Mani]
> Look up kiosk instead of DM maybe?
> eg https://fedoraproject.org/wiki/Fedora_Kiosk
>
> [Gene/Brian] Yeah I find your surprise surprising...
>
> All operating systems (except MSDOS!) have a detailed notion of
> protection levels,
Never used dos. Color Computers with os9, adding amigados, then linux 
from 1998. And the color computer is running right now. os9, now Nitros9 
is a unix like but no security other than a login password if coming in 
thru an rs232 connection.

> the basic point being that all users are NOT equal. 
This is true..

> And OS progress happens when this notion is refined more and more. For
> example we have users and groups then we have ACL and cgroups and
> other more modern zany stuff I don't understand pretend to understand!

All of which to me are not progress but bloat, slowing the machine. OTOH 
I am the only user here, and finding I have to sudo before I can run 
something just to check/read something, AND have to have the path to it 
memorized because like you, whats a cgroup? ACL's I might get used to, 
but more and more its all a PIMA, often caused by pam and its poor to 
non-existant docs, but its damned sure keeping me from doing something 
I've been doing since my first red hat 5.0 install. For instance I can 
ssh -Y from this wheezy box to any other wheezy box w/o a problem, but I 
have yet to find the magic twanger to make it Just Work to a jessie or 
stretch install. Then someone else has decreed there is no network until 
a user has logged in from the machines own keyboard.  Someone has 
decided its a security hole without understanding that they are making 
life a cast iron bitch for someone like you or me.

> All having the basic requirement (like the OP) that some users be
> prevented from doing some things that they very much would want to do
> egs
> 1 Try removing youtube from android
> Phone and you will find it's not possible.
>
> 2 I used to teach computer science at the university. And at a time
> when a single large mini was shared by all there was this dilemma:
> Give students root access and have them learn about operating systems
> but putting  other people's stuff at jeopardy. Or let them be ordinary
> users and not be able to try out things at the OS level.

The latter is not teaching CS, its teaching how to be dumb users, which 
to me is no better that mom & pop buying them a lappy and a net cable, 
they can learn that on their own, while letting a virus removal shop 
make a good living.

> 3 Parent doesn't mind child breaking the computer but would not like
> child to visit certain websites

Which is good on the face of it, but those web sites change addresses 
weekly, so its a lost cause, your 10 year old IS gonna find the porno. 
Changes in how his/her body acts is something the parents seem to have 
abdicated the explanation of such to the child, and that is a parental 
duty whether you have cows and pigs in the barn, and chickens in the 
yard, or are in the middle of star city.

-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: dd: error reading '/dev/sr0': Input/output error

2018-12-09 Thread Gene Heskett
On Monday 10 December 2018 00:34:58 md wrote:

> When copying a dvd to file on the harddrive, I'm getting the message
> dd: error reading '/dev/sr0': Input/output error
> If I first run dvdbackup, then Ctrl-C out of it. I can then reissue
> the dd command and it will finish fine. If I eject the dvd then insert
> another dvd, the same situation occurs.
>
Classic slow spinup. You can get a better dvd drive that /might/ be 
faster.

> My system:
>
> MD> lsb_release -a
> No LSB modules are available.
> Distributor ID: Debian
> Description:Debian GNU/Linux 9.6 (stretch)
> Release:9.6
> Codename:   stretch
>
> example terminal session::
>
> MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso
> 32596480 bytes (33 MB, 31 MiB) copied, 7.00018 s, 4.7 MB/s
> dd: error reading '/dev/sr0': Input/output error
> 67688+0 records in
> 67688+0 records out
> 34656256 bytes (35 MB, 33 MiB) copied, 7.55342 s, 4.6 MB/s
>
> MD> dvdbackup -M
> libdvdread: Attempting to retrieve all CSS keys
> libdvdread: This can take a _long_ time, please be patient
> libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x0142
> libdvdread: Elapsed time 0
> 
> libdvdread: Elapsed time 0
> ^C
> MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso status=progress
> 7996654080 bytes (8.0 GB, 7.4 GiB) copied, 1831 s, 4.4 MB/s
> 15621264+0 records in
> 15621264+0 records out
> 7998087168 bytes (8.0 GB, 7.4 GiB) copied, 1831.44 s, 4.4 MB/s



-- 
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page 



Re: dd: error reading '/dev/sr0': Input/output error

2018-12-09 Thread Thomas Schmitt
Hi,

md wrote:
> When copying a dvd to file on the harddrive, I'm getting [...]
> MD> sudo dd if=/dev/sr0 of=/sdb1/movie.iso
> 32596480 bytes (33 MB, 31 MiB) copied, 7.00018 s, 4.7 MB/s
> dd: error reading '/dev/sr0': Input/output error

Do you see fresh messages in the output of dmesg ?
Like

  Dec  2 13:56:33 ... kernel: [...] Sense Key : Medium Error [current]
  Dec  2 13:56:33 ... kernel: [...] Info fld=0x69c0
  Dec  2 13:56:33 ... kernel: [...] sr 2:0:0:0: [sr0]
  Dec  2 13:56:33 ... kernel: [...] Add. Sense: Unrecovered read error
  Dec  2 13:56:33 ... kernel: [...] sr 2:0:0:0: [sr0] CDB:
  Dec  2 13:56:33 ... kernel: [...] Read(10): 28 00 00 00 69 b8 00 00 40 00

What do you get from

  xorriso -outdev /dev/sr0 \
  -check_media use=outdev \
  data_to=/sdb1/movie.udf \
  --

(It will at least show error messages directly.)


Gene Heskett wrote:
> Classic slow spinup.

After 33 MiB of reading ?

(We have a bug in the kernel since 2008 which prevents waiting for the
 drive to become ready after automatic tray loading. But this causes
 0 bytes of read result and lets dd end immediately.)


> You can get a better dvd drive

Read failures of decaying drives often show surprising success-or-error
patterns. Depending on how idvdbackup accesses the drive, its doings
 might be beneficial.
But reading in

  http://manpages.ubuntu.com/manpages/bionic/man1/dvdbackup.1.html
  "-M, --mirror
 backup the whole DVD"

i'd expect it to read sequentiall, like dd does.

So more questions to md:

- Does a second or third dd run yield success if no dvdbackup was run
  inbetween ?

- Does dvdbackup yield a complete set of files if you let it work
  until it ends on its own ?


Have a nice day :)

Thomas



Re: dd: error reading '/dev/sr0': Input/output error

2018-12-09 Thread md
>> When copying a dvd to file on the harddrive, I'm getting the message
>> dd: error reading '/dev/sr0': Input/output error
>> If I first run dvdbackup, then Ctrl-C out of it. I can then reissue
>> the dd command and it will finish fine. If I eject the dvd then insert
>> another dvd, the same situation occurs.

> Classic slow spinup. You can get a better dvd drive that /might/ be faster.

You could be right. It hasn't been a problem in the past, but haven't needed to 
dd a disk in a while.
To test your idea, what other spinup task do you suggest I substitute for 
dvdbackup?