reiser4 problem with pam_mktemp
I have a problem with reiser4.
Recently I have installed Altlinux Compact-rc2 on reiserfs (v3.6), patched kernel 2.6.12 with patch 2.6.12-mm2, created new reiser4 partition hda6 and copied by #cp -ax / /mnt/hda6 there. Fixed /etc/fstab and /boot/grub for new partition and booted. And could not login, with messages in virtual consoles :
---
pam_tcb[8386]: login: Authentication passed for root from (uid=0)
Login incorrect
---
So I rebooted in original on reiserfs 3.6, edited /mnt/hda6/etc/inittab to change one of "/sbin/mingetty tty6" to be "/bin/bash" and after reboot to reiser4 based system saw, that the problem in pam_mktemp, by commenting out string
# account required pam_mktemp.so in file /etc/pam.d/system_auth the problem get fixed. Also it get fixed if I create some non-reiser4 partition to place /tmp on it.
With best regards,
Sergey Ivanov
Hello
Quoted 8 lines · sergey ivanov
I have a problem with reiser4.
Recently I have installed Altlinux Compact-rc2 on reiserfs (v3.6), patched kernel 2.6.12 with patch 2.6.12-mm2, created new reiser4 partition hda6 and copied by #cp -ax //mnt/hda6there. Fixed/etc/fstaband/boot/grubfor new partition and booted. And could not login, with messages in virtual consoles :
---
Quoted 6 lines
pam_tcb[8386]: login: Authentication passed for root from (uid=0)
Login incorrect
---
So I rebooted in original on reiserfs 3.6, edited/mnt/hda6/etc/inittabto change one of "/sbin/mingettytty6" to be "/bin/bash" and after reboot to reiser4 based system saw, that the problem inpam_mktemp, by commenting out string # account required pam_mktemp.so in file/etc/pam.d/system_auththe problem get fixed. Also it get fixed if I create some non-reiser4 partition to place /tmp on it.
Thanks for the report.
The problem is that reiser4 does not support ext2's file attributes pam_mktemp deals with.
Maybe reiser4 should have support for that like reiserfs, but now it does not.
Hi Vladimir,pam_mktemp can work on filesystem which does not support ext2's file attributes. For example, it works well on tmpfs.
For pam_mktemp to recognize the case and work without attributes, the filesystem should return 'ENOTTY' (Inappropriate ioctl for device) as a result of an setting/getting attributes call, as it tmpfs does. But reiser4 returns 'ENOSYS' (Function not implemented).
Will you accept patch changing this code to 'ENOTTY'?
Sergey
Quoted 30 lines · Vladimir V. Saveliev
Hello
Quoted 8 lines · sergey ivanov
I have a problem with reiser4.
Recently I have installed Altlinux Compact-rc2 on reiserfs (v3.6), patched kernel 2.6.12 with patch 2.6.12-mm2, created new reiser4 partition hda6 and copied by #cp -ax //mnt/hda6there. Fixed/etc/fstaband/boot/grubfor new partition and booted. And could not login, with messages in virtual consoles :
---Quoted 11 lines
pam_tcb[8386]: login: Authentication passed for root from (uid=0) Login incorrect
---
So I rebooted in original on reiserfs 3.6, edited/mnt/hda6/etc/inittabto change one of "/sbin/mingettytty6" to be "/bin/bash" and after reboot to reiser4 based system saw, that the problem inpam_mktemp, by commenting out string # account required pam_mktemp.so
in file/etc/pam.d/system_auththe problem get fixed. Also it get fixed if I create some non-reiser4 partition to place /tmp on it.Thanks for the report.
The problem is that reiser4 does not support ext2's file attributespam_mktempdeals with.Maybe reiser4 should have support for that like reiserfs, but now it does not.
Hello
Quoted 5 lines · sergey ivanov
Hi Vladimir,
pam_mktempcan work on filesystem which does not support ext2's file attributes.
For example, it works well on tmpfs.
Forpam_mktempto recognize the case and work without attributes, the filesystem should return 'ENOTTY' (Inappropriate ioctl for device) as a result of an setting/getting attributes call, as it tmpfs does. But reiser4 returns 'ENOSYS' (Function not implemented). Will you accept patch changing this code to 'ENOTTY'?
yes
Quoted 40 lines
Sergey
Quoted 30 lines · Vladimir V. Saveliev
Hello
Quoted 8 lines · sergey ivanov
I have a problem with reiser4.
Recently I have installed Altlinux Compact-rc2 on reiserfs (v3.6), patched kernel 2.6.12 with patch 2.6.12-mm2, created new reiser4 partition hda6 and copied by #cp -ax //mnt/hda6there. Fixed/etc/fstaband/boot/grubfor new partition and booted. And could not login, with messages in virtual consoles :
---Quoted 10 lines
pam_tcb[8386]: login: Authentication passed for root from (uid=0) Login incorrect
---
So I rebooted in original on reiserfs 3.6, edited/mnt/hda6/etc/inittabto change one of "/sbin/mingettytty6" to be "/bin/bash" and after reboot to reiser4 based system saw, that the problem inpam_mktemp, by commenting out string # account required pam_mktemp.so in file/etc/pam.d/system_auththe problem get fixed. Also it get fixed if I create some non-reiser4 partition to place /tmp on it.Thanks for the report.
The problem is that reiser4 does not support ext2's file attributespam_mktempdeals with.Maybe reiser4 should have support for that like reiserfs, but now it does not.
I have not succeeded with integrating reiser4 & pam_mktemp. From one side I recompiled kernel with reiser4 patches modified to return ENOTTY for attempt to deal with attributes, as tmpfs does. Pam_mktemp does not work after this. So I returned to the kernel with original Namesys' patches.
Then by my apeal pam_mktemp was modified to recognize ENOSYS the same way it recognizes ENOTTY returned by tmpfs and try to deal without attributes.
But this also does not help pam_mktemp to work.
So I did the following: rebooted to runlevel 1, and then did
# strace -o su.log -fF su - seriv
Once with /tmp on tmpfs and once with /tmp on reiser4.
And the following catches my attention: while on tmpfs, the lines
dealing with attributes looks like the following:
---
2034 mkdir("/tmp/.private", 0711) = 0
2034 lstat64("/tmp/.private", {st_mode=S_IFDIR|0711, st_size=40, ...}) = 02034 open("/tmp/.private", O_RDONLY) = 3
2034 ioctl(3, EXT2_IOC_GETFLAGS, 0xbfb7aab8) = -1 ENOTTY (Inappropriate ioctl for device)
2034 close(3) = 0
2034 mkdir("/tmp/.private/seriv", 01700) = 0
2034 open("/tmp/.private/seriv", O_RDONLY) = 3
2034 ioctl(3, EXT2_IOC_GETFLAGS, 0xbfb7aa88) = -1 ENOTTY (Inappropriate
ioctl for device)
2034 close(3) = 0
2034 chown32("/tmp/.private/seriv", 0, 500) = 0
2034 chmod("/tmp/.private/seriv", 01770) = 0
---
But with /tmp on reiser4, they are:
---
1993 mkdir("/tmp/.private", 0711) = -1 EEXIST (File exists)
1993 lstat64("/tmp/.private", {st_mode=S_IFDIR|0711, st_size=7, ...}) = 0
1993 open("/tmp/.private", O_RDONLY) = 3
1993 ioctl(3, EXT2_IOC_GETFLAGS, 0xbf9e37f8) = -1 EISDIR (Is a directory)
1993 close(3) = 0
1993 mkdir("/tmp/.private/seriv", 01700) = -1 EEXIST (File exists)
1993 open("/tmp/.private/seriv", O_RDONLY) = 3
1993 ioctl(3, EXT2_IOC_GETFLAGS, 0xbf9e37c8) = -1 EISDIR (Is a directory)
1993 close(3) = 0
1993 getuid32() = 0
1993 write(2, "Account management:- Cannot make"..., 85) = 85---
So it looks like reiser4 tries to be good and answer to ioctl getting/setting attributes "EEXIST" and "EISDIR",
and not return error "ENOTTY".
This is the reason, why pam_mktemp passes the tests if filesystem support attributes with confidence that reiser4 can do attributes. I think this was the right decision to return fake successes at the beginning of reiser4 development, but now I think reiser4 should behave more strictly and rejects this attribute setting/getting ioctl by ENOTTY codes.
Signature · 1 line
Sergey
Quoted 8 lines · sergey ivanov
I have not succeeded with integrating reiser4 &
pam_mktemp. From one side I recompiled kernel with reiser4 patches modified to return ENOTTY for attempt to deal with attributes, as tmpfs does.Pam_mktempdoes not work after this. So I returned to the kernel with original Namesys' patches.# strace -o su.log -fF su - seriv
Quoted 8 lines
1993 mkdir("/tmp/.private", 0711) = -1 EEXIST (File exists) 1993 lstat64("/tmp/.private", {st_mode=S_IFDIR|0711, st_size=7, ...}) = 0 1993 open("/tmp/.private", O_RDONLY) = 3 1993 ioctl(3, EXT2_IOC_GETFLAGS, 0xbf9e37f8) = -1 EISDIR (Is a directory)So it looks like reiser4 tries to be good and answer to ioctl getting/setting attributes "EEXIST" and "EISDIR", and not return error "ENOTTY".
This seems kind of confusing -- the problem with the idea that all files are files and directories... do we really want to be returning that it's a directory here? My guess is that this is the confusing bit about this filesystem. AFAIK, this is probably confusing the PAM code or whatever. *shrugs*
Signature · 3 lines
~Mike - Just my two cents - No man is an island, and no man is unable.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thank you, it works!
I've just recompiled kernel and now / mounted on reiser4 with /tmp in the same filesystem,
and pam_mktemp works without problems.
Signature · 3 lines
Sergey. Vladimir V. Saveliev пишет:
Quoted 151 lines
Hello
Quoted 1 line · sergey ivanov
I have not succeeded with integrating reiser4 &
pam_mktemp.Would you try the attached patch, please.
Quoted 47 lines
Quoted 1 line
From one side I recompiled kernel with reiser4 patches modified to
return ENOTTY for attempt to deal with attributes, as tmpfs does.
Pam_mktempdoes not work after this. So I returned to the kernel with original Namesys' patches.
Then by my apealpam_mktempwas modified to recognize ENOSYS the same way it recognizes ENOTTY returned by tmpfs and try to deal without attributes.
But this also does not helppam_mktempto work.
So I did the following: rebooted to runlevel 1, and then did# strace -o su.log -fF su - seriv Once with /tmp on tmpfs and once with /tmp on reiser4. And the following catches my attention: while on tmpfs, the lines dealing with attributes looks like the following: --- 2034 mkdir("/tmp/.private", 0711) = 0 2034 lstat64("/tmp/.private", {st_mode=S_IFDIR|0711, st_size=40, ...}) = 02034
open("/tmp/.private", O_RDONLY)= 3
2034ioctl(3, EXT2_IOC_GETFLAGS, 0xbfb7aab8)= -1 ENOTTY (Inappropriate ioctl for device)2034 close(3) = 0 2034 mkdir("/tmp/.private/seriv", 01700) = 0 2034 open("/tmp/.private/seriv", O_RDONLY) = 3 2034 ioctl(3, EXT2_IOC_GETFLAGS, 0xbfb7aa88) = -1 ENOTTY (Inappropriate ioctl for device) 2034 close(3) = 0 2034 chown32("/tmp/.private/seriv", 0, 500) = 0 2034 chmod("/tmp/.private/seriv", 01770) = 0---
But with /tmp on reiser4, they are:
---
1993mkdir("/tmp/.private", 0711)= -1 EEXIST (File exists)
1993lstat64("/tmp/.private", {st_mode=S_IFDIR|0711, st_size=7, ...})= 0
1993open("/tmp/.private", O_RDONLY)= 3
1993ioctl(3, EXT2_IOC_GETFLAGS, 0xbf9e37f8)= -1 EISDIR (Is a directory)1993 close(3) = 0 1993 mkdir("/tmp/.private/seriv", 01700) = -1 EEXIST (File exists) 1993 open("/tmp/.private/seriv", O_RDONLY) = 3 1993 ioctl(3, EXT2_IOC_GETFLAGS, 0xbf9e37c8) = -1 EISDIR (Is a directory) 1993 close(3) = 0 1993 getuid32() = 0 1993 write(2, "Account management:- Cannot make"..., 85) = 85Quoted 9 lines
---
So it looks like reiser4 tries to be good and answer to ioctl getting/setting attributes "EEXIST" and "EISDIR", and not return error "ENOTTY". This is the reason, whypam_mktemppasses the tests if filesystem support attributes with confidence that reiser4 can do attributes. I think this was the right decision to return fake successes at the beginning of reiser4 development, but now I think reiser4 should behave more strictly and rejects this attribute setting/getting ioctl by ENOTTY codes.------------------------------------------------------------------------
fs/reiser4/plugin/file/file.c| 2 +-fs/reiser4/plugin/object.c| 17 ++++++++++++-----2 files changed, 13 insertions(+), 6 deletions(-)diff -puN
fs/reiser4/plugin/object.c~reiser4-pam_mktemp-fixfs/reiser4/plugin/object.cfs/reiser4/plugin/object.c renamed from fs/reiser4/plugin/object.c~reiser4-pam_mktemp-fix +7
-0@@ -966,6 +966,13 @@ isdir(void)#define eisdir ((void *)isdir) +static int +notty (void ) +{ +return RETERR (-ENOTTY ); +} +#define enotty ((void *)notty) +static
ssize_t
perm(void)
{fs/reiser4/plugin/object.c renamed from fs/reiser4/plugin/object.c~reiser4-pam_mktemp-fix +5
-5@@ -1243,7 +1250,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI .read = eisdir, .write = eisdir, .release = release_dir, - .ioctl = eisdir, + .ioctl = enotty, .mmap = eisdir, .get_block = NULL, .flow_by_inode = NULL,@@ -1299,7 +1306,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI .read = eperm, .write = eperm, .release = NULL, - .ioctl = eperm, + .ioctl = enotty, .mmap = eperm, .sync = sync_common, .get_block = NULL,@@ -1358,7 +1365,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI .read = eperm, .write = eperm, .release = NULL, - .ioctl = eperm, + .ioctl = enotty, .mmap = eperm, .sync = sync_common, .get_block = NULL,@@ -1413,7 +1420,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI .read = read_pseudo, .write = write_pseudo, .release = release_pseudo, - .ioctl = eperm, + .ioctl = enotty, .mmap = eperm, .sync = sync_common, .get_block = eperm,@@ -1470,7 +1477,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI .read = read_cryptcompress, .write = write_cryptcompress, .release = NULL, - .ioctl = NULL, + .ioctl = enotty, .mmap = mmap_cryptcompress, .get_block = get_block_cryptcompress, .sync = sync_common,diff -puN
fs/reiser4/plugin/file/file.c~reiser4-pam_mktemp-fixfs/reiser4/plugin/file/file.cfs/reiser4/plugin/file/file.c renamed from fs/reiser4/plugin/file/file.c~reiser4-pam_mktemp-fix +1
-1@@ -2361,7 +2361,7 @@ ioctl_unix_file(struct inode *inode, strbreak ;default : - result =RETERR (-ENOSYS ); + result =RETERR (-ENOTTY );break ; }return result;_