summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* journal: Use separate variable for Data object in sd_journal_get_data()Daan De Meyer2021-11-181-13/+10
| | | | | | A little cleanup to make the next change easier. We're not moving to a new Entry object in the for loop so there's no danger of changing the Entry object window.
* journal: Skip over corrupt entry items in enumerate_data()Daan De Meyer2021-11-181-18/+29
| | | | | | | | Similar to sd_journal_next(), if trying to access an entry item offset's data results in EBADMSG, skip to the next entry item so we handle corruption better. Fixes #21407
* getty-generator: add kernel cmdline and env vars to disable itLuca Boccassi2021-11-181-0/+40
| | | | | systemd.getty_auto/rd.systemd.getty_auto/SYSTEMD_GETTY_AUTO can be used to disable the generator. Enabled by default.
* Merge pull request #21401 from poettering/open-mkdir-atLennart Poettering2021-11-187-27/+144
|\ | | | | add open_mkdir_at() helper and use it
| * tree-wide: port various places over to open_mkdir_at()Lennart Poettering2021-11-174-27/+24
| |
| * fs-util: add new helper open_mkdir_at()Lennart Poettering2021-11-173-0/+120
| |
* | Merge pull request #21421 from poettering/homed-recovery-pwLennart Poettering2021-11-172-0/+105
|\ \ | |/ |/| homed: handle password changing for accounts that have recovery keys correctly
| * pam_systemd_home: prompt user for recovery key if homed asks for itLennart Poettering2021-11-171-0/+27
| | | | | | | | | | For accoutns that have no passwords but only a recovery key homed might ask explicitly for that. Honour the request and ask the user for it.
| * homectl: if homed asks for the recovery key to be supplied, query the user ↵Lennart Poettering2021-11-171-0/+78
| | | | | | | | | | | | for it Fixes: #21103
* | hwdb: voidify call to mkdir_parents_labelLuca Boccassi2021-11-171-1/+1
|/ | | | CID#1466060
* network: accept all values provided by kernelYu Watanabe2021-11-171-13/+2
| | | | | | | | | | | | | Follow-up for af493fb742bece2cafcdbab9238c711ac9090c9f. The kernel sends FRA_SUPPRESS_IFGROUP attribute with -1, that must be handled by networkd. For FRA_SUPPRESS_PREFIXLEN, we already handled -1, but ignored values larger than 128. We should not configure rules with such a meaningless value, but should manage such rules when received from kernel. It can occur when created by other tools mistakenly. If networkd ignores them, then networkd cannot remove them.
* Merge pull request #21326 from poettering/mkdir-tweaksLennart Poettering2021-11-1665-161/+138
|\ | | | | various tweaks to mkdir code
| * shared: clean up mkdir.h/label.h situationLennart Poettering2021-11-1658-77/+80
| | | | | | | | | | | | | | | | | | | | Previously the mkdir_label() family of calls was implemented in src/shared/mkdir-label.c but its functions partly declared ins src/shared/label.h and partly in src/basic/mkdir.h (!!). That's weird (and wrong). Let's clean this up, and add a proper mkdir-label.h matching the .c file.
| * mkdir: drop mkdir_errno_wrapper(), use mkdirat_errno_wrapper() insteadLennart Poettering2021-11-163-29/+24
| | | | | | | | | | | | | | Let's reduce our code duplication, and let's focus on using xyzat() style APIs more, hence drop mkdir_errno_wrapper() and stick to mkdirar_errno_wrapper() wherever we can, it's a true superset of functionality after all.
| * tree-wide: don't use mkdir_errno_wrapper() without reasonLennart Poettering2021-11-163-5/+5
| | | | | | | | Simple mkdir() is fine, too, no need to use the wrapper
| * mkdir-label: make mkdir_label() a wrapper around mkdirat_label()Lennart Poettering2021-11-162-18/+6
| |
| * selinux: make mac_selinux_create_file_prepare() at wrapper around _at()Lennart Poettering2021-11-162-28/+15
| | | | | | | | | | | | Let's make sure mac_selinux_create_file_prepare_at() works fine with AT_FDCWD, and then make mac_selinux_create_file_prepare() just a inline wrapper around it.
| * smack make mac_smack_fix_at() useful when called with dir_fd=AT_FDCWDLennart Poettering2021-11-161-2/+9
| |
| * mkdir: use chase_symlinks_and_stat() where appropriateLennart Poettering2021-11-161-4/+1
| |
| * mkdir: make sure mode is setLennart Poettering2021-11-161-0/+1
| |
| * mkdir: tighten permission checkLennart Poettering2021-11-161-3/+2
| | | | | | | | | | Let's complain about any bit that is set in the existing inode but no in the mask we are supposed to use.
* | Merge pull request #21391 from poettering/homed-minimizeLennart Poettering2021-11-168-128/+360
|\ \ | | | | | | homed: add ability to "minimize" home dirs, i.e. shrink to smallest possible size
| * | homework: beef up luks resize logic to allow "minimizing" homesLennart Poettering2021-11-162-82/+321
| | |
| * | user-record: relax rules on diskSize user record fieldLennart Poettering2021-11-164-32/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let's not refuse low or high disk sizes unnecessarily early. They disk sizes are subject fs limits anyway, hence there's no point in adding another limit. Relaxing thhe rules here as the advantage that we can later allow "homectl resize lennart 0" as a generic way to minimize disk space.
| * | resize-fs: add helper that checks if the specified fs can do online grow/shrinkLennart Poettering2021-11-162-0/+7
| | | | | | | | | | | | | | | There's only one that can do this (btrfs), but let's abstract that fact, a bit in case the other file systems learn this too one day.
| * | homework: make sync of identies when resizing homes optionalLennart Poettering2021-11-162-15/+24
| | | | | | | | | | | | This is preparation for resizing automatically at login and logout.
* | | coredump: tweak which dir we createLennart Poettering2021-11-161-1/+1
| | |
* | | tree-wide: use WRITE_STRING_FILE_MKDIR_0755 at more placesLennart Poettering2021-11-163-20/+10
| | |
* | | Merge pull request #21392 from keszybz/memleak-fix-and-assorted-fs-code-cleanupsZbigniew Jędrzejewski-Szmek2021-11-163-39/+45
|\ \ \ | |/ / |/| | Memleak fix and assorted fs code cleanups
| * | analyze: supress bogus compiler warningZbigniew Jędrzejewski-Szmek2021-11-161-1/+1
| | |
| * | basic: f2fs can do discardZbigniew Jędrzejewski-Szmek2021-11-161-0/+1
| | |
| * | basic: cramfs is also a read-only fsZbigniew Jędrzejewski-Szmek2021-11-161-0/+1
| | |
| * | analyze: clarify return valueZbigniew Jędrzejewski-Szmek2021-11-161-1/+1
| | | | | | | | | | | | | | | In this case, EXIT_SUCCESS is the same as 0, but we shouldn't use it in a function that returns negative on error.
| * | analyze: add --quiet optionZbigniew Jędrzejewski-Szmek2021-11-161-11/+25
| | | | | | | | | | | | | | | This is useful for shell completion, but also for users who don't care about the extra output.
| * | basic/generate-fs-switch-case: inline commentsZbigniew Jędrzejewski-Szmek2021-11-161-25/+15
| | | | | | | | | | | | | | | | | | | | | Let's keep the comments together with the lines they describe, this is easier to read and probably more maintainable in the long run. Also, () → {} for idiomaticity.
| * | analyze: fix memleakZbigniew Jędrzejewski-Szmek2021-11-161-1/+1
| | |
* | | sysext: fix tmpfs mount sourceLennart Poettering2021-11-161-1/+1
| |/ |/| | | | | | | | | | | | | It's "sysext", not "sysexit". The string passed here is pure decoration, and noone will see it, since it's only in our private mount namespace. But still, it's a typo, let's fix it
* | Merge pull request #21275 from keszybz/makefs-quietLennart Poettering2021-11-165-36/+205
|\ \ | | | | | | Makefs quiet output
| * | makefs: add "support" for f2fsZbigniew Jędrzejewski-Szmek2021-11-161-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The man page doesn't quite match what --help says, and I needed to use "-f" to write a wiped partition. This all feels a bit experimental, but the fs has some adherents, and we should make it easy to use. (Also, an empty 256MB device formatted and mounted shows up as Filesystem Size Used Avail Use% Mounted on /dev/loop0 254M 85M 170M 34% /var/tmp/mount which also seems a bit over the top…) Requested in https://github.com/systemd/systemd/pull/21275#issuecomment-967928690.
| * | makefs: fix too-long swap labelsZbigniew Jędrzejewski-Szmek2021-11-161-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently mkswap has it's own limit, and it seems to be one lower than the one for ext2/3/4. $ for i in ext2 ext3 ext4 btrfs xfs vfat swap minix; do echo $i && wipefs -q -a '/var/tmp/głąbźśńćąśððð.img' build/systemd-makefs $i '/var/tmp/głąbźśńćąśððð.img' done ext2 /var/tmp/głąbźśńćąśððð.img successfully formatted as ext2 (label "głąbźśńćą", uuid 7626bc5c-8ac4-43cf-87b7-1b2761272dd3) ext3 /var/tmp/głąbźśńćąśððð.img successfully formatted as ext3 (label "głąbźśńćą", uuid 0da22cad-0dbf-4a7a-962d-12cd39d006b5) ext4 /var/tmp/głąbźśńćąśððð.img successfully formatted as ext4 (label "głąbźśńćą", uuid dded267b-8955-4d19-82a5-1f231d446059) btrfs /var/tmp/głąbźśńćąśððð.img successfully formatted as btrfs (label "głąbźśńćąśððð.img", uuid 9e2e89f1-010d-4ab6-80f3-f9e215dbc225) xfs /var/tmp/głąbźśńćąśððð.img successfully formatted as xfs (label "głąbźśń", uuid 2cc937af-4c41-465c-8f52-aab2304bd860) vfat mkfs.fat 4.2 (2021-01-31) /var/tmp/głąbźśńćąśððð.img successfully formatted as vfat (label "G__B_______", uuid a3a9e028) swap ... LABEL=głąbźśńć, UUID=0ab787aa-37a6-4b32-978b-d71efc6e6098 /var/tmp/głąbźśńćąśððð.img successfully formatted as swap (label "głąbźśńć", uuid 0ab787aa-37a6-4b32-978b-d71efc6e6098) minix ... /var/tmp/głąbźśńćąśððð.img successfully formatted as minix (no label or uuid specified)
| * | makefs: fix too-long ext2/3/4 labelsZbigniew Jędrzejewski-Szmek2021-11-161-1/+37
| | |
| * | makefs: fix label for vfat filesystemsZbigniew Jędrzejewski-Szmek2021-11-161-7/+30
| | | | | | | | | | | | | | | | | | I was testing with a "test1.img" and mkfs.vfat rejects "TEST1.IMG" with the error "Labels with characters *?.,;:/\|+=<>[]" are not allowed". So let's replace those characters with "_".
| * | basic/utf8: add function to convert to ASCIIZbigniew Jędrzejewski-Szmek2021-11-163-0/+61
| | | | | | | | | | | | The conversion must be lossy because ASCII doesn't have enough chars.
| * | basic/utf8: inline some iterator variablesZbigniew Jędrzejewski-Szmek2021-11-121-6/+2
| | |
| * | makefs: supress mkfs output, but print one line on successZbigniew Jędrzejewski-Szmek2021-11-122-22/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ for i in ext2 ext3 ext4 btrfs xfs vfat swap minix; do echo $i && wipefs -q -a /var/tmp/test2_img && build/systemd-makefs $i /var/tmp/test2_img done ext2 /var/tmp/test2_img successfully formatted as ext2 (label "test2_img", uuid ad584a5b-037b-497a-825d-eaf2ba90da2d) ext3 /var/tmp/test2_img successfully formatted as ext3 (label "test2_img", uuid 95239fff-55f4-44d5-bae0-11ef75d13166) ext4 /var/tmp/test2_img successfully formatted as ext4 (label "test2_img", uuid 8c7ea699-05ab-4ce6-8df6-bc20d53dfd29) btrfs /var/tmp/test2_img successfully formatted as btrfs (label "test2_img", uuid 860bb061-4d92-4607-8821-a9d00216490e) xfs /var/tmp/test2_img successfully formatted as xfs (label "test2_img", uuid f32499ea-7311-47bb-be57-da62e51d33ae) vfat mkfs.fat 4.2 (2021-01-31) /var/tmp/test2_img successfully formatted as vfat (label "TEST2_IMG", uuid d1e4ae63) swap mkswap: /var/tmp/test2_img: insecure permissions 0644, fix with: chmod 0600 /var/tmp/test2_img mkswap: /var/tmp/test2_img contains holes or other unsupported extents. This swap file can be rejected by kernel on swap activation! Use --verbose for more details. Setting up swapspace version 1, size = 256 MiB (268431360 bytes) LABEL=test2_img, UUID=16bc3d8c-98d4-462b-8ff8-338467cde871 /var/tmp/test2_img successfully formatted as swap (no label or uuid specified) minix 21856 inodes 65535 blocks Firstdatazone=696 (696) Zonesize=1024 Maxsize=268966912 /var/tmp/test2_img successfully formatted as minix (no label or uuid specified)
| * | makefs: also set uuid/label for ext2/ext3Zbigniew Jędrzejewski-Szmek2021-11-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were only "supporting" ext4. Let's add "support", i.e. pass our optimization options and uuid/label for the other two fses in the same family. Nowadays there is separate code in the kernel, all three fs types are handled by ext4 code. ext2 in particular is useful for in-memory devices: the journal is just a waste of space there. ext3 is added for completeness mostly, since ext4 should probably be used instead. But people might use it for testing or for compatibility with older systems and I don't see much reason to not add "support" here.
| * | makefs: reindent mkfs calls to follow the same styleZbigniew Jędrzejewski-Szmek2021-11-091-9/+15
| | | | | | | | | | | | I think this also makes it much easier to see what args are passed.
* | | Merge pull request #21386 from keszybz/binfmt-laterLennart Poettering2021-11-161-1/+1
|\ \ \ | | | | | | | | Order binfmt.service after local-fs.target
| * | | basic/errno-util: adjust indentationZbigniew Jędrzejewski-Szmek2021-11-161-1/+1
| | | | | | | | | | | | | | | | | | | | It was bothering me that this backslash wasn't aligned with the ones below.
* | | | network: tuntap: drop unnecessary minusYu Watanabe2021-11-161-5/+5
| | | |