public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Cc: xfs ML <xfs@oss.sgi.com>
Subject: Re: [BUG] xfs_quota: can't handle the users managed by LDAP
Date: Wed, 28 Nov 2012 08:05:18 +1100	[thread overview]
Message-ID: <20121127210518.GN6434@dastard> (raw)
In-Reply-To: <50B46B66.2040908@jp.fujitsu.com>

On Tue, Nov 27, 2012 at 04:27:34PM +0900, Satoru Takeuchi wrote:
> >>>>> Current xfs_quota (I pulled xfsprogs today) seems not be able to the users
> >>>>> managed by LDAP. There is no patch since I'm not good at LDAP and don't know
> >>>>> the root cause yet ;-(
> >>>>>
> >>>>> Step to reproduce(in this case, "sat" is the user managed by LDAP):
> >>>>> ===============================================================================
> >>>>> # uname -r
> >>>>> 3.7.0-rc5
> >>>>> # mount -o loop,usrquota xfs.img mnt
> >>>>> # xfsprogs/quota/xfs_quota -xc "limit bsoft=10M bhard=10M sat" /dev/loop0
> >>>>> xfs_quota: invalid user name: sat                                          # denied
> >>>>> # su sat
> >>>>> $                                                                          # But this user acutally exists.
> >>>>> ===============================================================================
.....

> So there is a problem in "report" subcommand. Refer to report_without_U.log,
> I found "quotactl(Q_XGETQUOTA|GRPQUOTA, ...) is only called for local users
> and it's because that getpwent() only returned only local users.

Yes, it appears from the strace that glibc is only reading
/etc/passwd and not querying the ldap server.

> open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=1724, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f851afee000
> read(3, "#¥n# /etc/nsswitch.conf¥n#¥n# An ex"..., 4096) = 1724
> read(3, "", 4096)                       = 0
> close(3)                                = 0
...
> open("/lib64/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 3
...
> open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=2005, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f851afee000
> lseek(3, 0, SEEK_CUR)                   = 0
> read(3, "root:x:0:0:root:/root:/bin/bash¥n"..., 4096) = 2005
> quotactl(Q_XGETQUOTA|USRQUOTA, "/dev/loop0", 0, {version=1, flags=XFS_USER_QUOTA, fieldmask=0, id=0, blk_hardlimit=0, blk_softlimit=0, ino_hardlimit=0, ino_softlimit=0, bcount=0, icount=3, ...}) = 0

As you can see, it only dynamically loads the local files name
service library, not the ones that do ldap lookups.

Can you run ldd on the test binary you had and on xfs_quota to see
if they are linked against the same libraries?

Other than that, I've go no idea why glibc would be behaving
differently for the same library call from different binaries.
it tends to imply a problem outside of xfs_quota, but I know close
to nothing about LDAP and the glibc name services, so I don't know
what more I can do to help here....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-11-27 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22  5:05 [BUG] xfs_quota: can't handle the users managed by LDAP Satoru Takeuchi
2012-11-22 23:37 ` Dave Chinner
2012-11-26  8:48   ` Satoru Takeuchi
2012-11-27  1:38     ` Satoru Takeuchi
2012-11-27  2:57       ` Dave Chinner
2012-11-27  7:27         ` Satoru Takeuchi
2012-11-27 21:05           ` Dave Chinner [this message]
2012-11-29  0:34             ` Satoru Takeuchi

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=20121127210518.GN6434@dastard \
    --to=david@fromorbit.com \
    --cc=takeuchi_satoru@jp.fujitsu.com \
    --cc=xfs@oss.sgi.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox