Programming :: Mount/umount Operations In C Program?

Feb 9, 2011

I need to do mount/umount operations in my c program. But my program can only be run under normal user. However, the user who run my program have sudo priviledges to do mount/umount operations. How can i apply the sudo privileges in the mount(2) system call?

View 6 Replies


ADVERTISEMENT

General :: Mount And Umount As User Without Fstab?

Jul 19, 2011

I am writing this software that creates virtual block device nodes almost like loop does. I need to allow non-superusers to mount and umount filesystems from these devices. I don't know the names of the block device nodes beforehand so i can't use fstab entries to add "user" or "owner" flags there.

Currently i solve this by providing a small suid helper tool that verifies that this is indeed "my" block device the user is trying to mount and then just call /sbin/mount or /sbin/umount to do the job. This is definitely better than setting a suid bit for the whole program but not really perfect.

View 1 Replies View Related

General :: Simple Way To Umount NFS Mount In System?

Oct 25, 2010

I've mounted a share using standard nomenclature for the NFS mount command with the following command line:

mount -t nfs -o rw {IP address1}:/ /mnt_for_70 / {IP address2}(rw)

mnt_for_70 is a mount point I created on {IP address2}

I'm confuse and want to be sure I use the correct command on the correct host to correctly umount the nfs share.

Would I execute umount /mnt_for_70 on {IP address2}

Not sure if such a simple command will work. As this is a semi-production host pair, I hesitate to just umount so simply & I have no test systems to try this on...

View 2 Replies View Related

General :: Script - Hook Into System Mount / Umount Event?

Mar 27, 2010

Is there a way to provide post-mount and pre-umount scripts in Linux?
I am trying to do some scripts on storage media when mounted and before umounting (eg, for syncing).

View 3 Replies View Related

Programming :: File/directory Operations In C?

May 5, 2010

How do you do things like list directory contents, mov/copy files, make directoriestc. in C?

View 1 Replies View Related

OpenSUSE :: Dolphin Services - Get Mount / Umount Option Under Right Click Services Menu

Dec 7, 2010

So I want to get mount/umount option under right click services menu. I went to Dolphin -> Settings -> Configure Dolphin -> Services -> Download New Services and from there I installed KDE CDEmu Emulator and MountISO. But neither of them is showing up in actual context menu. Neither in Dolphin -> Settings -> Configure Dolphin -> Services for that matter. I tried to install them as normal user and as a root. I went to have a peak in /usr/share/kde4/services/ServiceMenus/ but they aren't there as well... It's just me or lots of things seems to be not quite working in 11.3?

View 9 Replies View Related

Programming :: Perform Floating Point Operations In Linux Kernel?

Apr 7, 2011

how to perform floating point operations in kernel? i answered that its impossible to perform floating point operations in kernel.but he is telling that its possible but with some feature to be added.can any body know about this perfectly??

View 1 Replies View Related

Programming :: Unable To Store Multiple Sed Operations Using Pipe In A Variable / Fix It?

Jun 2, 2011

I am not able to execute a multiple sed statement using pipe filters in a variable. i am trying to extract a path from a file and then working on that path to change a few letters within the path by going through another sed statement.

the code looks like this code...

View 2 Replies View Related

Slackware :: Sudo: Umount Works, Mount Not Works?

Jul 8, 2010

I've got a problem in doing sudo working for mounting things (e.g. usb pen or optic discs). Details:The OS: Slackware 13.0The response to sudo -l command:

Code:
User user1 may run the following commands on this host:
root) /sbin/shutdown -h now, /sbin/shutdown -r now

[code]...

View 3 Replies View Related

Programming :: Accessing And Performing Operations On Base Level Kernel Structure?

Jan 20, 2011

We all know linux kernel base layer is made up of structures, in which every object of kernel is well defined. Structure members correspond to object properties required to define object behavior.

For example if we take case of File system.It composed of four objects , superblock objects, inode objects, file objects and dentry object.Each having well defined structure which is being operated by system call handler and by system call service routine in the kernel mode.

Now my question is even in kernel mode we do not have some mechanism by which we can get access to pointer of these structures.We have some macro.

If I want to manipulate structure on my on way, or performing some more operation defined by me.For example after the crash of Hard Disk Drive, having ext2/3 file system, If i want to know all the inode pointers, and block details.

Can I have some way out to do desired operation ??

mechanism to operate on these base label structures, even in kernel mode ..

View 5 Replies View Related

Programming :: Program A SH - Bash Program With Zenity To Play Radio Based On A Site?

Feb 15, 2011

I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html

My code to get url's radio country.htm is:

Code:

View 2 Replies View Related

Programming :: Open Or Run A File/program Through A C++ Program

Jan 15, 2010

Ok so Basically i have 2 questions

1. i know how to create a file with c++ using but is there a way to save it to a specific location on your computer with windows and linux

Code:

2. i need to know how to run/execute/open a file in a c++ program im using and its not working

Code:

View 4 Replies View Related

Fedora :: Pam_mount And 12 Umount Not Working?

Jan 19, 2010

I have a netbook I am setting up for our class (30 in all when I get it working). I had pam_mount working at creating the mount and unmounting with version 11, but I ran into some problem and am trying to reproduce the same results with Fedora 12. The only problem I seem to be having is the umount process. I don�t even see pam_mount trying to unmount at logoff in the log. Here are the conf files that should be relevant.The part I am getting stuck on is there is no output in the message log and I have the exact same setup on a Fedora 11 setup and it works no problem.

Pam_mount_conf.xml
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">

[code]....

View 2 Replies View Related

General :: Cannot Umount Volume / Get It To Work?

Dec 15, 2010

I am using ubuntu8.04 and i am not able to umount my usb using unmount option even as root on command line.
If i try the same using mouse right click, it showing error mesage as follows. "Cannot unmount volume. The volume 'STEEVEN_1' was probably mounted manually on the command line. Details: Device to unmount is not in /media/.halmtab so it is not mounted by HAL."
usb label is appearing even after the unmouting the usb manually.
next time mounting adding another hyphen to the usb label as follows.
steeven_1, steeven_1_, steeven_1__, steeven_1___ etc.

View 2 Replies View Related

Programming :: Build A Simple Program For C Programming Class?

Feb 12, 2011

im trying to build a simple program for my C programming class, this is the source code

#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;

[Code]...

i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?

View 5 Replies View Related

OpenSUSE Install :: No Umount On Shutdown Or Reboot?

Apr 2, 2011

On one of my computers that I upgraded from 11.3 to 11.4 with a SSD HDD, it no longer umounts any disks on reboot or shutdown, there are no errors shown, it goes from sending TERM and KILL to rebooting.here is my fstab:

Code:
/dev/disk/by-id/ata-OCZ_SOLID_SSD_MK0109030A6100011-part1 /boot ext4 acl,user_xattr,noatime 1 2

[code]...

View 6 Replies View Related

OpenSUSE Network :: NFS Umount Only Works With Root?

Mar 27, 2011

I mount my NFS shares with fstab entries likexxxx.xxxx.xx:/srv/vdr /media/vdr_video nfs noauto,user,bg,soft,intr,retry=5 0 0 With openSUSE 11.2 works this fine. With openSUSE 11.4 installation (no upgrade) only NFS mount works fine. The umount command works only with root.

View 9 Replies View Related

Ubuntu Installation :: Can't Install Because Can't Umount /cdrom?

Jul 30, 2010

I managed to boot from hard disk, everything works ok. But Gparted has a bug, it works in Live Hard Disk, but not when I click the install icon because it can't umount /cdrom. But I solved that by formatting ext4 and swap area from gnome-panel Live Hard Disk and only put mount point / after click on install.But problem stroked back: install is not possible because it wants to umount itself before installing, wich cannot be possible. I'm installing it in a new place /dev/sda5. Live Hard Disk is booting from /dev/sda3.

ubuntu@ubuntu:~$ df -h | grep sda
/dev/sda3 2.0G 726M 1.3G 36% /cdrom
/dev/sda1 43G 17G 26G 41% /media/Windows

[code]....

View 1 Replies View Related

Applications :: Aufs Mounts Won't Umount Due To Being Busy?

Aug 29, 2010

I've installed aufs in order to seemlessly union two filesystems over /usr. One branch is the plain old, existing /usr directory; it's not mounted from a separate filesystem or anything. The other is a /usr on a microsd card. This is what I've added to /etc/fstab:

#the microsd mounted on /aufs/internal_microsd
/dev/mmcblk0p1 /aufs/internal_microsd/ ext2 defaults,noatime 0 0
#the aufs /usr union

[code]...

View 1 Replies View Related

Slackware :: Autofs Mounts, But Doesn't Umount?

Apr 27, 2010

I have some trouble using autofs with Slackware64 13.0I use the alien's script [URL]Here's my auto.master :/mnt/autofs/etc/auto.misc --timeout 20Here's my auto.misc [URL]

View 6 Replies View Related

Ubuntu :: Started To Delete The Mountpoint Directory After Umount?

Sep 1, 2011

Ubuntu 10.04 lts Desktop suddenly started to delete the mountpoint directory after umount:
mkdir dirsudo mount -t ntfs /dev/sda1 dir... works well ...sudo umount dirdir is gone Another similar unanswered post.

View 4 Replies View Related

Server :: How To Grant Apache User Umount Rights?

Apr 29, 2009

I want my apache user (www-data) to be able to umount drives that are mounted with fuse. (i think it is the same as regular umount, but i'm not sure)

when i execute: www-data@1:$ umount /2345umount: /2345 is not in the fstab (and you are not root)

how can i get this done?

View 4 Replies View Related

Ubuntu :: CIFS Share Does Not Umount At Shutdown / Work-around It?

Jul 10, 2010

I have a network share mounted with cifs which does not work as expected. It should automount at boot and dismount at shutdown. It does not automount at boot, but "# mount -a" will mount it in the gui after booting finishes. This I can live with, but at shutdown or reboot, the cifs share hangs for about 30 seconds before dying. My /etc/fstab entry code...

I saw a bug report about the cifs umount issue, but can't find it at the moment. I did notice that it was a very old bug. If I remember to do "# umount /media/data-srv" before rebooting, all is fine, but I seem to constantly forget and then stew as the system hangs for an extra 30-45 seconds. I've tried several things to automate it including shutdown scripts added to /etc/init.d/ and elsewhere, but nothing seems to work. Anyone have this issue and find a work-around?

View 3 Replies View Related

Fedora :: Mount The Resumemaker Professional Iso - Download The Program

May 9, 2011

I'm brand new to linux and just started with fedora 14. I'm trying to mount the resumemaker professional iso so I can download the program. It's a windows program so I'm not sure if that matters. I've spent the past 2 hours trying to figure it out.

i did:
mkdir /mnt/iso for the new folder
then:
mount -o loop /home/jordanamman/ResumeMaker/ResumeMaker Professional 16.0 Deluxe.iso /mnt/iso

(I've tried like 20 different combinations from different websites so idk what I'm doing wrong)

View 2 Replies View Related

OpenSUSE Install :: Puzzle With Umount Ntsf Partitions During Shutdown 11.2?

Mar 3, 2010

Running OpenSuSE 11.2, KDE 4.3.5 "release 0", kernel 2.6.31.12-13-default.

During shutdown, the messages state:
"Unmounting file systems
Could not find /windows/J_big in mtab

[code]....

View 2 Replies View Related

Debian :: External Mounted Harddisk Safely Umount Automatically?

Jun 1, 2010

Debian if I suspend the PC, will the external mounted harddisk safely umount automatically? I want to make sure that the integrity of my external HDD is not compromised while the PC goes in the suspend mode.

View 4 Replies View Related

Ubuntu :: File Operations Take 15 To 30 Seconds?

May 16, 2010

Sometimes while using Open Office, trying to open a file the dialog box takes 15 to 30 seconds of spinning balls until it shows me anything. Then changing a directory takes another 15 to 30 seconds. Visual feedback on selections take several seconds, and often I find myself a couple of subdirectories down from where I wanted to go due to caching of unacknowledged clicks.

My system is usually very, very fast, as one would expect from the specs. This problem happened, well, almost all the time with kernel 2.6.32-21-generic, now it just started happening again with 2.6.32-22-generic.During these slowdowns, opening Dolphin reveals the same problem, exceedingly slow response. While this is happening, top shows the system is not busy, and the hard disk light is not flashing. Idle is over 90% and user and sys are basically nothing. The system is basically doing nothing while making me wait.

View 8 Replies View Related

Ubuntu :: File Operations Is Buggy?

Sep 3, 2010

Whenever I move files from a USB memory stick or external hard drive or any other such device the file only seems to transfer 99% of the data and often during moving file operations will freeze and an offer of 'force quit' will come up (although file operations will eventually vanish with the 99% of the file being moved).

Can anything be done to rectify problems with file operations?

View 5 Replies View Related

General :: Set Operations For Strings In System?

May 11, 2011

Let me know unix commands to implement set operations on strings.

View 9 Replies View Related

Debian Configuration :: Can't Umount Ramdisk After Loading New Root File System

Feb 1, 2010

I have built a kernel with a ramdisk(ramdisk.image.gz) included. Also in the kernel command line I specified root=/dev/ram0. I am trying to use this ramdisk to load a loopback file as the root filesystem off a fat partition. This is /sbin/init from the ramdisk.

#!/bin/sh
mount -n -t msdos /dev/mmcblk0p1 /mnt
losetup /dev/loop0 /mnt/linux/linuxdsk.img
mount -t ext2 /dev/loop0 /mnt2

[Code]....

The problem is both umount and blockdev report "device is busy". I want to free up this RAM any suggestions?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved