summaryrefslogtreecommitdiff
path: root/src/udev/cdrom_id
AgeCommit message (Collapse)AuthorFilesLines
2019-10-24udev/cdrom_id: Do not open CD-rom in exclusive mode.Michal Suchanek1-23/+1
When you have a CD automunt solution that talks directly to the kernel independently of udev it races with cdrom_id for exclusive access to the device failing unpredictably. The whole is_mounted function in cdrom_id is broken: there is no saying what happens between calling is_mounted and opening the device. Hence assume that the device can be mounted asynchronously at any time, do not use exclusive access, and do away with is_mouted. Signed-off-by: Michal Suchanek <msuchanek@suse.de>
2019-10-11udev: do not hardcode program nameDavid Tardon1-2/+3
2019-05-01udev/cdrom_id: drop unneeded parenthesesZbigniew Jędrzejewski-Szmek1-20/+18
2019-04-30udev: drop unnecessary bracketsYu Watanabe1-10/+6
Follow-up for ed0cb346821972ec2c505ee11ed3d383aba6256e.
2019-04-30Merge pull request #12420 from mrc0mmand/coccinelle-tweaksLennart Poettering1-14/+11
Coccinelle improvements
2019-04-30tree-wide: code improvements suggested by CoccinelleFrantisek Sumsal1-12/+9
2019-04-29codespell: fix spelling errorsBen Boeckel1-1/+1
2019-04-28tree-wide: replace explicit NULL checks with their shorter variantsFrantisek Sumsal1-2/+2
Done by coccinelle/equals-null.cocci
2019-03-25tree-wide: constify a few static string tablesLennart Poettering1-1/+1
2019-03-13util: split out memcmp()/memset() related calls into memory-util.[ch]Lennart Poettering1-1/+1
Just some source rearranging.
2018-10-19tree-wide: replace 'unsigned int' with 'unsigned'Yu Watanabe1-56/+56
2018-09-10udev/cdrom_id: drop duplicated logsYu Watanabe1-2/+0
2018-09-10udev/cdrom_id: drop unused udev structYu Watanabe1-133/+110
2018-07-23tree-wide: drop empty lines in commentsYu Watanabe1-2/+0
2018-06-20tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek1-1/+0
Fixes #9320. for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms' done
2018-06-14Drop more license boilerplateZbigniew Jędrzejewski-Szmek1-12/+0
$ git grep -e 'This program is free software' -l |grep -v LICENSE | \ xargs perl -i -0pe 's/ \* This program.*?for more details.\s*\*\n( \* You should have.*licenses.>.\n)?//gms' For some reason they were missed previously. All those files seem to have proper SDPX tags.
2018-06-14tree-wide: use proper unicode © instead of (C) where we canLennart Poettering1-1/+1
Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
2018-02-08tree-wide: use "cannot" instead of "can not"Zbigniew Jędrzejewski-Szmek1-2/+2
This is the usual spelling, and a bit shorter.
2017-11-19Add SPDX license identifiers to source files under the GPLZbigniew Jędrzejewski-Szmek1-0/+1
2017-10-04tree-wide: use IN_SET macro (#6977)Yu Watanabe1-1/+1
2017-07-18build-sys: drop automake supportZbigniew Jędrzejewski-Szmek1-1/+0
v2: - also mention m4
2017-05-07Rip out setting of the log level from udev_new and put it in a new functionZbigniew Jędrzejewski-Szmek1-2/+4
This function is internal to systemd code, so external users of libudev will not see those log messages. I think this is better. If we want to allow that, the function could be put in libudev and exported. v2: check that the string is more than one char before stripping quotes
2015-11-17tree-wide: group include of libudev.h with sd-*Thomas Hindoe Paaboel Andersen1-1/+2
2015-11-16tree-wide: sort includesThomas Hindoe Paaboel Andersen1-2/+1
Sort the includes accoding to the new coding style.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering1-11/+12
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-09-09tree-wide: replace while(1) by for(;;) everywhereLennart Poettering1-1/+1
Another Coccinelle script.
2015-09-09tree-wide: update empty-if coccinelle script to cover empty-while and moreLennart Poettering1-2/+1
Let's also clean up single-line while and for blocks.
2015-08-06tree-wide: do not return error codes as boolThomas Hindoe Paaboel Andersen1-2/+2
2015-04-11shared: add random-util.[ch]Ronny Chevalier1-0/+1
2015-03-27cdrom_id: unroll and simplify data check loopHarald Hoyer1-13/+14
also removes this warning: src/udev/cdrom_id/cdrom_id.c: In function ‘cd_media_info.isra.13’: src/udev/cdrom_id/cdrom_id.c:612:12: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow] static int cd_media_info(struct udev *udev, int fd) ^
2015-01-01udev: improve help/usage for some more programsRobert Milasan1-5/+5
2014-12-11use correct format typesThomas Hindoe Paaboel Andersen1-5/+5
2014-11-13udev: switch to systemd logging functionsKay Sievers1-11/+0
2014-10-30util: unify how we see srand()Lennart Poettering1-1/+1
2014-10-27cdrom_id: do not attempt to read past end of bufferZbigniew Jędrzejewski-Szmek1-1/+1
CID #1238437
2014-08-11build-sys: add missing makefile symlinksLennart Poettering1-0/+1
2014-08-11udev: never bypass our own logging framework and call vsyslog() directly ↵Lennart Poettering1-10/+6
from udev tools
2014-02-27cdrom_id: use the old MMC fallbackLukas Nykryn1-1/+1
https://bugzilla.redhat.com/show_bug.cgi?id=1038015 The problem seems to be that the your virtual DVD is emulating a really old DVD device, and doing it kind of strangely. > dracut:# /lib/udev/cdrom_id --debug /dev/sr0 > probing: '/dev/sr0' > INQUIRY: [IMM ][Virtual CD/DVD ][0316] > GET CONFIGURATION failed with SK=5h/ASC=24h/ACQ=00h So your virtual drive rejects the GET CONFIGURATION command as illegal. Other pre-MMC2 drives that don't accept this command usually return the error SK=5h,ASC=20h (invalid/unsupported command code), in which case cdrom_id tries an older method, and then ID_CDROM_MEDIA_TRACK_COUNT_DATA gets set and all the /dev/disk/by-label (etc) links get set up. The virtual drive returns the error SK=5h,ASC=24h (invalid field in Command Descriptor Block), which cdrom_id doesn't handle, so it gives up and the links never get made. The ideal solution would be to make the IMM to emulate a device that's less than 15 years old, but I'm not going to hold my breath waiting for that. So probably cdrom_id should also use the old MMC fallback when the error is SK=5h,ASC=24h, and then all of this would work as expected. Suggested-by:Luca Miccini <lmiccini@redhat.com>
2014-02-13everywhere: always use O_CLOEXEC where it makes senseLennart Poettering1-1/+1
2014-01-31use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH1-1/+1
In trying to track down a stupid linker bug, I noticed a bunch of memset() calls that should be using memzero() to make it more "obvious" that the options are correct (i.e. 0 is not the length, but the data to set). So fix up all current calls to memset(foo, 0, length) to memzero(foo, length).
2013-12-24log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering1-80/+80
including it in the log strings
2013-12-14Add more _printf_'s for format-nonliteralsThomas Hindoe Paaboel Andersen1-0/+1
Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there.
2013-03-11Remove or indent #define GNU_SOURCEZbigniew Jędrzejewski-Szmek1-4/+0
It is only needed in files designed to be usable in standalone compilation. In those files the #ifdefinery is indented. When compiling in-tree, GNU_SOURCE is always defined, so remove one definition.
2013-02-12cdrom_id: add data track count for bad virtual drive implementationsHarald Hoyer1-0/+2
/# /lib/udev/cdrom_id --debug /dev/sr0 probing: '/dev/sr0' INQUIRY: [AMI ][Virtual CDROM ][1.00] GET CONFIGURATION failed with SK=5h/ASC=20h/ACQ=00h drive is pre-MMC2 and does not support 46h get configuration command trying to work around the problem READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h no current profile, but disc is present; assuming CD-ROM READ TOC: len: 12, start track: 1, end track: 1 last track 1 starts at block 0 READ DISC INFORMATION failed with SK=5h/ASC=20h/ACQ=00h ID_CDROM=1 ID_CDROM_MEDIA=1 ID_CDROM_MEDIA_CD=1 What is missing here is ID_CDROM_MEDIA_TRACK_COUNT_DATA to trigger blkid in /lib/udev/rules.d/60-persistent-storage.rules KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \ IMPORT{builtin}="blkid --noraid"
2012-11-12use the same email address everywhereKay Sievers1-1/+1
2012-07-26udev: cdrom_id, accelerometer - enable debug output for --debugKay Sievers1-2/+2
2012-07-05udev: add some O_CLOEXECKay Sievers1-1/+1
2012-04-14udev: move all unconditionally installed rules to rules/Kay Sievers1-20/+0
2012-04-08udev: switch to systemd logging functionsKay Sievers1-82/+82
2012-04-04udev: fix gcc warningsKay Sievers1-1/+1