359754 |
09-Apr-2020 |
kevans |
MFC -fno-common fixes: r359389, r359394, r359397-r359399, r359403-r359404, r359406, r359413-r359416, r359425, r359427, r359432-r359433, r359443, r359675-r359677
Note: this is not necessarily a complete fix to get these programs to build with -fno-common applied.
r359389: config(8): fixes for -fno-common
Move this handful of definitions into main.c, properly declare these as extern in config.h. This fixes the config(8) build with -fno-common.
Unexplained in my previous commit to gas, -fno-common will become the default in GCC10 and LLVM11, so it's worth addressing these in advance.
r359394: MFV r359393: tcsh: import 6974bc35a5cd
This removes an extra variable definition that causes the -fno-common build to fail, which will be a new default in GCC10/LLVM11.
r359397: zfs: fix -fno-common issues
A similar (or identical?) fix has already landed in OpenZFS.
-fno-common will become the default in GCC10/LLVM11.
r359398: sh: remove duplicate el definition
el is declared extern in myhistedit.h and defined in histedit.c. Remove the duplicate definition in input.c to appease the -fno-common build.
-fno-common will become the default in GCC10/LLVM11.
r359399: telnet: remove some duplicate definitions, mark terminaltype extern
Most of these were already properly declared and defined elsewhere, this is effectively just a minor cleanup that fixes the -fno-common build.
-fno-common will become the default in GCC10/LLVM11.
r359403: Revert 359399: telnet -fno-common bits
There was a large misfire from my local diff that I need to investigate, and this version committed did not build.
r359404: Re-apply r359399: telnet -fno-common fix
line and auth_level's redefinitions are just extraneous
telnetd will #define extern and then include ext.h to allocate storage for all of these extern'd vars; however, two of them are actually defined in libtelnet instead. Instead of doing an #ifdef extern dance around those function pointers, just add an EXTERN macro to make it easier to differentiate by sight which ones will get allocated in globals.c and which ones are defined elsewhere.
r359406: telnet: kill off remaining duplicate definition
r359413: ipfilter: remove duplicate definition of 'thishost'
thishost is already defined in lib/initparse.c; no need for this one. This fixes the ipfilter build with -fno-common.
-fno-common will become the default in GCC10/LLVM11.
r359414: iscontrol: move definition of vflag/iscsidev to iscontrol.c
Mark the declaration extern as these are used elsewhere; this fixes the build with -fno-common.
r359415: userboot: mark host_fsops as extern
This is already defined elsewhere; mark this declaration extern to the fix the -fno-common build.
r359416: systat: remove redundant definition of kd
kd is already properly declared in extern.h and defined in main.c, rendering this definition useless. This fixes the -fno-common build.
r359425: locate: fix -fno-common build
Just a single variable declaration to extern and define elsewhere here, myctype.
-fno-common will become a default in GCC10/LLVM11.
r359427: fsck_ffs/fsdb: fix -fno-common build
This one is also a small list:
- 3x duplicate definition (ufs2_zino, returntosingle, nflag) - 5x 'needs extern', 3/5 of which are referenced in fsdb
-fno-common will become the default in GCC10/LLVM11.
r359432: gdb: compile with -fcommon explicitly
As described in the comment, gdb relies on some of the linker magic that happens with -fcommon. I suspect the life expectancy of gdb-in-base is low enough that this isn't worth spending much time addressing, especially given the vintage. Hit it with the -fcommon hammer so that it continues to just work.
r359433: bmake: fix -fno-common build
debug was declared extern, but debug_file was not; correct this and define debug_file in main.c (as debug is) to fix the -fno-common build.
-fno-common will become the default with GCC10/LLVM11.
r359443: MFV r359442: bmake: import -fno-common fix build back from upstream
sjg@ committed the local patch previously committed upstream; pull it in to vendor/ to ease any potential stress of future imports.
r359675: kqueue tests: fix -fno-common build
vnode_fd and kqfd are both shared among multiple CU; define them exactly once.
In the case of vnode_fd, it was simply the declaration that needed correction.
-fno-common will become the default in GCC10/LLVM11.
r359676: ntpd: fix build with -fno-common
Only a small nit here: psl should be declared extern and defined exactly once.
-fno-common will become the default in GCC10/LLVM11.
r359677: yp*: fix -fno-common build
This is mostly two problems spread out far and wide: - ypldap_process should be declared properly - debug is defined differently in many programs
For the latter, just extern it and define it everywhere that actually needs it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the assignment at the beginning of main in favor of defining it properly.
-fno-common will become the default in GCC10/LLVM11. |
319191 |
30-May-2017 |
ngie |
MFC r314451,r314452,r314453,r314456,r314457,r314458,r314459,r314460,r314461,r314462,r314464,r314466,r314468,r314470,r314472,r314478:
r314451:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
The SRCTOP conversion simplifies pathing in make/displayed output.
Also, while here, change a hardcoded path to ar5523.bin.uu in the make target with ${.ALLSRC} .
r314452:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
r314453:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
r314456:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314457:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
The SRCTOP conversion simplifies pathing in make/displayed output.
Also, while here, change a hardcoded path to ${RPCDIR}/ypupdate_prot.x in the make targets with ${.ALLSRC} .
r314458:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314459:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314460:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314461:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314462:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
The SRCTOP conversion simplifies pathing in make/displayed output.
Also, while here, change a hardcoded path to ${RPCDIR}/ypxfrd.x in the make targets with ${.ALLSRC} .
r314464:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314466:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314468:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
Also, use :H where possible/sensical to manipulate .CURDIR-relative paths
This simplifies pathing in make/displayed output.
r314470:
Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones
This simplifies pathing in make/displayed output.
r314472:
Simplify/improve idioms in usr.sbin/ntp Makefiles
- Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones. This simplifies pathing in make/displayed output. - Also, use :H where possible/sensical to manipulate .CURDIR-relative paths - Remove superfluous bsd.own.mk .includes which are already handled via src.opts.mk .includes
r314478:
Simplify idioms in Makefiles further
- Use SRCTOP-relative paths instead of .CURDIR-relative ones where possible - Use :H to manipulate .CURDIR in areas instead of ..-relative paths. |
300430 |
22-May-2016 |
ngie |
Wrap EXPAND(..) macro with a do-while(0) loop and put a single statement on each line
As a positive side-effect, this eliminates the double semicolons reported by Coverity: the macro contained a trailing semicolon, in addition to the semicolon placed on each line where EXPAND(..) was called.
MFC after: 1 week Reported by: Coverity CID: 1194269 Sponsored by: EMC / Isilon Storage Division
|
288482 |
02-Oct-2015 |
araujo |
The rpc.yppasswdd has an option to not allow shell changes (-s), but is always passed a shell by the remote yppasswd. If an NIS client overrides the shell provided by the ypserv, then yppasswd (pam_unix, actually, afaict) will pass this new shell to the yppasswdd. If this shell has been set on the client to a shell which is invalid on the server, a user will never be able to change their password on the client.
PR: 67142 Submitted by: russell@rucus.ru.ac.za Approved by: bapt (mentor) Sponsored by: EuroBSDCon Sweden.
|
188766 |
18-Feb-2009 |
imp |
yppasswdd assumed that a struct x_master_passwd is type punable to a struct passwd. This is not the case when sizeof(unsigned long) != sizeof(time_t). Write a dinky function to do the assignment instead of relying on the punning. This does slow things down a little (1 extra function call, 11 pointer or int assignments), but is much safer and machines have been fast enough since the mid 1990s that nobody will notice the difference.
time_t is a 64-bits int on arm and mips. Before this change, arm was silently broken. I guess there aren't that many ARM machines running master YP domain servers. :)
The client side doesn't assume this type punning, so it doesn't need to be fixed.
|
184459 |
30-Oct-2008 |
rafan |
- Whenever a password/shell is changed via rpc.yppasswdd, the daemon leaves one zombie process because it does not do the cleanup. For a long running NIS/YP server, it will have lots of zombie processes on it. Fix that by ignoring the SIGCHLD signal since we don't really care about the exit status in this case.
PR: bin/91980 Reported by: Arjan van der Velde <dj_noresult at hotmail.com> Submitted by: Jui-Nan Lin" <jnlin at csie.nctu.edu.tw> Reviewed by: delphij MFC after: 1 month
|
173766 |
20-Nov-2007 |
jb |
These are the things that the tinderbox has problems with because it doesn't use the default CFLAGS which contain -fno-strict-aliasing.
Until the code is cleaned up, just add -fno-strict-aliasing to the CFLAGS of these for the tinderboxes' sake, allowing the rest of the tree to have -Werror enabled again.
|
116421 |
15-Jun-2003 |
mbr |
Fix yppasswdproc_update_master_1_svc() too.
Only call pw_mkdb if passfile == _PATH_MASTERPASSWD. Otherwise, rename master.passwd to a temp filename, rename the new passwd to master.passwd, and let yppwupdate update passwd as it sees fit.
Reviewed by: phk Tested by: genesys
|
116392 |
15-Jun-2003 |
mbr |
Only call pw_mkdb if passfile == _PATH_MASTERPASSWD. Otherwise, rename master.passwd to a temp filename, rename the new passwd to master.passwd, and let yppwupdate update passwd as it sees fit.
PR: 52601, 7968 Reviewed by: des Submitted by: Dan Nelson <dnelson@allantgroup.com>
|
90297 |
06-Feb-2002 |
des |
Apply the following mechanical transformations in preparation for ansification and constification:
s{\s+__P\((\(.*?\))\)}{$1}g; s{\(\s+}{\(}g; s{\s+\)}{\)}g; s{\s+,}{,}g; s{(\s+)(for|if|switch|while)\(}{$1$2 \(}g; s{return ([^\(].*?);}{return ($1);}g; s{([\w\)])([!=+/\*-]?=)([\w\(+-])}{$1 $2 $3}g; s{\s+$}{\n};g
Also add $FreeBSD$ where needed.
MFC after: 1 week
|
90253 |
05-Feb-2002 |
alfred |
Fix the breakage in rpc.yppasswd. Readded the svc_create() and the registering of the "unix" transport, now it is fixed.
Everywhere, rq_cred is taken to look what authentification we have. We can not be sure that transp>xp_verf.oa_flavor is also filled in. This seems to be the same for all sun source. they take the flavor of rq_cred, instead of transp.
Submitted by: mbr
|
74462 |
19-Mar-2001 |
alfred |
Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) and associated changes that had to happen to make this possible as well as bugs fixed along the way.
Bring in required TLI library routines to support this.
Since we don't support TLI we've essentially copied what NetBSD has done, adding a thin layer to emulate direct the TLI calls into BSD socket calls.
This is mostly from Sun's tirpc release that was made in 1994, however some fixes were backported from the 1999 release (supposedly only made available after this porting effort was underway).
The submitter has agreed to continue on and bring us up to the 1999 release.
Several key features are introduced with this update: Client calls are thread safe. (1999 code has server side thread safe) Updated, a more modern interface.
Many userland updates were done to bring the code up to par with the recent RPC API.
There is an update to the pthreads library, a function pthread_main_np() was added to emulate a function of Sun's threads library.
While we're at it, bring in NetBSD's lockd, it's been far too long of a wait.
New rpcbind(8) replaces portmap(8) (supporting communication over an authenticated Unix-domain socket, and by default only allowing set and unset requests over that channel). It's much more secure than the old portmapper.
Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded to support TI-RPC and to support IPV6.
Umount(8) is also fixed to unmount pathnames longer than 80 chars, which are currently truncated by the Kernel statfs structure.
Submitted by: Martin Blapp <mb@imp.ch> Manpage review: ru Secure RPC implemented by: wpaul
|
21673 |
14-Jan-1997 |
jkh |
Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
|
19138 |
23-Oct-1996 |
wpaul |
Add extra sanity checking to the in-place update routine. Sometimes you find two users with the same UID (i.e. root and toor), but yp_mkdb(8) forbits duplicate keys, so only one of them will end up in the *.byuid maps (probably toor, since it comes after root in the template file). If I asked rpc.yppasswdd(8) to change toor's password, it would update the *.byname maps correctly, but incorrectly modify root's entry in the *.byuid maps since the only matching record with UID=0 in those maps belongs to root.
To fix this, we check that both the name and UID are correct before trying to write new entries to the maps.
|
19091 |
22-Oct-1996 |
wpaul |
Since rpc.yppasswdd(8) also supports adding entries to the /var/yp/master.passwd template file and it uses the same kind of code as chpass(1), it may also be vulnerable to the bug from PR #1519. May as well deal with it since I'm in the area. (yppasswdd in -stable doesn't do additions, therefore it shouldn't be have this problem.)
|
17431 |
04-Aug-1996 |
wpaul |
Fix a couple of bogons. The first two were brought to my attention by Peter Wemm:
- In yppasswdproc_update_1_svc(), I wasn't paying attention and put a couple of lines of code _after_ a return() instead of before. (*blush*)
- The removal of certain temp files didn't always work (this showed up mostly if you were using /etc/master.passwd as your NIS passwd template instead of /var/yp/master.passwd). This is because the whole temp file creation mechanism I was using was tragically broken (you can't rename across filesystems).
This problem I found myself:
- If you have a very large password database (30,000 or more entries), there can be a delay of several seconds while pw_copy() copies the ASCII template file and subsitutes in the modified/new entry. During this time, the clnt_udp() code in the RPC library may get impatient and retry its request. This will get queued at the server and be treated as a second request. By then the password change will have been completed and the second request will fail (the old password is no longer valid). To attempt to fix this, we save the IP address and port of each request and ignore any subsequent requests from the same IP and same port that arrive within five minutes of each other.
|
16876 |
01-Jul-1996 |
guido |
Implement incremental passwd database updates. This is done by ading a '-u' option to pwd_mkdb and adding this option to utilities invoking it. Further, the filling of both the secure and insecure databases has been merged into one loop giving also a performance improvemnet. Note that I did *not* change the adduser command. I don't read perl (it is a write only language anyway). The change will drastically improve performance for passwd and friends with large passwd files. Vipw's performance won't change. In order to do that some kind of diff should be made between the old and new master.passwd and depending the amount of changes, an incremental or complete update of the databases should be agreed upon.
|
16134 |
05-Jun-1996 |
wpaul |
Added support for in-place updates:
If rpc.yppasswdd is invoked with the -i flag, password changes will be made to the master.passwd template file and the hash map files in-place, which means it won't have to run a complete map update. Instead, it calls /var/yp/Makefile with the 'pushpw' target, which just pushes the maps to the slaves and runs yp_mkdb -c to tell the local ypserv to flush its database cache.
The server will check the passwd.byname and passwd.byuid maps to see if they were built in 'insecure' or 'secure' mode (i.e. with real encrypted passwords in them or without) and update them accordingly.
This combined with rpc.ypxfrd greatly reduces the amount of time it takes to complete an NIS password change, especially with very large passwd databases.
|
15687 |
08-May-1996 |
wpaul |
Fix 'multidomain' code. It returns a pointer to memory that it doesn't really own (and which can end up being mangled later). The manifestation of this bug is that the first attempt by a user to change their NIS password succeeds, but all subsequent attempts fail. rpc.yppasswdd also logs a message about not being able to find a file called '/var/yp/<some garbage string>/master.passwd.' (Note that for some bizarre reason, this doesn't happen with the malloc() from FreeBSD 2.1.0. I suppose this means we can chalk up another victory for phkmalloc. :)
This bug only occurs if you use the -m flag with rpc.yppasswdd.
Fix this by copying the domain name to a static buffer and returning a pointer to that instead.
Reported by: Jian-Da Li (jdli@csie.nctu.edu.tw)
|
14241 |
24-Feb-1996 |
wpaul |
Add securenets support (uses same access control mechanism as ypserv, also controlled by /var/yp/securenets).
Add -u flag to turn off the privileged port check done by yp_access(); some commercial systems (IRIX, Solaris 2.x, HP-UX, and probably others) don't use a reserved port for submitting yppasswd updates. If we always enforce the check, these client systems will be unable to submit updates to us.
Document securenets support and -u flag in man page.
Like ypserv, you can compile rpc.yppasswdd to use the tcpwrapper package instead of securenets if you want to.
|