Project

General

Profile

Bug #11603

smbadm has wrong exit code while listing SMB group properties

Added by Yuri Pankov about 1 month ago. Updated 15 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cifs - CIFS server and client
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

While listing properties for SMB group, smbadm returns 1 instead of 0 in case of successful execution.

root@53a# /usr/sbin/smbadm get administrators
        backup: Off
        restore: On
        take-ownership: On
        bypass-read: Off
        bypass-write: Off
        description: Members can fully administer the computer/domain
root@53a# echo $?
1
root@53a#
root@53a# /usr/sbin/smbadm get administratorzzzzzzzzzzzz
failed to get backup (group not found)
failed to get restore (group not found)
failed to get take-ownership (group not found)
failed to get bypass-read (group not found)
failed to get bypass-write (group not found)
failed to get the group description (group not found)
root@53a# echo $?
1
root@53a#

History

#1

Updated by Yuri Pankov 20 days ago

  • Assignee changed from Anonymous to Yuri Pankov
  • % Done changed from 0 to 90
#2

Updated by Yuri Pankov 16 days ago

To test this, I checked return values from successful and failed smbadm runs:

# smbadm get administrators; echo 'ret=' $?
        backup: Off
        restore: Off
        take-ownership: On
        description: Members can fully administer the computer/domain
ret= 0
# smbadm get someunknowngroup; echo 'ret=' $?
failed to get backup (group not found)
failed to get restore (group not found)
failed to get take-ownership (group not found)
failed to get the group description (group not found)
ret= 1

# smbadm set -p backup=off administrators; echo 'ret=' $?
Disabling backup privilege succeeded
ret= 0
# smbadm set -p backup=off someunknowngroup; echo 'ret=' $?
Disabling backup privilege failed: group not found
ret= 1

#3

Updated by Electric Monk 15 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 2c54ade085d70dd5a2914f0fa5cf7fe208cd36a6

commit  2c54ade085d70dd5a2914f0fa5cf7fe208cd36a6
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2019-09-05T16:54:11.000Z

    11603 smbadm has wrong exit code while listing SMB group properties
    Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
    Reviewed by: Matt Barden <matt.barden@nexenta.com>
    Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
    Reviewed by: Rich Lowe <richlowe@richlowe.net>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF