Commit graph

2236 commits

Author SHA1 Message Date
Peter Breitenlohner
74bb20ebb7 reset.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:08 +02:00
Peter Breitenlohner
f736d38534 rename.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:08 +02:00
Peter Breitenlohner
3eca4291b9 namei.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:07 +02:00
Peter Breitenlohner
894aa2f20c mcookie.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:07 +02:00
Peter Breitenlohner
b0315e1fab kill.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:07 +02:00
Peter Breitenlohner
1fb6af9149 ddate.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:07 +02:00
Peter Breitenlohner
eb3395852b cal.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:07 +02:00
Daniel Mierswa
c0f19ccff7 replace bcopy,bzero,index and rindex
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008.

Replaced with memmove,memset,strchr and strrchr.

Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-08-17 11:15:59 +02:00
Peter Breitenlohner
f06602a42a cal: fix broken computation for Sep 1752
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-07-20 15:33:50 +02:00
Peter Breitenlohner
32dec5ac25 cal: fix (harmless) typo
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-07-20 15:33:44 +02:00
Karel Zak
91b72e09a4 scriptreplay: fix typo in error message
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-20 10:31:27 +02:00
Karel Zak
30688dde55 build-sys: rename to _execdir
The variable name "usrlibexecdir" is very confusing (because we have
/usr/libexec). The "exec" prefix is required for user-defined
directories, see

   http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install

This patch renames all usr*execdir variables to usr*_execdir.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04 01:23:41 +02:00
Karel Zak
5663298c2c blkid: move to misc-utils/ directory
The others utilities are in one of the top-level directories. That's
confusing to have blkid(8) and findfs(8) in shlibs/ tree.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-02 14:38:23 +02:00
Karel Zak
e2d96cd60b uuidd: init /var/run/uuidd, add option for on-demand mode to .rc file
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-01 21:25:37 +02:00
Karel Zak
d3cbfb8f82 Merge branch 'tytso' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/util-linux-ng into test 2009-07-01 20:55:00 +02:00
Theodore Ts'o
3b90c50066 libuuid, uuidd: Avoid infinite loop while reading from the socket fd
If for some reason the uuidd daemon or the process calling uuidd
exited unexpectely, the read_all() function would end up looping
forever, either in uuidd or in libuuid.  Fix this terminating the loop
if no data can be read after five tries to read from the file
descriptor.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-30 23:26:09 -04:00
Theodore Ts'o
fdb3e93ce9 uuidd: Avoid closing the server socket when calling create_daemon()
In the event that file descriptors 0-2 are closed when uuidd is
started, the server socket could be created as a file descriptor that
will get closed when create_daemon() tries detaching the uuidd daemon
from its controlling tty.   Avoid this case by using dup(2).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-06-30 23:26:09 -04:00
Karel Zak
4436271060 uuidd: fix $PIDFILE in uuidd.rc
.. that's very probably a typo.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-30 15:10:20 +02:00
Karel Zak
9a3e4ae5c9 uuidd: move uuidd.rc to misc-utils directory
The file should be on more visible place.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-30 15:04:49 +02:00
Karel Zak
c74c0dafff include: clean up _PATH_DEV_* macros
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-30 01:13:42 +02:00
Karel Zak
a0fca6a752 uuidd: move uuidd files from /var/lib/libuuid to /var/run/uuidd
Reported-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-29 15:59:48 +02:00
Karel Zak
18c3e4168c build-sys: fix --disable-uuidd
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-28 22:52:29 +02:00
Karel Zak
69045d3dba uuidd: new command (UUID daemon from e2fsprogs)
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:16 +02:00
Karel Zak
0140c3972b uuidgen: new command (from e2fsprogs)
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-22 10:06:16 +02:00
Tom Prince
a88057d9a3 cal: uClibc has langinfo.h but not _NL_TIME_WEEK_1STDAY.
Signed-off-by: Tom Prince <cougar@hermes>
2009-05-19 14:25:43 +02:00
Rajeev V. Pillai
a43145e157 cal: Highlight today even when month or year specified
* misc-utils/cal.c: Unconditionally call time()
and highlight today where possible.

Signed-off-by: Rajeev V. Pillai <rajeevvp@gmail.com>
Signed-off-by: Pádraig Brady <P@draigBrady.com>
2009-05-07 10:59:29 +02:00
Karel Zak
dcb54fafb1 cal: remove gcc-ism from nl_langinfo() call
> On Tue, Mar 10, 2009 at 01:15:14PM +0100, Samuel Thibault wrote:
> That will only work with the gcc compiler, which allows to read a
> union field what you wrote in another.  Shouldn't
> (int)(intptr_t)nl_langinfo() be just fine?

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-10 13:36:56 +01:00
Pádraig Brady
0a9bead039 cal: determine the first day of week from the locale
Previously it defaulted to Sunday rather than using
the value from the locale. Lauri Nurmi <lanurmi@iki.fi>
provided the detailed argument for this change while
Samuel Thibault <samuel.thibault@ens-lyon.org> provided
the information on how to read the first day of the week
from the locale correctly.

[kzak@redhat.com: - fix "cast from pointer to integer",
                    nl_langinfo(_NL_TIME_WEEK_1STDAY) call)]

Signed-off-by: Pádraig Brady <P@draigBrady.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-10 13:01:39 +01:00
Karel Zak
06b2b6af77 namei: add missing options to namei.1
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-27 15:00:35 +01:00
Karel Zak
c3ecdb3ea4 namei: add --vertical option
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-27 14:48:32 +01:00
Karel Zak
922a121b60 namei: don't duplicate '/' directory
sake@lelux ~ namei -l /
f: /
 drwxr-xr-x root root /
 drwxr-xr-x root root

The duplicate '/' directory is unexpected behavior.

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-26 11:36:31 +01:00
Karel Zak
f7ed29a7b6 namei: fix buffer overflow
$ ./namei  /usr/bin/java
 *** glibc detected *** ./namei: free(): invalid next size (fast): 0x00000000018e5070 ***
 [...]
 Aborted

Reported-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-01-06 14:26:12 +01:00
Karel Zak
e273df94ba setterm: fix -blank man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-05 11:41:28 +01:00
Karel Zak
4cfcf09b33 namei: add --owners and --long options
Added file owner and group name printing support. The groupnames and
usernames are cached to avoid an extra overhead. This implementation
does not use fixed width of user/group name columns.

$ namei -l /var/www/cgi-bin
f: /var/www/cgi-bin
 drwxr-xr-x root root /
 drwxr-xr-x root root var
 drwxr-xr-x root root www
 drwxr-xr-x root root cgi-bin

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-13 23:25:59 +01:00
Karel Zak
c84a633a92 namei: new re-written version
This new version:
 * not based on chdir()
 * implemented without recursion (does not depend on stack size)
 * list of directories is stored in allocated memory (the code is
   extendable with new functionality (e.g. show usernames, groupnames,
   selunux contexts, ...).
 * supports long command line options
 * adds a new command line option:
     -n, --nosymlinks    don't follow symlinks

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-13 23:25:46 +01:00
Pedro Ribeiro
331b704481 logger: several strings without gettext calls
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 09:17:07 +02:00
Karel Zak
0c723f3490 scriptreplay: new implementation is out-of-sync
Reproduction steps:

1. Run "script -t 2>timing".
2. When the prompt comes up, hit return.
3. New prompt. Wait several seconds, then type "true" and hit return.
4. Repeat (3) as desired, then exit scripted shell.
5. Run "scriptreplay timing".

You'll find on the replay that, rather than waiting several seconds
between the prompt and true, the wait will actually occur after the
first "t" of true.

Reported-by: Micah Cowan <micah@cowan.name>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-08-13 11:54:13 +02:00
Andrew McGill
e8c7a57b4f script: don't flush input when starting script
script currently flushed the input buffer when starting up.  This undocumented
behaviour prevents typeahead when starting up (e.g. as part of .profile).
Rather retain queued input. Don't discard queued output either.

Signed-off-by: Andrew McGill <andrew@lunch.za.net>
2008-08-05 12:39:01 +02:00
maximilian attems
d3e8f6598b remove CVS keywords
this patch removes old CVS keywords from comments.

mount(8) works for newer Linux then 0.99 ;)

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:10:08 +02:00
maximilian attems
7574f09b3d whereis: include dirent.h instead sys/dir.h
sys/dir.h is an old BSD'ism not carried by klibc,
include dirent directly.

compile tested against glibc.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:08:30 +02:00
maximilian attems
172b3c277d misc-utils: write include signal.h directly
another small step for better klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:08:09 +02:00
Karel Zak
bf09b61a32 write: doesn't check for tty group
write(1) selects a wrong tty, because there is not a proper
check of tty group ownership:

	$ write kzak
	write: kzak is logged in more than once; writing to tty7
	write: /dev/tty7: Permission denied

	$ ls -la /dev/tty7
	crw--w---- 1 root root 4, 7 2008-07-04 00:32 /dev/tty7
	                  ^^^^

	$ ls -la /usr/bin/write
	-rwxr-sr-x 1 root tty 11864 2008-04-02 16:24 /usr/bin/write
	      ^           ^^^

We have to check for tty group owner, because we don't have
permissions to write to arbitrary tty.

Fixed version:

	$ write kzak
	write: kzak is logged in more than once; writing to pts/6
	                                                    ^^^^
	Message from test@nb on pts/7 at 15:22 ...

	^C

	$ ls -la /dev/pts/6
	crw--w---- 1 kzak tty 136, 6 2008-07-07 15:35 /dev/pts/6
	                  ^^^

Addresses-Red-Hat-Bugzilla: #454252
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-07 22:20:44 +02:00
Volker Schatz
0eab17b95d ddate: 11th, 12th and 13th of month
the Discordian date utility ddate gives the 11th, 12th and 13th of the month as
the "11st", "12nd" and "13rd".  Unless this is a religious thing, please apply
the patch below.

Signed-off-by: Volker Schatz <oss@volkerschatz.com>
2008-06-09 12:49:40 +02:00
Karel Zak
3e6e4bf6ae scriptreplay: gettextize a forgotten messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-28 13:58:24 +02:00
Karel Zak
310170b83b cal: use HAVE_LIB{NCURSES,NCURSESW} instead HAVE_NCURSES
The HAVE_NCURSES is obsolete macro. The autotool generates HAVE_LIBxxx macros.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 23:12:40 +02:00
Karel Zak
00077d4d53 build-sys: update .gitignore files
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:24:03 +02:00
James Youngman
c4e1583799 build-sys: ignore a bunch of generated files, mostly binaries
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:08:00 +02:00
Karel Zak
18a706bdfd scriptreplay: rewrite in C
The dependence on Perl sucks...

Co-Author: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: James Youngman <jay@gnu.org>
2008-04-14 10:50:18 +02:00
James Youngman
9d374821a0 script: read returns a size_t
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08 01:44:51 +02:00
Karel Zak
7ba1ca0d05 Revert "script: improve quiet mode"
This reverts commit 7baec9a561.

Note, scriptreplay(8) expects the "Script started on.." line. We cannot remove
this message...
2008-03-31 15:45:11 +02:00