* chmod fails though it pretends to succeed
@ 2009-05-25 14:44 Christoph Pleger
2009-05-25 23:46 ` Robert Hancock
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Pleger @ 2009-05-25 14:44 UTC (permalink / raw)
To: linux-kernel
Hello,
I have a strange problem here with a C program that calls chmod.
The C program is a PAM module called pam-devperm. The purpose of this
module is to set appropriate device ownerships and permissions when a
user logs in. But the module does not work as expected on my Ubuntu
9.04 system. When a user logs in the first time after system boot, only
the device ownerships are changed, the permissions are not. When the
user logs out and in again, permissions are changed, too.
I added some lines of code to the the source of of pam-devperm so that
it produces more debug output when changing the properties of /dev/dsp.
The debug output showed me that chmod has been called to set the
permissions of /dev/dsp to 0600 and that chmod returned 0, which means
success. In spite of that, device permissions remain at 660.
Now I have two questions:
1. What can be the reason for chmod to return a value of 0 though
device permissions have not been changed?
2. What can be the reason why this chmod fails on the first login of a
user, but succeeds on further logins?
Regards
Christoph
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: chmod fails though it pretends to succeed
2009-05-25 14:44 chmod fails though it pretends to succeed Christoph Pleger
@ 2009-05-25 23:46 ` Robert Hancock
2009-05-28 7:32 ` Christoph Pleger
0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2009-05-25 23:46 UTC (permalink / raw)
To: Christoph Pleger; +Cc: linux-kernel
Christoph Pleger wrote:
> Hello,
>
> I have a strange problem here with a C program that calls chmod.
>
> The C program is a PAM module called pam-devperm. The purpose of this
> module is to set appropriate device ownerships and permissions when a
> user logs in. But the module does not work as expected on my Ubuntu
> 9.04 system. When a user logs in the first time after system boot, only
> the device ownerships are changed, the permissions are not. When the
> user logs out and in again, permissions are changed, too.
>
> I added some lines of code to the the source of of pam-devperm so that
> it produces more debug output when changing the properties of /dev/dsp.
> The debug output showed me that chmod has been called to set the
> permissions of /dev/dsp to 0600 and that chmod returned 0, which means
> success. In spite of that, device permissions remain at 660.
>
> Now I have two questions:
>
> 1. What can be the reason for chmod to return a value of 0 though
> device permissions have not been changed?
>
> 2. What can be the reason why this chmod fails on the first login of a
> user, but succeeds on further logins?
Are you sure that some other process is not changing the device
permissions also?
>
> Regards
> Christoph
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: chmod fails though it pretends to succeed
2009-05-25 23:46 ` Robert Hancock
@ 2009-05-28 7:32 ` Christoph Pleger
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Pleger @ 2009-05-28 7:32 UTC (permalink / raw)
To: linux-kernel
Hello,
On Mon, 25 May 2009 17:46:30 -0600
Robert Hancock <hancockrwd@gmail.com> wrote:
> > Now I have two questions:
> >
> > 1. What can be the reason for chmod to return a value of 0 though
> > device permissions have not been changed?
> >
> > 2. What can be the reason why this chmod fails on the first login
> > of a user, but succeeds on further logins?
>
> Are you sure that some other process is not changing the device
> permissions also?
Maybe, but I do not have an idea what this can be. And if some other
process is interfering, why does this only happen on first login after
boot?
What completely surprises me is that when I install the Debian
lenny package of libpam-devperm (that works perfectly on lenny) on my
Ubuntu jaunty PC, it also does not change device permissions on first
login of a user.
Regards
Christoph
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-28 7:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-25 14:44 chmod fails though it pretends to succeed Christoph Pleger
2009-05-25 23:46 ` Robert Hancock
2009-05-28 7:32 ` Christoph Pleger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox