Dr. Werner Fink [Tue, 10 May 2011 15:35:23 +0000 (17:35 +0200)]
aggety: further mingetty features
Allow the system adminstrator to provide options to the login
program. Some changes for several layouts of the agetty
prompt like short host name or full qualified host name.
Four options enables the user to delay agetty after start,
to change the working directory, to change the root directory,
and to modified scheduling priority.
Werner Fink [Mon, 9 May 2011 13:52:39 +0000 (15:52 +0200)]
agetty: add an autologin feature
Add an autologin feature to agetty, that is that a user can be
automatically logged in. For this the options of for the
login program has to used. Make it possible to pass-through
options to the login program which requires a security check.
Dr. Werner Fink [Tue, 10 May 2011 15:34:30 +0000 (17:34 +0200)]
agetty: better support of virtual console
Better support of virtual console due support of UTF-8 login names
provided by e.g. LDAP. Set default size 24/80 on serial modem lines
if not found by the kernel.
Werner Fink [Mon, 9 May 2011 13:52:36 +0000 (15:52 +0200)]
agetty: proper session on the terminal line
Ensure a proper session on the terminal line, that is do a
vhangup() and become the controlling terminal. After this
determine if the terminal line a virtual console by using
the ioctl TIOCMGET to get the status modem bits of a serial
line which is a invalid argument on a virtual console.
Werner Fink [Mon, 9 May 2011 13:52:35 +0000 (15:52 +0200)]
agetty: cleanup argv parsing, utmp update, use writeall(), etc.
Next cleanup, that is split off special character parsing in do_prompt()
and parse_args(), handle name of line of virtual console and use it in
utmp update as well as the session id. Also move the initial TERM
variable to open_tty() as we use this later in open_tty(). Use writeall()
but avoid repeat to often for EAGAIN (compare with info page of the
(g)libc, description of the macro EAGAIN).
Werner Fink [Mon, 9 May 2011 13:52:34 +0000 (15:52 +0200)]
agetty: more code cleanup
More code cleanup, that is use bit mask for eight bit option, use
modern speed_t type, split local error() into local log_err(), log_warn(),
and dolog() for fine graduated logging with syslogger.
John Lindgren [Wed, 11 May 2011 18:32:18 +0000 (14:32 -0400)]
blkid: don't read past end of FAT32 cluster chain
When looking for a volume label on a FAT32 filesystem, blkid does not
correctly handle special cluster values in the range 0x0FFFFFF8 to
0x0FFFFFFF, which mark the last cluster in a chain. As a result, it
begins to read [what it treats as] FAT entries from past the end of the
FAT. Depending on the data read, it may then try to parse random data
from the filesystem (including user files, free space, and other
directories) as though it were part of the root directory.
Because parsing stops early when a volume label is found, the problem
only occurs on filesystems without a volume label. When it occurs, it
may result in a long sequence of lseek and read calls; on an older IDE
drive with a 2 GB FAT32 partition, this amounted to around 3 seconds of
disk I/O.
After patching, blkid stop parsing as soon as it reaches a cluster value
greater than or equal to the number of entries in the FAT.
[kzak@redhat.com: - add le32_to_cpu()]
Signed-off-by: John Lindgren <john.lindgren@tds.net>
Davidlohr Bueso [Tue, 10 May 2011 22:03:09 +0000 (18:03 -0400)]
taskset: make threads aware
Add a new '-a' option to view/modify the CPU affinity for an entire
group of threads belonging to a given PID. We create two new
functions, print_affinity() and do_taskset() for code simplification.
Example:
zeus@jilguero:~/src/util-linux/schedutils$ ./taskset -a -p 01 3142
pid 3142's current affinity mask: 2
pid 3142's new affinity mask: 1
pid 3164's current affinity mask: 2
pid 3164's new affinity mask: 1
pid 854's current affinity mask: 2
pid 854's new affinity mask: 1
[kzak@redhat.com: - clean up
- move variables to struct taskset]
Signed-off-by: Davidlohr Bueso <dave@gnu.org> Tested-by: Jonathan Gonzalez <zeus@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
sfdisk: returns non-zero on failed BLKRRPART ioctl
Make sfdisk(8) return non-zero value on failed BLKRRPART ioctl().
This will happen for either partition table re-reads after partition
changes or on explicit use of -R switch.
The function reread_disk_partition() was changed from 'void' to 'int'
and now returns a result to let the calling functions decide to exit(1).
Signed-off-by: Andrea Galbusera <gizero@gmail.com>
lsblk: add support for discard topology (-D option)
I got tired of poking around in sysfs to find the discard topology.
Here's a patch against lsblk that adds a -D option to present this
information in a human-readable form:
Davidlohr Bueso [Tue, 3 May 2011 18:57:01 +0000 (15:57 -0300)]
lib: [procutils.c]: general purpose procfs parsing functions
We include the following functions as a first approach:
- proc_open_tasks(): allocate resources and setup basic data
- proc_next_tid(): iterate over the thread group
- proc_close_tasks(): free used resources
[kzak@redhat.com: - free() on error in proc_open_tasks(),
- always call free() in proc_close_tasks()
- ignore non-digit dirs and return 1 on end-of-dir
in proc_next_tid()]
Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 2 May 2011 11:36:20 +0000 (13:36 +0200)]
docs: add Matej to AUTHORS
The original idea to have something like fallocate(1) is from Matej
Cepl -- his mkfile(1) prototype has been originally discussed on
coreutil mailing list. Thanks!
o Old school introduction back to the top of the source file.
o Indentation changes.
o Removal of void casting.
o Removal of braces from single statements.
o Unified format for comments.
o Comparison with W. Venema's code from 1993 to clean few comment
mysteries.
o Web referrals added to further explanation to near the code or
comments which some could find difficult to understand why.
o Clean up of comments.
o FIXME items added where attention is needed.
o Make functions static.
o Functions with same argument types use same argument order.
o Get rid of classic K&R style function declarations.
Please notice that this patch _should not_ affect how program
works e.g. this has no actual code changes.
Karel Zak [Thu, 21 Apr 2011 12:53:23 +0000 (14:53 +0200)]
libmount: add support for x-* mount comments
The current way how add any comment or extra information to /etc/fstab
is to use comment="" mount option. This is not too elegant and readable
if you want to add more than one comment.
It seems better to add any generic prefix that will be used for all
3rd-party userspace mount options.
Expected syntax is:
x-<application>-<options>[=<data>]
For example:
x-systemd-bar=managed
All x-* options (as well as comment=) are ignored by libmount and not
stored to the mtab file.
Requested-by: Lennart Poettering <lennart@poettering.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Sami Kerola [Sun, 10 Apr 2011 10:16:15 +0000 (12:16 +0200)]
agetty: getopt case segment reordering
The case clause after getopts is in alphabetical order, just like
option string definition and manual page. The patch also convers
spaces to tabs in this code block.
Sami Kerola [Sun, 10 Apr 2011 10:16:14 +0000 (12:16 +0200)]
docs: agetty long options
Long options to manual page with the new --version and --help.
The manual page option order is also set to be the same as it is
in code. For the persons who don't see the order it is short
option case in sensitive alphabetical order.