summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent
Commit message (Collapse)AuthorAge
* include <poll.h> instead of <sys/poll.h>Thomas Hindoe Paaboel Andersen2015-02-12
| | | | | | include-what-you-use automatically does this and it makes finding unnecessary harder to spot. The only content of poll.h is a include of sys/poll.h so should be harmless.
* util: rework strappenda(), and rename it strjoina()Lennart Poettering2015-02-03
| | | | | | After all it is now much more like strjoin() than strappend(). At the same time, add support for NULL sentinels, even if they are normally not necessary.
* util: rename ignore_file() to hidden_file()Lennart Poettering2014-12-19
| | | | | hidden_file() is a bit more precise, since dot files usually shouldn't be ignored, but certainly be considered hidden.
* treewide: sanitize loop_writeZbigniew Jędrzejewski-Szmek2014-12-09
| | | | | | | loop_write() didn't follow the usual systemd rules and returned status partially in errno and required extensive checks from callers. Some of the callers dealt with this properly, but many did not, treating partial writes as successful. Simplify things by conforming to usual rules.
* treewide: another round of simplificationsMichal Schmidt2014-11-28
| | | | | Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-28
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* treewide: no need to negate errno for log_*_errno()Michal Schmidt2014-11-28
| | | | It corrrectly handles both positive and negative errno values.
* treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt2014-11-28
| | | | | | | | | | | | | As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
* ask-password: Add --echo to enable echoing the user inputDavid Sommerseth2014-10-05
| | | | | | | | | | | | | | | | Programs such as OpenVPN may use ask-password for not only retrieving passwords, but also usernames. Masking usernames with * seems just silly. v2 - Don't mess with termios flags, instead print the input instead of an asterix. Resolves issues with backspace and TAB input. v3 - Renamed 'do_echo' variables and argument to 'echo'. Also modified the ask_password_{tty,agent,auto} API instead of additional wrapper functions. [zj: undo changes to ask_password_auto, since no callers were using the new argument.]
* Correct a few typosTorstein Husebø2014-10-02
|
* tty-ask-password-agent: modernizationZbigniew Jędrzejewski-Szmek2014-08-03
|
* Unify parse_argv styleZbigniew Jędrzejewski-Szmek2014-08-03
| | | | | | | | | | | | | | | | getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
* time-util: add and use USEC/NSEC_INFINIYKay Sievers2014-07-29
|
* Always check asprintf return codeKarel Zak2014-07-26
| | | | | | | There is a small number of the places in sources where we don't check asprintf() return code and assume that after error the function returns NULL pointer via the first argument. That's wrong, after error the content of pointer is undefined.
* tty-ask-password-agent: modernizationZbigniew Jędrzejewski-Szmek2014-07-16
|
* Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek2014-07-16
| | | | | | | | Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
* Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek2014-07-15
|
* tty-ask-password-agent: Do tell what directory we failed to openCristian Rodríguez2014-06-01
|
* tty-ask-password-agent: return negative errnoFlorian Albrechtskirchinger2014-04-05
| | | | | | | Return negative errno in wall_tty_block(). get_ctty_devnr() already returns a negative errno in case of failure, no need to negate it again. Reported-by: Simon <hwold@odai.homelinux.net>
* util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering2014-03-18
| | | | | | | | | | | | | | | safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
* utmp-wtmp: allow overriding username on wallSebastian Thorarensen2014-03-14
| | | | | | | utmp_wall() now takes an optional argument 'username_override' which allows the caller to override the username shown on wall messages. journald will use this to inform users that its wall messages comes from 'systemd-journald'.
* make gcc shut upLennart Poettering2014-02-19
| | | | | | | If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter.
* util: generalize code that checks whether PIDs are alive or unwaited forLennart Poettering2014-02-18
|
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-06
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* conf-parser: restrict .include usageLennart Poettering2013-04-25
| | | | | Disallow recursive .include, and make it unavailable in anything but unit files.
* Report about syntax errors with metadataZbigniew Jędrzejewski-Szmek2013-04-17
| | | | | | | | | | | | | The information about the unit for which files are being parsed is passed all the way down. This way messages land in the journal with proper UNIT=... or USER_UNIT=... attribution. 'systemctl status' and 'journalctl -u' not displaying those messages has been a source of confusion for users, since the journal entry for a misspelt setting was often logged quite a bit earlier than the failure to start a unit. Based-on-a-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
* tty-ask-password-agent: free passwordsLukas Nykryn2013-04-10
|
* Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek2013-04-05
| | | | | | | | | | | | | | | | | | | | | | | Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
* Revert "log_error() if inotify_add_watch() fails"Lennart Poettering2013-02-13
| | | | | | This reverts commit 2826d14091e43ed3397d862dee79d09d0115c84e. We never should generate log messages from a library.
* log_error() if inotify_add_watch() failsHarald Hoyer2013-02-13
| | | | | | | [zj: Reworded message s/to watch/to add watch on/ to make it clear that it was the watch init action that failed, and not the "process of watching". I think this way it'll be clearer to people who don't know what inotify does.]
* build-sys: drop all distribution specfic checksLennart Poettering2013-01-04
| | | | Yay, we now have a completely generic systemd. No distribution specific checks anymore!
* log.h: new log_oom() -> int -ENOMEM, use itShawn Landden2012-07-26
| | | | | | also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
* use "Out of memory." consistantly (or with "\n")Shawn Landden2012-07-25
| | | | | | | | glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
* log: correct usage of logging API at a few placesLennart Poettering2012-07-13
|
* man: document tty-ask-password-agentLennart Poettering2012-06-27
|
* core: make systemd.confirm_spawn=1 actually workLennart Poettering2012-06-26
| | | | | | This adds a timeout if the TTY cannot be acquired and makes sure we always output the question to the console, never to the TTY of the respective service.
* mkdir: append _label to all mkdir() calls that explicitly set the selinux ↵Kay Sievers2012-05-31
| | | | context
* util: split-out path-util.[ch]Kay Sievers2012-05-08
|
* build-sys: add stub makefiles to all subdirs to ease development with emacsLennart Poettering2012-04-13
|
* move all tools to subdirsKay Sievers2012-04-12