aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/su
Commit message (Collapse)AuthorAgeFilesLines
* Do not use macros in -widthMateusz Piotrowski2020-03-261-2/+2
| | | | | | | | | They do not expand. MFC after: 1 day Notes: svn path=/head/; revision=359340
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-2/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* su(1): build with WARNS=6Eitan Adler2018-06-221-2/+0
| | | | | | | Tested with full make universe Notes: svn path=/head/; revision=335535
* Use strlcpy().Xin LI2017-12-051-2/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=326561
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Mute gcc warning about p not being possibly initializedEnji Cooper2017-10-101-1/+1
| | | | | | | | | | I'm running into this warning on a tinderbox run with gcc 4.2.1 with mips and powerpc. MFC after: 1 week Notes: svn path=/head/; revision=324497
* Deorbit catman. The tradeoff of disk for performance has long since tippedGordon Tetlow2017-09-131-8/+8
| | | | | | | | | | | | | in favor of just rendering the manpage instead of relying on pre-formatted catpages. Note, this does not impede the ability to use existing catpages, it just removes the utility to generate them. Reviewed by: imp, allanjude Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12317 Notes: svn path=/head/; revision=323550
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-4/+2
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ Merge from headSimon J. Gerraty2013-09-052-5/+9
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-4/+2
| |_|/ |/| | | | | | | | | | | | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* | | Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| |/ |/| | | | | | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* | Make check for unknown login class actually work. Previously, using the ↵Edward Tomasz Napierala2013-08-121-0/+2
| | | | | | | | | | | | | | | | | | | | "-c" option with login class not defined in login.conf(5) would silently fail, resulting in using the default login class. Notes: svn path=/head/; revision=254259
* | In su(1), fix option ordering and clarify that the login class specifiedEdward Tomasz Napierala2013-08-111-5/+7
|/ | | | | | | | | must be defined in login.conf. MFC after: 1 month Notes: svn path=/head/; revision=254215
* Undo r226423.Ed Schouten2011-10-161-0/+2
| | | | | | | | It seems su does build without warnings, but it requires a small fix to libbsm headers, which I have not committed to SVN yet. Notes: svn path=/head/; revision=226428
* Remove WARNS line. This tool builds with WARNS=6 properly.Ed Schouten2011-10-161-2/+0
| | | | Notes: svn path=/head/; revision=226423
* Attempt to clear up some confusion in the following example, by statingGlen Barber2011-06-061-0/+6
| | | | | | | | | | | | | the '-c' argument is passed to the shell, not to su(1), which would indicate the login class. 'su -m <user> -c <command>' Submitted by: Warren Block <wblock@wonkity.com> (followup to 157078) MFC after: 5 days Notes: svn path=/head/; revision=222770
* Bump date from previous commit. :(Glen Barber2011-06-061-1/+1
| | | | | | | MFC after: 5 days Notes: svn path=/head/; revision=222759
* Document that when running 'su -m <user> -c <command>', <command> is runGlen Barber2011-06-061-4/+4
| | | | | | | | | | | within a shell as <user>. PR: 157078 Submitted by: Warren Block <wblock@wonkity.com> MFC after: 5 days Notes: svn path=/head/; revision=222758
* getpwnam(3) may return NULL.Hajimu UMEMOTO2011-03-271-3/+4
| | | | | | | | | Requested by: nork Reviewed by: Takeharu KATO <takeharu1219__at__ybb.ne.jp>, nork MFC after: 1 week Notes: svn path=/head/; revision=220055
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Build usr.bin/ with WARNS=6 by default.Ed Schouten2010-01-021-0/+2
| | | | | | | Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
* Revert most part of 200420 as requested, as more review and polish isXin LI2009-12-131-0/+1
| | | | | | | needed. Notes: svn path=/head/; revision=200462
* Remove unneeded header includes from usr.bin/ except contributed code.Xin LI2009-12-111-1/+0
| | | | | | | Tested with: make universe Notes: svn path=/head/; revision=200420
* Fixup the parameters to audit_submit(3) the order is errno then returnChristian S.J. Peron2009-04-041-7/+7
| | | | | | | | | | value. This bug went un-noticed for so long because EPERM == 1 MFC after: 1 week Spotted by: sson, rwatson Notes: svn path=/head/; revision=190700
* - add the -m option to the example commands because they would fail w/o itDaniel Gerzo2008-07-011-4/+9
| | | | | | | | | | | as the ``man'' user does not have a valid shell by default. PR: docs/121713 Approved by: trhodes MFC after: 3 days Notes: svn path=/head/; revision=180155
* Fix a strict aliasing warning - I think it is really telling usDavid Malone2008-06-041-2/+3
| | | | | | | | that the way char * and void * pointers may not be stored in the same way. Notes: svn path=/head/; revision=179547
* The upper while loop has already recycled child process, so the ifDavid Xu2007-10-181-3/+1
| | | | | | | | | statement has never executed as expected, fix it. MFC after: 3 days Notes: svn path=/head/; revision=172749
* Stop mentioning /usr/X11R6.Xin LI2007-07-241-2/+2
| | | | | | | Approved by: re (hrs) Notes: svn path=/head/; revision=171562
* Significantly reduce the memory leak as noted in BUGS section forSean Farley2007-07-041-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Notes: svn path=/head/; revision=171195
* Back out all POSIXified *env() changes.Andrey A. Chernov2007-05-011-3/+2
| | | | | | | | | | | | Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs. Notes: svn path=/head/; revision=169177
* Prepare for upcoming POSIXed putenv() rewrite:Andrey A. Chernov2007-04-301-2/+3
| | | | | | | don't free memory after putenv() Notes: svn path=/head/; revision=169125
* Backout previous change (SIGSYS related). The fix has been applied to theMaxim Sobolev2006-10-241-2/+0
| | | | | | | | | proper place. Pointed out by: rwatson Notes: svn path=/head/; revision=163665
* Ignore SIGSYS when BSM is compiled in. Otherwise, attempt to invoke su onMaxim Sobolev2006-10-241-0/+2
| | | | | | | | | | | | | | | | | | | | system that don't have audit framefork compiled into kernel or ia32 binary on amd64 system will result in SIGSYS. There is one place in su.c itself where it tries to check for errno != ENOSYS, but it has been a nop since su does not catch SIGSYS anyway. There are few other places in libbsm, where attempt to invoke audit syscal would result in SIGSYS if no audit support is present in the kernel, so that the only reliable method for now is to disable SIGSYS completely in the case when BSM is compiled in. In the long run, both direct invocation of audit-related syscalls and libbsm should be made more intellegent to handle the case when BSM is not compiled into the kernel gracefully. MFC after: 3 days (provided re@ approval) Notes: svn path=/head/; revision=163641
* Markup fixes.Ruslan Ermilov2006-09-291-3/+3
| | | | Notes: svn path=/head/; revision=162792
* Do not chdir(2) until after setuid(2), otherwise "su - username" would failLuoqi Chen2006-09-291-6/+4
| | | | | | | | | when root doesn't have the permission to enter target user's home directory. If set, PAM environment variable HOME will be used in chdir(2) instead of pwd->pw_dir, this allows pam_chroot module to continue to function. Notes: svn path=/head/; revision=162761
* Remove references to the pam(8) manual page. It does not exist.Joel Dahl2006-09-131-2/+1
| | | | | | | | Requested by: novel Discussed with: brueffer, simon Notes: svn path=/head/; revision=162286
* Integrate audit_submit(3) bits into su. This means that records forChristian S.J. Peron2006-09-012-6/+76
| | | | | | | | | | | | | | | successful and failed su attempts will be recorded using the AUE_su event type (login or lo class) if auditing is present in the system. Currently, the records will have a header, subject, text (with the actual diagnostics), a return and trailer token. See audit_submit(3) for more information. Reviewed by: rwatson Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=161815
* - Mention that users need to be in the wheel group to `su - root' by ↵Brad Davis2006-01-281-3/+17
| | | | | | | | | | | | | default, and how to change it. PR: docs/70616 Submitted by: Jilles Tjoelker <jilles at stack dot nl> Reviewed by: ru@ Approved by: ceri@ MFC after: 3 days Notes: svn path=/head/; revision=154945
* Fix the other su bug reintroduced two commits ago, namelyBrian Somers2006-01-031-1/+14
| | | | | | | | | | | | | | | | $ su % kill -STOP $$ where su is executing (t)csh. csh's job handling is a little more special than that of (a)sh, bash and even zsh and blows up a little more spectacularly. This modification restores the original mucking about with the tty pgrp, but is careful to only do it when su (or su's child) is the foreground process. While I'm here, fix a STDERR_FILENO spelling as suggested by bde. Notes: svn path=/head/; revision=153985