summaryrefslogtreecommitdiffstats
path: root/utils/idmapd
Commit message (Collapse)AuthorAgeFilesLines
* rpc.idmapd: Ignore open failures in dirscancb()David Jeffery2013-01-161-1/+2
| | | | | | | | | | | | | From: David Jeffery <djeffery@redhat.com> The daemon "rpc.idmapd" scans the /var/lib/nfs/rpc_pipefs/nfs/ directory periodically looking for NFS client mounts to communicate to. The daemon tried to open communication with a client mount but it disappeared in between looking for directory entries and opening them. NFS mount was umounted just before rpc.idmapd tried to communicate with it. This behavior is usually seen when autofs is configured on the system. Signed-off-by: Steve Dickson <steved@redhat.com>
* idmapd: allow non-ASCII characters (UTF-8) in NFSv4 domain nameSuresh Jayaraman2012-12-171-23/+5
| | | | | | | | | | | | | | | | | | | | | | The validateascii() check in imconv() maps NFSv4 domain names with non-ASCII characters to 'nobody'. In setups where Active directory or LDAP is used this causes names with UTF-8 characters to being mapped to 'nobody' because of this check. As Bruce Fields puts it: "idmapd doesn't seem like the right place to enforce restrictions on names. Once the system has allowed a name it's too late to be complaining about it here." Replace the validateascii() call in imconv() with a check for null-termination just to be extra-careful and remove the validateascii() function itself as the only user of that function is being removed by this patch. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* autoconf: don't let libnfsidmap test add -lnfsidmap to $LIBSJeff Layton2012-01-051-1/+1
| | | | | | | | | | ...as that makes that library get linked into every binary. Also, replace "hardcoded" -lnfsidmap linker flag in Makefiles with a AC_SUBST variable. This fixes a regression introduced in commit d7c64dd. Signed-off-by: Jeff Layton <jlayton@redhat.com>
* autoconf: fix up libevent autoconf testJeff Layton2012-01-051-1/+1
| | | | | | | Have it set LIBEVENT to -levent and use that in the Makefiles instead of hardcoding it. Signed-off-by: Jeff Layton <jlayton@redhat.com>
* rpc.idmapd: Dies with 'I/O possible'Luca Giuzzi2011-10-041-1/+1
| | | | | | | | | | | | We have had problems on some of our machines (all Fedora 14), where rpc.idmapd used to die with an `I/O possible' message at (basically) random times. A strace suggested the issue being in nfsopen() where a signal type is reset before notification is disabled; a signal at just the right time might be the cause of the problem; see https://bugzilla.redhat.com/show_bug.cgi?id=684308 Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* idmapd: Fix decoding of octal encoded fieldsJan-Marek Glogowski2011-09-201-2/+2
| | | | | | | | | | | | The decoded octal will always be positive and (char) -1 is negative. Any field containing an encoded octal will be rejected. As the encoded value should be an unsigned char, fix the check to reject all values > (unsigned char) -1 = UCHAR_MAX, as this indicate an error in the encoding. Signed-off-by: Jan-Marek Glogowski <glogow@fbihome.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Move common code into supportSteve Dickson2010-10-135-220/+0
| | | | | | | | | | There are several source files and headers present in the ./utils/idmapd directory which are also usable in a doimapd daemon. Because of this we move that support into the support directory such that it can be shared by both daemons. Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.idmapd: Type of idmap client should be defined by ic_id not ic_clid.Bian Naimeng2010-09-161-4/+4
| | | | | | | | The type of idmap_client is defined by idmap_client.ic_id for nfs, so nfsd should have the same style. Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from idmapd.cSteve Dickson2010-08-091-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | idmapd.c:120: warning: missing initializer idmapd.c:120: warning: (near initialization for 'nfsd_ic[0].ic_event') idmapd.c:121: warning: missing initializer idmapd.c:121: warning: (near initialization for 'nfsd_ic[1].ic_event') idmapd.c: In function 'flush_nfsd_cache': idmapd.c:173: warning: comparison between signed and unsigned integer expressions idmapd.c: In function 'dirscancb': idmapd.c:384: warning: unused parameter 'fd' idmapd.c:384: warning: unused parameter 'which' idmapd.c: In function 'svrreopen': idmapd.c:468: warning: unused parameter 'fd' idmapd.c:468: warning: unused parameter 'which' idmapd.c:468: warning: unused parameter 'data' idmapd.c: In function 'clntscancb': idmapd.c:474: warning: unused parameter 'fd' idmapd.c:474: warning: unused parameter 'which' idmapd.c: In function 'nfsdcb': idmapd.c:488: warning: unused parameter 'fd' idmapd.c: In function 'nfscb': idmapd.c:663: warning: unused parameter 'fd' idmapd.c: In function 'validateascii': idmapd.c:850: warning: comparison between signed and unsigned integer expressions idmapd.c:858: warning: comparison between signed and unsigned integer expressions idmapd.c: In function 'getfield': idmapd.c:916: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed warnings from atomicio.cSteve Dickson2010-08-091-1/+2
| | | | | | | atomicio.c: In function 'atomicio': atomicio.c:48: warning: comparison between signed and unsigned integer expressions Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove the idmapd.conf man. It now lives in theSteve Dickson2010-01-222-78/+2
| | | | | | libnfsidmap library git tree Signed-off-by: Steve Dickson <steved@redhat.com>
* idmapd: rearm event handler after error in nfsdcb()Jeff Layton2009-09-141-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple of years ago, Bruce committed a patch to make knfsd send unsigned uid's and gid's to idmapd, rather than signed values. Part of that earlier discussion is here: http://linux-nfs.org/pipermail/nfsv4/2007-December/007321.html While this fixed the immediate problem, it doesn't appear that anything was ever done to make idmapd continue working when it gets a bogus upcall. idmapd uses libevent for its main event handling loop. When idmapd gets an upcall from knfsd it will service the request and then rearm the event by calling event_add on the event structure again. When it hits an error though, it returns in most cases w/o rearming the event. That prevents idmapd from servicing any further requests from knfsd. I've made another change too. If an error is encountered while reading the channel file, this patch has it close and reopen the file prior to rearming the event. I've not been able to test this patch directly, but I have tested a backport of it to earlier idmapd code and verified that it did prevent idmapd from hanging when it got a badly formatted upcall from knfsd. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Move idmapd's configuration file parsing routines intoSteve Dickson2009-08-164-963/+2
| | | | | | | the shared libnfs.a library, making them available to\ other daemons and programs. Signed-off-by: Steve Dickson <steved@redhat.com>
* mydaemon: remove closeall() calls from mydaemon()Steve Dickson2009-06-291-3/+6
| | | | | | | | | | | | | | | idmapd and svcgssd have a mydaemon() routine that uses closeall() to close file descriptors. Unfortunately, they aren't using it correctly and it ends up closing the pipe that the child process uses to talk to its parent. Fix this by not using closeall() in this routine and instead, just close the file descriptors that we know need to be closed. If /dev/null can't be opened for some reason, then just have the child exit with a non-zero error. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* In recent Fedora builds, the '-D _FORTIFY_SOURCE=2' compileSteve Dickson2009-03-231-2/+8
| | | | | | | | flag has been set. This cause warnings to be generated when return values from reads/writes (and other calls) are not checked. The patch address those warnings. Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.idmapd should tell the user more verbosely if DnotifyLukas Hejtmanek2009-02-181-2/+4
| | | | | | | support is missing in kernel. Signed-off-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove idmapd.confJ. Bruce Fields2008-08-281-10/+0
| | | | | | | | The example idmapd.conf file is kept in libnfsidmap now, which is what's responsible for parsing it anyway. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* If validateascii is passed a string containing only non-zero 7bitNeilBrown2008-02-261-1/+1
| | | | | | | | | | | | values, then the loop with exit with i == len, and the following test will access beyond the end of the array. So add an extra test to fix this. Found by Marcus Meissner <meissner@novell.com>. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Remove unnecessary code from idmapd.Kevin Coffman2007-10-153-118/+0
| | | | | | | | | | This patch removes unnecessary code from idmapd. setproctitle is not used anywhere and it can be removed. In addition the kernel section of the nfs_idmap.h header is not used and is out of date and thus is removed. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Remove old logging implementation for idmapd and rework gssd and idmapd to ↵Kevin Coffman2007-10-151-104/+38
| | | | | | | | | | | | | use the new xlog logging infrastructure. This patch removes all of the old idmap_* logging functions and replaced them with the corresponding xlog functions. In addition that that it also reworks the gssd logging wrappers to use the new xlog_backend. Finally it makes necessary changes to the build files to get the project compiling again. Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Neil Brown <neilb@suse.de>
* Fix more 'prototype' warnings and other warnings.Neil Brown2007-07-304-20/+19
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Stop using storage after freeKevin Coffman2007-02-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> The previous patch seems to expose a use after free bug in dirscancb. At least, I could reliably reproduce a segfault by doing a bunch of mounts and then unmounting them all. The code uses the following list macro: TAILQ_FOREACH(ic, icq, ic_next) { ...to iterate over all of the ic entries and clean up any that no longer have a corresponding directory in rpc_pipefs. This macro unrolls into: for(ic=icq->tqh_first; ic != NULL; ic=ic->ic_next.tqe_next) { ...but within this loop, we can free ic, and then the for loop can trip over that when it tries to do the iteration. The attached patch works around this by not using the TAILQ_FOREACH macro and saving off the tqe_next pointer prior to the free. Again, this was tested on a patched 1.0.6, but the 1.0.10 code is very similar, and I think the problem exists there as well. Signed-off-by: Neil Brown <neilb@suse.de>
* Fix memory leak in idmapd.Kevin Coffman2007-02-091-3/+8
| | | | | | | | | | | | | | | | Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> There is a pretty nasty memory leak in idmapd in dirscancb(). Some of our customers have reported that idmapd can eat gigabytes of memory on machines with a large number of mounts and unmounts and a long uptime. That function uses scandir(), which malloc's an array of strings, but dirscancb() never frees the strings or the array. The following patch should correct this, but I've not yet tested it on 1.0.10 (only on the RHEL4 1.0.6 version). Still, the code is very similar and I'm fairly certain the problem exists in both versions. Signed-off-by: Neil Brown <neilb@suse.de>
* Don't always use default mapping to "nobody".J. Bruce Fields2006-10-171-17/+35
| | | | | | | | | | | | | | | | | | Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> We've been ignoring all mapping errors and instead mapping to a "nobody" user or group. This is arguably OK for the cases where we're returning a value to the user (so, id->name mapping on the server or name->id mapping on the client). But it's a disaster in the other direction (id->name on the server or id->name on the client): for example, a chown to an unknown user should *not* automatically be translated into a succesful chown to "nobody". This patch fixes that problem on the server side. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
* Merge branch 'master' of git://linux-nfs.org/nfs-utilsGreg Banks2006-07-032-7/+16
|\
| * Further coverity related cleanups.Neil Brown2006-06-231-2/+5
| | | | | | | | | | Greg Banks suggested some variations, particularly improved use of xmalloc/xstrdup functions. Thanks.
| * Fix various issues discovered by CoverityNeil Brown2006-06-232-6/+12
| | | | | | | | Thanks to Michael Halcrow for finding them.
* | Fix a number of the easier compile warnings: unused variables,Greg Banks2006-06-221-3/+4
| | | | | | | | unused labels, constness, signedness.
* | Detect presence of nfs4_set_debug() in libnfsidmap andGreg Banks2006-06-221-0/+2
|/ | | | don't bother calling it if it's missing.
* Minor man page tidyupNeil Brown2006-06-051-6/+6
|
* Remove **/Makefile.in, aclocal.m4, configure, andNeil Brown2006-04-171-659/+0
| | | | | | support/include/config.h.in from source control These are auto autogenerated by aclocal -I aclocal ; autoheader ; automake ; autoconf
* 2006-04-10 NeilBrown <neilb@suse.de>neilbrown2006-04-101-2/+3
| | | | | | | | | | | | | Various paranoia checks: gssd_proc.c: pass max_field sizes to sscanf to avoid buffer overflow svcgssd_proc.c: range_check name.length, to ensure name.length+1 doesn't wrap idmapd.c(nfsdcb): make sure at least one byte is read before zeroing the last byte that was read, otherwise memory corruption is possible. Found by SuSE security audit.
* 2006-04-10 "Kevin Coffman" <kwc@citi.umich.edu>neilbrown2006-04-101-0/+2
| | | | | Check for sufficient version of librpcsecgss and libgssapi in configure.in
* 2006-04-10 "Kevin Coffman" <kwc@citi.umich.edu>neilbrown2006-04-101-0/+2
| | | | | Update aclocal/tcp-wrappers.m4 to define HAVE_LIBWRAP and HAVE_TCP_WRAPPERS as appropriate.
* aclocal/autoconf/automake, properly this time.neilbrown2006-03-281-0/+4
|
* User-selectable idmapping cache lifetimeneilbrown2006-03-281-3/+38
| | | | | | Read and process new configuration option, Cache-Expiration, and use the value to determine how long idmapping entries are cached. (Really this time)
* Set libnfsidmap library debugging level and logging function.neilbrown2006-03-261-1/+7
| | | | | | This patch adds a call to the new libnfsidmap library function nfs4_set_debug(), which defines the verbosity level libnfsidmap should use as well as the logging function.
* Don't close file descriptor until after calling event_del().neilbrown2006-03-261-2/+2
| | | | | Delete event processing for a file descriptor before closing it. This was causing hangs when used in combination with libevent-1.0b.
* Remove all the Makefilesneilbrown2005-12-201-13/+0
|
* More automake stuffneilbrown2005-12-201-0/+651
|
* Autogen updateneilbrown2005-12-201-0/+70
|
* Updates from Kevin Coffman at UMichneilbrown2005-12-161-63/+144
|
* idmapd update from Steve Dicksonneilbrown2005-11-031-23/+24
|
* Assorted changes from Steve Dicksonneilbrown2005-10-062-13/+10
|
* 2005-08-26 Kevin Coffman <kwc@citi.umich.edu>neilbrown2005-08-261-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * utils/exportfs/exports.man: Document the "crossmnt" export export option * utils/gssd/krb5_util.c: Add better debugging and partially revert the function check for gss_krb5_ccache_name. For MIT Kerberos releases up to and including 1.3.1, we *must* use the routine gss_krb5_ccache_name to get the K5 gssapi code to use a different credentials cache. For releases 1.3.2 and on, we want to use the KRB5CCNAME environment variable to tell it what to use. (A problem was reported where 1.3.5 was being used, our code was using gss_krb5_ccache_name, but the underlying code continued to use the first (or default?) credentials cache. Switching to using the env variable fixed the problem. I cannot recreate this problem. *utils/gssd/krb5_util.c: Andrew Mahone <andrew.mahone@gmail.com> reported that reiser4 always has DT_UNKNOWN. He supplied patch to move the check for regular files after the stat() call to correctly find ccache files in reiser4 filesystem. Also change the name comparison so that the wrong file is not selected when the substring comparison is done. *utils/gssd/krb5_util.c: Limit the set of encryption types that can be negotiated by the Kerberos library to those that the kernel code currently supports. This should eventually query the kernel for the list of supported enctypes. *utils/gssd/gss_util.c, utils/svcgssd/svcgssd_main_loop.c: Print more information in error messages to help debugging failures. *utils/svcgssd/svcgssd_proc.c: Increase token buffer size and update error handling so that a response is always sent. *utils/svcgssd/svcgssd_proc.c: Add support to retrieve supplementary groups.
* 2005-08-26 Kevin Coffman <kwc@citi.umich.edu>neilbrown2005-08-261-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | * configure.in etc Consolidate some of the Kerberos checking instead of repeating the same things for MIT and Heimdal. Also adds more checks to distinguish 32-bit from 64-bit (mainly for gssapi.h) Fix svcgssd Makefile so make TOP=../../ works correctly there. Enable running a modern autoheader. * utils/gssd/gss_oids.c: Use correct OID value for SPKM-3 * utils/gssd/gss_util.c: Fix build with older MIT releases that do not define GSS_C_NT_HOSTBASED_SERVICE * utils/gssd/write_bytes.h, support/include/gssapi/gssapi.h: Length of gss_buffer_desc is a size_t which is 64-bits on a 64-bit machine. Kernel code expects 32-bit integer for length. Coerce length value into a 32-bit value when reading from or writing to the kernel. Change gssapi.h to use datatype size values obtained from configure rather than hard-coded values. * utils/idmapd/idmapd.c: The EV_INIT check here was wrong, and was causing idmapd to become unresponsive to server requests after receiving a sighup. * utils/idmapd/idmapd.c: Idmapd should flush the server id<->name caches when its started.
* Added TOP, as needed, for easier compile in subdirectoriesgmorris2005-04-121-1/+2
|
* *** empty log message ***neilbrown2004-11-221-29/+4
|
* further idmapd updateneilbrown2004-11-221-2/+71
|
* more idmapd updatesneilbrown2004-11-221-1/+43
|