/***************************************************************************
* CVSID: $Id$
*
* hal-storage-unmount.c : Unmount wrapper
*
* Copyright (C) 2006 David Zeuthen, <david@fubar.dk>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
**************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#ifdef __FreeBSD__
#include <fstab.h>
#include <limits.h>
#include <pwd.h>
#include <fcntl.h>
#else
#include <mntent.h>
#endif
#include <unistd.h>
#include <libhal.h>
#include <libhal-storage.h>
#ifdef HAVE_POLKIT
#include <libpolkit.h>
#endif
#include "hal-storage-shared.h"
static void
usage (void)
{
exit (1);
}
static void
{
exit (1);
}
int
{
char *udi;
char *device;
#ifdef HAVE_POLKIT
#endif
char *invoked_by_uid;
char *invoked_by_syscon_name;
int i;
char **given_options;
const char *end;
if (!lock_hal_mtab ()) {
unknown_error ("Cannot obtain lock on /media/.hal-mtab");
}
usage ();
usage ();
dbus_error_init (&error);
printf ("Cannot connect to hald\n");
usage ();
}
dbus_error_init (&error);
if (system_bus == NULL) {
printf ("Cannot connect to the system bus\n");
usage ();
}
#ifdef HAVE_POLKIT
printf ("Cannot get libpolkit context\n");
unknown_error ("Cannot get libpolkit context");
}
#endif
/* read from stdin */
/* validate that input from stdin is UTF-8 */
unknown_error ("Error validating unmount_options as UTF-8");
#ifdef DEBUG
#endif
/* delete any trailing whitespace options from splitting the string */
if (strlen (given_options[i]) > 0)
break;
given_options[i] = NULL;
}
/* check unmount options */
for (i = 0; given_options[i] != NULL; i++) {
} else {
}
}
usage ();
} else {
#ifdef HAVE_POLKIT
#endif
}
} else {
const char *drive_udi;
unknown_error ("Cannot get drive_udi from volume");
unknown_error ("Cannot get drive from hal");
#ifdef HAVE_POLKIT
#endif
}
unlock_hal_mtab ();
return 0;
}