LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Grant Coady <grant_lkml@dodo.com.au>
To: dann frazier <dannf@dannf.org>
Cc: Willy Tarreau <w@1wt.eu>, Grant Coady <gcoady.lk@gmail.com>,
	Santiago Garcia Mantinan <manty@debian.org>,
	linux-kernel@vger.kernel.org, debian-kernel@lists.debian.org
Subject: Re: problems with latest smbfs changes on 2.4.34 and security backports
Date: Wed, 24 Jan 2007 10:46:24 +1100	[thread overview]
Message-ID: <nt6dr29m1lalc3dersj4sf22od2l638fvq@4ax.com> (raw)
In-Reply-To: <20070123211256.GB26310@colo>

On Tue, 23 Jan 2007 14:12:57 -0700, dann frazier <dannf@dannf.org> wrote:

>Users have reported a symlink issue with my recent smbfs backport.
>Turns out my backport overlooked a second 2.6 patch w/ the fix:
> http://linux.bkbits.net:8080/linux-2.6/?PAGE=cset&REV=419e7b76CdrmRG_NZ8LKj9DUUBGu1w
>
>This is a backport of Haroldo Gamal's 2.6 patch that fixes the symlink
>issue, and also cleans up an unnecessary double assignment. As his
>commit message notes, you will need the userspace patches from Samba
>Bug #999 in order to use the permission/ownership assigned by the
>server.

Server-side:
grant@deltree:/home/other$ uname -r
2.6.19.2a
grant@deltree:/home/other$ ls -l
total 8
drwxr-xr-x 2 root  root  96 2007-01-21 11:44 dir/
lrwxrwxrwx 1 root  root   3 2007-01-21 11:43 dirlink -> dir/
-rw-r--r-- 1 root  root  15 2007-01-21 11:43 file
lrwxrwxrwx 1 root  root   4 2007-01-21 11:44 filelink -> file
-rw-r--r-- 1 grant wheel 20 2007-01-24 10:24 test
lrwxrwxrwx 1 grant wheel  4 2007-01-24 10:23 testlink -> test

Client-side, 2.4.34c is with this new patch, 2.4.33.3 and 2.6.19.2 
for comparison:

grant@sempro:/home/other$ uname -r
2.4.33.3
grant@sempro:/home/other$ ls -l
total 4096
drwxr-xr-x 1 root  root   0 2007-01-21 11:44 dir/
lrwxrwxrwx 1 root  root   3 2007-01-21 11:43 dirlink -> dir/
-rw-r--r-- 1 root  root  15 2007-01-21 11:43 file
lrwxrwxrwx 1 root  root   4 2007-01-21 11:44 filelink -> file
-rw-r--r-- 1 grant wheel 20 2007-01-24 10:24 test
lrwxrwxrwx 1 grant wheel  4 2007-01-24 10:23 testlink -> test

grant@sempro:~$ uname -r
2.6.19.2a
grant@sempro:~$ ls -l /home/other/
total 10
drwxr-xr-x 1 grant wheel  0 2007-01-21 11:44 dir/
lrwxr-xr-x 1 grant wheel  3 2007-01-21 11:43 dirlink -> dir/
-rwxr-xr-x 1 grant wheel 15 2007-01-21 11:43 file*
lrwxr-xr-x 1 grant wheel  4 2007-01-21 11:44 filelink -> file*
-rwxr-xr-x 1 grant wheel 20 2007-01-24 10:24 test*
lrwxr-xr-x 1 grant wheel  4 2007-01-24 10:23 testlink -> test*

grant@sempro:~$ uname -r
2.4.34c
grant@sempro:~$ ls -l /home/other/
total 4096
drwxr-xr-x 1 grant wheel  0 2007-01-21 11:44 dir/
lrwxr-xr-x 1 grant wheel  3 2007-01-21 11:43 dirlink -> dir/
-rwxr-xr-x 1 grant wheel 15 2007-01-21 11:43 file*
lrwxr-xr-x 1 grant wheel  4 2007-01-21 11:44 filelink -> file*
-rwxr-xr-x 1 grant wheel 20 2007-01-24 10:24 test*
lrwxr-xr-x 1 grant wheel  4 2007-01-24 10:23 testlink -> test*

Grant.

>
>Signed-off-by: dann frazier <dannf@debian.org>
>
>diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
>index be975fe..7fd9b51 100644
>--- a/fs/smbfs/inode.c
>+++ b/fs/smbfs/inode.c
>@@ -513,10 +513,10 @@ smb_read_super(struct super_block *sb, void *raw_data, int silent)
> 		mnt->flags = (oldmnt->file_mode >> 9) | SMB_MOUNT_UID |
> 			SMB_MOUNT_GID | SMB_MOUNT_FMODE | SMB_MOUNT_DMODE;
> 	} else {
>-		mnt->file_mode = mnt->dir_mode = S_IRWXU | S_IRGRP | S_IXGRP |
>-						S_IROTH | S_IXOTH | S_IFREG;
>-		mnt->dir_mode = mnt->dir_mode = S_IRWXU | S_IRGRP | S_IXGRP |
>-						S_IROTH | S_IXOTH | S_IFDIR;
>+		mnt->file_mode = S_IRWXU | S_IRGRP | S_IXGRP |
>+				S_IROTH | S_IXOTH | S_IFREG;
>+	        mnt->dir_mode = S_IRWXU | S_IRGRP | S_IXGRP |
>+				S_IROTH | S_IXOTH | S_IFDIR;
> 		if (parse_options(mnt, raw_data))
> 			goto out_bad_option;
> 	}
>diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c
>index 7f0794c..5570007 100644
>--- a/fs/smbfs/proc.c
>+++ b/fs/smbfs/proc.c
>@@ -1994,10 +1994,11 @@ void smb_decode_unix_basic(struct smb_fattr *fattr, struct smb_sb_info *server,
> 
> 	if ( (server->mnt->flags & SMB_MOUNT_DMODE) &&
> 	     (S_ISDIR(fattr->f_mode)) )
>-		fattr->f_mode = (server->mnt->dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFDIR;
>+		fattr->f_mode = (server->mnt->dir_mode & S_IRWXUGO) | S_IFDIR;
> 	else if ( (server->mnt->flags & SMB_MOUNT_FMODE) &&
> 	          !(S_ISDIR(fattr->f_mode)) )
>-		fattr->f_mode = (server->mnt->file_mode & (S_IRWXU | S_IRWXG | S_IRWXO)) | S_IFREG;
>+		fattr->f_mode = (server->mnt->file_mode & S_IRWXUGO) |
>+				(fattr->f_mode & S_IFMT);
> 
> }
> 


  parent reply	other threads:[~2007-01-23 23:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-17 10:00 Santiago Garcia Mantinan
2007-01-17 21:55 ` Willy Tarreau
2007-01-18  0:09   ` Grant Coady
2007-01-18  4:21     ` Willy Tarreau
2007-01-18  5:59       ` Grant Coady
2007-01-18 22:51   ` dann frazier
2007-01-19  1:00   ` dann frazier
2007-01-19  5:15     ` Willy Tarreau
2007-01-20  1:05     ` dann frazier
2007-01-20  6:18       ` Willy Tarreau
2007-01-21 22:52       ` Grant Coady
2007-01-21 23:03         ` Willy Tarreau
2007-01-21 23:50           ` Grant Coady
2007-01-22 18:19             ` dann frazier
2007-01-23  5:42               ` Willy Tarreau
2007-01-23 21:12                 ` dann frazier
2007-01-23 22:00                   ` Willy Tarreau
2007-01-23 23:46                   ` Grant Coady [this message]
2007-01-24  0:11                     ` dann frazier
2007-01-22  8:54           ` Santiago Garcia Mantinan
2007-01-22  9:18             ` Willy Tarreau
2007-01-22  9:36               ` Santiago Garcia Mantinan
2007-01-22 10:49                 ` Grant Coady
2007-01-22 10:46               ` Grant Coady
2007-01-23 20:19           ` dann frazier
2007-01-23 21:04             ` Grant Coady
2007-01-23 21:35               ` dann frazier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nt6dr29m1lalc3dersj4sf22od2l638fvq@4ax.com \
    --to=grant_lkml@dodo.com.au \
    --cc=dannf@dannf.org \
    --cc=debian-kernel@lists.debian.org \
    --cc=gcoady.lk@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manty@debian.org \
    --cc=w@1wt.eu \
    --subject='Re: problems with latest smbfs changes on 2.4.34 and security backports' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).