Hot answers tagged

7

If you could call mknod arbitrarily, then you could create device files owned and accessible by you for any device. The device files give you unlimited access to the corresponding devices; therefore, any user could access devices arbitrarily. For instance, suppose /dev/sda1 holds a file system to which you have no access. (Say, it is mounted to /secret). ...


4

With mknod, you create device-special files that allow raw access to the hardware. That is, the kernel looks at the device-special file's permissions to decide whether a given user is allowed raw acess to hardware, not to anything in configuration or some such. E.g., on Debian, devices related to optical drives are created with 0660 permission bits, user ...


4

After the regular, FIFO and socket file types, mknod can also create device files. These are used to access devices. Granting access to devices is considered a privileged operation. Generally, we don't want to create arbitrary device nodes and make them accessible to regular users. That would be Bad. [Aside: Typically device access is granted by ...


1

Well, hex 804 is actually two bytes, typically written as 0x0804. The first byte is 0x08 (the "major" number), the second is 0x04 (the "minor" number). Converting them to decimal, that's where 8, 4 comes from. You can find out what the 8 means from /proc/devices, which gives block device 8 as sd, which is SCSI disk. It's the first one in there, which is how ...


1

Unless I am misreading your question, the answer is yes; were it not possible to do, no device drivers could exist. You won't be able to read any USB device as plaintext or anything like that, though, and you will need direct access to the usb device node. Drivers may interfere with reading from them. But on a theoretical level, yes, one may read data from ...


1

Infinte printf loop Reeplace \u00 with the byte you want. while true ; do printf "\u00" ; done | yourapp C++ code: #include<cstdio> int main(){ char out=Byte; while(true) fwrite(&out,sizeof(out),1,stdout); } Compile: reeplace Byte with the value you want. g++ -O3 -o bin file.cpp -D Byte=0x01 Use ./bin | yourapp



Only top voted, non community-wiki answers of a minimum length are eligible