3

The abstract question is:

If script x calls program y, do I need a NOPASSWD entry in /etc/sudoers for x, y or both x & y? (And can x then call sudo -v without a password?)

Details:

I'm trying to figure out what should go into the /etc/sudoers file to allow a user on Ubuntu (i.e., user ID 1000 who has sudo privileges) to execute a pre-configured full backup without entering a password.

My backup script is: /usr/local/bin/backup
(See below for script.)

The actual backup program called by my script is /opt/storeBackup/bin/storeBackup.pl
(See http://storebackup.org/)

I tried several approaches with visudo but regardless of what I tried, I was still prompted for the password when running the script.

I expected that adding a final line to /etc/sudoers (using visudo) like the following would work:

myuser ALL=(ALL) NOPASSWORD:/usr/local/bin/backup

That didn't work. Neither did this:

myuser ALL=(ALL) NOPASSWORD:/usr/local/bin/backup, /opt/storeBackup/bin/storeBackup.pl

Is the problem due to my script calling sudo -v near the beginning? Or is something else the problem?

To execute the following script, I expect the user to open a terminal and type backup. I want it to be that simple and I don't want them to be prompted for a password at all.

#!/bin/bash
sudo -v
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
#do a bunch of stuff that could take a while...
#finally, do backup without asking for password:
sudo /opt/storeBackup/bin/storeBackup.pl -f backup.conf

Thanks

asked Mar 18, 2014 at 5:18
1
  • Have you tried removing everything except for the last line? You haven't given your user permission to run true with no password and those lines are completely unnecessary anyways. Commented Mar 18, 2014 at 5:30

3 Answers 3

3

I was successful in using the following examples as you've described. Sample scripts:

top.bash
$ cat /tmp/top.bash 
#!/bin/bash
echo "running 0ドル"
sudo -v 
whoami
sudo /tmp/bott.bash
bott.bash
$ more /tmp/bott.bash
#!/bin/bash
echo "running 0ドル"
whoami

Now with the following modification to sudo:

## Allow root to run any commands anywhere 
root ALL=(ALL) ALL
sam ALL=(ALL) NOPASSWD:/tmp/top.bash

Now as user sam:

$ sudo /tmp/top.bash 
running /tmp/top.bash
root
running /tmp/bott.bash
root

What about running top.bash without sudo?

If I alter the /etc/sudoers file like so:

sam ALL=(ALL) NOPASSWD:/tmp/top.bash,/tmp/bott.bash

And then just run /tmp/top.bash as user saml:

$ /tmp/top.bash 
running /tmp/top.bash
sam
running /tmp/bott.bash
root

I get the above. Which is what I would expect.

answered Mar 18, 2014 at 6:24
8
  • Thanks. This all works for me, except for sudo -v in top.bash (and the while loop in my original script). Maybe I can find a way around using those... Commented Mar 18, 2014 at 21:51
  • I ran /tmp/top.bash without sudo and as my regular user; that's how my real script gets called. It worked. It even works if I add in the while true loop. But in my real script it does not work unless I remove sudo -v and the while true loop. However, I see no differences in the code at all. Very strange... Commented Mar 18, 2014 at 22:04
  • @MountainX - see updates. Commented Mar 18, 2014 at 22:20
  • Thanks. Yes, I had to do the same alteration of /etc/sudoers. So our results are the same for the test script. But my actual script chokes on sudo -v (as in top.bash) and I cannot find any differences in the code (or file permissions). Commented Mar 19, 2014 at 0:51
  • @MountainX - is apparmor enabled? I'm wondering if it's interfering w/ the locations of scripts even though sudo is allowing it. Commented Mar 19, 2014 at 1:02
2

If you use Ubuntu, you should add your line at the end of /etc/sudoers, so no others lines can override your entry.

# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d

If your entry goes before %sudo entry, it will override your entry, because in Ubuntu, you are in sudo group:

$ id
uid=1000(cuonglm) gid=1000(cuonglm) groups=1000(cuonglm),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)

And you must allow both your wrapper script and actual script (In your case, it's /usr/local/bin/backup and /opt/storeBackup/bin/storeBackup.pl)

answered Mar 18, 2014 at 6:18
0

This info is for @slm. (See https://unix.stackexchange.com/a/120159/15010 .) Even with this simple case, it asks for the password.

$ sudo cat /etc/sudoers

tester2 ALL=(ALL) NOPASSWD: /usr/local/bin/backup, /opt/storeBackup/bin/storeBackup.pl

tester2@11038-VirtualBox:~$ sudo -l

Matching Defaults entries for tester2 on this host:
 env_reset,
 secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,
 !tty_tickets
User tester2 may run the following commands on this host:
 (ALL : ALL) ALL
 (ALL) NOPASSWD: /usr/local/bin/backup, (ALL) /opt/storeBackup/bin/storeBackup.pl

I'm testing with only one file (this one):
$cat /usr/local/bin/backup

#!/bin/bash
echo "0ドル"
sudo -v 
whoami

The above file is executable and it is owned by the user (tester2 / id 1000).

And running this commmand strace -s 2000 -o sudo.log /usr/local/bin/backup from tester2's account looks like this (and I entered the password):

execve("/usr/local/bin/backup", ["backup"], [/* 45 vars */]) = 0
brk(0) = 0x9be0000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77d3000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=74931, ...}) = 0
mmap2(NULL, 74931, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb77c0000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "177円ELF1円1円1円0円0円0円0円0円0円0円0円0円3円0円3円0円1円0円0円0円PW0円0004円0円0円0円210円324円1円0円0円0円0円0004円0円 0円7円0円(0円33円0円32円0円1円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円P264円1円0円P264円1円0円5円0円0円0円0円20円0円0円1円0円0円0円320円266円1円0円320円306円1円0円320円306円1円0円270円34円0円0円| 0円0円6円0円0円0円0円20円0円0円2円0円0円0円264円316円1円0円264円336円1円0円264円336円1円0円310円0円0円0円310円0円0円0円6円0円0円0円4円0円0円0円4円0円0円0円24円1円0円0円24円1円0円0円24円1円0円0円$0円0円0円$0円0円0円4円0円0円0円4円0円0円0円P345円td310円220円1円0円310円220円1円0円310円220円1円0円204円5円0円0円204円5円0円0円4円0円0円0円4円0円0円0円Q345円td0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円6円0円0円0円4円0円0円0円R345円td320円266円1円0円320円306円1円0円320円306円1円0000円31円0円0000円31円0円0円4円0円0円0円1円0円0円0円4円0円0円0円24円0円0円0円3円0円0円0円GNU0円261円x200円265円F310円?m300円226円33円327円267円y24円374円371円ge4203円0円0円0007円0円0円0円 0円0円0円\n0円0円0円@20円0円4円2円213円0円224円200円1円220円10円0021円26円270円@0円0円 920円2448円q262円25円}\\26円244円202円350円3277円e:F&300円212円C6円j0円260円H*V$ ,10円203円1円A20円31円0円21円*200円 24円241円0円\fa*(D10円35円1円b!203円305円@20円Y2円212円20円213円31円b@ 200円0円0円204円324円0円24円PF310円YI201円. P201円33円\n241円B2円A272円234円246円\n10円 260円351円24円$217円)0N366円@70円0円0008円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円:0円0円0円;0円0円0円0円0円0円0円=0円0円0円0円0円0円0円?0円0円0円A0円0円0円C0円0円0円", 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=121024, ...}) = 0
mmap2(NULL, 124748, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb77a1000
mmap2(0xb77bd000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b) = 0xb77bd000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "177円ELF1円1円1円0円0円0円0円0円0円0円0円0円3円0円3円0円1円0円0円0円`\n0円0004円0円0円0円t10円0円0円0円0円0004円0円 0円\t0円(0円 0円37円0円6円0円0円0004円0円0円0004円0円0円0004円0円0円0円 1円0円0円 1円0円0円5円0円0円0円4円0円0円0円3円0円0円0円307円32円0円0円307円32円0円0円307円32円0円0円23円0円0円0円23円0円0円0円4円0円0円0円1円0円0円0円1円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円\\!0円0円\\!0円0円5円0円0円0円0円20円0円0円1円0円0円0円244円.0円0円244円>0円0円244円>0円0円240円1円0円0円324円1円0円0円6円0円0円0円0円20円0円0円2円0円0円0円300円.0円0円300円>0円0円300円>0円0円10円1円0円0円10円1円0円0円6円0円0円0円4円0円0円0円4円0円0円0円T1円0円0円T1円0円0円T1円0円0円D0円0円0円D0円0円0円4円0円0円0円4円0円0円0円P345円td334円32円0円0円334円32円0円0円334円32円0円0円324円0円0円0円324円0円0円0円4円0円0円0円4円0円0円0円Q345円td0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円6円0円0円0円4円0円0円0円R345円td244円.0円0円244円>0円0円244円>0円0円\\1円0円0円\\1円0円0円4円0円0円0円1円0円0円0円4円0円0円0円24円0円0円0円3円0円0円0円GNU0円;\nY324円X267円371円341円Zj21円232円i,366円323円307円333円C364円4円0円0円0円20円0円0円0円1円0円0円0円GNU0円0円0円0円0円2円0円0円0円6円0円0円0円30円0円0円0円26円0円0円0円30円0円0円0円4円0円0円0円7円0円0円0円230円0円21円0円0円B0円0円202円0円`10円223円(10円336円30円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円31円0円0円0円0円0円0円0円32円0円0円0円33円0円0円0円0円0円0円0円35円0円0円0円0円0円0円0円0円0円0円0円36円0円0円0円 0円0円0円!0円0円0円0円0円0円0円0円0円0円0円\"0円0円0円", 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=13940, ...}) = 0
mmap2(NULL, 16504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb779c000
mmap2(0xb779f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb779f000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "177円ELF1円1円1円0円0円0円0円0円0円0円0円0円3円0円3円0円1円0円0円0000円226円1円0004円0円0円0円p`32円0円0円0円0円0004円0円 0円\n0円(0円#0円\"0円6円0円0円0004円0円0円0004円0円0円0004円0円0円0円@1円0円0円@1円0円0円5円0円0円0円4円0円0円0円3円0円0円0円h263円26円0円h263円26円0円h263円26円0円23円0円0円0円23円0円0円0円4円0円0円0円1円0円0円0円1円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円320円-32円0円320円-32円0円5円0円0円0円0円20円0円0円1円0円0円0円3001円32円0円3001円32円0円3001円32円0円34円-0円0円34円Y0円0円6円0円0円0円0円20円0円0円2円0円0円0円|M32円0円|M32円0円|M32円0円360円0円0円0円360円0円0円0円6円0円0円0円4円0円0円0円4円0円0円0円t1円0円0円t1円0円0円t1円0円0円D0円0円0円D0円0円0円4円0円0円0円4円0円0円0円7円0円0円0円3001円32円0円3001円32円0円3001円32円0円10円0円0円0円@0円0円0円4円0円0円0円4円0円0円0円P345円td|263円26円0円|263円26円0円|263円26円0円354円v0円0円354円v0円0円4円0円0円0円4円0円0円0円Q345円td0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円0円6円0円0円0円4円0円0円0円R345円td3001円32円0円3001円32円0円3001円32円0円@36円0円0円@36円0円0円4円0円0円0円1円0円0円0円4円0円0円0円24円0円0円0円3円0円0円0円GNU0円240円\rn0円W32円Y263円23円220円314円370円S322円}320円-37円350円270円4円0円0円0円20円0円0円0円1円0円0円0円GNU0円0円0円0円0円2円0円0円0円6円0円0円0円30円0円0円0円363円3円0円0円\t0円0円0円0円2円0円0円16円0円0円0円2400円20円D200円 2円1円214円3円346円220円AE210円0円204円0円10円0円E200円0円`300円200円0円\f212円\f0円0010円0円10円@210円256円4円210円H6l240円0260円0円&204円200円216円4円10円B$", 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1730024, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb779b000
mmap2(NULL, 1739484, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb75f2000
mmap2(0xb7795000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a3) = 0xb7795000
mmap2(0xb7798000, 10972, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7798000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75f1000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb75f16c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7795000, 8192, PROT_READ) = 0
mprotect(0xb779f000, 4096, PROT_READ) = 0
mprotect(0xb77bd000, 8192, PROT_READ) = 0
mprotect(0x8124000, 4096, PROT_READ) = 0
mprotect(0xb77f6000, 4096, PROT_READ) = 0
munmap(0xb77c0000, 74931) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/dev/tty", O_RDWR|O_NONBLOCK|O_LARGEFILE) = 3
close(3) = 0
brk(0) = 0x9be0000
brk(0x9be1000) = 0x9be1000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=4447600, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb73f1000
mmap2(NULL, 262144, PROT_READ, MAP_PRIVATE, 3, 0x2bd) = 0xb73b1000
mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0x43a) = 0xb73b0000
close(3) = 0
brk(0x9be2000) = 0x9be2000
brk(0x9be3000) = 0x9be3000
getuid32() = 1000
getgid32() = 1000
geteuid32() = 1000
getegid32() = 1000
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
time(NULL) = 1395267410
brk(0x9be4000) = 0x9be4000
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb73af000
read(3, "MemTotal: 2061512 kB\nMemFree: 161556 kB\nBuffers: 23816 kB\nCached: 1229076 kB\nSwapCached: 0 kB\nActive: 1038852 kB\nInactive: 792548 kB\nActive(anon): 447940 kB\nInactive(anon): 161448 kB\nActive(file): 590912 kB\nInactive(file): 631100 kB\nUnevictable: 0 kB\nMlocked: 0 kB\nHighTotal: 1183688 kB\nHighFree: 14988 kB\nLowTotal: 877824 kB\nLowFree: 146568 kB\nSwapTotal: 2095100 kB\nSwapFree: 2095028 kB\nDirty: 60 kB\nWriteback: 0 kB\nAnonPages: 578540 kB\nMapped: 156860 kB\nShmem: 30880 kB\nSlab: 48428 kB\nSReclaimable: 36208 kB\nSUnreclaim: 12220 kB\nKernelStack: 2672 kB\nPageTables: 8804 kB\nNFS_Unstable: 0 kB\nBounce: 0 kB\nWritebackTmp: 0 kB\nCommitLimit: 3125856 kB\nCommitted_AS: 1922516 kB\nVmallocTotal: 122880 kB\nVmallocUsed: 28356 kB\nVmallocChunk: ", 1024) = 1024
close(3) = 0
munmap(0xb73af000, 4096) = 0
brk(0x9be5000) = 0x9be5000
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTART}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGCHLD, {SIG_DFL, [], SA_RESTART}, {SIG_DFL, [], SA_RESTART}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 0
rt_sigaction(SIGQUIT, {SIG_DFL, [], 0}, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigaction(SIGQUIT, {SIG_IGN, [], 0}, {SIG_DFL, [], 0}, 8) = 0
uname({sys="Linux", node="11038-VirtualBox", ...}) = 0
brk(0x9be6000) = 0x9be6000
brk(0x9be7000) = 0x9be7000
stat64("/home/tester2", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
getpid() = 8307
open("/usr/lib/i386-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=26256, ...}) = 0
mmap2(NULL, 26256, PROT_READ, MAP_SHARED, 3, 0) = 0xb73a9000
close(3) = 0
brk(0x9be8000) = 0x9be8000
getppid() = 8306
gettimeofday({1395267410, 397418}, NULL) = 0
brk(0x9be9000) = 0x9be9000
brk(0x9bea000) = 0x9bea000
getpgrp() = 8306
rt_sigaction(SIGCHLD, {0x8085410, [], SA_RESTART}, {SIG_DFL, [], SA_RESTART}, 8) = 0
getrlimit(RLIMIT_NPROC, {rlim_cur=15942, rlim_max=15942}) = 0
brk(0x9beb000) = 0x9beb000
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
open("/usr/local/bin/backup", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfad4848) = -1 ENOTTY (Inappropriate ioctl for device)
_llseek(3, 0, [0], SEEK_CUR) = 0
read(3, "#!/bin/bash\n\necho \"0ドル\"\n\nsudo -v\nwhoami\n\n", 80) = 40
_llseek(3, 0, [0], SEEK_SET) = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=4*1024}) = 0
fcntl64(255, F_GETFD) = -1 EBADF (Bad file descriptor)
dup2(3, 255) = 255
close(3) = 0
fcntl64(255, F_SETFD, FD_CLOEXEC) = 0
fcntl64(255, F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE)
fstat64(255, {st_mode=S_IFREG|0755, st_size=40, ...}) = 0
_llseek(255, 0, [0], SEEK_CUR) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
read(255, "#!/bin/bash\n\necho \"0ドル\"\n\nsudo -v\nwhoami\n\n", 40) = 40
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
brk(0x9bec000) = 0x9bec000
write(1, "/usr/local/bin/backup\n", 22) = 22
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/local/sbin/sudo", 0xbfad4600) = -1 ENOENT (No such file or directory)
stat64("/usr/local/bin/sudo", 0xbfad4600) = -1 ENOENT (No such file or directory)
stat64("/usr/sbin/sudo", 0xbfad4600) = -1 ENOENT (No such file or directory)
stat64("/usr/bin/sudo", {st_mode=S_IFREG|S_ISUID|0755, st_size=69708, ...}) = 0
stat64("/usr/bin/sudo", {st_mode=S_IFREG|S_ISUID|0755, st_size=69708, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/sudo", X_OK) = 0
stat64("/usr/bin/sudo", {st_mode=S_IFREG|S_ISUID|0755, st_size=69708, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/sudo", R_OK) = 0
stat64("/usr/bin/sudo", {st_mode=S_IFREG|S_ISUID|0755, st_size=69708, ...}) = 0
stat64("/usr/bin/sudo", {st_mode=S_IFREG|S_ISUID|0755, st_size=69708, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/sudo", X_OK) = 0
stat64("/usr/bin/sudo", {st_mode=S_IFREG|S_ISUID|0755, st_size=69708, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/sudo", R_OK) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
_llseek(255, -8, [32], SEEK_CUR) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb75f1728) = 8308
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGINT, {0x80829d0, [], 0}, {SIG_DFL, [], 0}, 8) = 0
waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 8308
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
waitpid(-1, 0xbfad4038, WNOHANG) = -1 ECHILD (No child processes)
sigreturn() = ? (mask now [])
rt_sigaction(SIGINT, {SIG_DFL, [], 0}, {0x80829d0, [], 0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
read(255, "whoami\n\n", 40) = 8
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/usr/local/sbin/whoami", 0xbfad4600) = -1 ENOENT (No such file or directory)
stat64("/usr/local/bin/whoami", 0xbfad4600) = -1 ENOENT (No such file or directory)
stat64("/usr/sbin/whoami", 0xbfad4600) = -1 ENOENT (No such file or directory)
stat64("/usr/bin/whoami", {st_mode=S_IFREG|0755, st_size=22060, ...}) = 0
stat64("/usr/bin/whoami", {st_mode=S_IFREG|0755, st_size=22060, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/whoami", X_OK) = 0
stat64("/usr/bin/whoami", {st_mode=S_IFREG|0755, st_size=22060, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/whoami", R_OK) = 0
stat64("/usr/bin/whoami", {st_mode=S_IFREG|0755, st_size=22060, ...}) = 0
stat64("/usr/bin/whoami", {st_mode=S_IFREG|0755, st_size=22060, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/whoami", X_OK) = 0
stat64("/usr/bin/whoami", {st_mode=S_IFREG|0755, st_size=22060, ...}) = 0
geteuid32() = 1000
getegid32() = 1000
getuid32() = 1000
getgid32() = 1000
access("/usr/bin/whoami", R_OK) = 0
rt_sigprocmask(SIG_BLOCK, [INT CHLD], [], 8) = 0
_llseek(255, -1, [39], SEEK_CUR) = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb75f1728) = 8309
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGINT, {0x80829d0, [], 0}, {SIG_DFL, [], 0}, 8) = 0
waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 8309
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGCHLD (Child exited) @ 0 (0) ---
waitpid(-1, 0xbfad4038, WNOHANG) = -1 ECHILD (No child processes)
sigreturn() = ? (mask now [])
rt_sigaction(SIGINT, {SIG_DFL, [], 0}, {0x80829d0, [], 0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
read(255, "\n", 40) = 1
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
read(255, "", 40) = 0
exit_group(0) = ?
answered Mar 19, 2014 at 22:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.