[Mplayer-cvslog] CVS: main fibmap_mplayer.c,NONE,1.1

Gabor Lenart lgb at users.sourceforge.net
Tue Jun 19 02:05:29 CEST 2001

Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv29590/main

Added Files:
Log Message:
According an idea, mplayer now can use external setuid root wrapper to do FIBMAP ioctl (requires root priv). Also, a serious bug was fixed in dvdauth.c made by some guy when mixing old and new style CSS API into dvdauth.c ;-)

--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>

#ifndef FIBMAP
#define FIBMAP 1

int main ( int argc , char ** argv )
	int fd,lba=0;
	if (argc!=2) {
	    printf("Bad usage.\n");
	    return 1;
	if ((fd = open(argv[1], O_RDONLY)) == -1) {
    	    printf("Cannot open file %s: %s\n",
	    argv[1] ? argv[1] : "(NULL)", strerror(errno));
    	    return 1;
        if (ioctl(fd, FIBMAP, &lba) != 0) {
	    printf("fibmap ioctl: %s (Hint: %s is not suid root?)\n",strerror(errno),argv[0]);
            return 1;
	return 0;

Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net

More information about the MPlayer-cvslog mailing list